Example #1
0
 /**
  * Set cookie
  *
  * @return void
  */
 protected function setCookie()
 {
     if (!headers_sent() && 'cli' != PHP_SAPI) {
         $arg = $this->getName();
         $httpDomain = $this->getCookieDomain();
         $httpsDomain = $this->getCookieDomain(true);
         $ttl = static::getTTL();
         setcookie($arg, $this->session->getSid(), $ttl, $this->getCookiePath(), $httpDomain, false, true);
         if ($httpDomain != $httpsDomain) {
             setcookie($arg, $this->session->getSid(), $ttl, $this->getCookiePath(true), $httpsDomain, false, true);
         }
         $this->setLCRefererCookie();
     }
 }
Example #2
0
 /**
  * Return true if cron tasks should be run
  *
  * @return boolean
  */
 protected function isCronActive()
 {
     // Run cron tasks once per 100 sessions
     return !\XLite\Core\Request::getInstance()->isCLI() && \XLite\Core\Config::getInstance()->General && \XLite\Core\Config::getInstance()->General->internal_cron_enabled && 0 === $this->session->getId() % 100;
 }
 /**
  * {@inheritDoc}
  */
 public function prepareEntityBeforeCommit($type)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'prepareEntityBeforeCommit', array($type));
     return parent::prepareEntityBeforeCommit($type);
 }