Permalink
Browse files

Removed library/Zf2, added Zf2Mvc module

- Removed prototyping code, in favor or prototype/mvc-module code from ZF2 repo
  • Loading branch information...
1 parent d0f668a commit ad4ae7e405a652efbb605d885effd4b1db1ed097 @weierophinney committed Sep 6, 2011
Showing with 3,094 additions and 3,551 deletions.
  1. +0 −7 library/Zf2/Http/Exception.php
  2. +0 −11 library/Zf2/Http/Exception/InvalidArgumentException.php
  3. +0 −11 library/Zf2/Http/Exception/RuntimeException.php
  4. +0 −168 library/Zf2/Http/Header.php
  5. +0 −273 library/Zf2/Http/Headers.php
  6. +0 −21 library/Zf2/Http/HttpHeader.php
  7. +0 −73 library/Zf2/Http/HttpHeaders.php
  8. +0 −69 library/Zf2/Http/HttpRequest.php
  9. +0 −13 library/Zf2/Http/HttpRequestHeaders.php
  10. +0 −18 library/Zf2/Http/HttpResponse.php
  11. +0 −70 library/Zf2/Http/HttpResponseHeaders.php
  12. +0 −86 library/Zf2/Http/Parameters.php
  13. +0 −388 library/Zf2/Http/Request.php
  14. +0 −118 library/Zf2/Http/RequestHeaders.php
  15. +0 −127 library/Zf2/Http/Response.php
  16. +0 −439 library/Zf2/Http/ResponseHeaders.php
  17. +0 −53 library/Zf2/Mvc/ActionController.php
  18. +0 −9 library/Zf2/Mvc/Exception/DomainException.php
  19. +0 −11 library/Zf2/Mvc/Exception/InvalidArgumentException.php
  20. +0 −9 library/Zf2/Mvc/Exception/InvalidRequestException.php
  21. +0 −9 library/Zf2/Mvc/Exception/InvalidRouteException.php
  22. +0 −9 library/Zf2/Mvc/Exception/MissingParameterException.php
  23. +0 −176 library/Zf2/Mvc/FrontController.php
  24. +0 −11 library/Zf2/Mvc/Route.php
  25. +0 −107 library/Zf2/Mvc/Route/RegexRoute.php
  26. +0 −93 library/Zf2/Mvc/Route/StaticRoute.php
  27. +0 −9 library/Zf2/Mvc/RouteStack.php
  28. +0 −134 library/Zf2/Mvc/Router.php
  29. +0 −7 library/Zf2/Stdlib/Dispatchable.php
  30. +0 −7 library/Zf2/Stdlib/Exception.php
  31. +0 −9 library/Zf2/Stdlib/Exception/DomainException.php
  32. +0 −11 library/Zf2/Stdlib/Exception/InvalidArgumentException.php
  33. +0 −85 library/Zf2/Stdlib/Message.php
  34. +0 −12 library/Zf2/Stdlib/MessageDescription.php
  35. +0 −30 library/Zf2/Stdlib/Parameters.php
  36. +0 −25 library/Zf2/Stdlib/Request.php
  37. +0 −9 library/Zf2/Stdlib/RequestDescription.php
  38. +0 −30 library/Zf2/Stdlib/Response.php
  39. +0 −12 library/Zf2/Stdlib/ResponseDescription.php
  40. +0 −789 library/Zf2DiDefinition.php
  41. +62 −0 modules/Zf2Mvc/.vimproject
  42. +12 −0 modules/Zf2Mvc/Information.php
  43. +22 −0 modules/Zf2Mvc/classmap.php
  44. +20 −0 modules/Zf2Mvc/composer.json
  45. +236 −0 modules/Zf2Mvc/docs/zf2-mvc.examples.md
  46. +101 −0 modules/Zf2Mvc/src/Zf2Mvc/AppContext.php
  47. +256 −0 modules/Zf2Mvc/src/Zf2Mvc/Application.php
  48. +164 −0 modules/Zf2Mvc/src/Zf2Mvc/Controller/ActionController.php
  49. +242 −0 modules/Zf2Mvc/src/Zf2Mvc/Controller/RestfulController.php
  50. +2 −3 {library/Zf2/Mvc → modules/Zf2Mvc/src/Zf2Mvc}/Exception.php
  51. +10 −0 modules/Zf2Mvc/src/Zf2Mvc/Exception/InvalidArgumentException.php
  52. +9 −0 modules/Zf2Mvc/src/Zf2Mvc/Exception/MissingLocatorException.php
  53. +32 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Exception.php
  54. +36 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Exception/RuntimeException.php
  55. +125 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Http/Literal.php
  56. +168 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Http/Part.php
  57. +105 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Http/Regex.php
  58. +50 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Http/Route.php
  59. +81 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Http/TreeRouteStack.php
  60. +217 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/PriorityList.php
  61. +61 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/Route.php
  62. +119 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/RouteMatch.php
  63. +59 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/RouteStack.php
  64. +263 −0 modules/Zf2Mvc/src/Zf2Mvc/Router/SimpleRouteStack.php
  65. +182 −0 modules/Zf2Mvc/tests/Zf2Mvc/ApplicationTest.php
  66. +113 −0 modules/Zf2Mvc/tests/Zf2Mvc/Controller/ActionControllerTest.php
  67. +160 −0 modules/Zf2Mvc/tests/Zf2Mvc/Controller/RestfulControllerTest.php
  68. +78 −0 modules/Zf2Mvc/tests/Zf2Mvc/Controller/TestAsset/RestfulController.php
  69. +18 −0 modules/Zf2Mvc/tests/Zf2Mvc/Controller/TestAsset/SampleController.php
  70. +26 −0 modules/Zf2Mvc/tests/Zf2Mvc/TestAsset/Locator.php
  71. +19 −0 modules/Zf2Mvc/tests/Zf2Mvc/TestAsset/PathController.php
  72. +29 −0 modules/Zf2Mvc/tests/bootstrap.php
  73. +17 −0 modules/Zf2Mvc/tests/phpunit.xml
