This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rfc/escaper
- Loading branch information
33 parents
261ddba
+
9c23ce8
+
d2ea716
+
8a38d20
+
29c3c53
+
9681f39
+
7dc76e1
+
7e1a689
+
a1f3efa
+
b138336
+
0ac8011
+
498f096
+
a002c09
+
a72d069
+
d696070
+
95b016c
+
f72f2a8
+
63f9aa4
+
c62eb22
+
56ff1e4
+
17753e6
+
f52efc3
+
5400ef9
+
2de31e5
+
5ef1929
+
5d57927
+
fb86f9e
+
a0d3c0d
+
754d50b
+
9ae8ef7
+
80bb476
+
7a4072e
+
1b4e215
commit 9e453d7
Showing
106 changed files
with
4,625 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Exception; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
*/ | ||
interface 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Exception; | ||
|
||
/** | ||
* Invalid Argument Exception | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Exception | ||
*/ | ||
class InvalidArgumentException extends \InvalidArgumentException 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Exception; | ||
|
||
/** | ||
* Runtime Exception | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Exception | ||
*/ | ||
class RuntimeException extends \RuntimeException 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Feature; | ||
|
||
/** | ||
* Autoloader provider interface | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
*/ | ||
interface AutoloaderProviderInterface | ||
{ | ||
/** | ||
* Return an array for passing to Zend\Loader\AutoloaderFactory. | ||
* | ||
* @return array | ||
*/ | ||
public function getAutoloaderConfig(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Feature; | ||
|
||
use Zend\EventManager\Event; | ||
|
||
/** | ||
* Boostrap listener provider interface | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
*/ | ||
interface BootstrapListenerInterface | ||
{ | ||
/** | ||
* Listen to the bootstrap event | ||
* | ||
* @return array | ||
*/ | ||
public function onBootstrap(Event $e); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* 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 license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Feature; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
interface ConfigProviderInterface | ||
{ | ||
/** | ||
* Returns configuration to merge with application configuration | ||
* | ||
* @return array|\Traversable | ||
*/ | ||
public function getConfig(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* 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 license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Feature; | ||
|
||
use Zend\ModuleManager\ModuleManagerInterface; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
interface InitProviderInterface | ||
{ | ||
/** | ||
* Initialize workflow | ||
* | ||
* @param \Zend\ModuleManager\ModuleManagerInterface $manager | ||
* @return void | ||
*/ | ||
public function init(ModuleManagerInterface $manager); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Feature; | ||
|
||
/** | ||
* LocatorRegistered | ||
* | ||
* By implementing this interface in a Module class, the instance of the Module | ||
* class will be automatically injected into any DI-configured object which has | ||
* a constructor or setter parameter which is type hinted with the Module class | ||
* name. Implementing this interface obviously does not require adding any | ||
* methods to your class. | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
*/ | ||
interface LocatorRegisteredInterface | ||
{ | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* 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 license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Feature; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Feature | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
interface ServiceProviderInterface | ||
{ | ||
/** | ||
* Expected to return \Zend\ServiceManager\Configuration object or array to | ||
* seed such an object. | ||
* | ||
* @return array|\Zend\ServiceManager\Configuration | ||
*/ | ||
public function getServiceConfiguration(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Listener; | ||
|
||
/** | ||
* Abstract listener | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Listener | ||
*/ | ||
abstract class AbstractListener | ||
{ | ||
/** | ||
* @var ListenerOptions | ||
*/ | ||
protected $options; | ||
|
||
/** | ||
* __construct | ||
* | ||
* @param ListenerOptions $options | ||
* @return void | ||
*/ | ||
public function __construct(ListenerOptions $options = null) | ||
{ | ||
if (null === $options) { | ||
$this->setOptions(new ListenerOptions); | ||
} else { | ||
$this->setOptions($options); | ||
} | ||
} | ||
|
||
/** | ||
* Get options. | ||
* | ||
* @return ListenerOptions | ||
*/ | ||
public function getOptions() | ||
{ | ||
return $this->options; | ||
} | ||
|
||
/** | ||
* Set options. | ||
* | ||
* @param ListenerOptions $options the value to be set | ||
* @return AbstractListener | ||
*/ | ||
public function setOptions(ListenerOptions $options) | ||
{ | ||
$this->options = $options; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Write a simple array of scalars to a file | ||
* | ||
* @param string $filePath | ||
* @param array $array | ||
* @return AbstractListener | ||
*/ | ||
protected function writeArrayToFile($filePath, $array) | ||
{ | ||
$content = "<?php\nreturn " . var_export($array, 1) . ';'; | ||
file_put_contents($filePath, $content); | ||
return $this; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @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_ModuleManager | ||
*/ | ||
|
||
namespace Zend\ModuleManager\Listener; | ||
|
||
use Zend\Loader\AutoloaderFactory; | ||
use Zend\ModuleManager\Feature\AutoloaderProviderInterface; | ||
use Zend\ModuleManager\ModuleEvent; | ||
|
||
/** | ||
* Autoloader listener | ||
* | ||
* @category Zend | ||
* @package Zend_ModuleManager | ||
* @subpackage Listener | ||
*/ | ||
class AutoloaderListener extends AbstractListener | ||
{ | ||
|
||
/** | ||
* @param ModuleEvent $e | ||
* @return void | ||
*/ | ||
public function __invoke(ModuleEvent $e) | ||
{ | ||
$module = $e->getModule(); | ||
if (!$module instanceof AutoloaderProviderInterface | ||
&& !method_exists($module, 'getAutoloaderConfig') | ||
) { | ||
return; | ||
} | ||
$autoloaderConfig = $module->getAutoloaderConfig(); | ||
AutoloaderFactory::factory($autoloaderConfig); | ||
} | ||
} |
Oops, something went wrong.