From f92665b3e2db719482ab7bb2966f2cb9e6024d54 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 26 May 2021 17:08:40 +0700 Subject: [PATCH 1/2] Use variable for Config/Paths config to reduce repetitive definition --- public/index.php | 3 ++- spark | 3 ++- user_guide_src/source/general/managing_apps.rst | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/public/index.php b/public/index.php index cd60baeb11eb..77373025f96d 100644 --- a/public/index.php +++ b/public/index.php @@ -17,8 +17,9 @@ // Load our paths config file // This is the line that might need to be changed, depending on your folder structure. -require realpath(FCPATH . '../app/Config/Paths.php') ?: FCPATH . '../app/Config/Paths.php'; +$pathsConfig = FCPATH . '../app/Config/Paths.php'; // ^^^ Change this if you move your application folder +require realpath($pathsConfig) ?: $pathsConfig; $paths = new Config\Paths(); diff --git a/spark b/spark index c4ad645a366b..f62aeddb2978 100755 --- a/spark +++ b/spark @@ -33,8 +33,9 @@ if (strpos(PHP_SAPI, 'cgi') === 0) define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR); // Load our paths config file -require realpath('app/Config/Paths.php') ?: 'app/Config/Paths.php'; +$pathsConfig = 'app/Config/Paths.php'; // ^^^ Change this line if you move your application folder +require realpath($pathsConfig) ?: $pathsConfig; $paths = new Config\Paths(); diff --git a/user_guide_src/source/general/managing_apps.rst b/user_guide_src/source/general/managing_apps.rst index 3f412c8fa886..172c017b2233 100644 --- a/user_guide_src/source/general/managing_apps.rst +++ b/user_guide_src/source/general/managing_apps.rst @@ -23,14 +23,15 @@ they can find the ``Paths`` configuration file: - ``/spark`` runs command line apps; the path is specified on or about line 36:: - require realpath('app/Config/Paths.php') ?: 'app/Config/Paths.php'; - // ^^^ Change this if you move your application folder + $pathsConfig = 'app/Config/Paths.php'; + // ^^^ Change this line if you move your application folder - ``/public/index.php`` is the front controller for your webapp; the config path is specified on or about line 20:: - require realpath(FCPATH . '../app/Config/Paths.php') ?: FCPATH . '../app/Config/Paths.php'; + // This is the line that might need to be changed, depending on your folder structure. + $pathsConfig = FCPATH . '../app/Config/Paths.php'; // ^^^ Change this if you move your application folder From d60a5b79864ac5ce5384f4be6c813bf4efb2f78d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 26 May 2021 17:15:13 +0700 Subject: [PATCH 2/2] doc fix --- user_guide_src/source/general/managing_apps.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/user_guide_src/source/general/managing_apps.rst b/user_guide_src/source/general/managing_apps.rst index 172c017b2233..c1781e032fa0 100644 --- a/user_guide_src/source/general/managing_apps.rst +++ b/user_guide_src/source/general/managing_apps.rst @@ -30,7 +30,6 @@ they can find the ``Paths`` configuration file: - ``/public/index.php`` is the front controller for your webapp; the config path is specified on or about line 20:: - // This is the line that might need to be changed, depending on your folder structure. $pathsConfig = FCPATH . '../app/Config/Paths.php'; // ^^^ Change this if you move your application folder