forked from nextcloud/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include copy of Symfony routing component, and don't use composer
- Loading branch information
Showing
44 changed files
with
4,037 additions
and
22 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
Binary file not shown.
103 changes: 103 additions & 0 deletions
103
3rdparty/symfony/routing/Symfony/Component/Routing/Annotation/Route.php
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,103 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Annotation; | ||
|
||
/** | ||
* Annotation class for @Route(). | ||
* | ||
* @Annotation | ||
* | ||
* @author Fabien Potencier <[email protected]> | ||
*/ | ||
class Route | ||
{ | ||
private $pattern; | ||
private $name; | ||
private $requirements; | ||
private $options; | ||
private $defaults; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param array $data An array of key/value parameters. | ||
*/ | ||
public function __construct(array $data) | ||
{ | ||
$this->requirements = array(); | ||
$this->options = array(); | ||
$this->defaults = array(); | ||
|
||
if (isset($data['value'])) { | ||
$data['pattern'] = $data['value']; | ||
unset($data['value']); | ||
} | ||
|
||
foreach ($data as $key => $value) { | ||
$method = 'set'.$key; | ||
if (!method_exists($this, $method)) { | ||
throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this))); | ||
} | ||
$this->$method($value); | ||
} | ||
} | ||
|
||
public function setPattern($pattern) | ||
{ | ||
$this->pattern = $pattern; | ||
} | ||
|
||
public function getPattern() | ||
{ | ||
return $this->pattern; | ||
} | ||
|
||
public function setName($name) | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function setRequirements($requirements) | ||
{ | ||
$this->requirements = $requirements; | ||
} | ||
|
||
public function getRequirements() | ||
{ | ||
return $this->requirements; | ||
} | ||
|
||
public function setOptions($options) | ||
{ | ||
$this->options = $options; | ||
} | ||
|
||
public function getOptions() | ||
{ | ||
return $this->options; | ||
} | ||
|
||
public function setDefaults($defaults) | ||
{ | ||
$this->defaults = $defaults; | ||
} | ||
|
||
public function getDefaults() | ||
{ | ||
return $this->defaults; | ||
} | ||
} |
134 changes: 134 additions & 0 deletions
134
3rdparty/symfony/routing/Symfony/Component/Routing/CompiledRoute.php
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,134 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing; | ||
|
||
/** | ||
* CompiledRoutes are returned by the RouteCompiler class. | ||
* | ||
* @author Fabien Potencier <[email protected]> | ||
*/ | ||
class CompiledRoute | ||
{ | ||
private $route; | ||
private $variables; | ||
private $tokens; | ||
private $staticPrefix; | ||
private $regex; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param Route $route A original Route instance | ||
* @param string $staticPrefix The static prefix of the compiled route | ||
* @param string $regex The regular expression to use to match this route | ||
* @param array $tokens An array of tokens to use to generate URL for this route | ||
* @param array $variables An array of variables | ||
*/ | ||
public function __construct(Route $route, $staticPrefix, $regex, array $tokens, array $variables) | ||
{ | ||
$this->route = $route; | ||
$this->staticPrefix = $staticPrefix; | ||
$this->regex = $regex; | ||
$this->tokens = $tokens; | ||
$this->variables = $variables; | ||
} | ||
|
||
/** | ||
* Returns the Route instance. | ||
* | ||
* @return Route A Route instance | ||
*/ | ||
public function getRoute() | ||
{ | ||
return $this->route; | ||
} | ||
|
||
/** | ||
* Returns the static prefix. | ||
* | ||
* @return string The static prefix | ||
*/ | ||
public function getStaticPrefix() | ||
{ | ||
return $this->staticPrefix; | ||
} | ||
|
||
/** | ||
* Returns the regex. | ||
* | ||
* @return string The regex | ||
*/ | ||
public function getRegex() | ||
{ | ||
return $this->regex; | ||
} | ||
|
||
/** | ||
* Returns the tokens. | ||
* | ||
* @return array The tokens | ||
*/ | ||
public function getTokens() | ||
{ | ||
return $this->tokens; | ||
} | ||
|
||
/** | ||
* Returns the variables. | ||
* | ||
* @return array The variables | ||
*/ | ||
public function getVariables() | ||
{ | ||
return $this->variables; | ||
} | ||
|
||
/** | ||
* Returns the pattern. | ||
* | ||
* @return string The pattern | ||
*/ | ||
public function getPattern() | ||
{ | ||
return $this->route->getPattern(); | ||
} | ||
|
||
/** | ||
* Returns the options. | ||
* | ||
* @return array The options | ||
*/ | ||
public function getOptions() | ||
{ | ||
return $this->route->getOptions(); | ||
} | ||
|
||
/** | ||
* Returns the defaults. | ||
* | ||
* @return array The defaults | ||
*/ | ||
public function getDefaults() | ||
{ | ||
return $this->route->getDefaults(); | ||
} | ||
|
||
/** | ||
* Returns the requirements. | ||
* | ||
* @return array The requirements | ||
*/ | ||
public function getRequirements() | ||
{ | ||
return $this->route->getRequirements(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
3rdparty/symfony/routing/Symfony/Component/Routing/Exception/ExceptionInterface.php
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,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Exception; | ||
|
||
/** | ||
* ExceptionInterface | ||
* | ||
* @author Alexandre Salomé <[email protected]> | ||
* | ||
* @api | ||
*/ | ||
interface ExceptionInterface | ||
{ | ||
} |
23 changes: 23 additions & 0 deletions
23
3rdparty/symfony/routing/Symfony/Component/Routing/Exception/InvalidParameterException.php
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,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Exception; | ||
|
||
/** | ||
* Exception thrown when a parameter is not valid | ||
* | ||
* @author Alexandre Salomé <[email protected]> | ||
* | ||
* @api | ||
*/ | ||
class InvalidParameterException extends \InvalidArgumentException implements ExceptionInterface | ||
{ | ||
} |
38 changes: 38 additions & 0 deletions
38
3rdparty/symfony/routing/Symfony/Component/Routing/Exception/MethodNotAllowedException.php
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,38 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Exception; | ||
|
||
/** | ||
* The resource was found but the request method is not allowed. | ||
* | ||
* This exception should trigger an HTTP 405 response in your application code. | ||
* | ||
* @author Kris Wallsmith <[email protected]> | ||
* | ||
* @api | ||
*/ | ||
class MethodNotAllowedException extends \RuntimeException implements ExceptionInterface | ||
{ | ||
protected $allowedMethods; | ||
|
||
public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) | ||
{ | ||
$this->allowedMethods = array_map('strtoupper', $allowedMethods); | ||
|
||
parent::__construct($message, $code, $previous); | ||
} | ||
|
||
public function getAllowedMethods() | ||
{ | ||
return $this->allowedMethods; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...mfony/routing/Symfony/Component/Routing/Exception/MissingMandatoryParametersException.php
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,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Exception; | ||
|
||
/** | ||
* Exception thrown when a route cannot be generated because of missing | ||
* mandatory parameters. | ||
* | ||
* @author Alexandre Salomé <[email protected]> | ||
* | ||
* @api | ||
*/ | ||
class MissingMandatoryParametersException extends \InvalidArgumentException implements ExceptionInterface | ||
{ | ||
} |
25 changes: 25 additions & 0 deletions
25
3rdparty/symfony/routing/Symfony/Component/Routing/Exception/ResourceNotFoundException.php
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,25 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Exception; | ||
|
||
/** | ||
* The resource was not found. | ||
* | ||
* This exception should trigger an HTTP 404 response in your application code. | ||
* | ||
* @author Kris Wallsmith <[email protected]> | ||
* | ||
* @api | ||
*/ | ||
class ResourceNotFoundException extends \RuntimeException implements ExceptionInterface | ||
{ | ||
} |
Oops, something went wrong.