public function task($script) {

		if(false === is_string($script)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($script)), E_USER_ERROR);
		}

		$script = sprintf('%s%s%s.php', Path :: get('schedule'), Application :: get(['prefix', 'schedule']), NameConvert :: toCamelcase($script, true));

		//Check if script is readable
		if(false === is_readable($script)) {
			return trigger_error(sprintf('Script "%s" is not a readable Schedule file', (string) $script));
		}

		//Include script
		require_once($script);

		//Create new instance
		$file 		= new File($script);
		$classname 	= $file -> entity() -> getName();
		$class 		= new $classname();
			
		//Check if needed constants are defined
		foreach(['TIME', 'ENABLED'] as $constant) {
			
			if(false === defined($classname . '::' . $constant)) {
				return trigger_error(sprintf('Missing constant "%s" in Schedule "%s" class', $constant, $classname));
			}
		}

		//Check if schedule has start method
		if(false === is_callable([$class, 'start'])) {
			return trigger_error(sprintf('Missing methode start in Schedule "%s" class', $classname));
		}

		//If the current schedule is enabled
		if(true === $class :: ENABLED) {

			$run = $this -> checkRun($class :: TIME);

			if(true === $run) {

				ob_start();

				//Capture return ouput 
				$data 						= [];
				$data[$classname]['start']  = date('Y-m-d H:i:s');
				$data[$classname]['return'] = (string) $class -> start();
				$data[$classname]['echo'] 	= ob_get_clean();
				$data[$classname]['end']  	= date('Y-m-d H:i:s');

				//Check if the current schedule has the complete method
				if(true === is_callable([$class, 'complete'])) {
					$class -> complete($data[$classname]);
				}

				//Write to log
				$logger = $this -> getLogger();
				$logger -> setDirectory(Path :: get('log-schedule'));
				$logger -> write(json_encode($data));
			}
		}
	}
public function task($script) {

		if(false === is_string($script)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($script)), E_USER_ERROR);
		}

		$script = sprintf('%s%s%s.php', Path :: get('schedule'), Application :: get(['prefix', 'schedule']), NameConvert :: toCamelcase($script, true));

		//Check if script is readable
		if(false === is_readable($script)) {
			return trigger_error(sprintf('Script "%s" is not a readable Schedule file', (string) $script));
		}

		//Include script
		require_once($script);

		//Create new instance
		$file 		= new File($script);
		$classname 	= $file -> entity() -> getName();
		$class 		= new $classname();
			
		//Check if needed constants are defined
		foreach(['TIME', 'ENABLED'] as $constant) {
			
			if(false === defined($classname . '::' . $constant)) {
				return trigger_error(sprintf('Missing constant "%s" in Schedule "%s" class', $constant, $classname));
			}
		}

		//Check if schedule has start method
		if(false === is_callable([$class, 'start'])) {
			return trigger_error(sprintf('Missing methode start in Schedule "%s" class', $classname));
		}

		//If the current schedule is enabled
		if(true === $class :: ENABLED) {

			$run = $this -> checkRun($class :: TIME);

			if(true === $run) {

				ob_start();

				//Capture return ouput 
				$data 						= [];
				$data[$classname]['start']  = date('Y-m-d H:i:s');
				$data[$classname]['return'] = (string) $class -> start();
				$data[$classname]['echo'] 	= ob_get_clean();
				$data[$classname]['end']  	= date('Y-m-d H:i:s');

				//Check if the current schedule has the complete method
				if(true === is_callable([$class, 'complete'])) {
					$class -> complete($data[$classname]);
				}

				//Write to log
				$logger = $this -> getLogger();
				$logger -> setDirectory(Path :: get('log-schedule'));
				$logger -> write(json_encode($data));
			}
		}
	}
public function task ( $ script ) { if ( false === is_string ( $ script ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ script ) ) , E_USER_ERROR ) ; } $ script = sprintf ( '%s%s%s.php' , Path :: get ( 'schedule' ) , Application :: get ( [ 'prefix' , 'schedule' ] ) , NameConvert :: toCamelcase ( $ script , true ) ) ; //Check if script is readable
 if ( false === is_readable ( $ script ) ) { return trigger_error ( sprintf ( 'Script "%s" is not a readable Schedule file' , ( string ) $ script ) ) ; } //Include script
 require_once ( $ script ) ; //Create new instance
 $ file = new File ( $ script ) ; $ classname = $ file -> entity ( ) -> getName ( ) ; $ class = new $ classname ( ) ; //Check if needed constants are defined
 foreach ( [ 'TIME' , 'ENABLED' ] as $ constant ) { if ( false === defined ( $ classname . '::' . $ constant ) ) { return trigger_error ( sprintf ( 'Missing constant "%s" in Schedule "%s" class' , $ constant , $ classname ) ) ; } } //Check if schedule has start method
 if ( false === is_callable ( [ $ class , 'start' ] ) ) { return trigger_error ( sprintf ( 'Missing methode start in Schedule "%s" class' , $ classname ) ) ; } //If the current schedule is enabled
 if ( true === $ class :: ENABLED ) { $ run = $ this -> checkRun ( $ class :: TIME ) ; if ( true === $ run ) { ob_start ( ) ; //Capture return ouput 
 $ data = [ ] ; $ data [ $ classname ] [ 'start' ] = date ( 'Y-m-d H:i:s' ) ; $ data [ $ classname ] [ 'return' ] = ( string ) $ class -> start ( ) ; $ data [ $ classname ] [ 'echo' ] = ob_get_clean ( ) ; $ data [ $ classname ] [ 'end' ] = date ( 'Y-m-d H:i:s' ) ; //Check if the current schedule has the complete method
 if ( true === is_callable ( [ $ class , 'complete' ] ) ) { $ class -> complete ( $ data [ $ classname ] ) ; } //Write to log
 $ logger = $ this -> getLogger ( ) ; $ logger -> setDirectory ( Path :: get ( 'log-schedule' ) ) ; $ logger -> write ( json_encode ( $ data ) ) ; } } }
Execute individual task of schedule file
@param
@return
Execute individual task of schedule file