Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Merge branch 'livedocx-2.0' of http://github.com/jonathanmaro…

…n/zf2 into merges/jonathanmaron-livedocx"

This reverts commit 2396268, reversing
changes made to 3addea5.
  • Loading branch information...
commit 7722417e9334bb835402dbfaab16b193074c6d05 1 parent bfc0000
@weierophinney weierophinney authored
Showing with 525 additions and 7,536 deletions.
  1. +0 −1  .gitignore
  2. +39 −35 INSTALL.txt
  3. +5 −0 README-DEV.txt
  4. +7 −0 README.txt
  5. BIN  demos/Zend/Service/LiveDocx/MailMerge/conference-pass/dailemaitre.jpg
  6. +0 −39 demos/Zend/Service/LiveDocx/MailMerge/conference-pass/generate-document.php
  7. BIN  demos/Zend/Service/LiveDocx/MailMerge/conference-pass/template.docx
  8. +0 −30 demos/Zend/Service/LiveDocx/MailMerge/images/delete-all.php
  9. +0 −31 demos/Zend/Service/LiveDocx/MailMerge/images/download.php
  10. BIN  demos/Zend/Service/LiveDocx/MailMerge/images/image-01.png
  11. BIN  demos/Zend/Service/LiveDocx/MailMerge/images/image-02.png
  12. +0 −30 demos/Zend/Service/LiveDocx/MailMerge/images/image-exists.php
  13. +0 −24 demos/Zend/Service/LiveDocx/MailMerge/images/list.php
  14. +0 −30 demos/Zend/Service/LiveDocx/MailMerge/images/upload.php
  15. +1 −1  demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php
  16. +1 −1  demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php
  17. +1 −1  demos/Zend/Service/LiveDocx/check-environment.php
  18. +19 −14 library/Zend/CodeGenerator/PHP/Exception.php → demos/Zend/Service/LiveDocx/configuration.php.dist
  19. +8 −4 library/Zend/Amf/Server.php
  20. +1 −1  library/Zend/Application/Module/Bootstrap.php
  21. +3 −4 library/Zend/Application/Resource/Mail.php
  22. +1 −1  library/Zend/Application/Resource/Modules.php
  23. +1 −1  library/Zend/Barcode/Renderer/Image.php
  24. +1 −1  library/Zend/Cache/Backend/StaticBackend.php
  25. +0 −98 library/Zend/CodeGenerator/PHP/AbstractPHP.php
  26. +0 −99 library/Zend/CodeGenerator/PHP/Docblock/Tag/License.php
  27. +0 −129 library/Zend/CodeGenerator/PHP/Docblock/Tag/Param.php
  28. +0 −99 library/Zend/CodeGenerator/PHP/Docblock/Tag/Return.php
  29. +0 −74 library/Zend/CodeGenerator/PHP/PHPBody.php
  30. +0 −553 library/Zend/CodeGenerator/PHP/PHPClass.php
  31. +0 −217 library/Zend/CodeGenerator/PHP/PHPDocblock.php
  32. +0 −142 library/Zend/CodeGenerator/PHP/PHPDocblockTag.php
  33. +0 −573 library/Zend/CodeGenerator/PHP/PHPFile.php
  34. +0 −220 library/Zend/CodeGenerator/PHP/PHPMember/AbstractMember.php
  35. +0 −60 library/Zend/CodeGenerator/PHP/PHPMember/MemberContainer.php
  36. +0 −227 library/Zend/CodeGenerator/PHP/PHPMethod.php
  37. +0 −247 library/Zend/CodeGenerator/PHP/PHPParameter.php
  38. +0 −52 library/Zend/CodeGenerator/PHP/PHPParameterDefaultValue.php
  39. +0 −176 library/Zend/CodeGenerator/PHP/PHPProperty.php
  40. +0 −39 library/Zend/CodeGenerator/PHP/PHPPropertyValue.php
  41. +0 −340 library/Zend/CodeGenerator/PHP/PHPValue.php
  42. +1 −0  library/Zend/Controller/Action.php
  43. +16 −6 library/Zend/Controller/Action/Helper/FlashMessenger.php
  44. +1 −8 library/Zend/Controller/Action/Helper/Redirector.php
  45. +1 −1  library/Zend/Controller/Action/Helper/ViewRenderer.php
  46. +3 −3 library/Zend/Controller/Dispatcher/AbstractDispatcher.php
  47. +1 −1  library/Zend/Controller/Dispatcher/Standard.php
  48. +4 −4 library/Zend/Controller/Router/Rewrite.php
  49. +1 −1  library/Zend/Db/Table/AbstractRow.php
  50. +0 −632 library/Zend/Feed/Reader/Entry/RSS.php
  51. +38 −3 library/Zend/Feed/Writer/AbstractFeed.php
  52. +1 −1  library/Zend/Feed/Writer/Feed.php
  53. +38 −2 library/Zend/Feed/Writer/Renderer/Entry/Atom.php
  54. +0 −347 library/Zend/Feed/Writer/Renderer/Entry/RSS.php
  55. +0 −498 library/Zend/Feed/Writer/Renderer/Feed/RSS.php
  56. +1 −1  library/Zend/Form/Element/Hash.php
  57. +3 −2 library/Zend/GData/App/Base.php
  58. +3 −2 library/Zend/GData/App/BaseMediaSource.php
  59. +2 −3 library/Zend/GData/Query.php
  60. +10 −7 library/Zend/Locale/Format.php
  61. +9 −9 library/Zend/Locale/PhpMath.php
  62. +2 −2 library/Zend/Log/Filter/Priority.php
  63. +1 −1  library/Zend/Log/Logger.php
  64. +1 −1  library/Zend/Log/Writer/Db.php
  65. +14 −14 library/Zend/Log/Writer/Firebug.php
  66. +1 −1  library/Zend/Markup/Markup.php
  67. +0 −476 library/Zend/Markup/Parser/BBCode.php
  68. +24 −0 library/Zend/Markup/Parser/Textile.php
  69. +0 −533 library/Zend/Markup/Renderer/HTML.php
  70. +0 −126 library/Zend/Markup/Renderer/Markup/HTML/AbstractHTML.php
  71. +0 −55 library/Zend/Markup/Renderer/Markup/HTML/Code.php
  72. +0 −84 library/Zend/Markup/Renderer/Markup/HTML/Img.php
  73. +0 −106 library/Zend/Markup/Renderer/Markup/HTML/ListItem.php
  74. +0 −74 library/Zend/Markup/Renderer/Markup/HTML/Replace.php
  75. +0 −77 library/Zend/Markup/Renderer/Markup/HTML/URL.php
  76. +1 −1  library/Zend/OAuth/Config/StandardConfig.php
  77. +1 −1  library/Zend/Reflection/ReflectionFile.php
  78. +1 −1  library/Zend/Serializer/Serializer.php
  79. +1 −1  library/Zend/Service/Amazon/Amazon.php
  80. +7 −7 library/Zend/Service/LiveDocx/AbstractLiveDocx.php
  81. +26 −177 library/Zend/Service/LiveDocx/MailMerge.php
  82. +74 −8 library/Zend/Session/Container.php
  83. +10 −0 library/Zend/Session/SessionManager.php
  84. +1 −1  library/Zend/SignalSlot/GlobalSignals.php
  85. +3 −4 library/Zend/Soap/Client.php
  86. +3 −2 library/Zend/Stdlib/SignalHandler.php
  87. +0 −156 library/Zend/Tag/Cloud/Decorator/HTMLCloud.php
  88. +0 −303 library/Zend/Tag/Cloud/Decorator/HTMLTag.php
  89. +2 −2 library/Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php
  90. +1 −1  library/Zend/Tool/Project/Context/Filesystem/File.php
  91. +2 −2 library/Zend/Tool/Project/Context/Zf/AbstractClassFile.php
  92. +3 −4 library/Zend/Tool/Project/Context/Zf/ActionMethod.php
  93. +1 −1  library/Zend/Tool/Project/Context/Zf/ApplicationDirectory.php
  94. +4 −4 library/Zend/Tool/Project/Context/Zf/BootstrapFile.php
  95. +15 −15 library/Zend/Tool/Project/Context/Zf/ControllerFile.php
  96. +10 −10 library/Zend/Tool/Project/Context/Zf/DbTableFile.php
  97. +7 −7 library/Zend/Tool/Project/Context/Zf/FormFile.php
  98. +4 −4 library/Zend/Tool/Project/Context/Zf/ModelFile.php
  99. +7 −11 library/Zend/Tool/Project/Context/Zf/ProjectProviderFile.php
  100. +2 −2 library/Zend/Tool/Project/Context/Zf/PublicIndexFile.php
  101. +8 −8 library/Zend/Tool/Project/Context/Zf/TestApplicationControllerFile.php
  102. +8 −8 library/Zend/Tool/Project/Context/Zf/TestLibraryFile.php
  103. +2 −2 library/Zend/Tool/Project/Profile/Iterator/ContextFilter.php
  104. +1 −1  library/Zend/Tool/Project/Profile/Resource/Container.php
  105. +2 −1  library/Zend/Tool/Project/Provider/Module.php
  106. +4 −4 library/Zend/Tool/Project/Provider/Test.php
  107. +1 −1  library/Zend/Validator/Barcode/AbstractAdapter.php
  108. +3 −2 library/Zend/Validator/Date.php
  109. +1 −1  library/Zend/XmlRpc/Server/Fault.php
  110. +2 −2 tests/Zend/Service/LiveDocx/LiveDocxTest.php
  111. BIN  tests/Zend/Service/LiveDocx/MailMerge/image-01.png
  112. BIN  tests/Zend/Service/LiveDocx/MailMerge/image-02.png
  113. +43 −106 tests/Zend/Service/LiveDocx/MailMergeTest.php
