Example #1
0
 /**
  * @depends testGetCallMode
  */
 public function testObjectCall()
 {
     $args = array('\\Savant\\Service\\CBitly');
     $opts = array('mode' => \Savant\AGenericCallInterface::MODE_OBJECT);
     $res = \Savant\AGenericCallInterface::call('\\Savant\\Controller\\CFrontController', 'invokeFactory', $args, $opts);
     $this->assertTrue($res instanceof \Savant\Service\CBitly);
 }
Example #2
0
 /**
  * connect to defined database driver
  * @param string $pConn
  */
 public function _connect()
 {
     if (!$this->isConnected()) {
         try {
             $this->con = \Savant\AGenericCallInterface::call((string) $this->DRIVER_CLASS, 'connect', array($this));
             \Savant\CBootstrap::log(\Savant\Utils\CFileLogging::getIndent() . "connect to " . $this->confSection . " as " . $this->USERNAME);
         } catch (EDatabase $e) {
             throw $e;
         }
     } else {
         return;
     }
 }
Example #3
0
 /**
  * get module instance
  * @param string $pClass
  * @return Savant\Security\IModule
  */
 private function getModuleInstance($pClass)
 {
     if (!\array_key_exists($pClass, $this->moduleInstances)) {
         if (!\class_exists($pClass)) {
             throw new EContext('security module %s does not exist', $pClass);
         }
         $modInstance = \Savant\AGenericCallInterface::call($pClass, 'create');
         if (!$modInstance instanceof self::$MODULE_INTERFACE) {
             throw new EContext('invalid security module class %s does not implement %s', $pClass, self::MODULE_INSTANCE);
         }
         $this->moduleInstances[$pClass] = $modInstance;
     }
     return $this->moduleInstances[$pClass];
 }
Example #4
0
 /**
  * return meta information of query method
  * @return array
  */
 private function getMetaInformation()
 {
     $method = 'meta__query' . $this->method;
     if (\method_exists($this->class, $method)) {
         return \Savant\AGenericCallInterface::call($this->class, $method);
     } else {
         return false;
     }
 }