forked from craftcms/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_bootstrap.php
More file actions
31 lines (24 loc) · 1.29 KB
/
Copy path_bootstrap.php
File metadata and controls
31 lines (24 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
use craft\test\TestSetup;
ini_set('date.timezone', 'UTC');
date_default_timezone_set('UTC');
define('CRAFT_ROOT_PATH', dirname(__DIR__));
// Use the current installation of Craft
const CRAFT_TESTS_PATH = __DIR__;
const CRAFT_STORAGE_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_craft' . DIRECTORY_SEPARATOR . 'storage';
const CRAFT_TEMPLATES_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_craft' . DIRECTORY_SEPARATOR . 'templates';
const CRAFT_CONFIG_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_craft' . DIRECTORY_SEPARATOR . 'config';
const CRAFT_SECRETS_PATH = CRAFT_CONFIG_PATH . '/secrets.php';
const CRAFT_MIGRATIONS_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_craft' . DIRECTORY_SEPARATOR . 'migrations';
const CRAFT_TRANSLATIONS_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_craft' . DIRECTORY_SEPARATOR . 'translations';
define('CRAFT_VENDOR_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor');
$devMode = true;
$compiledTemplates = CRAFT_STORAGE_PATH . DIRECTORY_SEPARATOR . 'runtime' . DIRECTORY_SEPARATOR . 'compiled_classes';
if (is_dir($compiledTemplates)) {
foreach (new DirectoryIterator($compiledTemplates) as $file) {
if (!$file->isDot() && $file->getExtension() === 'php') {
include $compiledTemplates . DIRECTORY_SEPARATOR . $file;
}
}
}
TestSetup::configureCraft();