diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Core/ObjectStorage/FileStorage.php | 2 | ||||
-rw-r--r-- | app/Core/Template.php | 5 | ||||
-rw-r--r-- | app/constants.php | 8 |
3 files changed, 8 insertions, 7 deletions
diff --git a/app/Core/ObjectStorage/FileStorage.php b/app/Core/ObjectStorage/FileStorage.php index 683a9e7f..dd049ca2 100644 --- a/app/Core/ObjectStorage/FileStorage.php +++ b/app/Core/ObjectStorage/FileStorage.php @@ -140,7 +140,7 @@ class FileStorage implements ObjectStorageInterface */ private function createFolder($key) { - $folder = strpos($key, '/') !== false ? $this->path.DIRECTORY_SEPARATOR.dirname($key) : $this->path; + $folder = strpos($key, DIRECTORY_SEPARATOR) !== false ? $this->path.DIRECTORY_SEPARATOR.dirname($key) : $this->path; if (! is_dir($folder) && ! mkdir($folder, 0755, true)) { throw new ObjectStorageException('Unable to create folder: '.$folder); diff --git a/app/Core/Template.php b/app/Core/Template.php index 002b20b1..ce2884a7 100644 --- a/app/Core/Template.php +++ b/app/Core/Template.php @@ -84,9 +84,10 @@ class Template extends Helper if (strpos($template_name, ':') !== false) { list($plugin, $template) = explode(':', $template_name); - $path = __DIR__.'/../../plugins/'.ucfirst($plugin).'/Template/'.$template.'.php'; + $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'; + $path .= DIRECTORY_SEPARATOR.ucfirst($plugin).DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.$template.'.php'; } else { - $path = __DIR__.'/../Template/'.$template_name.'.php'; + $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Template'.DIRECTORY_SEPARATOR.$template_name.'.php'; } return $path; diff --git a/app/constants.php b/app/constants.php index 5010dacd..218d8f78 100644 --- a/app/constants.php +++ b/app/constants.php @@ -2,10 +2,10 @@ // Enable/disable debug defined('DEBUG') or define('DEBUG', false); -defined('DEBUG_FILE') or define('DEBUG_FILE', __DIR__.'/../data/debug.log'); +defined('DEBUG_FILE') or define('DEBUG_FILE', __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'debug.log'); // Plugin directory -defined('PLUGINS_DIR') or define('PLUGINS_DIR', __DIR__.'/../plugins'); +defined('PLUGINS_DIR') or define('PLUGINS_DIR', __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'plugins'); // Application version defined('APP_VERSION') or define('APP_VERSION', 'master'); @@ -14,7 +14,7 @@ defined('APP_VERSION') or define('APP_VERSION', 'master'); defined('DB_DRIVER') or define('DB_DRIVER', 'sqlite'); // Sqlite configuration -defined('DB_FILENAME') or define('DB_FILENAME', 'data/db.sqlite'); +defined('DB_FILENAME') or define('DB_FILENAME', 'data'.DIRECTORY_SEPARATOR.'db.sqlite'); // Mysql/Postgres configuration defined('DB_USERNAME') or define('DB_USERNAME', 'root'); @@ -93,7 +93,7 @@ defined('ENABLE_XFRAME') or define('ENABLE_XFRAME', true); defined('ENABLE_SYSLOG') or define('ENABLE_SYSLOG', true); // Default files directory -defined('FILES_DIR') or define('FILES_DIR', 'data/files/'); +defined('FILES_DIR') or define('FILES_DIR', 'data'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR); // Escape html inside markdown text defined('MARKDOWN_ESCAPE_HTML') or define('MARKDOWN_ESCAPE_HTML', true); |