From 46c0e1c44b3276d91380c6780011aa78d80cdf21 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 8 Aug 2015 15:52:34 -0600 Subject: [PATCH] Re #27 - Create system.yaml and site.yaml files --- admin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/admin.php b/admin.php index bb54c77f..8d2497dc 100644 --- a/admin.php +++ b/admin.php @@ -304,6 +304,17 @@ class AdminPlugin extends Plugin throw new \RuntimeException('One of the required plugins is missing or not enabled'); } + // Double check we have system.yaml and site.yaml + $config_files[] = $this->grav['locator']->findResource('user://config') . '/system.yaml'; + $config_files[] = $this->grav['locator']->findResource('user://config') . '/site.yaml'; + foreach ($config_files as $config_file) { + if (!file_exists($config_file)) { + touch($config_file); + } + } + + + // Decide admin template and route. $path = trim(substr($this->uri->route(), strlen($this->base)), '/'); $this->template = 'dashboard';