Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Let mediawiki autoloader run first
Browse files Browse the repository at this point in the history
  • Loading branch information
Władysław Bodzek committed Sep 8, 2015
1 parent 88edf08 commit cd3b7ec
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -34,3 +34,6 @@ node_modules

# Ignore eval.php log
maintenance/.mweval_history

composer.phar

3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -6,7 +6,8 @@
}
],
"config": {
"vendor-dir": "lib/composer"
"vendor-dir": "lib/composer",
"prepend-autoloader": false
},
"require": {
"wikia/fluent-sql-php": "1.0.*",
Expand Down
8 changes: 4 additions & 4 deletions lib/composer/composer/ClassLoader.php
Expand Up @@ -351,7 +351,7 @@ private function findFileWithExtension($class, $ext)
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
if (0 === strpos($class, $prefix)) {
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
return $file;
}
}
Expand All @@ -361,7 +361,7 @@ private function findFileWithExtension($class, $ext)

// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
Expand All @@ -380,7 +380,7 @@ private function findFileWithExtension($class, $ext)
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
Expand All @@ -390,7 +390,7 @@ private function findFileWithExtension($class, $ext)

// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
Expand Down
21 changes: 21 additions & 0 deletions lib/composer/composer/LICENSE
@@ -0,0 +1,21 @@

Copyright (c) 2015 Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

4 changes: 2 additions & 2 deletions lib/composer/composer/autoload_real.php
Expand Up @@ -19,7 +19,7 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitb367f9b4bf4d43e0d5ea402c134db26b', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitb367f9b4bf4d43e0d5ea402c134db26b', 'loadClassLoader'), true, false);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitb367f9b4bf4d43e0d5ea402c134db26b', 'loadClassLoader'));

Expand All @@ -42,7 +42,7 @@ public static function getLoader()
$loader->addClassMap($classMap);
}

$loader->register(true);
$loader->register(false);

$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
Expand Down

0 comments on commit cd3b7ec

Please sign in to comment.