Skip to content

Commit 8e052c4

Browse files
committed
Initial commit
0 parents  commit 8e052c4

File tree

5 files changed

+170
-0
lines changed

5 files changed

+170
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.buildpath
2+
/.cache
3+
/.metadata
4+
/.project
5+
/.settings
6+
/.vscode
7+
/.idea
8+
/.gitattributes
9+
.DS_Store

LICENSE.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2005-2015, Zend Technologies USA, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of Zend Technologies USA, Inc. nor the names of its
15+
contributors may be used to endorse or promote products derived from this
16+
software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
INFORMATION
2+
===================
3+
4+
This is a fork from Zend Framework 1.12.16 Release.
5+
6+
PURPOSE
7+
---------------------------
8+
This package is a part of the Zend Framework 1. Component was separated and put into its own composer package.
9+
10+
LICENSE
11+
=======
12+
13+
The files in this archive are released under the Zend Framework license.
14+
You can find a copy of this license in [LICENSE.txt](LICENSE.txt).

composer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "magento/zend-exception",
3+
"description": "Magento Zend Framework 1",
4+
"type": "library",
5+
"keywords": [
6+
"framework",
7+
"zf1"
8+
],
9+
"homepage": "http://framework.zend.com/",
10+
"license": "BSD-3-Clause",
11+
"require": {
12+
"php": ">=7.0.0"
13+
},
14+
"autoload": {
15+
"psr-0": {
16+
"Zend_Exception": "library/"
17+
}
18+
},
19+
"extra": {
20+
"branch-alias": {
21+
"dev-main": "1.16.x-dev"
22+
}
23+
}
24+
}

library/Zend/Exception.php

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?php
2+
/**
3+
* Zend Framework
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://framework.zend.com/license/new-bsd
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* @category Zend
16+
* @package Zend
17+
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
18+
* @license http://framework.zend.com/license/new-bsd New BSD License
19+
* @version $Id$
20+
*/
21+
22+
/**
23+
* @category Zend
24+
* @package Zend
25+
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
26+
* @license http://framework.zend.com/license/new-bsd New BSD License
27+
*/
28+
class Zend_Exception extends Exception
29+
{
30+
/**
31+
* @var null|Exception
32+
*/
33+
private $_previous = null;
34+
35+
/**
36+
* Construct the exception
37+
*
38+
* @param string $msg
39+
* @param int $code
40+
* @param Exception $previous
41+
* @return void
42+
*/
43+
public function __construct($msg = '', $code = 0, Exception $previous = null)
44+
{
45+
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
46+
parent::__construct($msg, (int) $code);
47+
$this->_previous = $previous;
48+
} else {
49+
parent::__construct($msg, (int) $code, $previous);
50+
}
51+
}
52+
53+
/**
54+
* Overloading
55+
*
56+
* For PHP < 5.3.0, provides access to the getPrevious() method.
57+
*
58+
* @param string $method
59+
* @param array $args
60+
* @return mixed
61+
*/
62+
public function __call($method, array $args)
63+
{
64+
if ('getprevious' == strtolower($method)) {
65+
return $this->_getPrevious();
66+
}
67+
return null;
68+
}
69+
70+
/**
71+
* String representation of the exception
72+
*
73+
* @return string
74+
*/
75+
public function __toString()
76+
{
77+
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
78+
if (null !== ($e = $this->getPrevious())) {
79+
return $e->__toString()
80+
. "\n\nNext "
81+
. parent::__toString();
82+
}
83+
}
84+
return parent::__toString();
85+
}
86+
87+
/**
88+
* Returns previous Exception
89+
*
90+
* @return Exception|null
91+
*/
92+
protected function _getPrevious()
93+
{
94+
return $this->_previous;
95+
}
96+
}

0 commit comments

Comments
 (0)