Skip to content

Commit

Permalink
Move legacy classes from PSR0 to PSR4
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Apr 7, 2020
1 parent 9895aff commit 1e08606
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 41 deletions.
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
"optimize-autoloader": true
},
"autoload" : {
"psr-0": {
"": "lib/private/legacy"
},
"psr-4": {
"psr-4": {
"": "lib/private/legacy",
"OC\\": "lib/private",
"OC\\Core\\": "core/",
"OCP\\": "lib/public"
Expand Down
32 changes: 16 additions & 16 deletions lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1292,20 +1292,20 @@
'OC\\User\\NoUserException' => $baseDir . '/lib/private/User/NoUserException.php',
'OC\\User\\Session' => $baseDir . '/lib/private/User/Session.php',
'OC\\User\\User' => $baseDir . '/lib/private/User/User.php',
'OC_API' => $baseDir . '/lib/private/legacy/api.php',
'OC_App' => $baseDir . '/lib/private/legacy/app.php',
'OC_DB' => $baseDir . '/lib/private/legacy/db.php',
'OC_DB_StatementWrapper' => $baseDir . '/lib/private/legacy/db/statementwrapper.php',
'OC_Defaults' => $baseDir . '/lib/private/legacy/defaults.php',
'OC_EventSource' => $baseDir . '/lib/private/legacy/eventsource.php',
'OC_FileChunking' => $baseDir . '/lib/private/legacy/filechunking.php',
'OC_Files' => $baseDir . '/lib/private/legacy/files.php',
'OC_Helper' => $baseDir . '/lib/private/legacy/helper.php',
'OC_Hook' => $baseDir . '/lib/private/legacy/hook.php',
'OC_Image' => $baseDir . '/lib/private/legacy/image.php',
'OC_JSON' => $baseDir . '/lib/private/legacy/json.php',
'OC_Response' => $baseDir . '/lib/private/legacy/response.php',
'OC_Template' => $baseDir . '/lib/private/legacy/template.php',
'OC_User' => $baseDir . '/lib/private/legacy/user.php',
'OC_Util' => $baseDir . '/lib/private/legacy/util.php',
'OC_API' => $baseDir . '/lib/private/legacy/OC_API.php',
'OC_App' => $baseDir . '/lib/private/legacy/OC_App.php',
'OC_DB' => $baseDir . '/lib/private/legacy/OC_DB.php',
'OC_DB_StatementWrapper' => $baseDir . '/lib/private/legacy/OC_DB_StatementWrapper.php',
'OC_Defaults' => $baseDir . '/lib/private/legacy/OC_Defaults.php',
'OC_EventSource' => $baseDir . '/lib/private/legacy/OC_EventSource.php',
'OC_FileChunking' => $baseDir . '/lib/private/legacy/OC_FileChunking.php',
'OC_Files' => $baseDir . '/lib/private/legacy/OC_Files.php',
'OC_Helper' => $baseDir . '/lib/private/legacy/OC_Helper.php',
'OC_Hook' => $baseDir . '/lib/private/legacy/OC_Hook.php',
'OC_Image' => $baseDir . '/lib/private/legacy/OC_Image.php',
'OC_JSON' => $baseDir . '/lib/private/legacy/OC_JSON.php',
'OC_Response' => $baseDir . '/lib/private/legacy/OC_Response.php',
'OC_Template' => $baseDir . '/lib/private/legacy/OC_Template.php',
'OC_User' => $baseDir . '/lib/private/legacy/OC_User.php',
'OC_Util' => $baseDir . '/lib/private/legacy/OC_Util.php',
);
1 change: 0 additions & 1 deletion lib/composer/composer/autoload_namespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
$baseDir = dirname(dirname($vendorDir));

return array(
'' => array($baseDir . '/lib/private/legacy'),
);
1 change: 1 addition & 0 deletions lib/composer/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
'OC\\Core\\' => array($baseDir . '/core'),
'OC\\' => array($baseDir . '/lib/private'),
'OCP\\' => array($baseDir . '/lib/public'),
'' => array($baseDir . '/lib/private/legacy'),
);
36 changes: 18 additions & 18 deletions lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
),
);

public static $fallbackDirsPsr0 = array (
public static $fallbackDirsPsr4 = array (
0 => __DIR__ . '/../../..' . '/lib/private/legacy',
);

Expand Down Expand Up @@ -1321,30 +1321,30 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\User\\NoUserException' => __DIR__ . '/../../..' . '/lib/private/User/NoUserException.php',
'OC\\User\\Session' => __DIR__ . '/../../..' . '/lib/private/User/Session.php',
'OC\\User\\User' => __DIR__ . '/../../..' . '/lib/private/User/User.php',
'OC_API' => __DIR__ . '/../../..' . '/lib/private/legacy/api.php',
'OC_App' => __DIR__ . '/../../..' . '/lib/private/legacy/app.php',
'OC_DB' => __DIR__ . '/../../..' . '/lib/private/legacy/db.php',
'OC_DB_StatementWrapper' => __DIR__ . '/../../..' . '/lib/private/legacy/db/statementwrapper.php',
'OC_Defaults' => __DIR__ . '/../../..' . '/lib/private/legacy/defaults.php',
'OC_EventSource' => __DIR__ . '/../../..' . '/lib/private/legacy/eventsource.php',
'OC_FileChunking' => __DIR__ . '/../../..' . '/lib/private/legacy/filechunking.php',
'OC_Files' => __DIR__ . '/../../..' . '/lib/private/legacy/files.php',
'OC_Helper' => __DIR__ . '/../../..' . '/lib/private/legacy/helper.php',
'OC_Hook' => __DIR__ . '/../../..' . '/lib/private/legacy/hook.php',
'OC_Image' => __DIR__ . '/../../..' . '/lib/private/legacy/image.php',
'OC_JSON' => __DIR__ . '/../../..' . '/lib/private/legacy/json.php',
'OC_Response' => __DIR__ . '/../../..' . '/lib/private/legacy/response.php',
'OC_Template' => __DIR__ . '/../../..' . '/lib/private/legacy/template.php',
'OC_User' => __DIR__ . '/../../..' . '/lib/private/legacy/user.php',
'OC_Util' => __DIR__ . '/../../..' . '/lib/private/legacy/util.php',
'OC_API' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_API.php',
'OC_App' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_App.php',
'OC_DB' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_DB.php',
'OC_DB_StatementWrapper' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_DB_StatementWrapper.php',
'OC_Defaults' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Defaults.php',
'OC_EventSource' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_EventSource.php',
'OC_FileChunking' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_FileChunking.php',
'OC_Files' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Files.php',
'OC_Helper' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Helper.php',
'OC_Hook' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Hook.php',
'OC_Image' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Image.php',
'OC_JSON' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_JSON.php',
'OC_Response' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Response.php',
'OC_Template' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Template.php',
'OC_User' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_User.php',
'OC_Util' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Util.php',
);

public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c::$prefixDirsPsr4;
$loader->fallbackDirsPsr0 = ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c::$fallbackDirsPsr0;
$loader->fallbackDirsPsr4 = ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c::$fallbackDirsPsr4;
$loader->classMap = ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c::$classMap;

}, null, ClassLoader::class);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions tests/lib/TemplateFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class TemplateFunctionsTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();

$loader = new \OC\Autoloader([\OC::$SERVERROOT . '/lib']);
$loader->load('OC_Template');
require_once \OC::$SERVERROOT . '/lib/private/legacy/OC_Template.php';
}

public function testPJavaScript() {
Expand Down

0 comments on commit 1e08606

Please sign in to comment.