tryLoad() public method

Handles autoloading of classes, interfaces or traits.
public tryLoad ( $type ) : void
return void
Beispiel #1
0
 public function tryLoad($type)
 {
     if (!$this->initialized) {
         $this->initialize();
     }
     parent::tryLoad($type);
 }
Beispiel #2
0
 /**
  * @param string $presentersRoot from where to find presenters
  * @param IStorage $cacheStorage
  * @param RouteAnnotation $routeAnnotation
  */
 public function __construct($presentersRoot, IStorage $cacheStorage, RouteAnnotation $routeAnnotation)
 {
     $loader = new RobotLoader();
     $loader->addDirectory($presentersRoot);
     $loader->setCacheStorage($cacheStorage);
     $loader->tryLoad('Drahak\\Restful\\Application\\IResourcePresenter');
     $this->loader = $loader;
     $this->cacheStorage = $cacheStorage;
     $this->routeAnnotation = $routeAnnotation;
 }