"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ClassExistenceResource.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

ClassExistenceResource.php  (phplist-3.4.5.tgz):ClassExistenceResource.php  (phplist-3.4.6.tgz)
skipping to change at line 79 skipping to change at line 79
$exists = $exists || $loaded; $exists = $exists || $loaded;
} elseif (!$exists = $loaded) { } elseif (!$exists = $loaded) {
if (!self::$autoloadLevel++) { if (!self::$autoloadLevel++) {
spl_autoload_register(__CLASS__.'::throwOnRequiredClass'); spl_autoload_register(__CLASS__.'::throwOnRequiredClass');
} }
$autoloadedClass = self::$autoloadedClass; $autoloadedClass = self::$autoloadedClass;
self::$autoloadedClass = $this->resource; self::$autoloadedClass = $this->resource;
try { try {
$exists = class_exists($this->resource) || interface_exists($thi s->resource, false) || trait_exists($this->resource, false); $exists = class_exists($this->resource) || interface_exists($thi s->resource, false) || trait_exists($this->resource, false);
} catch (\ReflectionException $e) { } catch (\Exception $e) {
if (0 >= $timestamp) { try {
unset(self::$existsCache[1][$this->resource]); self::throwOnRequiredClass($this->resource, $e);
throw $e; } catch (\ReflectionException $e) {
if (0 >= $timestamp) {
unset(self::$existsCache[1][$this->resource]);
throw $e;
}
} }
} finally { } finally {
self::$autoloadedClass = $autoloadedClass; self::$autoloadedClass = $autoloadedClass;
if (!--self::$autoloadLevel) { if (!--self::$autoloadLevel) {
spl_autoload_unregister(__CLASS__.'::throwOnRequiredClass'); spl_autoload_unregister(__CLASS__.'::throwOnRequiredClass');
} }
} }
} }
if (null === $this->exists) { if (null === $this->exists) {
skipping to change at line 120 skipping to change at line 124
/** /**
* @internal * @internal
*/ */
public function unserialize($serialized) public function unserialize($serialized)
{ {
list($this->resource, $this->exists) = unserialize($serialized); list($this->resource, $this->exists) = unserialize($serialized);
} }
/** /**
* @throws \ReflectionException When $class is not found and is required * Throws a reflection exception when the passed class does not exist but is
required.
*
* A class is considered "not required" when it's loaded as part of a "class
_exists" or similar check.
*
* This function can be used as an autoload function to throw a reflection
* exception if the class was not found by previous autoload functions.
*
* A previous exception can be passed. In this case, the class is considered
as being
* required totally, so if it doesn't exist, a reflection exception is alway
s thrown.
* If it exists, the previous exception is rethrown.
*
* @throws \ReflectionException
* *
* @internal * @internal
*/ */
public static function throwOnRequiredClass($class) public static function throwOnRequiredClass($class, \Exception $previous = n ull)
{ {
if (self::$autoloadedClass === $class) { // If the passed class is the resource being checked, we shouldn't throw
.
if (null === $previous && self::$autoloadedClass === $class) {
return;
}
if (class_exists($class, false) || interface_exists($class, false) || tr
ait_exists($class, false)) {
if (null !== $previous) {
throw $previous;
}
return; return;
} }
$e = new \ReflectionException("Class $class not found");
if ($previous instanceof \ReflectionException) {
throw $previous;
}
$e = new \ReflectionException("Class $class not found", 0, $previous);
if (null !== $previous) {
throw $e;
}
$trace = $e->getTrace(); $trace = $e->getTrace();
$autoloadFrame = [ $autoloadFrame = [
'function' => 'spl_autoload_call', 'function' => 'spl_autoload_call',
'args' => [$class], 'args' => [$class],
]; ];
$i = 1 + array_search($autoloadFrame, $trace, true);
if (isset($trace[$i]['function']) && !isset($trace[$i]['class'])) { if (false === $i = array_search($autoloadFrame, $trace, true)) {
throw $e;
}
if (isset($trace[++$i]['function']) && !isset($trace[$i]['class'])) {
switch ($trace[$i]['function']) { switch ($trace[$i]['function']) {
case 'get_class_methods': case 'get_class_methods':
case 'get_class_vars': case 'get_class_vars':
case 'get_parent_class': case 'get_parent_class':
case 'is_a': case 'is_a':
case 'is_subclass_of': case 'is_subclass_of':
case 'class_exists': case 'class_exists':
case 'class_implements': case 'class_implements':
case 'class_parents': case 'class_parents':
case 'trait_exists': case 'trait_exists':
 End of changes. 7 change blocks. 
10 lines changed or deleted 53 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)