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