-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,926 additions
and
288 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 |
---|---|---|
|
@@ -8,3 +8,7 @@ SHORTCODE_CHARS= | |
DB_USER= | ||
DB_PASSWORD= | ||
DB_NAME= | ||
|
||
# Rest authentication | ||
REST_USER= | ||
REST_PASSWORD= |
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ branches: | |
- develop | ||
|
||
php: | ||
- 5.5 | ||
- 5.6 | ||
- 7 | ||
- hhvm | ||
|
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,13 @@ | ||
## CHANGELOG | ||
|
||
### 0.2.0 | ||
|
||
**Enhancements:** | ||
|
||
* [9: Use symfony/console to dispatch console requests, instead of trying to integrate the process with expressive](https://github.com/acelaya/url-shortener/issues/9) | ||
* [8: Create a REST API](https://github.com/acelaya/url-shortener/issues/8) | ||
* [10: Add more CLI functionality](https://github.com/acelaya/url-shortener/issues/10) | ||
|
||
**Tasks** | ||
|
||
* [5: Create CHANGELOG file](https://github.com/acelaya/url-shortener/issues/5) |
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 |
---|---|---|
@@ -1,17 +1,10 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
use Interop\Container\ContainerInterface; | ||
use Zend\Diactoros\ServerRequestFactory; | ||
use Zend\Diactoros\Uri; | ||
use Zend\Expressive\Application; | ||
use Symfony\Component\Console\Application as CliApp; | ||
|
||
/** @var ContainerInterface $container */ | ||
$container = include __DIR__ . '/../config/container.php'; | ||
/** @var Application $app */ | ||
$app = $container->get(Application::class); | ||
|
||
$command = count($_SERVER['argv']) > 1 ? $_SERVER['argv'][1] : ''; | ||
$request = ServerRequestFactory::fromGlobals() | ||
->withMethod('CLI') | ||
->withUri(new Uri(sprintf('/%s', $command))); | ||
$app->run($request); | ||
$app = $container->get(CliApp::class); | ||
$app->run(); |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
use Acelaya\UrlShortener\CLI\Command; | ||
|
||
return [ | ||
|
||
'cli' => [ | ||
'commands' => [ | ||
Command\GenerateShortcodeCommand::class, | ||
Command\ResolveUrlCommand::class, | ||
Command\ListShortcodesCommand::class, | ||
Command\GetVisitsCommand::class, | ||
] | ||
], | ||
|
||
]; |
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,21 @@ | ||
<?php | ||
|
||
return [ | ||
'services' => [ | ||
'invokables' => [ | ||
'Zend\Expressive\Whoops' => Whoops\Run::class, | ||
'Zend\Expressive\WhoopsPageHandler' => Whoops\Handler\PrettyPageHandler::class, | ||
], | ||
'factories' => [ | ||
'Zend\Expressive\FinalHandler' => Zend\Expressive\Container\WhoopsErrorHandlerFactory::class, | ||
], | ||
], | ||
|
||
'whoops' => [ | ||
'json_exceptions' => [ | ||
'display' => true, | ||
'show_trace' => true, | ||
'ajax_only' => true, | ||
], | ||
], | ||
]; |
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,9 @@ | ||
<?php | ||
return [ | ||
|
||
'rest' => [ | ||
'username' => getenv('REST_USER'), | ||
'password' => getenv('REST_PASSWORD'), | ||
], | ||
|
||
]; |
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
Oops, something went wrong.