Changeset 630
- Timestamp:
- 04/25/07 23:10:07 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/util/ext/stubXPClassLoader.php
r448 r630 29 29 */ 30 30 protected static $initialized = false; 31 31 32 32 /** 33 33 * constructor 34 * 35 * It is possible to select a version of the XP-Framework. It is not 36 * possible to use a version lower than 5.0.0. If no version is specified 37 * a search in the lib path is done where the highest available version 38 * will be used. Only one version can be loaded at once, a second 39 * instantiation of this class will yield the same result like the first 34 * 35 * It is possible to select a version of the XP-Framework. It is not 36 * possible to use a version lower than 5.0.0. If no version is specified 37 * a search in the lib path is done where the highest available version 38 * will be used. Only one version can be loaded at once, a second 39 * instantiation of this class will yield the same result like the first 40 40 * one regardless of the value of $version. 41 * 41 * 42 42 * @param string $version optional the version to use 43 43 * @throws stubIllegalArgumentException … … 49 49 return; 50 50 } 51 51 52 52 $libPath = stubConfig::getLibPath() . DIRECTORY_SEPARATOR; 53 53 if (null != $version && version_compare($version, '5.0.0', '<') == true) { … … 62 62 continue; 63 63 } 64 64 65 65 $testVersion = str_replace('xp-rt-', '', str_replace('.xar', '', $file->getFilename())); 66 66 if (version_compare($testVersion, $version, '>') == true) { … … 68 68 } 69 69 } 70 70 71 71 if (version_compare($version, '5.0.0', '<') == true) { 72 throw new stubException('Did not f ound a copy of the XP-Framework 5.0.0 or higher.');72 throw new stubException('Did not find a copy of the XP-Framework 5.0.0 or higher.'); 73 73 } 74 74 } 75 75 76 76 set_include_path(get_include_path() . PATH_SEPARATOR . $libPath . 'xp-rt-' . $version . '.xar'); 77 77 require $libPath . 'lang.base.php'; 78 78 self::$initialized = true; 79 79 } 80 80 81 81 /** 82 82 * sets the namespace where this classloader is responsible for … … 88 88 $this->namespace = $namespace; 89 89 } 90 90 91 91 /** 92 92 * returns the namespace where this classloader is responsible for … … 98 98 return $this->namespace; 99 99 } 100 100 101 101 /** 102 102 * loads the given class … … 111 111 return; 112 112 } 113 113 114 114 uses(str_replace($this->namespace . '.', '', $fqClassName)); 115 115 }
