Permalink
Browse files

Upgraded ApiGen to version 2.6.0

  • Loading branch information...
1 parent d5b22b6 commit 5a945827192fc8401c8f18487fbbaa51a07ca219 @kukulich kukulich committed Mar 16, 2012
Showing with 6,303 additions and 2,676 deletions.
  1. +22 −16 tools/ApiGen/ApiGen/Backend.php
  2. +167 −61 tools/ApiGen/ApiGen/Config.php
  3. +25 −0 tools/ApiGen/ApiGen/ConfigException.php
  4. +0 −31 tools/ApiGen/ApiGen/Exception.php
  5. +442 −145 tools/ApiGen/ApiGen/Generator.php
  6. +4 −7 tools/ApiGen/ApiGen/ReflectionBase.php
  7. +23 −11 tools/ApiGen/ApiGen/ReflectionClass.php
  8. +22 −6 tools/ApiGen/ApiGen/ReflectionConstant.php
  9. +150 −20 tools/ApiGen/ApiGen/ReflectionElement.php
  10. +4 −7 tools/ApiGen/ApiGen/ReflectionExtension.php
  11. +18 −6 tools/ApiGen/ApiGen/ReflectionFunction.php
  12. +7 −8 tools/ApiGen/ApiGen/ReflectionFunctionBase.php
  13. +18 −6 tools/ApiGen/ApiGen/ReflectionMethod.php
  14. +4 −6 tools/ApiGen/ApiGen/ReflectionParameter.php
  15. +18 −6 tools/ApiGen/ApiGen/ReflectionProperty.php
  16. +159 −241 tools/ApiGen/ApiGen/Template.php
  17. +7 −8 tools/ApiGen/ApiGen/Tree.php
  18. +16 −10 tools/ApiGen/apigen.neon
  19. +96 −40 tools/ApiGen/apigen.php
  20. +104 −63 tools/ApiGen/libs/TokenReflection/TokenReflection/Broker.php
  21. +27 −2 tools/ApiGen/libs/TokenReflection/TokenReflection/Broker/Backend.php
  22. +87 −30 tools/ApiGen/libs/TokenReflection/TokenReflection/Broker/Backend/Memory.php
  23. +61 −69 tools/ApiGen/libs/TokenReflection/TokenReflection/Dummy/ReflectionClass.php
  24. +0 −36 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception.php
  25. +102 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/BaseException.php
  26. +66 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/BrokerException.php
  27. +80 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/FileProcessingException.php
  28. +0 −58 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/Parse.php
  29. +264 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/ParseException.php
  30. +0 −48 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/Runtime.php
  31. +72 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/RuntimeException.php
  32. +96 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Exception/StreamException.php
  33. +8 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflection.php
  34. +29 −14 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionClass.php
  35. +17 −2 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionConstant.php
  36. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionExtension.php
  37. +9 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionFunction.php
  38. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionFunctionBase.php
  39. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionMethod.php
  40. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionNamespace.php
  41. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionParameter.php
  42. +8 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/IReflectionProperty.php
  43. +1,040 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Invalid/ReflectionClass.php
  44. +332 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Invalid/ReflectionConstant.php
  45. +48 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Invalid/ReflectionElement.php
  46. +421 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/Invalid/ReflectionFunction.php
  47. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/IReflection.php
  48. +50 −28 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionClass.php
  49. +65 −12 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionConstant.php
  50. +15 −5 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionExtension.php
  51. +31 −9 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionFunction.php
  52. +21 −11 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionMethod.php
  53. +15 −5 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionParameter.php
  54. +15 −5 tools/ApiGen/libs/TokenReflection/TokenReflection/Php/ReflectionProperty.php
  55. +111 −30 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionAnnotation.php
  56. +28 −310 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionBase.php
  57. +189 −194 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionClass.php
  58. +93 −69 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionConstant.php
  59. +359 −0 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionElement.php
  60. +60 −162 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionFile.php
  61. +114 −61 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionFileNamespace.php
  62. +21 −10 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionFunction.php
  63. +134 −144 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionFunctionBase.php
  64. +69 −75 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionMethod.php
  65. +108 −31 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionNamespace.php
  66. +127 −137 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionParameter.php
  67. +116 −119 tools/ApiGen/libs/TokenReflection/TokenReflection/ReflectionProperty.php
  68. +12 −12 tools/ApiGen/libs/TokenReflection/TokenReflection/Resolver.php
  69. +6 −6 tools/ApiGen/libs/TokenReflection/TokenReflection/Stream/FileStream.php
  70. +25 −20 tools/ApiGen/libs/TokenReflection/TokenReflection/Stream/StreamBase.php
  71. +1 −1 tools/ApiGen/libs/TokenReflection/TokenReflection/Stream/StringStream.php
  72. +23 −24 tools/ApiGen/templates/@elementlist.latte
  73. +43 −54 tools/ApiGen/templates/@layout.latte
  74. +60 −42 tools/ApiGen/templates/class.latte
  75. +16 −1 tools/ApiGen/templates/combined.js.latte
  76. +1 −1 tools/ApiGen/templates/config.neon
  77. +30 −3 tools/ApiGen/templates/constant.latte
  78. +20 −33 tools/ApiGen/templates/deprecated.latte
  79. +10 −0 tools/ApiGen/templates/elementlist.js.latte
  80. +31 −4 tools/ApiGen/templates/function.latte
  81. +8 −0 tools/ApiGen/templates/js/jquery.sprintf.js
  82. +29 −9 tools/ApiGen/templates/js/main.js
  83. +10 −0 tools/ApiGen/templates/namespace.latte
  84. +10 −0 tools/ApiGen/templates/opensearch.xml.latte
  85. +24 −10 tools/ApiGen/templates/overview.latte
  86. +15 −10 tools/ApiGen/templates/package.latte
  87. BIN tools/ApiGen/templates/resources/collapsed.png
  88. +30 −12 tools/ApiGen/templates/resources/style.css
  89. +10 −0 tools/ApiGen/templates/robots.txt.latte
  90. +25 −20 tools/ApiGen/templates/sitemap.xml.latte
  91. +10 −0 tools/ApiGen/templates/source.latte
  92. +20 −27 tools/ApiGen/templates/todo.latte
  93. +14 −4 tools/ApiGen/templates/tree.latte
