diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-09 01:44:12 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-09 22:52:26 +0200 |
commit | 21bd539847f33c3889c4f58f14afd672f54a410a (patch) | |
tree | d6ff27e38727197b60d1c2c47968b7f64d4f5c2f /tests/classloader.php | |
parent | fcef0800a24818305e8a52761b05f87e13206689 (diff) |
ported to owncloud internal appframework classes, confused with how to start the app and define deps
Diffstat (limited to 'tests/classloader.php')
-rw-r--r-- | tests/classloader.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/classloader.php b/tests/classloader.php index 7c0f82212..b59ecd85a 100644 --- a/tests/classloader.php +++ b/tests/classloader.php @@ -21,7 +21,7 @@ * */ -require_once __DIR__ . '/../../appframework/3rdparty/SimplePie/autoloader.php'; +require_once __DIR__ . '/../3rdparty/simplepie/autoloader.php'; // to execute without owncloud, we need to create our own classloader spl_autoload_register(function ($className){ @@ -33,5 +33,12 @@ spl_autoload_register(function ($className){ if(file_exists($relPath)){ require_once $relPath; } + } else if(strpos($className, 'OCP\\') === 0) { + $path = strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); + $relPath = __DIR__ . '/../../../lib/public' . $path; + + if(file_exists($relPath)){ + require_once $relPath; + } } });
\ No newline at end of file |