View
1  .gitignore
@@ -1,3 +1,2 @@
nbproject
-demos/Zend/Service/LiveDocx/DemoConfiguration.php
View
74 INSTALL.txt
@@ -1,68 +1,72 @@
INSTALLATION
------------
-Zend Framework requires no special installation steps. Simply download the framework,
-extract it to the folder you would like to keep it in, and add the library directory
-to your PHP include_path. To use components in the extras library, add the extras/library
-directory to your PHP include_path, as well.
-If you would like to use Zend_Tool, simply add bin/zf.bat (for Windows) or
-bin/zf.sh (for anything else) to your system executable path.
+Zend Framework requires no special installation steps. Simply download
+the framework, extract it to the folder you would like to keep it in,
+and add the library directory to your PHP include_path. To use
+components in the extras library, add the extras/library directory to
+your PHP include_path as well.
+
+If you would like to use Zend_Tool, simply add "bin/zf.bat" (for Windows)
+or "bin/zf.sh" (for anything else) to your system executable path.
SYSTEM REQUIREMENTS
-------------------
-Zend Framework requires PHP 5.2.4 or later. Please see the system requirements
-appendix for more detailed information:
+Zend Framework 2 requires PHP 5.3.1 or later.
-http://framework.zend.com/manual/en/requirements.html
DEVELOPMENT VERSIONS
--------------------
-If you would like to preview enhancements or bug fixes that have not yet been
-released, you can obtain the current development version of Zend Framework using one
-of the following methods:
+If you would like to preview enhancements or bug fixes that have not yet
+been released, you can obtain the current development version of Zend
+Framework using one of the following methods:
-* Using a Git client. Zend Framework is open source software, and the Git
- repository used for its development is publicly available. Consider using Git
- to get Zend Framework if you already use Git for your application development,
- want to contribute back to the framework, or need to upgrade your framework
- version very often.
+* Using a Git client. Zend Framework is open source software, and the
+ Git repository used for its development is publicly available.
+ Consider using Git to get Zend Framework if you already use Git for
+ your application development, want to contribute back to the
+ framework, or need to upgrade your framework version very often.
- Checking out a working copy is necessary if you would like to directly contribute
- to Zend Framework; a working copy can be updated any time using git pull.
+ Checking out a working copy is necessary if you would like to directly
+ contribute to Zend Framework; a working copy can be updated any time
+ using git pull.
To clone the git repository, use the following URL:
- git://git.zendframework.com/zf.git
+ git://git.zendframework.com/zf.git
For more information about Git, please see the official website:
- http://www.git-scm.org
+ http://www.git-scm.org
CONFIGURING THE INCLUDE PATH
----------------------------
-Once you have a copy of Zend Framework available, your application will need to
-access the framework classes. Though there are several ways to achieve this, your
-PHP include_path needs to contain the path to the Zend Framework classes under the
-/library directory in this distribution. You can find out more about the PHP
-include_path configuration directive here:
+Once you have a copy of Zend Framework available, your application will
+need to access the framework classes. Though there are several ways to
+achieve this, your PHP include_path needs to contain the path to the
+Zend Framework classes under the /library directory in this
+distribution. You can find out more about the PHP include_path
+configuration directive here:
-http://www.php.net/manual/en/ini.core.php#ini.include-path
+ http://www.php.net/manual/en/ini.core.php#ini.include-path
-Instructions on how to change PHP configuration directives can be found here:
+Instructions on how to change PHP configuration directives can be found
+here:
-http://www.php.net/manual/en/configuration.changes.php
+ http://www.php.net/manual/en/configuration.changes.php
GETTING STARTED
---------------
-A great place to get up-to-speed quickly is the Zend Framework QuickStart:
+A great place to get up-to-speed quickly is the Zend Framework
+QuickStart:
-http://framework.zend.com/manual/en/learning.quickstart.html
+ http://framework.zend.com/manual/en/learning.quickstart.html
-The QuickStart covers some of the most commonly used components of ZF. Since
-Zend Framework is designed with a use-at-will architecture and components are
-loosely coupled, you can select and use only those components that are needed for
-your project.
+The QuickStart covers some of the most commonly used components of ZF.
+Since Zend Framework is designed with a use-at-will architecture and
+components are loosely coupled, you can select and use only those
+components that are needed for your project.
View
5 README-DEV.txt
@@ -55,6 +55,11 @@ To run tests:
% phpunit --group Zend_Application
+ This will likely lead to errors, so it's usually best to specify a
+ specific component in which to run test:
+
+ % phpunit --group ZF-XYZ Zend/Application
+
You can turn on conditional tests with the TestConfiguration.php file.
To do so:
View
7 README.txt
@@ -30,6 +30,13 @@ INSTALLATION
Please see INSTALL.txt.
+CONTRIBUTING
+------------
+
+If you wish to contribute to Zend Framework 2.0, please make sure you have
+signed a CLA (http://framework.zend.com/cla), and please read both the
+README-DEV.txt and README-GIT.txt file.
+
QUESTIONS AND FEEDBACK
----------------------
View
BIN  demos/Zend/Service/LiveDocx/MailMerge/conference-pass/dailemaitre.jpg
Deleted file not rendered
View
39 demos/Zend/Service/LiveDocx/MailMerge/conference-pass/generate-document.php
@@ -1,39 +0,0 @@
-<?php
-
-require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
-
-
-use Zend\Date\Date;
-use Zend\Service\LiveDocx\MailMerge;
-
-$mailMerge = new MailMerge();
-
-$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
- ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
-
-/**
- * Image Source:
- * iStock_000003413016Medium_business-man-with-hands-up.jpg
- */
-$photoFilename = 'dailemaitre.jpg';
-
-if (!$mailMerge->imageExists($photoFilename)) {
- $mailMerge->uploadImage($photoFilename);
-}
-
-$mailMerge->setLocalTemplate('template.docx');
-
-$mailMerge->assign('name', 'Daï Lemaitre')
- ->assign('company', 'Megasoft Co-operation')
- ->assign('date', Date::now()->toString(Date::DATE_LONG))
- ->assign('image:photo', $photoFilename);
-
-$mailMerge->createDocument();
-
-$document = $mailMerge->retrieveDocument('pdf');
-
-file_put_contents('document.pdf', $document);
-
-$mailMerge->deleteImage($photoFilename);
-
-unset($mailMerge);
View
BIN  demos/Zend/Service/LiveDocx/MailMerge/conference-pass/template.docx
Binary file not shown
View
30 demos/Zend/Service/LiveDocx/MailMerge/images/delete-all.php
@@ -1,30 +0,0 @@
-<?php
-
-require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
-
-
-use Zend\Service\LiveDocx\Helper;
-use Zend\Service\LiveDocx\MailMerge;
-
-Helper::printLine(
- PHP_EOL . 'Deleting All Remotely Stored Images' .
- PHP_EOL .
- PHP_EOL
-);
-
-$mailMerge = new MailMerge();
-
-$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
- ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
-
-$counter = 1;
-foreach ($mailMerge->listImages() as $result) {
- printf('%d) %s', $counter, $result['filename']);
- $mailMerge->deleteImage($result['filename']);
- print(' - DELETED.' . PHP_EOL);
- $counter++;
-}
-
-print(PHP_EOL);
-
-unset($mailMerge);
View
31 demos/Zend/Service/LiveDocx/MailMerge/images/download.php
@@ -1,31 +0,0 @@
-<?php
-
-require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
-
-
-use Zend\Service\LiveDocx\Helper;
-use Zend\Service\LiveDocx\MailMerge;
-
-Helper::printLine(
- PHP_EOL . 'Downloading Remotely Stored Images' .
- PHP_EOL .
- PHP_EOL
-);
-
-$mailMerge = new MailMerge();
-
-$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
- ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
-
-$counter = 1;
-foreach ($mailMerge->listImages() as $result) {
- printf('%d) %s', $counter, $result['filename']);
- $image = $mailMerge->downloadImage($result['filename']);
- file_put_contents('downloaded-' . $result['filename'], $image);
- print(' - DOWNLOADED.' . PHP_EOL);
- $counter++;
-}
-
-print(PHP_EOL);
-
-unset($mailMerge);
View
BIN  demos/Zend/Service/LiveDocx/MailMerge/images/image-01.png
Deleted file not rendered
View
BIN  demos/Zend/Service/LiveDocx/MailMerge/images/image-02.png
Deleted file not rendered
View
30 demos/Zend/Service/LiveDocx/MailMerge/images/image-exists.php
@@ -1,30 +0,0 @@
-<?php
-
-require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
-
-
-use Zend\Service\LiveDocx\Helper;
-use Zend\Service\LiveDocx\MailMerge;
-
-Helper::printLine(
- PHP_EOL . 'Checking For Remotely Stored Images' .
- PHP_EOL .
- PHP_EOL
-);
-
-$mailMerge = new MailMerge();
-
-$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
- ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
-
-print('Checking whether an image is available... ');
-if (true === $mailMerge->imageExists('image-01.png')) {
- print('EXISTS. ');
-} else {
- print('DOES NOT EXIST. ');
-}
-print('DONE' . PHP_EOL);
-
-print(PHP_EOL);
-
-unset($mailMerge);
View
24 demos/Zend/Service/LiveDocx/MailMerge/images/list.php
@@ -1,24 +0,0 @@
-<?php
-
-require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
-
-
-use Zend\Service\LiveDocx\Helper;
-use Zend\Service\LiveDocx\MailMerge;
-
-Helper::printLine(
- PHP_EOL . 'Remotely Stored Images' .
- PHP_EOL .
- PHP_EOL . 'The following images are currently stored on the LiveDocx server:' .
- PHP_EOL .
- PHP_EOL
-);
-
-$mailMerge = new MailMerge();
-
-$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
- ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
-
-print(Helper::listDecorator($mailMerge->listImages()));
-
-unset($mailMerge);
View
30 demos/Zend/Service/LiveDocx/MailMerge/images/upload.php
@@ -1,30 +0,0 @@
-<?php
-
-require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
-
-
-use Zend\Service\LiveDocx\Helper;
-use Zend\Service\LiveDocx\MailMerge;
-
-Helper::printLine(
- PHP_EOL . 'Uploading Locally Stored Images to Server' .
- PHP_EOL .
- PHP_EOL
-);
-
-$mailMerge = new MailMerge();
-
-$mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
- ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
-
-print('Uploading image... ');
-$mailMerge->uploadImage('image-01.png');
-print('DONE.' . PHP_EOL);
-
-print('Uploading image... ');
-$mailMerge->uploadImage('image-02.png');
-print('DONE.' . PHP_EOL);
-
-print(PHP_EOL);
-
-unset($mailMerge);
View
2  demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats-cached.php
@@ -47,7 +47,7 @@
$formats->template = $mailMerge->getTemplateFormats();
$formats->document = $mailMerge->getDocumentFormats();
- $formats->image = $mailMerge->getImageExportFormats();
+ $formats->image = $mailMerge->getImageFormats();
$cache->save($formats, $cacheId);
View
2  demos/Zend/Service/LiveDocx/MailMerge/supported-formats/show-supported-formats.php
@@ -26,7 +26,7 @@
Helper::arrayDecorator($mailMerge->getDocumentFormats()), PHP_EOL);
printf("Supported IMAGE file formats (output) : %s%s",
- Helper::arrayDecorator($mailMerge->getImageExportFormats()), PHP_EOL);
+ Helper::arrayDecorator($mailMerge->getImageFormats()), PHP_EOL);
print PHP_EOL;
View
2  demos/Zend/Service/LiveDocx/check-environment.php
@@ -227,7 +227,7 @@
try {
$microtime = microtime(true);
- $mailMerge = new MailMerge(
+ $mailMerge = new Zend_Service_LiveDocx_MailMerge(
array (
'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD
View
33 library/Zend/CodeGenerator/PHP/Exception.php → demos/Zend/Service/LiveDocx/configuration.php.dist
@@ -1,4 +1,5 @@
<?php
+
/**
* Zend Framework
*
@@ -13,26 +14,30 @@
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
- * @package Zend_CodeGenerator
- * @subpackage PHP
+ * @package Zend_Service
+ * @subpackage LiveDocx
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
*/
/**
- * @namespace
+ * This file defines configuration for running the Zend_Service_LiveDocx demo
+ * applications.
+ *
+ * Do not edit this file. Instead, copy this file to configuration.php,
+ * and edit the new file. Never commit plaintext passwords to the source
+ * code repository.
*/
-namespace Zend\CodeGenerator\PHP;
/**
- * @uses \Zend\CodeGenerator\Exception
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
+ * Zend_Service_LiveDocx configuration
+ *
+ * Define username and password in order to access LiveDocx web services.
+ *
+ * Get a username and password here:
+ *
+ * https://www.livedocx.com/user/account_registration.aspx
+ *
*/
-class Exception extends \Zend\CodeGenerator\Exception
-{
-
-}
+define('DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME', false);
+define('DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD', false);
View
12 library/Zend/Amf/Server.php
@@ -272,14 +272,18 @@ protected function _checkAcl($object, $function)
return true;
}
if($object) {
- $class = is_object($object)?get_class($object):$object;
+ $isObject = is_object($object);
+ $class = ($isObject) ? get_class($object) : $object;
if(!$this->_acl->hasResource($class)) {
$this->_acl->addResource(new \Zend\Acl\Resource\GenericResource($class));
}
- $call = array($object, "initAcl");
- if(is_callable($call) && !call_user_func($call, $this->_acl)) {
+ if (method_exists($object, 'initAcl')) {
// if initAcl returns false, no ACL check
- return true;
+ if ($isObject && $object->initAcl($this->_acl)) {
+ return true;
+ } elseif ($class::initAcl($this->_acl)) {
+ return true;
+ }
}
} else {
$class = null;
View
2  library/Zend/Application/Module/Bootstrap.php
@@ -117,7 +117,7 @@ public function getModuleName()
{
if (empty($this->_moduleName)) {
$class = get_class($this);
- if (preg_match('/^([a-z][a-z0-9]*)_/i', $class, $matches)) {
+ if (preg_match('/^([a-z][a-z0-9]*)\\\\/i', $class, $matches)) {
$prefix = $matches[1];
} else {
$prefix = $class;
View
7 library/Zend/Application/Resource/Mail.php
@@ -107,14 +107,13 @@ protected function _setDefaults($type)
if(isset($options[$key]['email']) &&
!is_numeric($options[$key]['email']))
{
- $method = array('Zend\\Mail\\Mail', 'setDefault' . ucfirst($type));
+ $method = 'setDefault' . ucfirst($type);
if(isset($options[$key]['name']) &&
!is_numeric($options[$key]['name']))
{
- call_user_func($method, $options[$key]['email'],
- $options[$key]['name']);
+ \Zend\Mail\Mail::$method($options[$key]['email'], $options[$key]['name']);
} else {
- call_user_func($method, $options[$key]['email']);
+ \Zend\Mail\Mail::$method($options[$key]['email']);
}
}
}
View
2  library/Zend/Application/Resource/Modules.php
@@ -71,7 +71,7 @@ public function init()
$default = $front->getDefaultModule();
$curBootstrapClass = get_class($bootstrap);
foreach ($modules as $module => $moduleDirectory) {
- $bootstrapClass = $this->_formatModuleName($module) . '_Bootstrap';
+ $bootstrapClass = $this->_formatModuleName($module) . '\Bootstrap';
if (!class_exists($bootstrapClass, false)) {
$bootstrapPath = dirname($moduleDirectory) . '/Bootstrap.php';
if (file_exists($bootstrapPath)) {
View
2  library/Zend/Barcode/Renderer/Image.php
@@ -333,7 +333,7 @@ public function render()
$this->draw();
header("Content-Type: image/" . $this->_imageType);
$functionName = 'image' . $this->_imageType;
- call_user_func($functionName, $this->_resource);
+ $functionName($this->_resource);
@imagedestroy($this->_resource);
}
View
2  library/Zend/Cache/Backend/StaticBackend.php
@@ -558,6 +558,6 @@ protected function _octdec($val)
*/
protected function _decodeId($id)
{
- return pack('H*', $id);;
+ return pack('H*', $id);
}
}
View
98 library/Zend/CodeGenerator/PHP/AbstractPHP.php
@@ -1,98 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP;
-
-/**
- * @uses \Zend\CodeGenerator\AbstractCodeGenerator
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-abstract class AbstractPHP extends \Zend\CodeGenerator\AbstractCodeGenerator
-{
-
- /**
- * Line feed to use in place of EOL
- *
- */
- const LINE_FEED = "\n";
-
- /**
- * @var bool
- */
- protected $_isSourceDirty = true;
-
- /**
- * @var int|string
- */
- protected $_indentation = ' ';
-
- /**
- * setSourceDirty()
- *
- * @param bool $isSourceDirty
- * @return \Zend\CodeGenerator\PHP\AbstractPHP
- */
- public function setSourceDirty($isSourceDirty = true)
- {
- $this->_isSourceDirty = ($isSourceDirty) ? true : false;
- return $this;
- }
-
- /**
- * isSourceDirty()
- *
- * @return bool
- */
- public function isSourceDirty()
- {
- return $this->_isSourceDirty;
- }
-
- /**
- * setIndentation()
- *
- * @param string|int $indentation
- * @return \Zend\CodeGenerator\PHP\AbstractPHP
- */
- public function setIndentation($indentation)
- {
- $this->_indentation = $indentation;
- return $this;
- }
-
- /**
- * getIndentation()
- *
- * @return string|int
- */
- public function getIndentation()
- {
- return $this->_indentation;
- }
-
-}
View
99 library/Zend/CodeGenerator/PHP/Docblock/Tag/License.php
@@ -1,99 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP\Docblock\Tag;
-
-/**
- * @uses \Zend\CodeGenerator\PHP\PHPDocblockTag
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class License extends \Zend\CodeGenerator\PHP\PHPDocblockTag
-{
-
- /**
- * @var string
- */
- protected $_url = null;
-
- /**
- * @var string
- */
- protected $_description = null;
-
- /**
- * fromReflection()
- *
- * @param \Zend\Reflection\ReflectionDocblockTag $reflectionTagReturn
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\License
- */
- public static function fromReflection(\Zend\Reflection\ReflectionDocblockTag $reflectionTagLicense)
- {
- $returnTag = new \self();
-
- $returnTag->setName('license');
- $returnTag->setUrl($reflectionTagLicense->getUrl());
- $returnTag->setDescription($reflectionTagLicense->getDescription());
-
- return $returnTag;
- }
-
- /**
- * setUrl()
- *
- * @param string $url
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\License
- */
- public function setUrl($url)
- {
- $this->_url = $url;
- return $this;
- }
-
- /**
- * getUrl()
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->_url;
- }
-
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- $output = '@license ' . $this->_url . ' ' . $this->_description . self::LINE_FEED;
- return $output;
- }
-
-}
View
129 library/Zend/CodeGenerator/PHP/Docblock/Tag/Param.php
@@ -1,129 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP\Docblock\Tag;
-
-/**
- * @uses \Zend\CodeGenerator\PHP\PHPDocblockTag
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Param extends \Zend\CodeGenerator\PHP\PHPDocblockTag
-{
-
- /**
- * @var string
- */
- protected $_datatype = null;
-
- /**
- * @var string
- */
- protected $_paramName = null;
-
- /**
- * @var string
- */
- protected $_description = null;
-
- /**
- * fromReflection()
- *
- * @param \Zend\Reflection\ReflectionDocblockTag $reflectionTagParam
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\Param
- */
- public static function fromReflection(\Zend\Reflection\ReflectionDocblockTag $reflectionTagParam)
- {
- $paramTag = new \self();
-
- $paramTag->setName('param');
- $paramTag->setDatatype($reflectionTagParam->getType()); // @todo rename
- $paramTag->setParamName($reflectionTagParam->getVariableName());
- $paramTag->setDescription($reflectionTagParam->getDescription());
-
- return $paramTag;
- }
-
- /**
- * setDatatype()
- *
- * @param string $datatype
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\Param
- */
- public function setDatatype($datatype)
- {
- $this->_datatype = $datatype;
- return $this;
- }
-
- /**
- * getDatatype
- *
- * @return string
- */
- public function getDatatype()
- {
- return $this->_datatype;
- }
-
- /**
- * setParamName()
- *
- * @param string $paramName
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\Param
- */
- public function setParamName($paramName)
- {
- $this->_paramName = $paramName;
- return $this;
- }
-
- /**
- * getParamName()
- *
- * @return string
- */
- public function getParamName()
- {
- return $this->_paramName;
- }
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- $output = '@param '
- . (($this->_datatype != null) ? $this->_datatype : 'unknown')
- . (($this->_paramName != null) ? ' $' . $this->_paramName : '')
- . (($this->_description != null) ? ' ' . $this->_description : '');
- return $output;
- }
-
-}
View
99 library/Zend/CodeGenerator/PHP/Docblock/Tag/Return.php
@@ -1,99 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP\Docblock\Tag;
-
-/**
- * @uses \Zend\CodeGenerator\PHP\PHPDocblockTag
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class Return extends \Zend\CodeGenerator\PHP\PHPDocblockTag
-{
-
- /**
- * @var string
- */
- protected $_datatype = null;
-
- /**
- * @var string
- */
- protected $_description = null;
-
- /**
- * fromReflection()
- *
- * @param \Zend\Reflection\ReflectionDocblockTag $reflectionTagReturn
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\Return
- */
- public static function fromReflection(\Zend\Reflection\ReflectionDocblockTag $reflectionTagReturn)
- {
- $returnTag = new \self();
-
- $returnTag->setName('return');
- $returnTag->setDatatype($reflectionTagReturn->getType()); // @todo rename
- $returnTag->setDescription($reflectionTagReturn->getDescription());
-
- return $returnTag;
- }
-
- /**
- * setDatatype()
- *
- * @param string $datatype
- * @return \Zend\CodeGenerator\PHP\Docblock\Tag\Return
- */
- public function setDatatype($datatype)
- {
- $this->_datatype = $datatype;
- return $this;
- }
-
- /**
- * getDatatype()
- *
- * @return string
- */
- public function getDatatype()
- {
- return $this->_datatype;
- }
-
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- $output = '@return ' . $this->_datatype . ' ' . $this->_description;
- return $output;
- }
-
-}
View
74 library/Zend/CodeGenerator/PHP/PHPBody.php
@@ -1,74 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP;
-
-/**
- * @uses \Zend\CodeGenerator\AbstractCodeGenerator
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class PHPBody extends \Zend\CodeGenerator\AbstractCodeGenerator
-{
-
- /**
- * @var string
- */
- protected $_content = null;
-
- /**
- * setContent()
- *
- * @param string $content
- * @return \Zend\CodeGenerator\PHP\PHPBody
- */
- public function setContent($content)
- {
- $this->_content = $content;
- return $this;
- }
-
- /**
- * getContent()
- *
- * @return string
- */
- public function getContent()
- {
- return (string) $this->_content;
- }
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- return $this->getContent();
- }
-}
View
553 library/Zend/CodeGenerator/PHP/PHPClass.php
@@ -1,553 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP;
-
-/**
- * @uses \Zend\CodeGenerator\PHP\AbstractPHP
- * @uses \Zend\CodeGenerator\PHPDocblock
- * @uses \Zend\CodeGenerator\PHP\Exception
- * @uses \Zend\CodeGenerator\PHP\PHPMember\MemberContainer
- * @uses \Zend\CodeGenerator\PHP\PHPMethod
- * @uses \Zend\CodeGenerator\PHP\PHPProperty
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class PHPClass extends AbstractPHP
-{
-
- /**
- * @var \Zend\CodeGenerator\PHP\PHPFile
- */
- protected $_phpFile = null;
-
- /**
- * @var string
- */
- protected $_namespaceName = null;
-
- /**
- * @var \Zend\CodeGenerator\PHP\PHPDocblock
- */
- protected $_docblock = null;
-
- /**
- * @var string
- */
- protected $_name = null;
-
- /**
- * @var bool
- */
- protected $_isAbstract = false;
-
- /**
- * @var string
- */
- protected $_extendedClass = null;
-
- /**
- * @var array Array of string names
- */
- protected $_implementedInterfaces = array();
-
- /**
- * @var array Array of properties
- */
- protected $_properties = null;
-
- /**
- * @var array Array of methods
- */
- protected $_methods = null;
-
- /**
- * fromReflection() - build a Code Generation PHP Object from a Class Reflection
- *
- * @param \Zend\Reflection\ReflectionClass $reflectionClass
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public static function fromReflection(\Zend\Reflection\ReflectionClass $reflectionClass)
- {
- $class = new self();
-
- $class->setSourceContent($class->getSourceContent());
- $class->setSourceDirty(false);
-
- if ($reflectionClass->getDocComment() != '') {
- $class->setDocblock(PHPDocblock::fromReflection($reflectionClass->getDocblock()));
- }
-
- $class->setAbstract($reflectionClass->isAbstract());
-
- // set the namespace
- if ($reflectionClass->inNamespace()) {
- $class->setNamespaceName($reflectionClass->getNamespaceName());
- }
-
- $class->setName($reflectionClass->getName());
-
- if ($parentClass = $reflectionClass->getParentClass()) {
- $class->setExtendedClass($parentClass->getName());
- $interfaces = array_diff($reflectionClass->getInterfaces(), $parentClass->getInterfaces());
- } else {
- $interfaces = $reflectionClass->getInterfaces();
- }
-
- $interfaceNames = array();
- foreach($interfaces AS $interface) {
- $interfaceNames[] = $interface->getName();
- }
-
- $class->setImplementedInterfaces($interfaceNames);
-
- $properties = array();
- foreach ($reflectionClass->getProperties() as $reflectionProperty) {
- if ($reflectionProperty->getDeclaringClass()->getName() == $class->getName()) {
- $properties[] = PHPProperty::fromReflection($reflectionProperty);
- }
- }
- $class->setProperties($properties);
-
- $methods = array();
- foreach ($reflectionClass->getMethods() as $reflectionMethod) {
- if ($reflectionMethod->getDeclaringClass()->getName() == $class->getName()) {
- $methods[] = PHPMethod::fromReflection($reflectionMethod);
- }
- }
- $class->setMethods($methods);
-
- return $class;
- }
-
- /**
- * setPHPFile()
- *
- * @param Zend\CodeGenerator\PHP\PHPFile $phpFile
- */
- public function setPHPFile(PHPFile $phpFile)
- {
- $this->_phpFile = $phpFile;
- return $this;
- }
-
- /**
- * getPHPFile()
- *
- * @return Zend\CodeGenerator\PHP\PHPFile
- */
- public function getPHPFile()
- {
- return $this->_phpFile;
- }
-
- /**
- * setDocblock() Set the docblock
- *
- * @param \Zend\CodeGenerator\PHPDocblock|array|string $docblock
- * @return \Zend\CodeGenerator\PHP\PHPFile
- */
- public function setDocblock($docblock)
- {
- if (is_string($docblock)) {
- $docblock = array('shortDescription' => $docblock);
- }
-
- if (is_array($docblock)) {
- $docblock = new PHPDocblock($docblock);
- } elseif (!$docblock instanceof PHPDocblock) {
- throw new Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock');
- }
-
- $this->_docblock = $docblock;
- return $this;
- }
-
- /**
- * getNamespaceName()
- *
- * @return string
- */
- public function getNamespaceName()
- {
- return $this->_namespaceName;
- }
-
- /**
- * setNamespaceName()
- *
- * @param $namespaceName
- * @return Zend\CodeGenerator\PHP\PHPClass
- */
- public function setNamespaceName($namespaceName)
- {
- $this->_namespaceName = $namespaceName;
- return $this;
- }
-
- /**
- * getDocblock()
- *
- * @return \Zend\CodeGenerator\PHPDocblock
- */
- public function getDocblock()
- {
- return $this->_docblock;
- }
-
- /**
- * setName()
- *
- * @param string $name
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setName($name)
- {
- $this->_name = $name;
- return $this;
- }
-
- /**
- * getName()
- *
- * @return string
- */
- public function getName()
- {
- return $this->_name;
- }
-
- /**
- * setAbstract()
- *
- * @param bool $isAbstract
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setAbstract($isAbstract)
- {
- $this->_isAbstract = ($isAbstract) ? true : false;
- return $this;
- }
-
- /**
- * isAbstract()
- *
- * @return bool
- */
- public function isAbstract()
- {
- return $this->_isAbstract;
- }
-
- /**
- * setExtendedClass()
- *
- * @param string $extendedClass
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setExtendedClass($extendedClass)
- {
- $this->_extendedClass = $extendedClass;
- return $this;
- }
-
- /**
- * getExtendedClass()
- *
- * @return string
- */
- public function getExtendedClass()
- {
- return $this->_extendedClass;
- }
-
- /**
- * setImplementedInterfaces()
- *
- * @param array $implementedInterfaces
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setImplementedInterfaces(Array $implementedInterfaces)
- {
- $this->_implementedInterfaces = $implementedInterfaces;
- return $this;
- }
-
- /**
- * getImplementedInterfaces
- *
- * @return array
- */
- public function getImplementedInterfaces()
- {
- return $this->_implementedInterfaces;
- }
-
- /**
- * setProperties()
- *
- * @param array $properties
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setProperties(Array $properties)
- {
- foreach ($properties as $property) {
- $this->setProperty($property);
- }
-
- return $this;
- }
-
- /**
- * setProperty()
- *
- * @param array|\Zend\CodeGenerator\PHP\PHPProperty $property
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setProperty($property)
- {
- if (is_array($property)) {
- $property = new PHPProperty($property);
- $propertyName = $property->getName();
- } elseif ($property instanceof PHPProperty) {
- $propertyName = $property->getName();
- } else {
- throw new Exception('setProperty() expects either an array of property options or an instance of Zend_CodeGenerator_Php_Property');
- }
-
- if (isset($this->_properties[$propertyName])) {
- throw new Exception('A property by name ' . $propertyName . ' already exists in this class.');
- }
-
- $this->_properties[$propertyName] = $property;
- return $this;
- }
-
- /**
- * getProperties()
- *
- * @return array
- */
- public function getProperties()
- {
- return $this->_properties;
- }
-
- /**
- * getProperty()
- *
- * @param string $propertyName
- * @return \Zend\CodeGenerator\PHP\PHPProperty
- */
- public function getProperty($propertyName)
- {
- foreach ($this->_properties as $property) {
- if ($property->getName() == $propertyName) {
- return $property;
- }
- }
- return false;
- }
-
- /**
- * hasProperty()
- *
- * @param string $propertyName
- * @return bool
- */
- public function hasProperty($propertyName)
- {
- return isset($this->_properties[$propertyName]);
- }
-
- /**
- * setMethods()
- *
- * @param array $methods
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setMethods(Array $methods)
- {
- foreach ($methods as $method) {
- $this->setMethod($method);
- }
- return $this;
- }
-
- /**
- * setMethod()
- *
- * @param array|\Zend\CodeGenerator\PHP\PHPMethod $method
- * @return \Zend\CodeGenerator\PHP\PHPClass
- */
- public function setMethod($method)
- {
- if (is_array($method)) {
- $method = new PHPMethod($method);
- $methodName = $method->getName();
- } elseif ($method instanceof PHPMethod) {
- $methodName = $method->getName();
- } else {
- throw new Exception('setMethod() expects either an array of method options or an instance of Zend\CodeGenerator\PHP\Method');
- }
-
- if (isset($this->_methods[$methodName])) {
- throw new Exception('A method by name ' . $methodName . ' already exists in this class.');
- }
-
- $this->_methods[$methodName] = $method;
- return $this;
- }
-
- /**
- * getMethods()
- *
- * @return array
- */
- public function getMethods()
- {
- return $this->_methods;
- }
-
- /**
- * getMethod()
- *
- * @param string $methodName
- * @return \Zend\CodeGenerator\PHP\PHPMethod
- */
- public function getMethod($methodName)
- {
- foreach ($this->_methods as $method) {
- if ($method->getName() == $methodName) {
- return $method;
- }
- }
- return false;
- }
-
- /**
- * hasMethod()
- *
- * @param string $methodName
- * @return bool
- */
- public function hasMethod($methodName)
- {
- return isset($this->_methods[$methodName]);
- }
-
- /**
- * isSourceDirty()
- *
- * @return bool
- */
- public function isSourceDirty()
- {
- if (($docblock = $this->getDocblock()) && $docblock->isSourceDirty()) {
- return true;
- }
-
- foreach ($this->_properties as $property) {
- if ($property->isSourceDirty()) {
- return true;
- }
- }
-
- foreach ($this->_methods as $method) {
- if ($method->isSourceDirty()) {
- return true;
- }
- }
-
- return parent::isSourceDirty();
- }
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- if (!$this->isSourceDirty()) {
- return $this->getSourceContent();
- }
-
- $output = '';
-
- if (null !== ($docblock = $this->getDocblock())) {
- $docblock->setIndentation('');
- $output .= $docblock->generate();
- }
-
- if ($this->isAbstract()) {
- $output .= 'abstract ';
- }
-
- $output .= 'class ' . $this->getName();
-
- if ( !empty( $this->_extendedClass) ) {
- $output .= ' extends ' . $this->_extendedClass;
- }
-
- $implemented = $this->getImplementedInterfaces();
- if (!empty($implemented)) {
- $output .= ' implements ' . implode(', ', $implemented);
- }
-
- $output .= self::LINE_FEED . '{' . self::LINE_FEED . self::LINE_FEED;
-
- $properties = $this->getProperties();
- if (!empty($properties)) {
- foreach ($properties as $property) {
- $output .= $property->generate() . self::LINE_FEED . self::LINE_FEED;
- }
- }
-
- $methods = $this->getMethods();
- if (!empty($methods)) {
- foreach ($methods as $method) {
- $output .= $method->generate() . self::LINE_FEED;
- }
- }
-
- $output .= self::LINE_FEED . '}' . self::LINE_FEED;
-
- return $output;
- }
-
- /**
- * _init() - is called at construction time
- *
- */
- protected function _init()
- {
- $this->_properties = new PHPMember\MemberContainer(PHPMember\MemberContainer::TYPE_PROPERTY);
- $this->_methods = new PHPMember\MemberContainer(PHPMember\MemberContainer::TYPE_METHOD);
- }
-
-}
View
217 library/Zend/CodeGenerator/PHP/PHPDocblock.php
@@ -1,217 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP;
-
-/**
- * @uses \Zend\CodeGenerator\PHP\AbstractPHP
- * @uses \Zend\CodeGenerator\PHP\PHPDocblockTag
- * @uses \Zend\CodeGenerator\PHP\Exception
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class PHPDocblock extends AbstractPHP
-{
- /**
- * @var string
- */
- protected $_shortDescription = null;
-
- /**
- * @var string
- */
- protected $_longDescription = null;
-
- /**
- * @var array
- */
- protected $_tags = array();
-
- /**
- * @var string
- */
- protected $_indentation = '';
-
- /**
- * fromReflection() - Build a docblock generator object from a reflection object
- *
- * @param Zend_Reflection_Docblock $reflectionDocblock
- * @return \Zend\CodeGenerator\PHPDocblock
- */
- public static function fromReflection(\Zend\Reflection\ReflectionDocblock $reflectionDocblock)
- {
- $docblock = new self();
-
- $docblock->setSourceContent($reflectionDocblock->getContents());
- $docblock->setSourceDirty(false);
-
- $docblock->setShortDescription($reflectionDocblock->getShortDescription());
- $docblock->setLongDescription($reflectionDocblock->getLongDescription());
-
- foreach ($reflectionDocblock->getTags() as $tag) {
- $docblock->setTag(PHPDocblockTag::fromReflection($tag));
- }
-
- return $docblock;
- }
-
- /**
- * setShortDescription()
- *
- * @param string $shortDescription
- * @return \Zend\CodeGenerator\PHPDocblock
- */
- public function setShortDescription($shortDescription)
- {
- $this->_shortDescription = $shortDescription;
- return $this;
- }
-
- /**
- * getShortDescription()
- *
- * @return string
- */
- public function getShortDescription()
- {
- return $this->_shortDescription;
- }
-
- /**
- * setLongDescription()
- *
- * @param string $longDescription
- * @return \Zend\CodeGenerator\PHPDocblock
- */
- public function setLongDescription($longDescription)
- {
- $this->_longDescription = $longDescription;
- return $this;
- }
-
- /**
- * getLongDescription()
- *
- * @return string
- */
- public function getLongDescription()
- {
- return $this->_longDescription;
- }
-
- /**
- * setTags()
- *
- * @param array $tags
- * @return \Zend\CodeGenerator\PHPDocblock
- */
- public function setTags(Array $tags)
- {
- foreach ($tags as $tag) {
- $this->setTag($tag);
- }
-
- return $this;
- }
-
- /**
- * setTag()
- *
- * @param array|\Zend\CodeGenerator\PHP\PHPDocblockTag $tag
- * @return \Zend\CodeGenerator\PHPDocblock
- */
- public function setTag($tag)
- {
- if (is_array($tag)) {
- $tag = new PHPDocblockTag($tag);
- } elseif (!$tag instanceof PHPDocblockTag) {
- throw new Exception(
- 'setTag() expects either an array of method options or an '
- . 'instance of Zend_CodeGenerator_Php_Docblock_Tag'
- );
- }
-
- $this->_tags[] = $tag;
- return $this;
- }
-
- /**
- * getTags
- *
- * @return array Array of \Zend\CodeGenerator\PHP\PHPDocblockTag
- */
- public function getTags()
- {
- return $this->_tags;
- }
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- if (!$this->isSourceDirty()) {
- return $this->_docCommentize($this->getSourceContent());
- }
-
- $output = '';
- if (null !== ($sd = $this->getShortDescription())) {
- $output .= $sd . self::LINE_FEED . self::LINE_FEED;
- }
- if (null !== ($ld = $this->getLongDescription())) {
- $output .= $ld . self::LINE_FEED . self::LINE_FEED;
- }
-
- foreach ($this->getTags() as $tag) {
- $output .= $tag->generate() . self::LINE_FEED;
- }
-
- return $this->_docCommentize(trim($output));
- }
-
- /**
- * _docCommentize()
- *
- * @param string $content
- * @return string
- */
- protected function _docCommentize($content)
- {
- $indent = $this->getIndentation();
- $output = $indent . '/**' . self::LINE_FEED;
- $content = wordwrap($content, 80, self::LINE_FEED);
- $lines = explode(self::LINE_FEED, $content);
- foreach ($lines as $line) {
- $output .= $indent . ' * ' . $line . self::LINE_FEED;
- }
- $output .= $indent . ' */' . self::LINE_FEED;
- return $output;
- }
-
-}
View
142 library/Zend/CodeGenerator/PHP/PHPDocblockTag.php
@@ -1,142 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP;
-
-/**
- * @uses \Zend\CodeGenerator\AbstractCodeGenerator
- * @uses \Zend\CodeGenerator\PHP\Docblock\Tag\Param
- * @uses \Zend\CodeGenerator\PHP\Docblock\Tag\Return
- * @uses \Zend\Loader\PluginLoader
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class PHPDocblockTag extends AbstractPHP
-{
-
- protected static $_typeFormats = array(
- array(
- 'param',
- '@param <type> <variable> <description>'
- ),
- array(
- 'return',
- '@return <type> <description>'
- ),
- array(
- 'tag',
- '@<name> <description>'
- )
- );
-
- /**
- * @var string
- */
- protected $_name = null;
-
- /**
- * fromReflection()
- *
- * @param \Zend\Reflection\ReflectionDocblockTag $reflectionTag
- * @return \Zend\CodeGenerator\PHP\PHPDocblockTag
- */
- public static function fromReflection(\Zend\Reflection\ReflectionDocblockTag $reflectionTag)
- {
- $tagName = $reflectionTag->getName();
-
- $codeGenDocblockTag = new self();
- $codeGenDocblockTag->setName($tagName);
-
- // transport any properties via accessors and mutators from reflection to codegen object
- $reflectionClass = new \ReflectionClass($reflectionTag);
- foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
- if (substr($method->getName(), 0, 3) == 'get') {
- $propertyName = substr($method->getName(), 3);
- if (method_exists($codeGenDocblockTag, 'set' . $propertyName)) {
- $codeGenDocblockTag->{'set' . $propertyName}($reflectionTag->{'get' . $propertyName}());
- }
- }
- }
-
- return $codeGenDocblockTag;
- }
-
- /**
- * setName()
- *
- * @param string $name
- * @return \Zend\CodeGenerator\PHP\PHPDocblockTag
- */
- public function setName($name)
- {
- $this->_name = ltrim($name, '@');
- return $this;
- }
-
- /**
- * getName()
- *
- * @return string
- */
- public function getName()
- {
- return $this->_name;
- }
-
- /**
- * setDescription()
- *
- * @param string $description
- * @return \Zend\CodeGenerator\PHP\PHPDocblockTag
- */
- public function setDescription($description)
- {
- $this->_description = $description;
- return $this;
- }
-
- /**
- * getDescription()
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->_description;
- }
-
- /**
- * generate()
- *
- * @return string
- */
- public function generate()
- {
- return '@' . $this->_name . ' ' . $this->_description;
- }
-
-}
View
573 library/Zend/CodeGenerator/PHP/PHPFile.php
@@ -1,573 +0,0 @@
-<?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_CodeGenerator
- * @subpackage PHP
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id$
- */
-
-/**
- * @namespace
- */
-namespace Zend\CodeGenerator\PHP;
-use Zend\Reflection;
-
-/**
- * @uses \Zend\CodeGenerator\PHP\AbstractPHP
- * @uses \Zend\CodeGenerator\PHP\PHPClass
- * @uses \Zend\CodeGenerator\PHP\Exception
- * @category Zend
- * @package Zend_CodeGenerator
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
- */
-class PHPFile extends AbstractPHP
-{
-
- /**
- * @var array Array of \Zend\CodeGenerator\PHP\PHPFile
- */
- protected static $_fileCodeGenerators = array();
-
- /**#@+
- * @var string
- */
- protected static $_markerDocblock = '/* Zend_CodeGenerator_Php_File-DocblockMarker */';
- protected static $_markerNamespace = '/* Zend_CodeGenerator_Php_File-NamespaceMarker */';
- protected static $_markerRequire = '/* Zend_CodeGenerator_Php_File-RequireMarker: {?} */';
- protected static $_markerClass = '/* Zend_CodeGenerator_Php_File-ClassMarker: {?} */';
- /**#@-*/
-
- /**
- * @var string
- */
- protected $_filename = null;
-
- /**
- * @var \Zend\CodeGenerator\PHPDocblock
- */
- protected $_docblock = null;
-
- /**
- * @var array
- */
- protected $_requiredFiles = array();
-
- /**
- * @var string
- */
- protected $_namespace = null;
-
- /**
- * @var array
- */
- protected $_uses = array();
-
- /**
- * @var array
- */
- protected $_classes = array();
-
- /**
- * @var string
- */
- protected $_body = null;
-
- /**
- * registerFileCodeGnereator()
- *
- * A file code generator registry
- *
- * @param PHPFile $fileCodeGenerator
- * @param string $fileName
- */
- public static function registerFileCodeGenerator(PHPFile $fileCodeGenerator, $fileName = null)
- {
- if ($fileName == null) {
- $fileName = $fileCodeGenerator->getFilename();
- }
-
- if ($fileName == '') {
- throw new Exception('FileName does not exist.');
- }
-
- // cannot use realpath since the file might not exist, but we do need to have the index
- // in the same DIRECTORY_SEPARATOR that realpath would use:
- $fileName = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $fileName);
-
- self::$_fileCodeGenerators[$fileName] = $fileCodeGenerator;
-
- }
-
- /**
- * fromReflectedFilePath() - use this if you intend on generating code generation objects based on the same file.
- * This will keep previous changes to the file in tact during the same PHP process
- *
- * @param string $filePath
- * @param bool $usePreviousCodeGeneratorIfItExists
- * @param bool $includeIfNotAlreadyIncluded
- * @return \Zend\CodeGenerator\PHP\PHPFile
- */
- public static function fromReflectedFileName($filePath, $usePreviousCodeGeneratorIfItExists = true, $includeIfNotAlreadyIncluded = true)
- {
- $realpath = realpath($filePath);
-
- if ($realpath === false) {
- if ( ($realpath = Reflection\file::findRealpathInIncludePath($filePath)) === false) {
- throw new Exception('No file for ' . $realpath . ' was found.');
- }
- }
-
- if ($usePreviousCodeGeneratorIfItExists && isset(self::$_fileCodeGenerators[$realpath])) {
- return self::$_fileCodeGenerators[$realpath];
- }
-
- if ($includeIfNotAlreadyIncluded && !in_array($realpath, get_included_files())) {
- include $realpath;
- }
-
- $codeGenerator = self::fromReflection(($fileReflector = new Reflection\ReflectionFile($realpath)));
-
- if (!isset(self::$_fileCodeGenerators[$fileReflector->getFileName()])) {
- self::$_fileCodeGenerators[$fileReflector->getFileName()] = $codeGenerator;
- }
-
- return $codeGenerator;
- }
-
- /**
- * fromReflection()
- *
- * @param \Zend\Reflection\ReflectionFile $reflectionFile
- * @return \Zend\CodeGenerator\PHP\PHPFile
- */
- public static function fromReflection(Reflection\ReflectionFile $reflectionFile)
- {
- $file = new self();
-
- $file->setSourceContent($reflectionFile->getContents());
- $file->setSourceDirty(false);
-
- $body = $reflectionFile->getContents();
-
- // @todo this whole area needs to be reworked with respect to how body lines are processed
- foreach ($reflectionFile->getClasses() as $class) {
- $phpClass = PHPClass::fromReflection($class);
- $phpClass->setPHPFile($file);
- $file->setClass($phpClass);
- $classStartLine = $class->getStartLine(true);
- $classEndLine = $class->getEndLine();
-
- $bodyLines = explode("\n", $body);
- $bodyReturn = array();
- for ($lineNum = 1; $lineNum <= count($bodyLines); $lineNum++) {
- if ($lineNum == $classStartLine) {
- $bodyReturn[] = str_replace('?', $class->getName(), self::$_markerClass); //'/* Zend_CodeGenerator_Php_File-ClassMarker: {' . $class->getName() . '} */';
- $lineNum = $classEndLine;
- } else {
- $bodyReturn[] = $bodyLines[$lineNum - 1]; // adjust for index -> line conversion
- }
- }
- $body = implode("\n", $bodyReturn);
- unset($bodyLines, $bodyReturn, $classStartLine, $classEndLine);
- }
-
- $namespace = $reflectionFile->getNamespace();
- if ($namespace != '') {
- $file->setNamespace($reflectionFile->getNamespace());
- }
-
- $uses = $reflectionFile->getUses();
- if ($uses) {
- $file->setUses($uses);
- }
-
-
- if (($reflectionFile->getDocComment() != '')) {
- $docblock = $reflectionFile->getDocblock();
- $file->setDocblock(PHPDocblock::fromReflection($docblock));
-
- $bodyLines = explode("\n", $body);
- $bodyReturn = array();
- for ($lineNum = 1; $lineNum <= count($bodyLines); $lineNum++) {
- if ($lineNum == $docblock->getStartLine()) {
- $bodyReturn[] = str_replace('?', $class->getName(), self::$_markerDocblock); //'/* Zend_CodeGenerator_Php_File-ClassMarker: {' . $class->getName() . '} */';
- $lineNum = $docblock->getEndLine();
- } else {
- $bodyReturn[] = $bodyLines[$lineNum - 1]; // adjust for index -> line conversion
- }
- }
- $body = implode("\n", $bodyReturn);
- unset($bodyLines, $bodyReturn, $classStartLine, $classEndLine);
- }
-
- $file->setBody($body);
-
- return $file;
- }
-
- /**
- * setDocblock() Set the docblock
- *
- * @param \Zend\CodeGenerator\PHPDocblock|array|string $docblock
- * @return \Zend\CodeGenerator\PHP\PHPFile
- */
- public function setDocblock($docblock)
- {
- if (is_string($docblock)) {
- $docblock = array('shortDescription' => $docblock);
- }
-
- if (is_array($docblock)) {
- $docblock = new PHPDocblock($docblock);
- } elseif (!$docblock instanceof PHPDocblock) {
- throw new Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock');
- }
-
- $this->_docblock = $docblock;
- return $this;
- }
-
- /**
- * Get docblock
- *
- * @return \Zend\CodeGenerator\PHPDocblock