@@ -1,27 +1,26 @@
<?php
/**
- * ApiGen 2.3.0 - API documentation generator for PHP 5.3+
+ * ApiGen 2.6.0 - API documentation generator for PHP 5.3+
*
- * Copyright (c) 2010 David Grudl (http://davidgrudl.com)
- * Copyright (c) 2011 Jaroslav Hanslík (https://github.com/kukulich)
- * Copyright (c) 2011 Ondřej Nešpor (https://github.com/Andrewsville)
+ * Copyright (c) 2010-2011 David Grudl (http://davidgrudl.com)
+ * Copyright (c) 2011-2012 Jaroslav Hanslík (https://github.com/kukulich)
+ * Copyright (c) 2011-2012 Ondřej Nešpor (https://github.com/Andrewsville)
*
* For the full copyright and license information, please view
* the file LICENSE.md that was distributed with this source code.
*/
namespace ApiGen;
+
use TokenReflection, TokenReflection\IReflectionConstant, TokenReflection\IReflectionFunction, TokenReflection\Broker;
+use InvalidArgumentException, RuntimeException;
/**
* Customized TokenReflection broker backend.
*
* Adds internal classes from @param, @var, @return, @throws annotations as well
* as parent classes to the overall class list.
- *
- * @author Ondřej Nešpor
- * @author Jaroslav Hanslík
*/
class Backend extends Broker\Backend\Memory
{
@@ -73,16 +72,19 @@ public function __destruct()
/**
* Adds a file to the backend storage.
*
+ * @param \TokenReflection\Stream\StreamBase $tokenStream Token stream
* @param \TokenReflection\ReflectionFile $file File reflection object
* @return \TokenReflection\Broker\Backend\Memory
*/
- public function addFile(TokenReflection\ReflectionFile $file)
+ public function addFile(TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\ReflectionFile $file)
{
- parent::addFile($file);
if ($this->cacheTokenStreams) {
$this->fileCache[$file->getName()] = $cacheFile = tempnam(sys_get_temp_dir(), 'trc');
- file_put_contents($cacheFile, serialize($file->getTokenStream()));
+ file_put_contents($cacheFile, serialize($tokenStream));
}
+
+ parent::addFile($tokenStream, $file);
+
return $this;
}
@@ -91,32 +93,32 @@ public function addFile(TokenReflection\ReflectionFile $file)
*
* @param string $fileName File name
* @return \TokenReflection\Stream
- * @throws \ApiGen\Exception If the token stream could not be returned.
+ * @throws \RuntimeException If the token stream could not be returned.
*/
public function getFileTokens($fileName)
{
try {
if (!$this->isFileProcessed($fileName)) {
- throw new Exception('File was not processed');
+ throw new InvalidArgumentException('File was not processed');
}
$realName = Broker::getRealPath($fileName);
if (!isset($this->fileCache[$realName])) {
- throw new Exception('File is not in the cache');
+ throw new InvalidArgumentException('File is not in the cache');
}
$data = @file_get_contents($this->fileCache[$realName]);
if (false === $data) {
- throw new Exception('Cached file is not readable');
+ throw new RuntimeException('Cached file is not readable');
}
$file = @unserialize($data);
if (false === $file) {
- throw new Exception('Stream could not be loaded from cache');
+ throw new RuntimeException('Stream could not be loaded from cache');
}
return $file;
} catch (\Exception $e) {
- throw new Exception(sprintf('Could not return token stream for file %s', $fileName), 0, $e);
+ throw new RuntimeException(sprintf('Could not return token stream for file %s', $fileName), 0, $e);
}
}
@@ -154,6 +156,8 @@ protected function parseClassLists()
}
}
}
+
+ $this->generator->checkMemory();
}
}
@@ -180,6 +184,8 @@ protected function parseClassLists()
}
}
}
+
+ $this->generator->checkMemory();
}
foreach ($this->getFunctions() as $function) {
Oops, something went wrong.

0 comments on commit 5a94582

Please sign in to comment.