<commit_before><?php
/**
 * OWASP Enterprise Security API (ESAPI)
 *
 * This file is part of the Open Web Application Security Project (OWASP)
 * Enterprise Security API (ESAPI) project.
 * 
 * PHP version 5.2
 *
 * LICENSE: This source file is subject to the New BSD license.  You should read
 * and accept the LICENSE before you use, modify, and/or redistribute this
 * software.
 *
 * @category  OWASP
 * @package   ESAPI
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @copyright 2009-2010 The OWASP Foundation
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD license
 * @version   SVN: $Id$
 * @link      http://www.owasp.org/index.php/ESAPI
 */

/**
 * Implementations will require ExecutorException.
 */
require_once dirname(__FILE__) . '/errors/ExecutorException.php';

/**
 * The Executor interface is used to run an OS command with reduced security
 * risk.
 * 
 * Implementations should do as much as possible to minimize the risk of
 * injection into either the command or parameters. In addition, implementations
 * should timeout after a specified time period in order to help prevent denial
 * of service attacks.
 * 
 * The class should perform logging and error handling as well. Finally,
 * implementation should handle errors and generate an ExecutorException with
 * all the necessary information.
 *
 * <img src="doc-files/Executor.jpg">
 *
 * @category  OWASP
 * @package   ESAPI
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @copyright 2009-2010 The OWASP Foundation
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD license
 * @version   Release: @package_version@
 * @link      http://www.owasp.org/index.php/ESAPI
 */
interface Executor
{

    /**
         * Invokes the specified executable with default workdir and not logging parameters.
         * 
         * @param executable
         *            the command to execute
         * @param params
         *            the parameters of the command being executed
         */
        function executeSystemCommand($executable, $params);

    /**
         * Executes a system command after checking that the executable exists and
         * escaping all the parameters to ensure that injection is impossible.
         * Implementations must change to the specified working
         * directory before invoking the command.
         * 
         * @param executable
         *            the command to execute
         * @param params
         *            the parameters of the command being executed
         * @param workdir
         *            the working directory
         * @param codec
         *            the codec to use to encode for the particular OS in use
         * @param logParams
         *            use false if any parameters contains sensitive or confidential information.
         *            (this is an ESAPI 2.0 feature)
         * 
         * @return the output of the command being run
         * 
         * @throws ExecutorException
         *             the service exception
         *             
         * note: this is PHP's equivalent to ESAPI4JAVA's overloaded executeSystemCommand($executable, $params, $workdir, $codec, $logParams)
         * note: the codec argument has been eliminated from this implementation since PHP's escapeshellcmd function does enough to not require explicit OS codecs
         */
        function executeSystemCommand_effectLonghand($executable, $params, $workdir, $logParams);

}<commit_msg>Some PEAR coding standard updates.<commit_after><?php
/**
 * OWASP Enterprise Security API (ESAPI)
 *
 * This file is part of the Open Web Application Security Project (OWASP)
 * Enterprise Security API (ESAPI) project.
 * 
 * PHP version 5.2
 *
 * LICENSE: This source file is subject to the New BSD license.  You should read
 * and accept the LICENSE before you use, modify, and/or redistribute this
 * software.
 *
 * @category  OWASP
 * @package   ESAPI
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @copyright 2009-2010 The OWASP Foundation
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD license
 * @version   SVN: $Id$
 * @link      http://www.owasp.org/index.php/ESAPI
 */

/**
 * Implementations will require ExecutorException.
 */
require_once dirname(__FILE__) . '/errors/ExecutorException.php';

/**
 * The Executor interface is used to run an OS command with reduced security
 * risk.
 * 
 * Implementations should do as much as possible to minimize the risk of
 * injection into either the command or parameters. In addition, implementations
 * should timeout after a specified time period in order to help prevent denial
 * of service attacks.
 * 
 * The class should perform logging and error handling as well. Finally,
 * implementation should handle errors and generate an ExecutorException with
 * all the necessary information.
 *
 * <img src="doc-files/Executor.jpg">
 *
 * @category  OWASP
 * @package   ESAPI
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @copyright 2009-2010 The OWASP Foundation
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD license
 * @version   Release: @package_version@
 * @link      http://www.owasp.org/index.php/ESAPI
 */
interface Executor
{

    /**
     * Invokes the specified executable with default workdir and not logging 
     * parameters.
     * 
     * @param string $executable the command to execute
     * @param array  $params     the parameters of the command being executed
     * 
     * @return does not return a value.
     */
    function executeSystemCommand($executable, $params);

    /**
     * Executes a system command after checking that the executable exists and
     * escaping all the parameters to ensure that injection is impossible.
     * Implementations must change to the specified working
     * directory before invoking the command.
     *             
     * note: this is PHP's equivalent to ESAPI4JAVA's overloaded 
     * executeSystemCommand($executable, $params, $workdir, $codec, $logParams)
     * note: the codec argument has been eliminated from this implementation since 
     * PHP's escapeshellcmd function does enough to not require explicit OS codecs
     * 
     * @param string $executable the command to execute
     * @param array  $params     the parameters of the command being executed
     * @param string $workdir    the working directory
     * @param bool   $logParams  use false if any parameters contains sensitive or 
     *                           confidential information. (this is an ESAPI 2.0 
     *                           feature)
     * 
     * @return string the output of the command being run
     * @throws ExecutorException the service exception
     */
     function executeSystemCommandLonghand($executable, $params, $workdir, 
         $logParams
     );

}
{'fraction_non_alphanumeric': 0.08423721650936751, 'fraction_numerical': 0.0059163262431328354, 'mean_word_length': 2.6749482401656315, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5032503', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1793, 'n_words': 733}