-
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.
Merge pull request #5 from zunnu/4.x-dev
4.x dev
- Loading branch information
Showing
16 changed files
with
177 additions
and
59 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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
/composer.lock | ||
/composer.phar | ||
/phpunit.xml | ||
/vendor | ||
config/Migrations/schema-dump-default.lock | ||
/.phpunit.result.cache | ||
/phpunit.phar | ||
/config/Migrations/schema-dump-default.lock | ||
/vendor/ | ||
/.idea/ |
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
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
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,4 +1,5 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace LogReader\Controller\Api\V1; | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace LogReader\Controller; | ||
|
||
|
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 |
---|---|---|
@@ -1,12 +1,102 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace LogReader; | ||
|
||
use Cake\Core\BasePlugin; | ||
use Cake\Core\ContainerInterface; | ||
use Cake\Core\PluginApplicationInterface; | ||
use Cake\Http\MiddlewareQueue; | ||
use Cake\Routing\RouteBuilder; | ||
use Cake\Console\CommandCollection; | ||
|
||
/** | ||
* Plugin for LogReader | ||
*/ | ||
class Plugin extends BasePlugin | ||
{ | ||
/** | ||
* Load all the plugin configuration and bootstrap logic. | ||
* | ||
* The host application is provided as an argument. This allows you to load | ||
* additional plugin dependencies, or attach events. | ||
* | ||
* @param \Cake\Core\PluginApplicationInterface $app The host application | ||
* @return void | ||
*/ | ||
public function bootstrap(PluginApplicationInterface $app): void | ||
{ | ||
} | ||
|
||
/** | ||
* Add routes for the plugin. | ||
* | ||
* If your plugin has many routes and you would like to isolate them into a separate file, | ||
* you can create `$plugin/config/routes.php` and delete this method. | ||
* | ||
* @param \Cake\Routing\RouteBuilder $routes The route builder to update. | ||
* @return void | ||
*/ | ||
public function routes(RouteBuilder $routes): void | ||
{ | ||
$routes->plugin( | ||
'LogReader', | ||
['path' => '/log-reader'], | ||
function (RouteBuilder $builder) { | ||
$builder->connect('/', ['controller' => 'LogReader', 'action' => 'index'])->setExtensions(['json']); | ||
|
||
$builder->prefix('api', function (RouteBuilder $builder) { | ||
$builder->prefix('v1', function (RouteBuilder $builder) { | ||
$builder->connect('/files', ['controller' => 'LogReader', 'action' => 'files'])->setExtensions(['json']); | ||
$builder->connect('/types', ['controller' => 'LogReader', 'action' => 'types'])->setExtensions(['json']); | ||
$builder->connect('/logs', ['controller' => 'LogReader', 'action' => 'logs'])->setExtensions(['json']); | ||
// // $builder->connect('/:controller'); | ||
}); | ||
}); | ||
|
||
$builder->fallbacks(); | ||
} | ||
); | ||
parent::routes($routes); | ||
} | ||
|
||
/** | ||
* Add middleware for the plugin. | ||
* | ||
* @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to update. | ||
* @return \Cake\Http\MiddlewareQueue | ||
*/ | ||
public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue | ||
{ | ||
// Add your middlewares here | ||
|
||
return $middlewareQueue; | ||
} | ||
|
||
/** | ||
* Add commands for the plugin. | ||
* | ||
* @param \Cake\Console\CommandCollection $commands The command collection to update. | ||
* @return \Cake\Console\CommandCollection | ||
*/ | ||
public function console(CommandCollection $commands) : CommandCollection | ||
{ | ||
// Add your commands here | ||
|
||
$commands = parent::console($commands); | ||
|
||
return $commands; | ||
} | ||
|
||
/** | ||
* Register application container services. | ||
* | ||
* @param \Cake\Core\ContainerInterface $container The Container to update. | ||
* @return void | ||
* @link https://book.cakephp.org/4/en/development/dependency-injection.html#dependency-injection | ||
*/ | ||
public function services(ContainerInterface $container): void | ||
{ | ||
// Add your services here | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.