diff --git a/library/Zend/Application/Bootstrap/BootstrapAbstract.php b/library/Zend/Application/Bootstrap/BootstrapAbstract.php index 5c7bd69e71..dc497e64a9 100644 --- a/library/Zend/Application/Bootstrap/BootstrapAbstract.php +++ b/library/Zend/Application/Bootstrap/BootstrapAbstract.php @@ -222,25 +222,12 @@ public function mergeOptions(array $array1, $array2 = null) /** * Get class resources (as resource/method pairs) * - * Uses get_class_methods() by default, reflection on prior to 5.2.6, - * as a bug prevents the usage of get_class_methods() there. - * * @return array */ public function getClassResources() { if (null === $this->_classResources) { - if (version_compare(PHP_VERSION, '5.2.6') === -1) { - $class = new ReflectionObject($this); - $classMethods = $class->getMethods(); - $methodNames = []; - - foreach ($classMethods as $method) { - $methodNames[] = $method->getName(); - } - } else { - $methodNames = get_class_methods($this); - } + $methodNames = get_class_methods($this); $this->_classResources = []; foreach ($methodNames as $method) { diff --git a/library/Zend/Cloud/Exception.php b/library/Zend/Cloud/Exception.php index 68ff0d5f0e..0a4a0c58f8 100644 --- a/library/Zend/Cloud/Exception.php +++ b/library/Zend/Cloud/Exception.php @@ -47,7 +47,7 @@ public function __construct($message, $code = 0, $clientException = null) } public function getClientException() { - return $this->_getPrevious(); + return $this->getPrevious(); } } diff --git a/library/Zend/EventManager/ResponseCollection.php b/library/Zend/EventManager/ResponseCollection.php index c23a9eaee6..299a0b7877 100644 --- a/library/Zend/EventManager/ResponseCollection.php +++ b/library/Zend/EventManager/ResponseCollection.php @@ -18,350 +18,6 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -if (version_compare(PHP_VERSION, '5.3.0', '<')) { - class SplStack implements Iterator, ArrayAccess, Countable - { - /** - * Delete items during iteration - */ - const IT_MODE_DELETE = 1; - - /** - * Keep items during iteration - */ - const IT_MODE_KEEP = 0; - - /** - * Mode used when iterating - * @var int - */ - protected $mode = self::IT_MODE_KEEP; - - /** - * Count of elements in the stack - * - * @var int - */ - protected $count = 0; - - /** - * Data represented by this stack - * - * @var array - */ - protected $data = []; - - /** - * Sorted stack of values - * - * @var false|array - */ - protected $stack = false; - - /** - * Set the iterator mode - * - * Must be set to one of IT_MODE_DELETE or IT_MODE_KEEP - * - * @todo Currently, IteratorMode is ignored, as we use the default (keep); should this be implemented? - * @param int $mode - * @return void - * @throws InvalidArgumentException - */ - public function setIteratorMode($mode) - { - $expected = [ - self::IT_MODE_DELETE => true, - self::IT_MODE_KEEP => true, - ]; - - if (!isset($expected[$mode])) { - throw new InvalidArgumentException(sprintf('Invalid iterator mode specified ("%s")', $mode)); - } - - $this->mode = $mode; - } - - /** - * Return last element in the stack - * - * @return mixed - */ - public function bottom() - { - $this->rewind(); - $value = array_pop($this->stack); - array_push($this->stack, $value); - return $value; - } - - /** - * Countable: return count of items in the stack - * - * @return int - */ - public function count(): int - { - return $this->count; - } - - /** - * Iterator: return current item in the stack - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function current() - { - if (!$this->stack) { - $this->rewind(); - } - return current($this->stack); - } - - /** - * Get iteration mode - * - * @return int - */ - public function getIteratorMode() - { - return $this->mode; - } - - /** - * Is the stack empty? - * - * @return bool - */ - public function isEmpty() - { - return $this->count === 0; - } - - /** - * Iterator: return key of current item in the stack - * - * @return int|string|null - */ - #[\ReturnTypeWillChange] - public function key() - { - if (!$this->stack) { - $this->rewind(); - } - return key($this->stack); - } - - /** - * Iterator: advance pointer to next item in the stack - * - * @return void - */ - #[\ReturnTypeWillChange] - public function next() - { - if (!$this->stack) { - $this->rewind(); - } - return next($this->stack); - } - - /** - * ArrayAccess: does an item exist at the specified offset? - * - * @param mixed $index - * @return bool - */ - public function offsetExists($index): bool - { - return array_key_exists($index, $this->data); - } - - /** - * ArrayAccess: get the item at the specified offset - * - * @param mixed $index - * @return mixed - * @throws OutOfRangeException - */ - #[\ReturnTypeWillChange] - public function offsetGet($index) - { - if (!$this->offsetExists($index)) { - throw OutOfRangeException(sprintf('Invalid index ("%s") specified', $index)); - } - return $this->data[$index]; - } - - /** - * ArrayAccess: add an item at the specified offset - * - * @param mixed $index - * @param mixed $newval - * @return void - */ - public function offsetSet($index, $newval): void - { - $this->data[$index] = $newval; - $this->stack = false; - $this->count++; - } - - /** - * ArrayAccess: unset the item at the specified offset - * - * @param mixed $index - * @return void - * @throws OutOfRangeException - */ - public function offsetUnset($index): void - { - if (!$this->offsetExists($index)) { - throw OutOfRangeException(sprintf('Invalid index ("%s") specified', $index)); - } - unset($this->data[$index]); - $this->stack = false; - $this->count--; - } - - /** - * Pop a node from the end of the stack - * - * @return mixed - * @throws RuntimeException - */ - public function pop() - { - $val = array_pop($this->data); - $this->stack = false; - $this->count--; - return $val; - } - - /** - * Move the iterator to the previous node - * - * @todo Does this need to be implemented? - * @return void - */ - public function prev() - { - } - - /** - * Push an element to the list - * - * @param mixed $value - * @return void - */ - public function push($value) - { - array_push($this->data, $value); - $this->count++; - $this->stack = false; - } - - /** - * Iterator: rewind to beginning of stack - * - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - if (is_array($this->stack)) { - return reset($this->stack); - } - $this->stack = array_reverse($this->data, true); - } - - /** - * Serialize the storage - * - * @return string - */ - public function serialize(): ?string - { - return serialize($this->__serialize()); - } - - public function __serialize(): array - { - return $this->data; - } - - /** - * Shifts a node from the beginning of the list - * - * @return mixed - * @throws RuntimeException - */ - public function shift() - { - $val = array_shift($this->data); - $this->stack = false; - $this->count--; - return $val; - } - - /** - * Peek at the top node of the stack - * - * @return mixed - */ - public function top() - { - $this->rewind(); - $value = array_shift($this->stack); - array_unshift($this->stack, $value); - return $value; - } - - /** - * Unserialize the storage - * - * @param string - * @return void - */ - public function unserialize($serialized): void - { - $this->__unserialize(unserialize($serialized)); - } - - public function __unserialize(array $data): void - { - $this->data = $data; - $this->stack = false; - } - - /** - * Unshift a node onto the beginning of the list - * - * @param mixed $value - * @return void - */ - public function unshift($value) - { - array_unshift($this->data, $value); - $this->count++; - $this->stack = false; - } - - /** - * Iterator: is the current pointer valid? - * - * @return bool - */ - public function valid(): bool - { - $key = key($this->stack); - - return ($key !== null && $key !== false); - } - } -} - /** * Collection of signal handler return values * diff --git a/library/Zend/Exception.php b/library/Zend/Exception.php index 3f4c31d09a..f4250364f9 100644 --- a/library/Zend/Exception.php +++ b/library/Zend/Exception.php @@ -27,11 +27,6 @@ */ class Zend_Exception extends Exception { - /** - * @var null|Exception - */ - private $_previous = null; - /** * Construct the exception * @@ -42,38 +37,6 @@ class Zend_Exception extends Exception */ public function __construct($msg = '', $code = 0, \Throwable $previous = null) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - parent::__construct($msg, (int) $code); - $this->_previous = $previous; - } else { - parent::__construct($msg, (int) $code, $previous); - } - } - - /** - * String representation of the exception - * - * @return string - */ - public function __toString() - { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - if (null !== ($e = $this->getPrevious())) { - return $e->__toString() - . "\n\nNext " - . parent::__toString(); - } - } - return parent::__toString(); - } - - /** - * Returns previous Exception - * - * @return Exception|null - */ - protected function _getPrevious() - { - return $this->_previous; + parent::__construct($msg, (int) $code, $previous); } } diff --git a/library/Zend/File/ClassFileLocator.php b/library/Zend/File/ClassFileLocator.php index a84b583ba5..f284e27e6e 100644 --- a/library/Zend/File/ClassFileLocator.php +++ b/library/Zend/File/ClassFileLocator.php @@ -59,16 +59,6 @@ public function __construct($dirOrIterator = '.') parent::__construct($iterator); $this->setInfoClass('Zend_File_PhpClassFile'); - // Forward-compat with PHP 5.3 - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - if (!defined('T_NAMESPACE')) { - define('T_NAMESPACE', 'namespace'); - } - if (!defined('T_NS_SEPARATOR')) { - define('T_NS_SEPARATOR', '\\'); - } - } - if (PHP_VERSION_ID < 80000) { if (!defined('T_NAME_QUALIFIED')) { define('T_NAME_QUALIFIED', 0); diff --git a/library/Zend/Filter/Compress/Zip.php b/library/Zend/Filter/Compress/Zip.php index 5ad5da9b7b..752d3bcce8 100644 --- a/library/Zend/Filter/Compress/Zip.php +++ b/library/Zend/Filter/Compress/Zip.php @@ -233,24 +233,6 @@ public function decompress($content) throw new Zend_Filter_Exception($this->_errorString($res)); } - if (version_compare(PHP_VERSION, '5.2.8', '<')) { - for ($i = 0; $i < $zip->numFiles; $i++) { - $statIndex = $zip->statIndex($i); - $currName = $statIndex['name']; - if (($currName[0] == '/') || - (substr($currName, 0, 2) == '..') || - (substr($currName, 0, 4) == './..') - ) - { - require_once 'Zend/Filter/Exception.php'; - throw new Zend_Filter_Exception('Upward directory traversal was detected inside ' . $archive - . ' please use PHP 5.2.8 or greater to take advantage of path resolution features of ' - . 'the zip extension in this decompress() method.' - ); - } - } - } - $res = @$zip->extractTo($target); if ($res !== true) { require_once 'Zend/Filter/Exception.php'; diff --git a/library/Zend/Filter/Encrypt/Mcrypt.php b/library/Zend/Filter/Encrypt/Mcrypt.php index d5d26dd493..226b064117 100644 --- a/library/Zend/Filter/Encrypt/Mcrypt.php +++ b/library/Zend/Filter/Encrypt/Mcrypt.php @@ -171,17 +171,12 @@ public function setVector($vector = null) $cipher = $this->_openCipher(); $size = mcrypt_enc_get_iv_size($cipher); if (empty($vector)) { - $this->_srand(); - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && version_compare(PHP_VERSION, '5.3.0', '<')) { - $method = MCRYPT_RAND; + if (file_exists('/dev/urandom') || (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')) { + $method = MCRYPT_DEV_URANDOM; + } elseif (file_exists('/dev/random')) { + $method = MCRYPT_DEV_RANDOM; } else { - if (file_exists('/dev/urandom') || (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')) { - $method = MCRYPT_DEV_URANDOM; - } elseif (file_exists('/dev/random')) { - $method = MCRYPT_DEV_RANDOM; - } else { - $method = MCRYPT_RAND; - } + $method = MCRYPT_RAND; } $vector = mcrypt_create_iv($size, $method); } else if (strlen($vector) != $size) { @@ -331,7 +326,6 @@ protected function _initCipher($cipher) $keysizes = mcrypt_enc_get_supported_key_sizes($cipher); if (empty($keysizes) || ($this->_encryption['salt'] == true)) { - $this->_srand(); $keysize = mcrypt_enc_get_key_size($cipher); $key = substr(md5($key), 0, $keysize); } else if (!in_array(strlen($key), $keysizes)) { @@ -347,20 +341,4 @@ protected function _initCipher($cipher) return $this; } - - /** - * _srand() interception - * - * @see ZF-8742 - */ - protected function _srand() - { - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - return; - } - if (!self::$_srandCalled) { - srand(Zend_Crypt_Math::randInteger(0, PHP_INT_MAX)); - self::$_srandCalled = true; - } - } } diff --git a/library/Zend/Http/Client.php b/library/Zend/Http/Client.php index 23008a8bce..1371bb7395 100644 --- a/library/Zend/Http/Client.php +++ b/library/Zend/Http/Client.php @@ -260,13 +260,6 @@ class Zend_Http_Client */ protected $_unmaskStatus = false; - /** - * Status if the http_build_query function escapes brackets - * - * @var boolean - */ - protected $_queryBracketsEscaped = true; - /** * Fileinfo magic database resource * @@ -292,8 +285,6 @@ public function __construct($uri = null, $config = null) if ($config !== null) { $this->setConfig($config); } - - $this->_queryBracketsEscaped = version_compare(phpversion(), '5.1.3', '>='); } /** @@ -1048,11 +1039,7 @@ public function request($method = null) // @see ZF-11671 to unmask for some services to foo=val1&foo=val2 if ($this->getUnmaskStatus()) { - if ($this->_queryBracketsEscaped) { - $query = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $query); - } else { - $query = preg_replace('/\\[(?:[0-9]|[1-9][0-9]+)\\]=/', '=', $query); - } + $query = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $query); } $uri->setQuery($query); diff --git a/library/Zend/Loader/ClassMapAutoloader.php b/library/Zend/Loader/ClassMapAutoloader.php index be5844673c..f1986b7059 100644 --- a/library/Zend/Loader/ClassMapAutoloader.php +++ b/library/Zend/Loader/ClassMapAutoloader.php @@ -156,11 +156,7 @@ public function autoload($class) */ public function register() { - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - spl_autoload_register([$this, 'autoload'], true, true); - } else { - spl_autoload_register([$this, 'autoload'], true); - } + spl_autoload_register([$this, 'autoload'], true, true); } /** diff --git a/library/Zend/Pdf/StringParser.php b/library/Zend/Pdf/StringParser.php index 13e30c858a..1a3db87273 100644 --- a/library/Zend/Pdf/StringParser.php +++ b/library/Zend/Pdf/StringParser.php @@ -256,12 +256,7 @@ public function readLexeme() } } else { $start = $this->offset; - $compare = ''; - if( version_compare( phpversion(), '5.2.5' ) >= 0) { - $compare = "()<>[]{}/%\x00\t\n\f\r "; - } else { - $compare = "()<>[]{}/%\x00\t\n\r "; - } + $compare = "()<>[]{}/%\x00\t\n\f\r "; $this->offset += strcspn($this->data, $compare, $this->offset); diff --git a/library/Zend/Stdlib/SplPriorityQueue.php b/library/Zend/Stdlib/SplPriorityQueue.php index 7c5954f00a..5ae1cb8e6f 100644 --- a/library/Zend/Stdlib/SplPriorityQueue.php +++ b/library/Zend/Stdlib/SplPriorityQueue.php @@ -18,363 +18,6 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -if (version_compare(PHP_VERSION, '5.3.0', '<')) { - /** - * SplPriorityQueue - * - * PHP 5.2.X userland implementation of PHP's SplPriorityQueue - */ - class SplPriorityQueue implements Iterator , Countable - { - /** - * Extract data only - */ - const EXTR_DATA = 0x00000001; - - /** - * Extract priority only - */ - const EXTR_PRIORITY = 0x00000002; - - /** - * Extract an array of ('data' => $value, 'priority' => $priority) - */ - const EXTR_BOTH = 0x00000003; - - /** - * Count of items in the queue - * @var int - */ - protected $count = 0; - - /** - * Flag indicating what should be returned when iterating or extracting - * @var int - */ - protected $extractFlags = self::EXTR_DATA; - - /** - * @var bool|array - */ - protected $preparedQueue = false; - - /** - * All items in the queue - * @var array - */ - protected $queue = []; - - /** - * Constructor - * - * Creates a new, empty queue - * - * @return void - */ - public function __construct() - { - } - - /** - * Compare two priorities - * - * Returns positive integer if $priority1 is greater than $priority2, 0 - * if equal, negative otherwise. - * - * Unused internally, and only included in order to retain the same - * interface as PHP's SplPriorityQueue. - * - * @param mixed $priority1 - * @param mixed $priority2 - * @return int - */ - public function compare($priority1, $priority2) - { - if ($priority1 > $priority2) { - return 1; - } - if ($priority1 == $priority2) { - return 0; - } - - return -1; - } - - /** - * Countable: return number of items composed in the queue - * - * @return int - */ - public function count(): int - { - return $this->count; - } - - /** - * Iterator: return current item - * - * @return mixed - */ - #[\ReturnTypeWillChange] - public function current() - { - if (!$this->preparedQueue) { - $this->rewind(); - } - if (!$this->count) { - throw new OutOfBoundsException('Cannot iterate SplPriorityQueue; no elements present'); - } - -if (!is_array($this->preparedQueue)) { - throw new DomainException(sprintf( - "Queue was prepared, but is empty?\n PreparedQueue: %s\n Internal Queue: %s\n", - var_export($this->preparedQueue, 1), - var_export($this->queue, 1) - )); -} - - $return = array_shift($this->preparedQueue); - $priority = $return['priority']; - $priorityKey = $return['priorityKey']; - $key = $return['key']; - unset($return['key']); - unset($return['priorityKey']); - unset($this->queue[$priorityKey][$key]); - - switch ($this->extractFlags) { - case self::EXTR_DATA: - return $return['data']; - case self::EXTR_PRIORITY: - return $return['priority']; - case self::EXTR_BOTH: - default: - return $return; - }; - } - - /** - * Extract a node from top of the heap and sift up - * - * Returns either the value, the priority, or both, depending on the extract flag. - * - * @return mixed; - */ - public function extract() - { - if (!$this->count) { - return null; - } - - if (!$this->preparedQueue) { - $this->prepareQueue(); - } - - if (empty($this->preparedQueue)) { - return null; - } - - $return = array_shift($this->preparedQueue); - $priority = $return['priority']; - $priorityKey = $return['priorityKey']; - $key = $return['key']; - unset($return['key']); - unset($return['priorityKey']); - unset($this->queue[$priorityKey][$key]); - $this->count--; - - switch ($this->extractFlags) { - case self::EXTR_DATA: - return $return['data']; - case self::EXTR_PRIORITY: - return $return['priority']; - case self::EXTR_BOTH: - default: - return $return; - }; - } - - /** - * Insert a value into the heap, at the specified priority - * - * @param mixed $value - * @param mixed $priority - * @return void - */ - public function insert($value, $priority) - { - if (!is_scalar($priority)) { - $priority = serialize($priority); - } - if (!isset($this->queue[$priority])) { - $this->queue[$priority] = []; - } - $this->queue[$priority][] = $value; - $this->count++; - $this->preparedQueue = false; - } - - /** - * Is the queue currently empty? - * - * @return bool - */ - public function isEmpty() - { - return (0 == $this->count); - } - - /** - * Iterator: return current key - * - * @return int Usually an int or string - */ - #[\ReturnTypeWillChange] - public function key() - { - return $this->count; - } - - /** - * Iterator: Move pointer forward - * - * @return void - */ - #[\ReturnTypeWillChange] - public function next() - { - $this->count--; - } - - /** - * Recover from corrupted state and allow further actions on the queue - * - * Unimplemented, and only included in order to retain the same interface as PHP's - * SplPriorityQueue. - * - * @return void - */ - public function recoverFromCorruption() - { - } - - /** - * Iterator: Move pointer to first item - * - * @return void - */ - public function rewind(): void - { - if (!$this->preparedQueue) { - $this->prepareQueue(); - } - } - - /** - * Set the extract flags - * - * Defines what is extracted by SplPriorityQueue::current(), - * SplPriorityQueue::top() and SplPriorityQueue::extract(). - * - * - SplPriorityQueue::EXTR_DATA (0x00000001): Extract the data - * - SplPriorityQueue::EXTR_PRIORITY (0x00000002): Extract the priority - * - SplPriorityQueue::EXTR_BOTH (0x00000003): Extract an array containing both - * - * The default mode is SplPriorityQueue::EXTR_DATA. - * - * @param int $flags - * @return void - */ - public function setExtractFlags($flags) - { - $expected = [ - self::EXTR_DATA => true, - self::EXTR_PRIORITY => true, - self::EXTR_BOTH => true, - ]; - if (!isset($expected[$flags])) { - throw new InvalidArgumentException(sprintf('Expected an EXTR_* flag; received %s', $flags)); - } - $this->extractFlags = $flags; - } - - /** - * Return the value or priority (or both) of the top node, depending on - * the extract flag - * - * @return mixed - */ - public function top() - { - $this->sort(); - $keys = array_keys($this->queue); - $key = array_shift($keys); - if (preg_match('/^(a|O):/', $key)) { - $key = unserialize($key); - } - - if ($this->extractFlags == self::EXTR_PRIORITY) { - return $key; - } - - if ($this->extractFlags == self::EXTR_DATA) { - return $this->queue[$key][0]; - } - - return [ - 'data' => $this->queue[$key][0], - 'priority' => $key, - ]; - } - - /** - * Iterator: is the current position valid for the queue - * - * @return bool - */ - public function valid(): bool - { - return (bool) $this->count; - } - - /** - * Sort the queue - * - * @return void - */ - protected function sort() - { - krsort($this->queue); - } - - /** - * Prepare the queue for iteration and/or extraction - * - * @return void - */ - protected function prepareQueue() - { - $this->sort(); - $count = $this->count; - $queue = []; - foreach ($this->queue as $priority => $values) { - $priorityKey = $priority; - if (preg_match('/^(a|O):/', $priority)) { - $priority = unserialize($priority); - } - foreach ($values as $key => $value) { - $queue[$count] = [ - 'data' => $value, - 'priority' => $priority, - 'priorityKey' => $priorityKey, - 'key' => $key, - ]; - $count--; - } - } - $this->preparedQueue = $queue; - } - } -} /** * Serializable version of SplPriorityQueue @@ -394,21 +37,6 @@ class Zend_Stdlib_SplPriorityQueue extends SplPriorityQueue implements Serializa */ protected $serial = PHP_INT_MAX; - /** - * @var bool - */ - protected $isPhp53; - - /** - * Constructor - * - * @return void - */ - public function __construct() - { - $this->isPhp53 = version_compare(PHP_VERSION, '5.3', '>='); - } - /** * Insert a value with a given priority * @@ -425,10 +53,8 @@ public function insert($datum, $priority) // hack around it to ensure that items registered at the same priority // return in the order registered. In the userland version, this is not // necessary. - if ($this->isPhp53) { - if (!is_array($priority)) { - $priority = [$priority, $this->serial--]; - } + if (!is_array($priority)) { + $priority = [$priority, $this->serial--]; } parent::insert($datum, $priority); } diff --git a/library/Zend/Validate/File/MimeType.php b/library/Zend/Validate/File/MimeType.php index d2aae0a661..a813bb19c1 100644 --- a/library/Zend/Validate/File/MimeType.php +++ b/library/Zend/Validate/File/MimeType.php @@ -156,42 +156,10 @@ public function __construct($mimetype) /** * Returns the actual set magicfile * - * Note that for PHP 5.3.0 or higher, we don't use $_ENV['MAGIC'] or try to - * find a magic file in a common location as PHP now has a built-in internal - * magic file. - * * @return string - * @throws Zend_Validate_Exception */ public function getMagicFile() { - if (version_compare(PHP_VERSION, '5.3.0', '<') - && null === $this->_magicfile) { - if (!empty($_ENV['MAGIC'])) { - $this->setMagicFile($_ENV['MAGIC']); - } elseif ( - !(@ini_get('safe_mode') == 'On' || @ini_get('safe_mode') === 1) - && $this->shouldTryCommonMagicFiles() // @see ZF-11784 - ) { - require_once 'Zend/Validate/Exception.php'; - foreach ($this->_magicFiles as $file) { - // supressing errors which are thrown due to openbase_dir restrictions - try { - $this->setMagicFile($file); - if ($this->_magicfile !== null) { - break; - } - } catch (Zend_Validate_Exception $e) { - // Intentionally, catch and fall through - } - } - } - - if ($this->_magicfile === null) { - $this->_magicfile = false; - } - } - return $this->_magicfile; }