예제 #1
0
 protected function reflect($class = null)
 {
     if (!is_null($class) && \Kinesis\Type::exists($class)) {
         $this->_class = new \ReflectionClass($class);
     }
     if ($this->_class instanceof \ReflectionClass) {
         return $this->_class;
     }
     return false;
 }
예제 #2
0
 protected function getDefaultCache()
 {
     $cacheClass = $this->Parameters['CacheClass'];
     $cacheParams = $this->Parameters['CacheParameters'];
     if (!is_array($cacheParams)) {
         $cacheParams = array();
     }
     if (is_string($cacheClass) && \Kinesis\Type::exists($cacheClass)) {
         return new $cacheClass($cacheParams);
     }
     return null;
 }
예제 #3
0
파일: Query.php 프로젝트: Kinetical/Kinesis
 protected function getDefaultDelegate()
 {
     $streamHandler = $this->Parameters['StreamHandler'];
     $streamCallback = $this->Parameters['StreamCallback'];
     if (\Kinesis\Type::exists($streamHandler)) {
         $handler = new $streamHandler($this->Stream);
     }
     $handlers = $this->Parameters['HandlerChain'];
     if (!is_array($handlers)) {
         $handlers = array($handlers);
     }
     if (count($handlers) > 0) {
         foreach ($handlers as $wrapClass) {
             if (\Kinesis\Type::exists($wrapClass)) {
                 $handler = new $wrapClass($handler);
             }
         }
     }
     return new \Core\Delegate($handler, $streamCallback);
 }