/**
  * @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);
 }
Exemple #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;
     }
 }
Exemple #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];
 }
Exemple #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;
     }
 }