/**
  * @api
  */
 public function __construct(\Composer\Autoload\ClassLoader $autoloader)
 {
     self::$autoloader = $autoloader;
     self::$extMinHeap = new Heap\MinHeap();
     Facade\AbstractFacade::setApplication($this);
     //$this->setApplication($this);
     $this->setPriority(999);
     parent::__construct();
 }
Esempio n. 2
0
 /**
  * @return \PHPCrystal\PHPCrystal\Component\Package\AbstractApplication
  */
 public function getApplication()
 {
     return AbstractFacade::getApplication();
 }
Esempio n. 3
0
 /**
  * Returns a package instance by the name of one of its classes
  * 
  * @return \PHPCrystal\PHPCrystal\Component\Package\AbstractPackage
  */
 public function getPackageByItsMember($mixed)
 {
     $className = is_object($mixed) ? get_class($mixed) : $mixed;
     $parts = explode('\\', $className);
     $pkgNamespace = $parts[0] . '\\' . $parts[1];
     foreach (Facade\AbstractFacade::getApplication()->getExtensions(true) as $pkg) {
         if ($pkgNamespace == $pkg->getNamespace()) {
             return $pkg;
         }
     }
 }