<commit_before><?php

mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');

// First, do some low level checks, like whether autoload is present, the cache
// folder is writable, etc.
require_once __DIR__ . '/classes/lib.php';
require_once __DIR__ . '/src/Bolt/Configuration/LowlevelChecks.php';

$checker = new Bolt\Configuration\LowlevelChecks;
require_once $checker->autoloadCheck(getcwd());


if (strpos(__DIR__, "/vendor/") !== false) {
    $config = new Bolt\Configuration\Composer(getcwd());
} else {
    $config = new Bolt\Configuration\Standard(__DIR__."/../");
}
$config->verify();
$config->compat();


// Create the 'Bolt application'
$app = new Bolt\Application(array('resources' => $config));


// Initialize the 'Bolt application': Set up all routes, providers, database, templating, etc..
$app->initialize();<commit_msg>Resolve BOLT_PROJECT_ROOT_DIR from parent directory of bootstrap.php, fixes #1526<commit_after><?php

require_once __DIR__ . '/classes/lib.php';
require_once __DIR__ . '/src/Bolt/Configuration/LowlevelChecks.php';

defined('BOLT_PROJECT_ROOT_DIR') or define('BOLT_PROJECT_ROOT_DIR', realpath(__DIR__ . DIRECTORY_SEPARATOR . '..'));

mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');

// First, do some low level checks, like whether autoload is present, the cache
// folder is writable, etc.
$checker = new Bolt\Configuration\LowlevelChecks;
require_once $checker->autoloadCheck(BOLT_PROJECT_ROOT_DIR);


if (strpos(__DIR__, "/vendor/") !== false) {
  $config = new Bolt\Configuration\Composer(BOLT_PROJECT_ROOT_DIR);
} else {
  $config = new Bolt\Configuration\Standard(BOLT_PROJECT_ROOT_DIR);
}
$config->verify();
$config->compat();


// Create the 'Bolt application'
$app = new Bolt\Application(array('resources' => $config));


// Initialize the 'Bolt application': Set up all routes, providers, database, templating, etc..
$app->initialize();
{'fraction_non_alphanumeric': 0.15335801163405605, 'fraction_numerical': 0.004230565838180857, 'mean_word_length': 5.524137931034483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '608430', 'n_tokens_mistral': 626, 'n_tokens_neox': 619, 'n_words': 142}