public function run() {
		
		//Check if the function exec is enabled
		if(false === function_exists('exec')) {
		    return trigger_error('Function "exec" is not enabled', E_USER_ERROR);
		}

		//Check if schedules folder is readable
		if(false === is_readable(Path :: get('schedule'))) {
			return trigger_error(printf('Could not read schedule folder "%s"', Path :: get('schedule')));
		}

		//Check if schedule cache folder is writable
		if(false === is_writable(Path :: get('log-schedule'))) {
			return trigger_error(printf('Could not write schedule cache folder "%s"', Path :: get('log-schedules')));
		}

		//Get all schedules from schedules folder
		$schedules = glob(Path :: get('schedule') . Application :: get(['prefix', 'schedule']) . '*.php');

		//For all the schedules classes; run the script
		foreach($schedules as $schedule) {

			//Remove path
			$schedule = preg_replace('#^'. Path :: get('schedule')  .'#', '', $schedule);
			
			//Remove prefix
			$schedule = preg_replace('#^'. Application :: get(['prefix', 'schedule'])  .'#', '', $schedule);

			//Remove extension
			$schedule = preg_replace('#.php$#', '', $schedule);

			//Execute schedule
			$this -> exec(sprintf('%s %s %s', $this -> path, getcwd() . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_FILENAME'], $schedule), true);
		}
	}
public function run() {
		
		//Check if the function exec is enabled
		if(false === function_exists('exec')) {
		    return trigger_error('Function "exec" is not enabled', E_USER_ERROR);
		}

		//Check if schedules folder is readable
		if(false === is_readable(Path :: get('schedule'))) {
			return trigger_error(printf('Could not read schedule folder "%s"', Path :: get('schedule')));
		}

		//Check if schedule cache folder is writable
		if(false === is_writable(Path :: get('log-schedule'))) {
			return trigger_error(printf('Could not write schedule cache folder "%s"', Path :: get('log-schedules')));
		}

		//Get all schedules from schedules folder
		$schedules = glob(Path :: get('schedule') . Application :: get(['prefix', 'schedule']) . '*.php');

		//For all the schedules classes; run the script
		foreach($schedules as $schedule) {

			//Remove path
			$schedule = preg_replace('#^'. Path :: get('schedule')  .'#', '', $schedule);
			
			//Remove prefix
			$schedule = preg_replace('#^'. Application :: get(['prefix', 'schedule'])  .'#', '', $schedule);

			//Remove extension
			$schedule = preg_replace('#.php$#', '', $schedule);

			//Execute schedule
			$this -> exec(sprintf('%s %s %s', $this -> path, getcwd() . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_FILENAME'], $schedule), true);
		}
	}
public function run ( ) { //Check if the function exec is enabled
 if ( false === function_exists ( 'exec' ) ) { return trigger_error ( 'Function "exec" is not enabled' , E_USER_ERROR ) ; } //Check if schedules folder is readable
 if ( false === is_readable ( Path :: get ( 'schedule' ) ) ) { return trigger_error ( printf ( 'Could not read schedule folder "%s"' , Path :: get ( 'schedule' ) ) ) ; } //Check if schedule cache folder is writable
 if ( false === is_writable ( Path :: get ( 'log-schedule' ) ) ) { return trigger_error ( printf ( 'Could not write schedule cache folder "%s"' , Path :: get ( 'log-schedules' ) ) ) ; } //Get all schedules from schedules folder
 $ schedules = glob ( Path :: get ( 'schedule' ) . Application :: get ( [ 'prefix' , 'schedule' ] ) . '*.php' ) ; //For all the schedules classes; run the script
 foreach ( $ schedules as $ schedule ) { //Remove path
 $ schedule = preg_replace ( '#^' . Path :: get ( 'schedule' ) . '#' , '' , $ schedule ) ; //Remove prefix
 $ schedule = preg_replace ( '#^' . Application :: get ( [ 'prefix' , 'schedule' ] ) . '#' , '' , $ schedule ) ; //Remove extension
 $ schedule = preg_replace ( '#.php$#' , '' , $ schedule ) ; //Execute schedule
 $ this -> exec ( sprintf ( '%s %s %s' , $ this -> path , getcwd ( ) . DIRECTORY_SEPARATOR . $ _SERVER [ 'SCRIPT_FILENAME' ] , $ schedule ) , true ) ; } }
Iterate over all schedule files and execute tasks
Iterate over all schedule files and execute tasks