Merge pull request #6266 from sminnee/src-folder
Move code files into the src/ folder. Fixes #6098
@ -63,6 +63,7 @@ script:
|
||||
- "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/behat @cms --config cms/tests/behat/behat.yml; fi"
|
||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run test; fi"
|
||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run lint; fi"
|
||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run build; fi"
|
||||
- "if [ \"$PHPUNIT_COVERAGE_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then phpdbg -qrr ./vendor/bin/phpunit --coverage-clover=coverage.xml; fi"
|
||||
- "if [ \"$PHPUNIT_COVERAGE_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi"
|
||||
|
||||
|
@ -11,7 +11,7 @@ DatabaseAdapterRegistry::register(
|
||||
'class' => 'MySQLDatabase',
|
||||
'module' => 'framework',
|
||||
'title' => 'MySQL 5.0+ (using MySQLi)',
|
||||
'helperPath' => __DIR__ . '/Dev/Install/MySQLDatabaseConfigurationHelper.php',
|
||||
'helperPath' => __DIR__ . '/src/Dev/Install/MySQLDatabaseConfigurationHelper.php',
|
||||
'helperClass' => MySQLDatabaseConfigurationHelper::class,
|
||||
'supported' => class_exists('MySQLi'),
|
||||
'missingExtensionText' =>
|
||||
@ -27,7 +27,7 @@ DatabaseAdapterRegistry::register(
|
||||
'class' => 'MySQLPDODatabase',
|
||||
'module' => 'framework',
|
||||
'title' => 'MySQL 5.0+ (using PDO)',
|
||||
'helperPath' => __DIR__ . '/Dev/Install/MySQLDatabaseConfigurationHelper.php',
|
||||
'helperPath' => __DIR__ . '/src/Dev/Install/MySQLDatabaseConfigurationHelper.php',
|
||||
'helperClass' => MySQLDatabaseConfigurationHelper::class,
|
||||
'supported' => (class_exists('PDO') && in_array('mysql', PDO::getAvailableDrivers())),
|
||||
'missingExtensionText' =>
|
||||
|
@ -38,21 +38,22 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"SilverStripe\\Admin\\": "admin/code/",
|
||||
"SilverStripe\\Assets\\": "Assets/",
|
||||
"SilverStripe\\Control\\": "Control/",
|
||||
"SilverStripe\\Core\\": "Core/",
|
||||
"SilverStripe\\Dev\\": "Dev/",
|
||||
"SilverStripe\\Forms\\": "Forms/",
|
||||
"SilverStripe\\i18n\\": "i18n/",
|
||||
"SilverStripe\\Logging\\": "Logging/",
|
||||
"SilverStripe\\ORM\\": "ORM/",
|
||||
"SilverStripe\\Security\\": "Security/",
|
||||
"SilverStripe\\View\\": "View/"
|
||||
"SilverStripe\\Assets\\": "src/Assets/",
|
||||
"SilverStripe\\Control\\": "src/Control/",
|
||||
"SilverStripe\\Core\\": "src/Core/",
|
||||
"SilverStripe\\Dev\\": "src/Dev/",
|
||||
"SilverStripe\\Forms\\": "src/Forms/",
|
||||
"SilverStripe\\i18n\\": "src/i18n/",
|
||||
"SilverStripe\\Logging\\": "src/Logging/",
|
||||
"SilverStripe\\ORM\\": "src/ORM/",
|
||||
"SilverStripe\\Security\\": "src/Security/",
|
||||
"SilverStripe\\View\\": "src/View/"
|
||||
},
|
||||
"files": ["Core/Constants.php"],
|
||||
"files": ["src/Core/Constants.php"],
|
||||
"classmap": ["tests/behat/features/bootstrap"]
|
||||
},
|
||||
"include-path": [
|
||||
"src/",
|
||||
"thirdparty/"
|
||||
],
|
||||
"min-stability": "dev",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"node": "^4.2.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack",
|
||||
"build": "webpack --bail",
|
||||
"watch": "webpack --config ./webpack-dev.config.js --watch",
|
||||
"css": "WEBPACK_CHILD=css webpack",
|
||||
"lock": "npm-shrinkwrap --dev",
|
||||
|
@ -224,7 +224,7 @@ define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR);
|
||||
// Relies on this being in a subdir of the framework.
|
||||
// If it isn't, or is symlinked to a folder with a different name, you must define FRAMEWORK_DIR
|
||||
|
||||
define('FRAMEWORK_PATH', realpath(__DIR__ . '/../'));
|
||||
define('FRAMEWORK_PATH', realpath(__DIR__ . '/../../'));
|
||||
if(strpos(FRAMEWORK_PATH, BASE_PATH) === 0) {
|
||||
define('FRAMEWORK_DIR', trim(substr(FRAMEWORK_PATH, strlen(BASE_PATH)), DIRECTORY_SEPARATOR));
|
||||
$frameworkDirSlashSuffix = FRAMEWORK_DIR ? FRAMEWORK_DIR . '/' : '';
|
||||
@ -248,24 +248,11 @@ if(!defined('ASSETS_PATH')) {
|
||||
define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// INCLUDES
|
||||
|
||||
// Custom include path - deprecated
|
||||
if(defined('CUSTOM_INCLUDE_PATH')) {
|
||||
$includePath = '.' . PATH_SEPARATOR . CUSTOM_INCLUDE_PATH . PATH_SEPARATOR
|
||||
. FRAMEWORK_PATH . PATH_SEPARATOR
|
||||
. FRAMEWORK_PATH . '/parsers' . PATH_SEPARATOR
|
||||
. THIRDPARTY_PATH . PATH_SEPARATOR
|
||||
. get_include_path();
|
||||
} else {
|
||||
$includePath = '.' . PATH_SEPARATOR . FRAMEWORK_PATH . PATH_SEPARATOR
|
||||
. FRAMEWORK_PATH . '/parsers' . PATH_SEPARATOR
|
||||
. THIRDPARTY_PATH . PATH_SEPARATOR
|
||||
. get_include_path();
|
||||
set_include_path(CUSTOM_INCLUDE_PATH . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
set_include_path($includePath);
|
||||
|
||||
/**
|
||||
* Define the temporary folder if it wasn't defined yet
|
||||
*/
|
@ -110,7 +110,7 @@ class DatabaseAdapterRegistry {
|
||||
* Detects all _register_database.php files and invokes them
|
||||
*/
|
||||
public static function autodiscover() {
|
||||
foreach(glob(dirname(__FILE__) . '/../../../*', GLOB_ONLYDIR) as $directory) {
|
||||
foreach(glob(__DIR__ . '/../../../../*', GLOB_ONLYDIR) as $directory) {
|
||||
if(file_exists($directory . '/_register_database.php')) {
|
||||
include_once($directory . '/_register_database.php');
|
||||
}
|
||||
@ -122,7 +122,7 @@ class DatabaseAdapterRegistry {
|
||||
* Called by ConfigureFromEnv.php
|
||||
*/
|
||||
public static function autoconfigure() {
|
||||
foreach(glob(dirname(__FILE__) . '/../../../*', GLOB_ONLYDIR) as $directory) {
|
||||
foreach(glob(__DIR__ . '/../../../../*', GLOB_ONLYDIR) as $directory) {
|
||||
if(file_exists($directory . '/_configure_database.php')) {
|
||||
include_once($directory . '/_configure_database.php');
|
||||
}
|
Before Width: | Height: | Size: 741 B After Width: | Height: | Size: 741 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
@ -7,8 +7,8 @@
|
||||
<title>SilverStripe CMS / Framework Installation</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
<script type="application/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
|
||||
<script type="application/javascript" src="<?php echo FRAMEWORK_NAME; ?>/Dev/Install/client/dist/js/install.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/Dev/Install/client/dist/styles/install.css">
|
||||
<script type="application/javascript" src="<?php echo FRAMEWORK_NAME; ?>/src/Dev/Install/client/dist/js/install.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/src/Dev/Install/client/dist/styles/install.css">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
@ -19,8 +19,8 @@ if (version_compare(phpversion(), '5.5.0', '<')) {
|
||||
echo str_replace(
|
||||
array('$PHPVersion', 'sapphire'),
|
||||
array(phpversion(), FRAMEWORK_NAME),
|
||||
file_get_contents(FRAMEWORK_NAME . "/Dev/Install/php5-required.html"));
|
||||
file_get_contents(__DIR__ . "/php5-required.html"));
|
||||
die();
|
||||
}
|
||||
|
||||
include(FRAMEWORK_NAME . '/Dev/Install/install.php5');
|
||||
include(__DIR__ . '/install.php5');
|
@ -39,10 +39,19 @@ if(function_exists('session_start') && !session_id()) {
|
||||
}
|
||||
|
||||
// require composers autoloader
|
||||
if (file_exists($autoloadPath = dirname(__DIR__) . '/../../vendor/autoload.php')) {
|
||||
require_once $autoloadPath;
|
||||
$autoloadPaths = [
|
||||
__DIR__ . '/../../../vendor/autoload.php', // framework/vendor
|
||||
__DIR__ . '/../../../../vendor/autoload.php', // root vendor
|
||||
];
|
||||
$included = false;
|
||||
foreach($autoloadPaths as $path) {
|
||||
if (file_exists($path)) {
|
||||
$included = true;
|
||||
require_once $path;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!$included) {
|
||||
if (!headers_sent()) {
|
||||
header($_SERVER['SERVER_PROTOCOL'] . " 500 Server Error");
|
||||
header('Content-Type: text/plain');
|
||||
@ -54,8 +63,8 @@ else {
|
||||
$envFileExists = defined('SS_ENVIRONMENT_FILE');
|
||||
$usingEnv = $envFileExists && !empty($_REQUEST['useEnv']);
|
||||
|
||||
require_once FRAMEWORK_NAME . '/Dev/Install/DatabaseConfigurationHelper.php';
|
||||
require_once FRAMEWORK_NAME . '/Dev/Install/DatabaseAdapterRegistry.php';
|
||||
require_once __DIR__ . '/DatabaseConfigurationHelper.php';
|
||||
require_once __DIR__ . '/DatabaseAdapterRegistry.php';
|
||||
|
||||
// Set default locale, but try and sniff from the user agent
|
||||
$defaultLocale = 'en_US';
|
||||
@ -240,7 +249,7 @@ if($installFromCli && ($req->hasErrors() || $dbReq->hasErrors())) {
|
||||
if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq->hasErrors() && $adminConfig['username'] && $adminConfig['password']) {
|
||||
// Confirm before reinstalling
|
||||
if(!$installFromCli && $alreadyInstalled) {
|
||||
include(FRAMEWORK_NAME . '/Dev/Install/config-form.html');
|
||||
include(__DIR__ . '/config-form.html');
|
||||
|
||||
} else {
|
||||
$inst = new Installer();
|
||||
@ -253,7 +262,7 @@ if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq-
|
||||
|
||||
// Show the config form
|
||||
} else {
|
||||
include(FRAMEWORK_NAME . '/Dev/Install/config-form.html');
|
||||
include(__DIR__ . '/config-form.html');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -410,7 +419,7 @@ class InstallRequirements {
|
||||
));
|
||||
|
||||
// Check that we can identify the root folder successfully
|
||||
$this->requireFile(FRAMEWORK_NAME . '/Dev/Install/config-form.html', array("File permissions",
|
||||
$this->requireFile(FRAMEWORK_NAME . '/src/Dev/Install/config-form.html', array("File permissions",
|
||||
"Does the webserver know where files are stored?",
|
||||
"The webserver isn't letting me identify where files are stored.",
|
||||
$this->getBaseDir()
|
||||
@ -1282,7 +1291,7 @@ class Installer extends InstallRequirements {
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Installing SilverStripe...</title>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/Dev/Install/client/dist/styles/install.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/src/Dev/Install/client/dist/styles/install.css"/>
|
||||
<script src="//code.jquery.com/jquery-1.7.2.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@ -1505,7 +1514,7 @@ PHP
|
||||
$this->statusMessage("Checking that friendly URLs work...");
|
||||
$this->checkRewrite();
|
||||
} else {
|
||||
require_once 'core/startup/ParameterConfirmationToken.php';
|
||||
require_once 'Core/Startup/ParameterConfirmationToken.php';
|
||||
$token = new ParameterConfirmationToken('flush');
|
||||
$params = http_build_query($token->params());
|
||||
|
||||
@ -1661,7 +1670,7 @@ TEXT;
|
||||
}
|
||||
|
||||
public function checkRewrite() {
|
||||
require_once 'core/startup/ParameterConfirmationToken.php';
|
||||
require_once 'Core/Startup/ParameterConfirmationToken.php';
|
||||
$token = new ParameterConfirmationToken('flush');
|
||||
$params = http_build_query($token->params());
|
||||
|
@ -1,7 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>PHP 5.5.0 is required</title>
|
||||
<link rel="stylesheet" type="text/css" href="framework/Dev/Install/client/dist/styles/install.css">
|
||||
<link rel="stylesheet" type="text/css" href="framework/src/Dev/Install/client/dist/styles/install.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="BgContainer">
|
@ -26,7 +26,7 @@ class PhpSyntaxTest extends SapphireTest {
|
||||
$settingTests = array('short_open_tag=Off','short_open_tag=On -d asp_tags=On');
|
||||
|
||||
$files = $this->getAllFiles('php');
|
||||
$files[] = FRAMEWORK_PATH.'/dev/install/config-form.html';
|
||||
$files[] = FRAMEWORK_PATH.'/src/Dev/Install/config-form.html';
|
||||
|
||||
foreach($files as $i => $file) {
|
||||
$CLI_file = escapeshellarg($file);
|
||||
|
@ -6,7 +6,7 @@
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\ORM\DB;
|
||||
|
||||
require_once __DIR__ . '/../../Core/Core.php';
|
||||
require_once __DIR__ . '/../../src/Core/Core.php';
|
||||
require_once __DIR__ . '/../FakeController.php';
|
||||
|
||||
global $databaseConfig;
|
||||
|
@ -17,8 +17,8 @@ const PATHS = {
|
||||
FRAMEWORK_THIRDPARTY: './thirdparty',
|
||||
FRAMEWORK_CSS_SRC: './client/src/styles',
|
||||
FRAMEWORK_CSS_DIST: './client/dist/styles',
|
||||
INSTALL_CSS_SRC: './dev/install/client/src/styles',
|
||||
INSTALL_CSS_DIST: './dev/install/client/dist/styles',
|
||||
INSTALL_CSS_SRC: './src/Dev/Install/client/src/styles',
|
||||
INSTALL_CSS_DIST: './src/Dev/Install/client/dist/styles',
|
||||
};
|
||||
|
||||
// Used for autoprefixing css properties (same as Bootstrap Aplha.2 defaults)
|
||||
|