Skip to content

Commit

Permalink
Adding functionality to mimmic old legacy app.
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Culp <[email protected]>
  • Loading branch information
adamculp committed Jun 18, 2020
1 parent ca0b557 commit e40041d
Show file tree
Hide file tree
Showing 25 changed files with 901 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AWS_REGION='us-east-1'
AWS_VERSION='latest'
AWS_S3_BUCKET_NAME=
AWS_KEY=
AWS_SECRET=
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
.serverless
/phpunit.xml
/phpunit.xml
.env
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"mezzio/mezzio": "^3.2.1",
"mezzio/mezzio-fastroute": "^3.0.3",
"mezzio/mezzio-helpers": "^5.3",
"mezzio/mezzio-platesrenderer": "^2.2"
"mezzio/mezzio-platesrenderer": "^2.2",
"vlucas/phpdotenv": "^5.0"
},
"require-dev": {
"laminas/laminas-development-mode": "^3.2",
Expand Down
207 changes: 191 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@
* Mezzio\Router\Route::HTTP_METHOD_ANY,
* 'contact'
* );
* @param Application $app
* @param MiddlewareFactory $factory
* @param ContainerInterface $container
*/
return static function (Application $app, MiddlewareFactory $factory, ContainerInterface $container) : void {
$app->get('/', App\Handler\HomePageHandler::class, 'home');
$app->get('/api/ping', App\Handler\PingHandler::class, 'api.ping');
$app->get('/logs', App\Handler\LogsHandler::class, 'logs');
$app->get('/logs-fetch', App\Handler\LogsFetchHandler::class, 'logs-fetch');
$app->get('/stats', App\Handler\StatsHandler::class, 'stats');
$app->get('/stats-view', App\Handler\StatsViewHandler::class, 'stats-view');
$app->get('/stats-file-view/{filename}', App\Handler\StatsFileViewHandler::class, 'stats-file-view');
// $app->get('/stats-file-view/{filename:([a-zA-Z0-9\s_\\.\-\(\):])+(.mp3)$}', App\Handler\StatsFileViewHandler::class, 'stats-file-view');
};
1 change: 1 addition & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
!cache
!cache/.gitkeep
!.gitignore
!schema.sql
15 changes: 15 additions & 0 deletions data/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

CREATE DATABASE IF NOT EXISTS `rungeeklogs` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

CREATE TABLE `logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`bucket` varchar(255) NOT NULL,
`date` date NOT NULL,
`time` time NOT NULL,
`datetime` datetime NOT NULL,
`ip` varchar(20) NOT NULL,
`file` varchar(255) NOT NULL,
`useragent` varchar(255) DEFAULT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
4 changes: 4 additions & 0 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
chdir(dirname(__DIR__));
require 'vendor/autoload.php';

// load ENV
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__.'/../');
$dotenv->load();

/**
* Self-called anonymous function that creates its own scope and keeps the global namespace clean.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/App/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public function getDependencies() : array
],
'factories' => [
Handler\HomePageHandler::class => Handler\HomePageHandlerFactory::class,
Handler\LogsHandler::class => Handler\LogsHandlerFactory::class,
Handler\LogsFetchHandler::class => Handler\LogsFetchHandlerFactory::class,
Handler\StatsHandler::class => Handler\StatsHandlerFactory::class,
Handler\StatsViewHandler::class => Handler\StatsViewHandlerFactory::class,
Handler\StatsFileViewHandler::class => Handler\StatsFileViewHandlerFactory::class,
],
];
}
Expand Down
Loading

0 comments on commit e40041d

Please sign in to comment.