diff --git a/app/CMS/Modules/Stubs/Migrations/create.stub b/app/CMS/Modules/Stubs/Migrations/create.stub index abdaad93..4eba77e2 100644 --- a/app/CMS/Modules/Stubs/Migrations/create.stub +++ b/app/CMS/Modules/Stubs/Migrations/create.stub @@ -1,7 +1,5 @@ where('manages_content', true) ->get(); @@ -68,7 +68,7 @@ class Module extends Repository implements IModule public function all() { - return Cache::rememberForever('enabled-modules-and-template', function () { + return Cache::remember('enabled-modules-and-template', setting('cacheModules', 3600), function () { return ModuleModel::where('enabled', true) ->get(); }); @@ -76,7 +76,7 @@ class Module extends Repository implements IModule public function getOnlyModules() { - return Cache::rememberForever('enabled-modules', function () { + return Cache::remember('enabled-modules', setting('cacheModules', 3600), function () { return ModuleModel::where('enabled', true) ->where('is_template', false) ->get(); diff --git a/app/CMS/Repositories/Templates/Template.php b/app/CMS/Repositories/Templates/Template.php index 1d80eff0..fdb0bcfd 100644 --- a/app/CMS/Repositories/Templates/Template.php +++ b/app/CMS/Repositories/Templates/Template.php @@ -70,7 +70,7 @@ class Template extends Repository implements ITemplate public function getForModule(Module $module) { - return Cache::rememberForever('templates-for-module', function () use ($module) { + return Cache::remember('templates-for-module-'.$module->id, setting('cacheModules', 3600), function () use ($module) { return TemplateModel::where('module_id', $module->id) ->select(['template_name', 'name', 'description']) ->get(); diff --git a/app/Console/Commands/Modules/CreateMigration.php b/app/Console/Commands/Modules/CreateMigration.php index d815a222..1f42ce11 100644 --- a/app/Console/Commands/Modules/CreateMigration.php +++ b/app/Console/Commands/Modules/CreateMigration.php @@ -49,11 +49,11 @@ class CreateMigration extends Command } while (is_null($name)) { - $name = $this->ask('Input migration name'); + $this->migrationName = $name = $this->ask('Input migration name'); } $stubName = $this->option('create') ? 'create' : 'new'; - $content = file_get_contents(config('modules.paths.stubs') . '/Migrations/'.$stubName.'.stub'); + $content = file_get_contents(config('modules.paths.stubs') . '/Migrations/' . $stubName . '.stub'); $content = $this->replacePlaceholders($content); $migrationName = $path . $this->getMigrationName($name); @@ -74,7 +74,7 @@ class CreateMigration extends Command { $replace = [ '$MigrationName$' => studly_case($this->migrationName), - '$ModuleName$' => $this->moduleName, + '$ModuleName$' => $this->moduleName, '$TableName$' => $this->tableName ]; diff --git a/app/Console/Commands/Modules/EnableModule.php b/app/Console/Commands/Modules/EnableModule.php index 426c0cda..c1ddba27 100644 --- a/app/Console/Commands/Modules/EnableModule.php +++ b/app/Console/Commands/Modules/EnableModule.php @@ -44,6 +44,7 @@ class EnableModule extends Command $module->save(); \Cache::forget('enabled-modules'); + \Cache::forget('enabled-content-modules'); \Cache::forget('enabled-modules-and-template'); $this->line('Module ' . $module->static_name . ' enabled.'); diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 38301379..a30639dc 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -14,21 +14,5 @@ define('LARAVEL_START', microtime(true)); | */ +require_once __DIR__ . '/../app/CMS/Helpers/functions.php'; require __DIR__.'/../vendor/autoload.php'; - -/* -|-------------------------------------------------------------------------- -| Include The Compiled Class File -|-------------------------------------------------------------------------- -| -| To dramatically increase your application's performance, you may use a -| compiled class file which contains all of the classes commonly used -| by a request. The Artisan "optimize" is used to create this file. -| -*/ - -$compiledPath = __DIR__.'/cache/compiled.php'; - -if (file_exists($compiledPath)) { - require $compiledPath; -} diff --git a/index.php b/index.php index 48384dc5..3fc4bbdc 100644 --- a/index.php +++ b/index.php @@ -16,5 +16,4 @@ if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) { return false; } -require_once __DIR__ . '/app/CMS/Helpers/functions.php'; require_once __DIR__ . '/public/index.php';