Example #1
0
 public function __construct(Zend_Controller_Request_Abstract $request)
 {
     if (self::$_instance instanceof Showcase_Auth_Storage_Db) {
         throw new Exception('Db was already instantiated');
     }
     $this->_request = $request;
     $this->_remoteIp = Showcase_Session::getRemoteIp($this->_request);
     $this->_timeStamp = time();
     $this->_pSalt = Showcase_Session_Salt::factory();
     parent::__construct();
 }
Example #2
0
 protected function _load($showId = null, $method = null, $preview = 0, $offset = 0, $limit = null, array $portals = array(), array $channels = array(), $series = null, $start = null, $finish = null, $exclude = null, $searchTerm = null, $searchFilter = null, $transcript = null)
 {
     $user = $this->getRequest()->getParam('User');
     $args = array('type' => $method ? $method : $this->getRequest()->getParam('action', null), 'userId' => $user->id, 'ip' => Showcase_Session::getRemoteIp($this->getRequest()), 'cache' => $user->isCmsUser ? false : true, 'preview' => $user->isCmsUser ? $preview : 0, 'portals' => $user->isCmsUser ? count($portals) ? implode(', ', $portals) : null : $this->getRequest()->getParam('Portal')->id, 'channels' => count($channels) ? implode(', ', $channels) : ($this->getRequest()->getParam('Channel', null) ? $this->getRequest()->getParam('Channel')->id : null), 'series' => $series, 'offset' => $offset, 'limit' => $limit, 'start' => $start ? new Zend_Date($start, Zend_registry::get('locale')) : null, 'finish' => $finish ? new Zend_Date($finish, Zend_registry::get('locale')) : null, 'show' => $showId, 'exclude' => $exclude, 'search' => $searchTerm, 'filter' => $searchFilter, 'transcript' => $transcript);
     $return = null;
     if ($args['cache']) {
         $id = $this->_makeId($method, $args);
         if ($this->_cache()->test($id)) {
             $return = unserialize($this->_cache()->load($id));
         }
     }
     if (!$return) {
         $return = call_user_func_array(array($this, '_factory'), $args);
         if ($args['cache']) {
             $this->_cache()->save(serialize($return), $id);
         }
     }
     return $return;
 }