/** * [Put your description here] * * @return [type] ... */ function init() { $available = parent::init(); // Here you can initialize your class. // The class have to do a strict check if the service is available. // The needed external programs are already checked in the parent class. // If there's no reason for initialization you can remove this function. return $available; }
/** * Checks if service is available,. In case of this service we check that * prerequesties for "PHP OpenID" libraries are fulfilled: * - GMP or BCMATH PHP extensions are installed and functional * - set_include_path() PHP function is available * * @return boolean true if service is available */ public function init() { $available = false; if (extension_loaded('gmp')) { $available = is_callable('gmp_init'); } elseif (extension_loaded('bcmath')) { $available = is_callable('bcadd'); } else { $this->writeLog('Neither bcmath, nor gmp PHP extension found. OpenID authentication will not be available.'); } // We also need set_include_path() PHP function if (!is_callable('set_include_path')) { $available = false; $this->writeDevLog('set_include_path() PHP function is not available. OpenID authentication is disabled.'); } return $available ? parent::init() : false; }