Skip to content

Commit

Permalink
refactor: Added Additional Autoload Classes
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Jul 9, 2024
1 parent aada84e commit 57082c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/webfiori/framework/test/TestAutoLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function test00() {
* @test
*/
public function test01() {
$cArr = explode('\\', 'webfiori\\entity\\AutoLoader');
$cArr = explode('\\', 'webfiori\\framework\\autoload\\AutoLoader');
$className = $cArr[count($cArr) - 1];
$classNs = implode('\\', array_slice($cArr, 0, count($cArr) - 1));

Expand Down
14 changes: 13 additions & 1 deletion webfiori/framework/autoload/AutoLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,19 @@ private function __construct(string $root = '', array $searchFolders = [], bool
}
$this->loadedClasses[] = [
ClassInfo::NAME => 'AutoLoader',
ClassInfo::NS => 'webfiori\\framework',
ClassInfo::NS => substr(self::class, 0, strlen(self::class) - strlen('AutoLoader') - 1),
ClassInfo::PATH => __DIR__,
ClassInfo::CACHED => false
];
$this->loadedClasses[] = [
ClassInfo::NAME => 'ClassInfo',
ClassInfo::NS => substr(ClassInfo::class, 0, strlen(ClassInfo::class) - strlen('ClassInfo') - 1),
ClassInfo::PATH => __DIR__,
ClassInfo::CACHED => false
];
$this->loadedClasses[] = [
ClassInfo::NAME => 'ClassLoaderException',
ClassInfo::NS => substr(ClassLoaderException::class, 0, strlen(ClassLoaderException::class) - strlen('ClassLoaderException') - 1),
ClassInfo::PATH => __DIR__,
ClassInfo::CACHED => false
];
Expand Down

0 comments on commit 57082c0

Please sign in to comment.