diff --git a/src/Controller/Caching.php b/src/Controller/Caching.php index dc2a555..097ad31 100644 --- a/src/Controller/Caching.php +++ b/src/Controller/Caching.php @@ -3,13 +3,11 @@ namespace Lean\Console\Controller; use League\Route\Router; -use Picea\{ FileFetcher, Picea ,Caching\Opcache, Extension\UrlExtension }; +use Picea\{FileFetcher, Picea, Caching\Opcache, Extension\UrlExtension, Ui\Method\FormHandler}; use Psr\Http\Message\{ ResponseInterface, ServerRequestInterface }; use Lean\Console\{ Form, Lib }; use Notes\Tell\Attribute\Language, Notes\Route\Attribute\Method\Route; -use function Home\View\{ _, lang, url, route, form }; - #[Language("lean.caching")] class Caching extends Console { use Lib\ConsoleControllerTrait; @@ -20,7 +18,7 @@ class Caching extends Console { $list = []; if ( isset($this->picea) ) { - form(new Form\Caching\Picea($this->picea, $list), $this->pushContext(new Lib\FormContext($request, "caching.picea"))); + new FormHandler($request, new Form\Caching\Picea($this->picea, $list), $this->pushContext(new Lib\FormContext($request, "caching.picea"))); } return $this->renderView("lean-console/page/caching/picea", get_defined_vars()); diff --git a/src/Form/Storage/DatabaseMigration.php b/src/Form/Storage/DatabaseMigration.php index 296d53a..43867de 100644 --- a/src/Form/Storage/DatabaseMigration.php +++ b/src/Form/Storage/DatabaseMigration.php @@ -25,7 +25,8 @@ class DatabaseMigration implements FormInterface $context->tableExist = []; foreach($this->migration->entities as $entity => $table) { - $adapter = $entity::resolveEntity()->sqlAdapter()->adapter(); + $connection = $entity::resolveEntity()->sqlAdapter(); + $adapter = $connection->adapter(); $tableName = $table->tableName(); $databaseName = $table->databaseName(); @@ -34,7 +35,7 @@ class DatabaseMigration implements FormInterface continue; } - $tableEntity = $adapter->schemaTable($databaseName, $tableName); + $tableEntity = $adapter->schemaTable($connection, $databaseName, $tableName); if ( $tableEntity ) { foreach($tableEntity->columns as $field => $definition) { diff --git a/src/Lib/ConsoleControllerTrait.php b/src/Lib/ConsoleControllerTrait.php index e6e079a..bc28880 100644 --- a/src/Lib/ConsoleControllerTrait.php +++ b/src/Lib/ConsoleControllerTrait.php @@ -13,7 +13,6 @@ use Notes\Security\Attribute\{ Security, Taxus }; use Picea; -#[Language("lean.route")] #[Security(locked: false)] #[Taxus("dev")] #[\Notes\Route\Attribute\Object\Route(method: [ 'GET', 'POST', 'DELETE'] , base: "/~")]