english/libraries/joomla/application/cli/daemon.php
/**
	 * Check to see if the daemon is active.  This does not assume that $this daemon is active, but
	 * only if an instance of the application is active as a daemon.
	 *
	 * @return  boolean  True if daemon is active.
	 *
	 * @since   11.1
	 */
Check to see if the daemon is active.  This does not assume that $this daemon is active, but
only if an instance of the application is active as a daemon.

@return  boolean  True if daemon is active.


Check to see if the daemon is active . This does not assume that $this daemon is active but only if an instance of the application is active as a daemon . @return boolean True if daemon is active .
public function isActive()
	{
		$pidFile = $this->config->get('application_pid_file');
		if (!is_file($pidFile)) {
			return false;
		}
		$fp = fopen($pidFile, 'r');
		$pid = fread($fp, filesize($pidFile));
		$pid = intval($pid);
		fclose($fp);
		if (!$pid) {
			return false;
		}
		if (!posix_kill($pid, 0)) {
			@ unlink($pidFile);
			JLog::add('The process found based on PID file was unresponsive.', JLog::WARNING);
			return false;
		}
		return true;
	}
public function isActive ( ) { $ pidFile = $ this -> config -> get ( 'application_pid_file' ) ; if ( ! is_file ( $ pidFile ) ) { return false ; } $ fp = fopen ( $ pidFile , 'r' ) ; $ pid = fread ( $ fp , filesize ( $ pidFile ) ) ; $ pid = intval ( $ pid ) ; fclose ( $ fp ) ; if ( ! $ pid ) { return false ; } if ( ! posix_kill ( $ pid , 0 ) ) { @ unlink ( $ pidFile ) ; JLog :: add ( 'The process found based on PID file was unresponsive.' , JLog :: WARNING ) ; return false ; } return true ; }
Check to see if the daemon is active.
Check to see if the daemon is active .
// Get the process id file location for the application. // If the process id file doesn't exist then the daemon is obviously not running. // Read the contents of the process id file as an integer. // Check to make sure that the process id exists as a positive integer. // Check to make sure the process is active by pinging it and ensure it responds. // No response so remove the process id file and log the situation.