Navigation Menu

Skip to content

Commit

Permalink
Modified nature of Library include path so that most recent paths add…
Browse files Browse the repository at this point in the history
…ed will have highest precedence.
  • Loading branch information
KrisJordan committed Jun 11, 2009
1 parent 786119f commit 1adaf70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions bootstrap.php
Expand Up @@ -74,9 +74,10 @@ static function init() {
date_default_timezone_set(self::$defaultTimeZone);

require_once($_ENV['dir.recess'] . 'recess/lang/Library.class.php');
Library::addClassPath(self::$appsDir);
Library::addClassPath(self::$pluginsDir);

Library::addClassPath(self::$recessDir);
Library::addClassPath(self::$pluginsDir);
Library::addClassPath(self::$appsDir);

if(self::$useTurboSpeed) {
Library::$useNamedRuns = true;
Expand Down
5 changes: 3 additions & 2 deletions recess/recess/lang/Library.class.php
Expand Up @@ -188,9 +188,10 @@ static function classExists($fullName) {
$file = str_replace(self::dotSeparator,self::pathSeparator, $fullName) . self::CLASS_FILE_EXTENSION;

if($pathIndex == -1) {
foreach(self::$paths as $index => $path) {
for($index = count(self::$paths) - 1; $index >= 0 ; $index--) {
$path = self::$paths[$index];
if(file_exists($path . $file)) {
include_once($path . $file);
include($path . $file);
if(class_exists($class, false) || interface_exists($class, false)) {
if(isset(self::$namedRun)) { self::namedRunMissed($class); }
self::$dirtyClasses = true;
Expand Down
6 changes: 3 additions & 3 deletions recess/recess/lang/Object.class.php
Expand Up @@ -172,7 +172,7 @@ protected static function initClassDescriptor($class) { return new ClassDescript
*
* @param $class string Name of class whose descriptor is being initialized.
* @param $method ReflectionMethod
* @param $descriptor ClassDescriptor ByRef
* @param $descriptor ClassDescriptor
* @param $annotations Array of annotations found on method.
* @return ClassDescriptor
*/
Expand All @@ -186,7 +186,7 @@ protected static function shapeDescriptorWithMethod($class, $method, $descriptor
*
* @param $class string Name of class whose descriptor is being initialized.
* @param $property ReflectionProperty
* @param $descriptor ClassDescriptor ByRef
* @param $descriptor ClassDescriptor
* @param $annotations Array of annotations found on method.
* @return ClassDescriptor
*/
Expand All @@ -200,7 +200,7 @@ protected static function shapeDescriptorWithProperty($class, $property, $descri
*
* @param $class
* @param $descriptor
* @return unknown_type
* @return ClassDescriptor
*/
protected static function finalClassDescriptor($class, $descriptor) { return $descriptor; }

Expand Down

0 comments on commit 1adaf70

Please sign in to comment.