function __construct($user = null) { if (null === $user) { throw new Zend_Exception('Username must be passed!'); } Zend_SetupInit::setupInit(); $this->_config = Zend_Registry::get(Zend_SetupInit::$_env); $this->_user = $user; }
/** * Constructor * * Initialize environment, root path, and configuration. * * @param string $env * @param string|null $root * @return void */ public function __construct($root = null) { if (null === $root) { $root = realpath(dirname(__FILE__) . '/../'); } $this->_root = $root; Zend_SetupInit::setupInit(); $this->_front = Zend_Controller_Front::getInstance(); $this->_initErrorReporting(); $tmz = Zend_ConfigSettings::setupTimeZone(); date_default_timezone_set($tmz); }
function __construct() { try { Zend_SetupInit::setupInit(); $this->_config = Zend_Registry::get(Zend_SetupInit::$_env); $user = $this->_config->twitter->user; $pass = $this->_config->twitter->pass; $this->_twitter = new Zend_Service_Twitter($user, $pass); $this->_response = $this->_twitter->account->verifyCredentials(); if ($this->_response->error()) { throw new Zend_Exception('An error occurred.'); } } catch (Exception $e) { // @todo please catch me. } }