Skip to content

Commit

Permalink
Merge pull request #12580 from tugrul/loader_register_priority
Browse files Browse the repository at this point in the history
\Phalcon\Loader::register() class loader priority
  • Loading branch information
sergeyklay committed Jan 26, 2017
2 parents 7859642 + 88cd51b commit 27dbc70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added the ability to use `Phalcon\Validation` with `Phalcon\Mvc\Collection`, deprecated `Phalcon\Mvc\Collection::validationHasFailed`
- Fixes internal cache saving in `Phalcon\Mvc\Model\Binder` when no cache backend is used
- Added the ability to get original values from `Phalcon\Mvc\Model\Binder`, added `Phalcon\Mvc\Micro::getModelBinder`, `Phalcon\Dispatcher::getModelBinder`
- Added `prepend` parameter to `Phalcon\Loader::register` to specify autoloader's loading order to top most

# [3.0.4](https://github.com/phalcon/cphalcon/releases/tag/v3.0.4) (XXXX-XX-XX)
- Fixed Isnull check is not correct when the model field defaults to an empty string. [#12507](https://github.com/phalcon/cphalcon/issues/12507)
Expand Down
6 changes: 3 additions & 3 deletions phalcon/loader.zep
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class Loader implements EventsAwareInterface
/**
* Register the autoload method
*/
public function register() -> <Loader>
public function register(boolean prepend = null) -> <Loader>
{
if this->_registered === false {
/**
Expand All @@ -234,7 +234,7 @@ class Loader implements EventsAwareInterface
/**
* Registers directories & namespaces to PHP's autoload
*/
spl_autoload_register([this, "autoLoad"]);
spl_autoload_register([this, "autoLoad"], true, prepend);

let this->_registered = true;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ class Loader implements EventsAwareInterface
* Checking in namespaces
*/
let namespaces = this->_namespaces;

for nsPrefix, directories in namespaces {

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/_proxies/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function getClasses()
return parent::getClasses();
}

public function register()
public function register($prepend = null)
{
return parent::register();
return parent::register($prepend);
}

public function unregister()
Expand Down

0 comments on commit 27dbc70

Please sign in to comment.