<commit_before><?php defined('C5_EXECUTE') or die("Access Denied.");

/**
 * ----------------------------------------------------------------------------
 * Ensure we're not accessing this file directly.
 * ----------------------------------------------------------------------------
 */
if (basename($_SERVER['PHP_SELF']) == DISPATCHER_FILENAME_CORE) {
    die("Access Denied.");
}

/**
 * ----------------------------------------------------------------------------
 * Import relevant classes.
 * ----------------------------------------------------------------------------
 */
use Concrete\Core\Application\Application;
use Concrete\Core\Asset\AssetList;
use Concrete\Core\Foundation\ClassAliasList;
use Concrete\Core\Foundation\Service\ProviderList;
use Concrete\Core\Permission\Key\Key as PermissionKey;
use Concrete\Core\Support\Facade\Facade;
use Patchwork\Utf8\Bootup;
use Concrete\Core\Config\Config as DatabaseConfig;
use Concrete\Core\Config\Repository as ConfigRepository;
use Concrete\Core\File\Type\TypeList;
use Concrete\Core\Config\ConfigLoader;
use Illuminate\Filesystem\Filesystem;

/**
 * ----------------------------------------------------------------------------
 * Instantiate concrete5.
 * ----------------------------------------------------------------------------
 */
$cms = new Application();
$cms->instance('app', $cms);

/**
 * ----------------------------------------------------------------------------
 * Bind the IOC container to our facades
 * Completely indebted to Taylor Otwell & Laravel for this.
 * ----------------------------------------------------------------------------
 */
Facade::setFacadeApplication($cms);

/**
 * ----------------------------------------------------------------------------
 * Enable Config
 * ----------------------------------------------------------------------------
 */
$file_system = new Filesystem();
$database_config = new DatabaseConfig();
$file_loader = new ConfigLoader($file_system, $database_config);

$db_config = $file_loader->loadStrict(null, 'database');

$environment = isset($db_config['default-connection']) ? ($cms->isRunThroughCommandLineInterface() ? 'cli' : 'default') : 'install';

$cms->instance('config', $config = new ConfigRepository($file_loader, $environment));



/**
 * ----------------------------------------------------------------------------
 * Get App version number
 * ----------------------------------------------------------------------------
 */
define('APP_VERSION', $config->get('app.version'));

/**
 * ----------------------------------------------------------------------------
 * Setup core classes aliases.
 * ----------------------------------------------------------------------------
 */
$list = ClassAliasList::getInstance();
$list->registerMultiple($config->get('app.aliases'));
$list->registerMultiple($config->get('app.facades'));

/**
 * ----------------------------------------------------------------------------
 * Setup the core service groups.
 * ----------------------------------------------------------------------------
 */
$list = new ProviderList($cms);
$list->registerProviders($config->get('app.providers'));

/**
 * ----------------------------------------------------------------------------
 * Setup file cache directories. Has to come after we define services
 * because we use the file service.
 * ----------------------------------------------------------------------------
 */
$cms->setupFilesystem();

/**
 * ----------------------------------------------------------------------------
 * Handle text encoding.
 * ----------------------------------------------------------------------------
 */
Bootup::initAll();

/**
 * ----------------------------------------------------------------------------
 * Registries for theme paths, assets, routes and file types.
 * ----------------------------------------------------------------------------
 */
$assets = $config->get('app.assets', array());
$asset_list = AssetList::getInstance();

foreach ($assets as $asset_handle => $asset_types) {
    foreach ($asset_types as $asset_type => $asset_settings) {
        array_splice($asset_settings, 1, 0, $asset_handle);
        call_user_func_array(array($asset_list, 'register'), $asset_settings);
    }
}

$asset_groups = $config->get('app.asset_groups', array());
foreach ($asset_groups as $group_handle => $group_setting) {
    array_unshift($group_setting, $group_handle);
    call_user_func_array(array($asset_list, 'registerGroup'), $group_setting);
}

$theme_paths = $config->get('app.theme_paths');
foreach ($theme_paths as $route => $theme) {
    Route::setThemeByRoute($route, $theme);
}

$routes = $config->get('app.routes');

foreach ($routes as $route => $route_settings) {
    array_unshift($route_settings, $route);
    call_user_func_array(array('Route', 'register'), $route_settings);
}

$type_list = TypeList::getInstance();
$file_types = $config->get('app.file_types');
foreach ($file_types as $type_name => $type_settings) {
    array_splice($type_settings, 1, 0, $type_name);

    call_user_func_array(array($type_list, 'define'), $type_settings);
}

$importer_attributes = $config->get('app.importer_attributes');
foreach ($importer_attributes as $attribute_name => $attribute_settings) {
    array_unshift($attribute_settings, $attribute_name);
    call_user_func_array(array($type_list, 'defineImporterAttribute'), $attribute_settings);
}


/**
 * ----------------------------------------------------------------------------
 * If we are running through the command line, we don't proceed any further
 * ----------------------------------------------------------------------------
 */
