Пример #1
0
 public function map_class($class_name, DB_SQL_View $view)
 {
     $this->class_mappers[Core_Types::virtual_class_name_for($class_name)] = $view;
     return $this;
 }
Пример #2
0
 /**
  * @return mixed
  */
 public function invoke($args = array())
 {
     $args = $this->get_args($args);
     if ($this->autoload && is_string($this->call[0])) {
         Core::autoload(Core_Types::virtual_class_name_for($this->call[0]), $this->call[0]);
     }
     if ($this->enable_cache) {
         $key = serialize($args);
         if (isset($this->cache[$key])) {
             return $this->cache[$key];
         }
         return $this->cache[$key] = call_user_func_array($this->call, $args);
     }
     return call_user_func_array($this->call, $args);
 }
Пример #3
0
 static function type_by_class($class)
 {
     $class = Core_Types::virtual_class_name_for($class);
     return array_search($class, CMS::$fields_types);
 }
Пример #4
0
 /**
  * @param string $property
  *
  * @return mixed
  */
 public function __get($property)
 {
     switch ($property) {
         case 'method':
         case 'asserts':
             return $this->{$property};
         case 'name':
             return Core_Types::virtual_class_name_for($this) . '::' . $this->method;
         default:
             throw new Core_MissingPropertyException($property);
     }
 }
Пример #5
0
 /**
  * @param string|array $app
  *
  * @return WS_REST_Application
  */
 protected function load_application($name, $parms = array())
 {
     $app = $this->mappings[$name];
     if (empty($app)) {
         return null;
     }
     $class_name = $app['class'];
     $instance = Core::amake($class_name, array($app['prefix'], array_merge($parms, $app['param'])));
     $instance->name = $name;
     if ($instance instanceof WS_Services_REST_Application) {
         return $instance;
     } else {
         throw new WS_Services_REST_Exception('Incompatible application class: ' . Core_Types::virtual_class_name_for($class_name));
     }
 }
Пример #6
0
 /**
  * @param Dev_Unit_TextCase $test
  *
  * @return Dev_Unit_Text_TestResult
  */
 public function on_start_test(Dev_Unit_TestResult $result, Dev_Unit_TestCase $test)
 {
     $name = Core_Types::virtual_class_name_for($test);
     return $this->format('%3d. %-39s %-20s ', $this->test_no++, $name != $this->current_name ? $this->current_name = $name : '', $test->method);
 }