-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfixes Rating functionality correction Apply fixes from StyleCI Due date client panel correction
- Loading branch information
Showing
20 changed files
with
138 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,13 @@ | |
* | ||
* @author Fabien Potencier <[email protected]> | ||
* @author Jordi Boggiano <[email protected]> | ||
* @see http://www.php-fig.org/psr/psr-0/ | ||
* @see http://www.php-fig.org/psr/psr-4/ | ||
* @see https://www.php-fig.org/psr/psr-0/ | ||
* @see https://www.php-fig.org/psr/psr-4/ | ||
*/ | ||
class ClassLoader | ||
{ | ||
private $vendorDir; | ||
|
||
// PSR-4 | ||
private $prefixLengthsPsr4 = array(); | ||
private $prefixDirsPsr4 = array(); | ||
|
@@ -57,10 +59,17 @@ class ClassLoader | |
private $missingClasses = array(); | ||
private $apcuPrefix; | ||
|
||
private static $registeredLoaders = array(); | ||
|
||
public function __construct($vendorDir = null) | ||
{ | ||
$this->vendorDir = $vendorDir; | ||
} | ||
|
||
public function getPrefixes() | ||
{ | ||
if (!empty($this->prefixesPsr0)) { | ||
return call_user_func_array('array_merge', $this->prefixesPsr0); | ||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); | ||
} | ||
|
||
return array(); | ||
|
@@ -300,6 +309,17 @@ public function getApcuPrefix() | |
public function register($prepend = false) | ||
{ | ||
spl_autoload_register(array($this, 'loadClass'), true, $prepend); | ||
|
||
if (null === $this->vendorDir) { | ||
return; | ||
} | ||
|
||
if ($prepend) { | ||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; | ||
} else { | ||
unset(self::$registeredLoaders[$this->vendorDir]); | ||
self::$registeredLoaders[$this->vendorDir] = $this; | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -308,6 +328,10 @@ public function register($prepend = false) | |
public function unregister() | ||
{ | ||
spl_autoload_unregister(array($this, 'loadClass')); | ||
|
||
if (null !== $this->vendorDir) { | ||
unset(self::$registeredLoaders[$this->vendorDir]); | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -367,6 +391,16 @@ public function findFile($class) | |
return $file; | ||
} | ||
|
||
/** | ||
* Returns the currently registered loaders indexed by their corresponding vendor directories. | ||
* | ||
* @return self[] | ||
*/ | ||
public static function getRegisteredLoaders() | ||
{ | ||
return self::$registeredLoaders; | ||
} | ||
|
||
private function findFileWithExtension($class, $ext) | ||
{ | ||
// PSR-4 lookup | ||
|
Oops, something went wrong.