Esempio n. 1
0
 /**
  * @desc Generates the autoload cache file by exploring phpboost folders
  */
 public static function generate_classlist()
 {
     if (!self::$already_reloaded) {
         self::$already_reloaded = true;
         self::$autoload = array();
         include_once PATH_TO_ROOT . '/kernel/framework/io/filesystem/FileSystemElement.class.php';
         include_once PATH_TO_ROOT . '/kernel/framework/io/filesystem/Folder.class.php';
         include_once PATH_TO_ROOT . '/kernel/framework/io/filesystem/File.class.php';
         include_once PATH_TO_ROOT . '/kernel/framework/io/IOException.class.php';
         include_once PATH_TO_ROOT . '/kernel/framework/util/Path.class.php';
         $phpboost_classfile_pattern = '`\\.class\\.php$`';
         $paths = array('/', '/kernel/framework/core/lang');
         foreach ($paths as $path) {
             self::add_classes(Path::phpboost_path() . $path, $phpboost_classfile_pattern);
         }
         self::add_classes(Path::phpboost_path() . '/kernel/framework/io/db/dbms/Doctrine/', '`\\.php$`');
         self::generate_autoload_cache();
     }
 }
Esempio n. 2
0
 public function test_get_classname_without_extension()
 {
     $classname = 'File';
     $class_file = Path::phpboost_path() . '/kernel/framework/util/' . $classname;
     self::assertEquals($classname, Path::get_classname($class_file));
 }