Skip to content

Commit

Permalink
Merge pull request #9 from stefanwerfling/master
Browse files Browse the repository at this point in the history
psr4-autoload app vendor autoloader
  • Loading branch information
ralfbecker authored Jul 13, 2017
2 parents 4e4999a + 3565f09 commit 726fc91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/src/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* class_exists('\\EGroupware\\Calendar\\Ui'); // /calendar/src/Ui.php
* class_exists('\\EGroupware\\Calendar\\Ui\\Lists'); // /calendar/src/Ui/Lists.php
* class_exists('\\EGroupware\\Calendar\\Ui\\Views'); // /calendar/src/Ui/Views.php
* class_exists('\\EGroupware\\Calendar\\Lib\\Dir\\AClass'); // /calendar/vendor/Lib/Dir/AClass.php
*/
spl_autoload_register(function($class)
{
Expand All @@ -49,6 +50,15 @@
require_once $path;
//error_log("PSR4_autoload('$class') --> require_once($path) --> class_exists('$class')=".array2string(class_exists($class,false)));
}
elseif (file_exists($al= EGW_INCLUDE_ROOT.'/'.$app.'/vendor/autoload.php'))
{
require_once($al);

if (class_exists($partclass = implode('\\', $parts), true))
{
class_alias($partclass, $class);
}
}
});

/**
Expand Down

0 comments on commit 726fc91

Please sign in to comment.