This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'zf2/master'
- Loading branch information
70 parents
c660c64
+
23e480a
+
2d1a86f
+
bcd3a85
+
d46ca8d
+
236d691
+
0c0ae53
+
16da5d7
+
1c4489e
+
a57bb3d
+
c14d67b
+
b241e8d
+
10c9e19
+
33f9f3b
+
4585cfe
+
d06b3a5
+
371eaa8
+
c9fbe3f
+
77552c9
+
5883d28
+
518460f
+
63a6a3b
+
f21d820
+
5b80282
+
8d4f7c0
+
3428c24
+
50a5cf9
+
0fcf91c
+
ffd0e6c
+
90cc750
+
4c0cba4
+
9e64972
+
3a86f54
+
f4931d8
+
9c496b9
+
f36d38f
+
1b580df
+
dab01ce
+
bc6e247
+
96739b6
+
e1b5376
+
1c7183f
+
0e68ed1
+
5b3198f
+
929c939
+
f7e2963
+
611c83e
+
1d9e7ae
+
eae64aa
+
1f3f9e7
+
b2d7401
+
2f1d9d3
+
de6b908
+
c73007c
+
9565c63
+
bc2a6d0
+
264d24f
+
c9c493c
+
3992e0d
+
5225965
+
0de9a5c
+
867db21
+
34fe2aa
+
6ec2723
+
e576e38
+
0a2e3ae
+
af23c99
+
80f5165
+
78d16a9
+
6bc4f23
commit d3f730c
Showing
26 changed files
with
350 additions
and
525 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,48 +1,36 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_File | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_File | ||
*/ | ||
|
||
namespace Zend\File; | ||
|
||
// import SPL classes/interfaces into local scope | ||
use DirectoryIterator, | ||
FilterIterator, | ||
RecursiveIterator, | ||
RecursiveDirectoryIterator, | ||
RecursiveIteratorIterator; | ||
use DirectoryIterator; | ||
use FilterIterator; | ||
use RecursiveDirectoryIterator; | ||
use RecursiveIterator; | ||
use RecursiveIteratorIterator; | ||
use SplFileInfo; | ||
|
||
/** | ||
* Locate files containing PHP classes, interfaces, abstracts or traits | ||
* | ||
* @category Zend | ||
* @package Zend_File | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
class ClassFileLocator extends FilterIterator | ||
{ | ||
/** | ||
* Create an instance of the locator iterator | ||
* | ||
* Expects either a directory, or a DirectoryIterator (or its recursive variant) | ||
* | ||
* Expects either a directory, or a DirectoryIterator (or its recursive variant) | ||
* instance. | ||
* | ||
* | ||
* @param string|DirectoryIterator $dirOrIterator | ||
*/ | ||
public function __construct($dirOrIterator = '.') | ||
|
@@ -62,20 +50,20 @@ public function __construct($dirOrIterator = '.') | |
} | ||
|
||
parent::__construct($dirOrIterator); | ||
$this->setInfoClass('Zend\File\PhpClassFile'); | ||
} | ||
|
||
/** | ||
* Filter for files containing PHP classes, interfaces, or abstracts | ||
* | ||
* | ||
* @return bool | ||
*/ | ||
public function accept() | ||
{ | ||
$file = $this->getInnerIterator()->current(); | ||
|
||
// If we somehow have something other than an SplFileInfo object, just | ||
// If we somehow have something other than an SplFileInfo object, just | ||
// return false | ||
if (!$file instanceof \SplFileInfo) { | ||
if (!$file instanceof SplFileInfo) { | ||
return false; | ||
} | ||
|
||
|
@@ -95,13 +83,11 @@ public function accept() | |
$t_trait = defined('T_TRAIT') ? T_TRAIT : -1; // For preserve PHP 5.3 compatibility | ||
for ($i = 0; $i < $count; $i++) { | ||
$token = $tokens[$i]; | ||
|
||
if (!is_array($token)) { | ||
// single character token found; skip | ||
$i++; | ||
continue; | ||
} | ||
|
||
switch ($token[0]) { | ||
case T_NAMESPACE: | ||
// Namespace found; grab it for later | ||
|
@@ -110,6 +96,11 @@ public function accept() | |
$token = $tokens[$i]; | ||
if (is_string($token)) { | ||
if (';' === $token) { | ||
$saveNamespace = false; | ||
break; | ||
} | ||
if ('{' === $token) { | ||
$saveNamespace = true; | ||
break; | ||
} | ||
continue; | ||
|
@@ -122,9 +113,9 @@ public function accept() | |
break; | ||
} | ||
} | ||
|
||
// Set the namespace of this file in the object | ||
$file->namespace = $namespace; | ||
if ($saveNamespace) { | ||
$savedNamespace = $namespace; | ||
} | ||
break; | ||
case $t_trait: | ||
case T_CLASS: | ||
|
@@ -141,16 +132,29 @@ public function accept() | |
if (T_STRING == $type) { | ||
// If a classname was found, set it in the object, and | ||
// return boolean true (found) | ||
$file->classname = $content; | ||
return true; | ||
if (!isset($namespace) || null === $namespace) { | ||
if (isset($saveNamespace) && $saveNamespace) { | ||
$namespace = $savedNamespace; | ||
} else { | ||
$namespace = null; | ||
} | ||
|
||
} | ||
$class = (null === $namespace) ? $content : $namespace . '\\' . $content; | ||
$file->addClass($class); | ||
$namespace = null; | ||
break; | ||
} | ||
} | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
$classes = $file->getClasses(); | ||
if (!empty($classes)) { | ||
return true; | ||
} | ||
// No class-type tokens found; return false | ||
return false; | ||
} | ||
|
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 |
---|---|---|
@@ -1,31 +1,19 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_File_Transfer | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_File | ||
*/ | ||
|
||
namespace Zend\File\Exception; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_File_Transfer | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
class BadMethodCallException extends \BadMethodCallException implements | ||
class BadMethodCallException extends \BadMethodCallException implements | ||
ExceptionInterface | ||
{} |
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 |
---|---|---|
@@ -1,32 +1,20 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_File | ||
* @subpackage Exception | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_File | ||
*/ | ||
|
||
namespace Zend\File\Exception; | ||
|
||
/** | ||
* Marker interface for exceptions found in this component | ||
* | ||
* | ||
* @package Zend_File | ||
* @subpackage Exception | ||
* @license New BSD {@link http://framework.zend.com/license/new-bsd} | ||
*/ | ||
interface ExceptionInterface | ||
{ | ||
|
Oops, something went wrong.