setDependencyInjector() 공개 메소드

Sets the dependency injector
public setDependencyInjector ( ManaPHP\DiInterface $dependencyInjector ) : static
$dependencyInjector ManaPHP\DiInterface
리턴 static
예제 #1
0
파일: Redis.php 프로젝트: manaphp/manaphp
 /**
  * @param \ManaPHP\DiInterface $dependencyInjector
  *
  * @return static
  */
 public function setDependencyInjector($dependencyInjector)
 {
     parent::setDependencyInjector($dependencyInjector);
     if (isset($this->redisDi)) {
         $this->redis = $this->redisDi->getShared($this->_service, ['key' => $this->_key]);
     }
     return $this;
 }
예제 #2
0
파일: Redis.php 프로젝트: manaphp/manaphp
 /**
  * @param \ManaPHP\DiInterface $dependencyInjector
  *
  * @return static
  */
 public function setDependencyInjector($dependencyInjector)
 {
     parent::setDependencyInjector($dependencyInjector);
     if (isset($this->redisDi)) {
         $this->redis = $this->redisDi->getShared('task', ['prefix' => $this->_prefix]);
     }
     return $this;
 }
예제 #3
0
파일: Logger.php 프로젝트: manaphp/manaphp
 /**
  * @param \ManaPHP\DiInterface $dependencyInjector
  *
  * @return static
  */
 public function setDependencyInjector($dependencyInjector)
 {
     parent::setDependencyInjector($dependencyInjector);
     if (!is_object($this->adapter)) {
         $this->adapter = $this->_dependencyInjector->getShared($this->adapter);
     }
     return $this;
 }
예제 #4
0
파일: Session.php 프로젝트: manaphp/manaphp
 /**
  * @param \ManaPHP\DiInterface $dependencyInjector
  *
  * @return static
  * @throws \ManaPHP\Http\Session\Exception
  */
 public function setDependencyInjector($dependencyInjector)
 {
     parent::setDependencyInjector($dependencyInjector);
     if (!is_object($this->adapter)) {
         $this->adapter = $this->_dependencyInjector->getShared($this->adapter);
     }
     $open = [$this->adapter, 'open'];
     $close = [$this->adapter, 'close'];
     $read = [$this->adapter, 'read'];
     $write = [$this->adapter, 'write'];
     $destroy = [$this->adapter, 'destroy'];
     $gc = [$this->adapter, 'gc'];
     session_set_save_handler($open, $close, $read, $write, $destroy, $gc);
     if (!session_start()) {
         throw new SessionException('session start failed: :last_error_message');
     }
     return $this;
 }