Compare commits
No commits in common. "a64ed080bb8ae792709ce588f745ba5d0798bcca" and "2655a793f58874c13a175701f8ae9f9edc5d25d2" have entirely different histories.
a64ed080bb
...
2655a793f5
@ -9,13 +9,12 @@ class Flash
|
|||||||
|
|
||||||
public static function setMessage(string $type, string $msg): void
|
public static function setMessage(string $type, string $msg): void
|
||||||
{
|
{
|
||||||
self::start();
|
Session::start();
|
||||||
Session::set($type, $msg);
|
Session::set($type, $msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMessage(string $type): string
|
public static function getMessage(string $type): string
|
||||||
{
|
{
|
||||||
self::start();
|
|
||||||
$msg = Session::get($type, false);
|
$msg = Session::get($type, false);
|
||||||
Session::remove($type);
|
Session::remove($type);
|
||||||
|
|
||||||
@ -24,16 +23,7 @@ class Flash
|
|||||||
|
|
||||||
public static function hasMessage(string $type): bool
|
public static function hasMessage(string $type): bool
|
||||||
{
|
{
|
||||||
self::start();
|
|
||||||
|
|
||||||
return Session::has($type);
|
return Session::has($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function start()
|
|
||||||
{
|
|
||||||
if (!Session::isStarted()){
|
|
||||||
Session::start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -71,15 +71,10 @@ class MigrationController extends ConsoleController
|
|||||||
$dmr = new DatabaseMigrationRepository(App::$db->capsule->getDatabaseManager(), 'migration');
|
$dmr = new DatabaseMigrationRepository(App::$db->capsule->getDatabaseManager(), 'migration');
|
||||||
|
|
||||||
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
||||||
if (isset($this->argv['path'])){
|
if (\kernel\App::$db->schema->hasTable('option')) {
|
||||||
$migrationPaths = [ROOT_DIR . $this->argv['path']];
|
$migrationPaths = array_merge($this->moduleService->getModulesMigrationsPaths(), [ROOT_DIR . '/migrations']);
|
||||||
}
|
} else {
|
||||||
else {
|
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||||
if (\kernel\App::$db->schema->hasTable('option')) {
|
|
||||||
$migrationPaths = array_merge($this->moduleService->getModulesMigrationsPaths(), [ROOT_DIR . '/migrations']);
|
|
||||||
} else {
|
|
||||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = $m->run($migrationPaths);
|
$res = $m->run($migrationPaths);
|
||||||
@ -99,13 +94,7 @@ class MigrationController extends ConsoleController
|
|||||||
|
|
||||||
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
||||||
//$migrationPaths = array_merge(App::$migrationsPaths, [WORKSPACE_DIR . '/console/migrations']);
|
//$migrationPaths = array_merge(App::$migrationsPaths, [WORKSPACE_DIR . '/console/migrations']);
|
||||||
if (isset($this->argv['path'])){
|
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||||
$migrationPaths = [ROOT_DIR . $this->argv['path']];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = $m->rollback($migrationPaths, ['step' => $step]);
|
$res = $m->rollback($migrationPaths, ['step' => $step]);
|
||||||
print_r($step);
|
print_r($step);
|
||||||
foreach ($res as $re) {
|
foreach ($res as $re) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Kernel",
|
"name": "Kernel",
|
||||||
"version": "0.1.7",
|
"version": "0.1.5",
|
||||||
"author": "ITGuild",
|
"author": "ITGuild",
|
||||||
"slug": "kernel",
|
"slug": "kernel",
|
||||||
"type": "kernel",
|
"type": "kernel",
|
||||||
|
@ -256,7 +256,8 @@ class ModuleShopClientController extends AdminController
|
|||||||
if ($this->adminThemeService->install('/resources/tmp/admin_themes/' . basename($adminThemeInfo['path_to_archive']))) {
|
if ($this->adminThemeService->install('/resources/tmp/admin_themes/' . basename($adminThemeInfo['path_to_archive']))) {
|
||||||
Flash::setMessage("success", "Тема админ-панели успешно загружена.");
|
Flash::setMessage("success", "Тема админ-панели успешно загружена.");
|
||||||
} else {
|
} else {
|
||||||
Flash::setMessage("error", implode(";", $this->adminThemeService->getErrors()));
|
Session::start();
|
||||||
|
Session::set("error", implode(";", $this->adminThemeService->getErrors()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->redirect('/admin/module_shop_client', 302);
|
$this->redirect('/admin/module_shop_client', 302);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user