mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Merge pull request #1053 from jim-parry/refactor/directories
Simplify folder paths in bootstrap
This commit is contained in:
commit
488dd49f3c
@ -6,7 +6,7 @@
|
||||
* Modifying these allows you to re-structure your application,
|
||||
* share a system folder between multiple applications, and more.
|
||||
*
|
||||
* All paths are relative to the application's front controller, index.php
|
||||
* All paths are relative to the project's root folder.
|
||||
*/
|
||||
class Paths
|
||||
{
|
||||
@ -19,7 +19,7 @@ class Paths
|
||||
* Include the path if the folder is not in the same directory
|
||||
* as this file.
|
||||
*/
|
||||
public $systemDirectory = '../system';
|
||||
public $systemDirectory = 'system';
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
@ -34,7 +34,7 @@ class Paths
|
||||
*
|
||||
* NO TRAILING SLASH!
|
||||
*/
|
||||
public $applicationDirectory = '../application';
|
||||
public $applicationDirectory = 'application';
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
@ -47,7 +47,7 @@ class Paths
|
||||
* for maximum security, keeping it out of the application and/or
|
||||
* system directories.
|
||||
*/
|
||||
public $writableDirectory = '../writable';
|
||||
public $writableDirectory = 'writable';
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
@ -60,7 +60,7 @@ class Paths
|
||||
* for maximum security, keeping it out of the application and/or
|
||||
* system directories.
|
||||
*/
|
||||
public $testsDirectory = '../tests';
|
||||
public $testsDirectory = 'tests';
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------
|
||||
|
@ -1,13 +1,12 @@
|
||||
<?php
|
||||
|
||||
// Location to the Paths config file.
|
||||
// This should be the only line you need to
|
||||
// edit in this file.
|
||||
$pathsPath = '../application/Config/Paths.php';
|
||||
|
||||
// Path to the front controller (this file)
|
||||
define('FCPATH', __DIR__.DIRECTORY_SEPARATOR);
|
||||
|
||||
// Location of the Paths config file.
|
||||
// This is the first of two lines that might need to be changed, depending on your folder structure.
|
||||
$pathsPath = FCPATH . '../application/Config/Paths.php';
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
* BOOTSTRAP THE APPLICATION
|
||||
@ -24,7 +23,9 @@ chdir(__DIR__);
|
||||
require $pathsPath;
|
||||
$paths = new Config\Paths();
|
||||
|
||||
$app = require rtrim($paths->systemDirectory,DIRECTORY_SEPARATOR) . '/bootstrap.php';
|
||||
// Location of the framework bootstrap file.
|
||||
// This is the second of two lines that might need to be changed, depending on your folder structure.
|
||||
$app = require FCPATH . '../system//bootstrap.php';
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
|
@ -63,7 +63,7 @@ if (! defined('ROOTPATH'))
|
||||
*/
|
||||
if (! defined('APPPATH'))
|
||||
{
|
||||
define('APPPATH', realpath($paths->applicationDirectory).DIRECTORY_SEPARATOR);
|
||||
define('APPPATH', realpath(ROOTPATH . $paths->applicationDirectory).DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +71,7 @@ if (! defined('APPPATH'))
|
||||
*/
|
||||
if (! defined('BASEPATH'))
|
||||
{
|
||||
define('BASEPATH', realpath($paths->systemDirectory).DIRECTORY_SEPARATOR);
|
||||
define('BASEPATH', realpath(ROOTPATH . $paths->systemDirectory).DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -79,7 +79,7 @@ if (! defined('BASEPATH'))
|
||||
*/
|
||||
if (! defined('WRITEPATH'))
|
||||
{
|
||||
define('WRITEPATH', realpath($paths->writableDirectory).DIRECTORY_SEPARATOR);
|
||||
define('WRITEPATH', realpath(ROOTPATH . $paths->writableDirectory).DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,7 +87,7 @@ if (! defined('WRITEPATH'))
|
||||
*/
|
||||
if (! defined('TESTPATH'))
|
||||
{
|
||||
define('TESTPATH', realpath($paths->testsDirectory).DIRECTORY_SEPARATOR);
|
||||
define('TESTPATH', realpath(ROOTPATH . $paths->testsDirectory).DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
use CodeIgniter\Test\FeatureTestCase;
|
||||
|
||||
/**
|
||||
* This relies on a database connection
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class HomeTest extends FeatureTestCase
|
||||
{
|
||||
public function testCanLoadPage()
|
||||
|
0
writable/cache/.htaccess
vendored
Normal file → Executable file
0
writable/cache/.htaccess
vendored
Normal file → Executable file
0
writable/cache/index.html
vendored
Normal file → Executable file
0
writable/cache/index.html
vendored
Normal file → Executable file
0
writable/debugbar/.gitkeep
Normal file → Executable file
0
writable/debugbar/.gitkeep
Normal file → Executable file
0
writable/logs/.htaccess
Normal file → Executable file
0
writable/logs/.htaccess
Normal file → Executable file
0
writable/logs/index.html
Normal file → Executable file
0
writable/logs/index.html
Normal file → Executable file
0
writable/uploads/index.html
Normal file → Executable file
0
writable/uploads/index.html
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user