diff --git a/composer.json b/composer.json index e6a943f8..adef5300 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "nesbot/carbon": "~1.22", "illuminate/database": "~5.5", "illuminate/filesystem": "~5.5", + "illuminate/pagination": "~5.5", "doctrine/dbal": "~2.6", "swiftmailer/swiftmailer": "~6.0", "erusev/parsedown": "~1.6" @@ -21,11 +22,22 @@ "phpunit/phpunit": "~6.0" }, "autoload": { + "classmap": [ + "database" + ], "psr-4": { "Misuzu\\": "src/" }, "files": [ "utility.php" ] + }, + "scripts": { + "post-install-cmd": [ + "php misuzu_migrate.php" + ] + }, + "config": { + "preferred-install": "dist" } } diff --git a/composer.lock b/composer.lock index d514c57e..146be931 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "fd3ae2504a3c120f29942565ef7cd403", + "content-hash": "cf7183af01ce52a9430cef6cfcbc9213", "packages": [ { "name": "doctrine/annotations", @@ -815,6 +815,50 @@ "homepage": "https://laravel.com", "time": "2017-12-14T13:33:54+00:00" }, + { + "name": "illuminate/pagination", + "version": "v5.5.28", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pagination.git", + "reference": "90e59fedc7d4760db5d85d66a59507ceac0bf354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/90e59fedc7d4760db5d85d66a59507ceac0bf354", + "reference": "90e59fedc7d4760db5d85d66a59507ceac0bf354", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.5.*", + "illuminate/support": "5.5.*", + "php": ">=7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.5-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pagination package.", + "homepage": "https://laravel.com", + "time": "2017-10-13T15:07:13+00:00" + }, { "name": "illuminate/support", "version": "v5.5.28", diff --git a/misuzu_migrate.php b/misuzu_migrate.php new file mode 100644 index 00000000..9195946a --- /dev/null +++ b/misuzu_migrate.php @@ -0,0 +1,31 @@ + Database::connection()]); +$repository = new DatabaseMigrationRepository($resolver, 'migrations'); +$repository->setSource('database'); +$migrator = new Migrator($repository, $repository->getConnectionResolver(), new Filesystem); + +if (!$migrator->repositoryExists()) { + $repository->createRepository(); +} + +$migrator->run(__DIR__ . '/database'); + +foreach ($migrator->getNotes() as $note) { + echo strip_tags($note) . PHP_EOL; +} diff --git a/src/Application.php b/src/Application.php index b3b9504c..a3867e2c 100644 --- a/src/Application.php +++ b/src/Application.php @@ -121,6 +121,10 @@ class Application } } + /** + * @todo Instead of reading a connections variable from the config, + * the expected connections should be defined somewhere in this class. + */ private function loadConfigDatabaseConnections(): void { $config = $this->config; diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php index c19d8843..a41c0dd9 100644 --- a/src/Controllers/HomeController.php +++ b/src/Controllers/HomeController.php @@ -3,6 +3,7 @@ namespace Misuzu\Controllers; use Misuzu\Application; use Misuzu\Database; +use Misuzu\AyaseUser; class HomeController extends Controller {