Exemple #1
0
 /**
  * Unload the finder
  *
  * @param array 			$configuration
  * @return void
  */
 public static function unload(array $configuration = array())
 {
     if (is_null(static::$finder)) {
         throw new Exception('Cannot unload autoloader, there is no autoloader registered.');
     }
     // register the autoloader
     spl_autoload_unregister(array(static::$finder, 'autoload'));
     // kill the object
     static::$finder = null;
 }
Exemple #2
0
 /**
  * @return Finder
  */
 protected static function getFinder()
 {
     if (static::$finder === null) {
         static::$finder = Yii::$container->get(Finder::className());
     }
     return static::$finder;
 }
Exemple #3
0
 /**
  * @param string|array $dirs
  *
  * @return static
  */
 public static function createIn($dirs)
 {
     $config = new static();
     $config->finder(DefaultFinder::createIn($dirs));
     return $config;
 }