src/CLI/Server/Cron/Daemon.php
public function serve( $service = false )
	{
		$lastminute	= $service ? date( "i", time() ) : "-1";
		do
		{
			if( $lastminute	!= date( "i", time() ) )
			{
				$cp	= new CLI_Server_Cron_Parser( $this->cronTab );
				$jobs	= $cp->getJobs();
				foreach( $jobs as $job )
				{
					if( $job->checkMaturity() )
					{
						$content	= $job->execute();
						if( $content )
						{
							$content	= preg_replace( "@((\\r)?\\n)+$@", "", $content );
							$this->logFile->note( $content );
						}
					}
				}
			}
			if( $service )
			{
				$lastminute	= date( "i", time() );
				sleep( 1 );
			}
		}
		while( $service );
	}
public function serve( $service = false )
	{
		$lastminute	= $service ? date( "i", time() ) : "-1";
		do
		{
			if( $lastminute	!= date( "i", time() ) )
			{
				$cp	= new CLI_Server_Cron_Parser( $this->cronTab );
				$jobs	= $cp->getJobs();
				foreach( $jobs as $job )
				{
					if( $job->checkMaturity() )
					{
						$content	= $job->execute();
						if( $content )
						{
							$content	= preg_replace( "@((\\r)?\\n)+$@", "", $content );
							$this->logFile->note( $content );
						}
					}
				}
			}
			if( $service )
			{
				$lastminute	= date( "i", time() );
				sleep( 1 );
			}
		}
		while( $service );
	}
public function serve ( $ service = false ) { $ lastminute = $ service ? date ( "i" , time ( ) ) : "-1" ; do { if ( $ lastminute != date ( "i" , time ( ) ) ) { $ cp = new CLI_Server_Cron_Parser ( $ this -> cronTab ) ; $ jobs = $ cp -> getJobs ( ) ; foreach ( $ jobs as $ job ) { if ( $ job -> checkMaturity ( ) ) { $ content = $ job -> execute ( ) ; if ( $ content ) { $ content = preg_replace ( "@((\\r)?\\n)+$@" , "" , $ content ) ; $ this -> logFile -> note ( $ content ) ; } } } } if ( $ service ) { $ lastminute = date ( "i" , time ( ) ) ; sleep ( 1 ) ; } } while ( $ service ) ; }
Executes Service once or Starts as Service.
@access		public
@param		bool		$service		Run as Service
@return		void
Executes Service once or Starts as Service .