if ($cms->isRunThroughCommandLineInterface()) {
    return $cms;<commit_msg>Convert everything other than assets to app config<commit_after><?php defined('C5_EXECUTE') or die("Access Denied.");

/**
 * ----------------------------------------------------------------------------
 * Ensure we're not accessing this file directly.
 * ----------------------------------------------------------------------------
 */
if (basename($_SERVER['PHP_SELF']) == DISPATCHER_FILENAME_CORE) {
    die("Access Denied.");
}

/**
 * ----------------------------------------------------------------------------
 * Import relevant classes.
 * ----------------------------------------------------------------------------
 */
use Concrete\Core\Application\Application;
use Concrete\Core\Asset\AssetList;
use Concrete\Core\Foundation\ClassAliasList;
use Concrete\Core\Foundation\Service\ProviderList;
use Concrete\Core\Permission\Key\Key as PermissionKey;
use Concrete\Core\Support\Facade\Facade;
use Patchwork\Utf8\Bootup;
use Concrete\Core\Config\Config as DatabaseConfig;
use Concrete\Core\Config\Repository as ConfigRepository;
use Concrete\Core\File\Type\TypeList;
use Concrete\Core\Config\ConfigLoader;
use Illuminate\Filesystem\Filesystem;

/**
 * ----------------------------------------------------------------------------
 * Instantiate concrete5.
 * ----------------------------------------------------------------------------
 */
$cms = new Application();
$cms->instance('app', $cms);

/**
 * ----------------------------------------------------------------------------
 * Bind the IOC container to our facades
 * Completely indebted to Taylor Otwell & Laravel for this.
 * ----------------------------------------------------------------------------
 */
Facade::setFacadeApplication($cms);

/**
 * ----------------------------------------------------------------------------
 * Enable Config
 * ----------------------------------------------------------------------------
 */
$file_system = new Filesystem();
$database_config = new DatabaseConfig();
$file_loader = new ConfigLoader($file_system, $database_config);

$db_config = $file_loader->loadStrict(null, 'database');

$environment = isset($db_config['default-connection']) ? ($cms->isRunThroughCommandLineInterface() ? 'cli' : 'default') : 'install';

$cms->instance('config', $config = new ConfigRepository($file_loader, $environment));



/**
 * ----------------------------------------------------------------------------
 * Get App version number
 * ----------------------------------------------------------------------------
 */
define('APP_VERSION', $config->get('app.version'));

/**
 * ----------------------------------------------------------------------------
 * Setup core classes aliases.
 * ----------------------------------------------------------------------------
 */
$list = ClassAliasList::getInstance();
$list->registerMultiple($config->get('app.aliases'));
$list->registerMultiple($config->get('app.facades'));

/**
 * ----------------------------------------------------------------------------
 * Setup the core service groups.
 * ----------------------------------------------------------------------------
 */
$list = new ProviderList($cms);
$list->registerProviders($config->get('app.providers'));

/**
 * ----------------------------------------------------------------------------
 * Setup file cache directories. Has to come after we define services
 * because we use the file service.
 * ----------------------------------------------------------------------------
 */
$cms->setupFilesystem();

/**
 * ----------------------------------------------------------------------------
 * Handle text encoding.
 * ----------------------------------------------------------------------------
 */
Bootup::initAll();

/**
 * ----------------------------------------------------------------------------
 * Registries for theme paths, assets, routes and file types.
 * ----------------------------------------------------------------------------
 */
$assets = $config->get('app.assets', array());
$asset_list = AssetList::getInstance();

foreach ($assets as $asset_handle => $asset_types) {
    foreach ($asset_types as $asset_type => $asset_settings) {
        array_splice($asset_settings, 1, 0, $asset_handle);
        call_user_func_array(array($asset_list, 'register'), $asset_settings);
    }
}

$asset_groups = $config->get('app.asset_groups', array());
foreach ($asset_groups as $group_handle => $group_setting) {
    array_unshift($group_setting, $group_handle);
    call_user_func_array(array($asset_list, 'registerGroup'), $group_setting);
}

$theme_paths = $config->get('app.theme_paths');
foreach ($theme_paths as $route => $theme) {
    Route::setThemeByRoute($route, $theme);
}

$routes = $config->get('app.routes');

foreach ($routes as $route => $route_settings) {
    array_unshift($route_settings, $route);
    call_user_func_array(array('Route', 'register'), $route_settings);
}

$type_list = TypeList::getInstance();
$file_types = $config->get('app.file_types');
foreach ($file_types as $type_name => $type_settings) {
    array_splice($type_settings, 1, 0, $type_name);

    call_user_func_array(array($type_list, 'define'), $type_settings);
}

$importer_attributes = $config->get('app.importer_attributes');
foreach ($importer_attributes as $attribute_name => $attribute_settings) {
    array_unshift($attribute_settings, $attribute_name);
    call_user_func_array(array($type_list, 'defineImporterAttribute'), $attribute_settings);
}

/**
 * ----------------------------------------------------------------------------
 * If we are running through the command line, we don't proceed any further
 * ----------------------------------------------------------------------------
 */
if ($cms->isRunThroughCommandLineInterface()) {
    return $cms;
{'fraction_non_alphanumeric': 0.4273519163763066, 'fraction_numerical': 0.0012195121951219512, 'mean_word_length': 1.3321145642900671, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, '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': '7037221', 'n_tokens_mistral': 2553, 'n_tokens_neox': 2504, 'n_words': 514}