|
|
@@ -1,52 +1,24 @@
|
|
|
<?php
|
|
|
-function find_root() {
|
|
|
- $root = dirname(__DIR__);
|
|
|
- if (is_dir($root . '/vendor/cakephp/cakephp')) {
|
|
|
- return $root;
|
|
|
- }
|
|
|
-
|
|
|
- $root = dirname(dirname(__DIR__));
|
|
|
- if (is_dir($root . '/vendor/cakephp/cakephp')) {
|
|
|
- return $root;
|
|
|
- }
|
|
|
-
|
|
|
- $root = dirname(dirname(dirname(__DIR__)));
|
|
|
- if (is_dir($root . '/vendor/cakephp/cakephp')) {
|
|
|
- return $root;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function find_app() {
|
|
|
- if (is_dir(ROOT . '/src')) {
|
|
|
- return 'src';
|
|
|
- }
|
|
|
- return 'App';
|
|
|
-}
|
|
|
-
|
|
|
define('DS', DIRECTORY_SEPARATOR);
|
|
|
-define('ROOT', find_root());
|
|
|
-define('APP_DIR', find_app());
|
|
|
-define('WEBROOT_DIR', 'webroot');
|
|
|
-define('APP', ROOT . DS . APP_DIR . DS);
|
|
|
-define('WWW_ROOT', ROOT . DS . WEBROOT_DIR . DS);
|
|
|
-define('TESTS', ROOT . DS . 'Test' . DS);
|
|
|
+define('ROOT', dirname(__DIR__));
|
|
|
define('TMP', ROOT . DS . 'tmp' . DS);
|
|
|
define('LOGS', TMP . 'logs' . DS);
|
|
|
define('CACHE', TMP . 'cache' . DS);
|
|
|
+define('APP', sys_get_temp_dir());
|
|
|
+define('APP_DIR', 'src');
|
|
|
define('CAKE_CORE_INCLUDE_PATH', ROOT . '/vendor/cakephp/cakephp');
|
|
|
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
|
|
-define('CAKE', CORE_PATH . 'src' . DS);
|
|
|
+define('CAKE', CORE_PATH . APP_DIR . DS);
|
|
|
|
|
|
require ROOT . '/vendor/cakephp/cakephp/src/basics.php';
|
|
|
require ROOT . '/vendor/autoload.php';
|
|
|
|
|
|
Cake\Core\Configure::write('App', ['namespace' => 'App']);
|
|
|
-Cake\Core\Configure::write('debug', 2);
|
|
|
|
|
|
-$TMP = new \Cake\Utility\Folder(TMP);
|
|
|
-$TMP->create(TMP . 'cache/models', 0777);
|
|
|
-$TMP->create(TMP . 'cache/persistent', 0777);
|
|
|
-$TMP->create(TMP . 'cache/views', 0777);
|
|
|
+$Tmp = new \Cake\Utility\Folder(TMP);
|
|
|
+$Tmp->create(TMP . 'cache/models', 0770);
|
|
|
+$Tmp->create(TMP . 'cache/persistent', 0770);
|
|
|
+$Tmp->create(TMP . 'cache/views', 0770);
|
|
|
|
|
|
$cache = [
|
|
|
'default' => [
|
|
|
@@ -70,7 +42,7 @@ $cache = [
|
|
|
|
|
|
Cake\Cache\Cache::config($cache);
|
|
|
|
|
|
-Cake\Core\Plugin::load('Tools', ['path' => './']);
|
|
|
+Cake\Core\Plugin::load('Tools', ['namespace' => 'Dereuromark\\Tools', 'path' => './']);
|
|
|
|
|
|
// Ensure default test connection is defined
|
|
|
if (!getenv('db_class')) {
|