Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T15489 loader enhancements #15582

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## Changed
- Changed `composer.json` to use PSR 1.1.x [#15504](https://github.com/phalcon/cphalcon/issues/15504)
- Changed `Phalcon\Loader` to `Phalcon\Autoload\Loader`; its own namespace [#15489](https://github.com/phalcon/cphalcon/issues/15489)

## Fixed
- Fixed `Phalcon\Container` interface to abide with `Psr\Container\ContainerInterface` after the upgrade to PSR 1.1.x [#15504](https://github.com/phalcon/cphalcon/issues/15504)
- Fixed `Phalcon\Loader` by changing the `require` statements to `require_once` so as not to interfere with other loader components [#15489](https://github.com/phalcon/cphalcon/issues/15489)

# [5.0.0alpha3](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0alpha3) (2021-06-30)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Loader;
namespace Phalcon\Autoload;

/**
* Phalcon\Loader\Exception
Expand Down
10 changes: 5 additions & 5 deletions phalcon/Loader.zep → phalcon/Autoload/Loader.zep
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Phalcon;
namespace Phalcon\Autoload;

use Phalcon\Loader\Exception;
use Phalcon\Events\ManagerInterface;
Expand Down Expand Up @@ -118,7 +118,7 @@ class Loader implements EventsAwareInterface
eventsManager->fire("loader:pathFound", this, filePath);
}

require filePath;
require_once filePath;

return true;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ class Loader implements EventsAwareInterface
/**
* Simulate a require
*/
require filePath;
require_once filePath;

/**
* Return true mean success
Expand Down Expand Up @@ -250,7 +250,7 @@ class Loader implements EventsAwareInterface
/**
* Simulate a require
*/
require filePath;
require_once filePath;

/**
* Return true meaning success
Expand Down Expand Up @@ -375,7 +375,7 @@ class Loader implements EventsAwareInterface
/**
* Simulate a require
*/
require filePath;
require_once filePath;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use UnitTester;

use function dataDir;

class GetClassesCest
{
/**
* Tests Phalcon\Loader :: getClasses()
* Tests Phalcon\Autoload\Loader:: getClasses()
*
* @author Sid Roberts <https://github.com/SidRoberts>
* @since 2019-05-25
*/
public function loaderGetClasses(UnitTester $I)
{
$I->wantToTest('Loader - getClasses()');
$I->wantToTest('Autoload\Loader- getClasses()');

$loader = new Loader();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use UnitTester;

use function dataDir;

class GetDirsCest
{
/**
* Tests Phalcon\Loader :: getDirs()
* Tests Phalcon\Autoload\Loader:: getDirs()
*
* @author Sid Roberts <https://github.com/SidRoberts>
* @since 2019-05-25
*/
public function loaderGetDirs(UnitTester $I)
{
$I->wantToTest('Loader - getDirs()');
$I->wantToTest('Autoload\Loader- getDirs()');

$loader = new Loader();
$Autoload\Loader = new Loader();

$loader->registerDirs(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use UnitTester;

class GetExtensionsCest
{
/**
* Tests Phalcon\Loader :: getExtensions()
* Tests Phalcon\Autoload\Loader:: getExtensions()
*
* @author Phalcon Team <[email protected]>
* @since 2018-11-13
*/
public function loaderGetExtensions(UnitTester $I)
{
$I->wantToTest('Loader - getExtensions()');
$I->wantToTest('Autoload\Loader- getExtensions()');

$I->skipTest('Need implementation');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use UnitTester;

use function dataDir;

class GetFilesCest
{
/**
* Tests Phalcon\Loader :: getFiles()
* Tests Phalcon\Autoload\Loader:: getFiles()
*
* @author Sid Roberts <https://github.com/SidRoberts>
* @since 2019-05-25
*/
public function loaderGetFiles(UnitTester $I)
{
$I->wantToTest('Loader - getFiles()');
$I->wantToTest('Autoload\Loader- getFiles()');

$loader = new Loader();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use UnitTester;

class GetFoundPathCest
{
/**
* Tests Phalcon\Loader :: getFoundPath()
* Tests Phalcon\Autoload\Loader:: getFoundPath()
*
* @author Phalcon Team <[email protected]>
* @since 2018-11-13
*/
public function loaderGetFoundPath(UnitTester $I)
{
$I->wantToTest('Loader - getFoundPath()');
$I->wantToTest('Autoload\Loader- getFoundPath()');

$I->skipTest('Need implementation');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use UnitTester;

use function dataDir;

class GetNamespacesCest
{
/**
* Tests Phalcon\Loader :: getNamespaces()
* Tests Phalcon\Autoload\Loader:: getNamespaces()
*
* @author Sid Roberts <https://github.com/SidRoberts>
* @since 2019-05-25
*/
public function loaderGetNamespaces(UnitTester $I)
{
$I->wantToTest('Loader - getNamespaces()');
$I->wantToTest('Autoload\Loader- getNamespaces()');

$loader = new Loader();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Autoload\Loader;
use Phalcon\Events\Manager;
use Phalcon\Loader;
use UnitTester;

class GetSetEventsManagerCest
{
/**
* Tests Phalcon\Loader :: getEventsManager() / setEventsManager()
* Tests Phalcon\Autoload\Loader:: getEventsManager() / setEventsManager()
*
* @author Jeremy PASTOURET <https://github.com/jenovateurs>
* @since 2020-01-19
*/
public function loaderGetSetEventsManager(UnitTester $I)
{
$I->wantToTest('Loader - getEventsManager() / setEventsManager()');
$I->wantToTest('Autoload\Loader- getEventsManager() / setEventsManager()');

$oLoader = new Loader();
$oManager = new Manager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use UnitTester;

class LoadFilesCest
{
/**
* Tests Phalcon\Loader :: loadFiles()
* Tests Phalcon\Autoload\Loader:: loadFiles()
*
* @author Phalcon Team <[email protected]>
* @since 2018-11-13
*/
public function loaderLoadFiles(UnitTester $I)
{
$I->wantToTest('Loader - loadFiles()');
$I->wantToTest('Autoload\Loader- loadFiles()');

$I->skipTest('Need implementation');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* file that was distributed with this source code.
*/

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use LoaderEvent;
use Phalcon\Autoload\Loader;
use Phalcon\Events\Event;
use Phalcon\Events\Manager;
use Phalcon\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use UnitTester;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use One;
use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use Two;
use UnitTester;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Integer;
use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use Sqlite;
use UnitTester;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use UnitTester;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Example\Namespaces\Adapter\Another;
use Example\Namespaces\Adapter\Mongo;
use Example\Namespaces\Adapter\Redis;
use Example\Namespaces\Engines\Gasoline;
use Example\Namespaces\Example\Example;
use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use UnitTester;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Example\Namespaces\Engines\Alcohol;
use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use UnitTester;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

declare(strict_types=1);

namespace Phalcon\Test\Unit\Loader;
namespace Phalcon\Test\Unit\Autoload;

use Phalcon\Loader;
use Phalcon\Autoload\Loader;
use Phalcon\Test\Fixtures\Traits\LoaderTrait;
use UnitTester;

Expand Down
Loading