This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to make Hack docks site re-usable
First step. Just putting it up so I can pull it into a few projects easily to see how well it works. refs hhvm/user-documentation#206
- Loading branch information
1 parent
b7b33c8
commit 0a1df5a
Showing
10 changed files
with
228 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.swp | ||
vendor/ |
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 @@ | ||
assume_php=false |
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,12 @@ | ||
{ | ||
"name": "fredemmott/hack-router", | ||
"description": "URI routing for Hack", | ||
"keywords": ["hack", "router", "routing", "hhvm"], | ||
"homepage": "https://github.com/fredemmott/hack-router", | ||
"require": { | ||
"nikic/fast-route": "^0.7.0" | ||
}, | ||
"autoload": { | ||
"classmap": ["src/"], | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?hh // strict | ||
/* | ||
* Copyright (c) 2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
namespace Facebook\HackRouter; | ||
|
||
final class MethodNotAllowedException extends RoutingException { | ||
public function __construct(string $method, string $path) { | ||
parent::__construct( | ||
"Method Not Allowed: ".$method.' ('.$path.')', | ||
$method, | ||
$path, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?hh // strict | ||
/* | ||
* Copyright (c) 2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
namespace Facebook\HackRouter; | ||
|
||
final class NotFoundException extends RoutingException { | ||
public function __construct(string $method, string $path) { | ||
parent::__construct( | ||
"Not Found: ".$path, | ||
$method, | ||
$path, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?hh // strict | ||
/* | ||
* Copyright (c) 2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
namespace Facebook\HackRouter; | ||
|
||
abstract class RoutingException extends \Exception { | ||
protected function __construct( | ||
string $message, | ||
private string $requestMethod, | ||
private string $requestedPath, | ||
) { | ||
parent::__construct($message); | ||
} | ||
|
||
public function getRequestMethod(): string { | ||
return $this->requestMethod; | ||
} | ||
|
||
public function getRequestedPath(): string { | ||
return $this->requestedPath; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?hh // strict | ||
/* | ||
* Copyright (c) 2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
namespace Facebook\HackRouter; | ||
|
||
final class UnknownException extends RoutingException { | ||
public function __construct( | ||
private array<mixed> $fastRouteResult, | ||
string $method, | ||
string $path, | ||
) { | ||
parent::__construct( | ||
"Unknown FastRoute result: ".var_export($fastRouteResult, true), | ||
$method, | ||
$path, | ||
); | ||
} | ||
|
||
public function getFastRouteResult(): array<mixed> { | ||
return $this->fastRouteResult; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.