@@ -1,7 +0,0 @@
-<?php
-
-namespace Zf2\Http;
-
-interface Exception
-{
-}
@@ -1,11 +0,0 @@
-<?php
-
-namespace Zf2\Http\Exception;
-
-use Zf2\Http\Exception;
-
-class InvalidArgumentException
- extends \InvalidArgumentException
- implements Exception
-{
-}
@@ -1,11 +0,0 @@
-<?php
-
-namespace Zf2\Http\Exception;
-
-use Zf2\Http\Exception;
-
-class RuntimeException
- extends \RuntimeException
- implements Exception
-{
-}
View
@@ -1,168 +0,0 @@
-<?php
-
-namespace Zf2\Http;
-
-use ArrayObject;
-
-class Header implements HttpHeader
-{
- /** @var string */
- protected $type;
-
- /** @var string */
- protected $value;
-
- /** @var bool */
- protected $replaceFlag;
-
- /**
- * Constructor
- *
- * @param string $type
- * @param string|array $value
- * @param bool $replace
- * @return void
- */
- public function __construct($header, $value = null, $replace = false)
- {
- if (is_array($header) || $header instanceof ArrayObject) {
- $type = $header['type'] ?: false;
- $value = $header['value'] ?: '';
- $replace = (bool) ($header['replace'] ?: false);
- $header = $type;
- }
-
- $this->setType($header);
- $this->setValue($value);
- $this->replace($replace);
- }
-
- /* mutators */
-
- /**
- * Set header type
- *
- * @param string $type
- * @return Header
- */
- public function setType($type)
- {
- if (!is_scalar($type)) {
- throw new Exception\InvalidArgumentException('Header type must be scalar');
- }
-
- // Pre-filter to normalize valid characters
- $type = $this->normalizeHeaderType((string) $type);
-
- // Validate what we have
- if (!preg_match('/^[a-z][a-z0-9-]*$/i', $type)) {
- throw new Exception\InvalidArgumentException('Header type must start with a letter, and consist of only letters, numbers, and dashes');
- }
-
- $this->type = $type;
- return $this;
- }
-
- /**
- * Set header value
- *
- * @param string|array $value
- * @return Header
- */
- public function setValue($value, $separator = '; ')
- {
- if (is_array($value)) {
- $value = implode($separator, $value);
- }
- $value = (string) $value;
- if (empty($value) || preg_match('/^\s+$/', $value)) {
- $value = '';
- }
- $this->value = $value;
- return $this;
- }
-
- /**
- * Retrieve or set "replace" flag
- *
- * Used by the Headers class when sending headers.
- *
- * If a null flag is passed (or no argument passed), returns the value of
- * the flag; otherwise, sets it.
- *
- * @param null|bool $flag
- * @return Header|bool
- */
- public function replace($flag = null)
- {
- if (null === $flag) {
- return $this->replaceFlag;
- }
- $this->replaceFlag = (bool) $flag;
- return $this;
- }
-
- /* accessors */
-
- /**
- * Retrieve header type
- *
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
-
- /**
- * Retrieve header value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->value;
- }
-
- /* behavior */
-
- /**
- * Send header
- *
- * Proxies to __toString() to format header appropriately (and trims it),
- * and uses value of replace flag as second argument for header().
- *
- * @return void
- */
- public function send()
- {
- header(trim($this->__toString()), $this->replace());
- }
-
- /**
- * Cast to string
- *
- * Returns in form of "TYPE: VALUE\r\n"
- *
- * @return string
- */
- public function __toString()
- {
- $type = $this->getType();
- $value = $this->getValue();
- return $type . ': ' . $value . "\r\n";
- }
-
- /**
- * Normalize the header string
- *
- * @param string $string
- * @return string
- */
- protected function normalizeHeaderType($string)
- {
- $type = str_replace(array('_', '-'), ' ', $string);
- $type = ucwords($type);
- return str_replace(' ', '-', $type);
- }
-}
Oops, something went wrong.

0 comments on commit ad4ae7e

Please sign in to comment.