src/php/Arbit/Periodic/Command/System/Exec.php
public function run( XML\Node $configuration, Logger $logger )
    {
        $command = (string) $configuration;
        if ( empty( $command ) )
        {
            $logger->log( 'No command provided for execution.', Logger::ERROR );
            return Executor::ERROR;
        }

        // Check for availability of PHP command execution functions
        if ( !function_exists( 'proc_open' ) )
        {
            $logger->log( 'Required PHP functions proc_* not available.', Logger::ERROR );
            return Executor::ERROR;
        }

        $failOnError = true;
        if ( isset( $configuration['failOnError'] ) )
        {
            $failOnError = !( (string) $configuration['failOnError'] === 'false' );
        }

        return $this->execute( $command, $failOnError, $logger );
    }
public function run( XML\Node $configuration, Logger $logger )
    {
        $command = (string) $configuration;
        if ( empty( $command ) )
        {
            $logger->log( 'No command provided for execution.', Logger::ERROR );
            return Executor::ERROR;
        }

        // Check for availability of PHP command execution functions
        if ( !function_exists( 'proc_open' ) )
        {
            $logger->log( 'Required PHP functions proc_* not available.', Logger::ERROR );
            return Executor::ERROR;
        }

        $failOnError = true;
        if ( isset( $configuration['failOnError'] ) )
        {
            $failOnError = !( (string) $configuration['failOnError'] === 'false' );
        }

        return $this->execute( $command, $failOnError, $logger );
    }
public function run ( XML \ Node $ configuration , Logger $ logger ) { $ command = ( string ) $ configuration ; if ( empty ( $ command ) ) { $ logger -> log ( 'No command provided for execution.' , Logger :: ERROR ) ; return Executor :: ERROR ; } // Check for availability of PHP command execution functions if ( ! function_exists ( 'proc_open' ) ) { $ logger -> log ( 'Required PHP functions proc_* not available.' , Logger :: ERROR ) ; return Executor :: ERROR ; } $ failOnError = true ; if ( isset ( $ configuration [ 'failOnError' ] ) ) { $ failOnError = ! ( ( string ) $ configuration [ 'failOnError' ] === 'false' ) ; } return $ this -> execute ( $ command , $ failOnError , $ logger ) ; }
Run command

Execute the actual bits.

Should return one of the status constant values, defined as class
constants in Executor.

@param XML\Node $configuration
@param Logger $logger
@return int
Run command