<commit_before><?php

defined('AK_ENVIRONMENT')   ||  define('AK_ENVIRONMENT',    'testing');
defined('AK_BASE_DIR')      ||  define('AK_BASE_DIR',       str_replace(DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php','', substr(AK_TEST_DIR,0,-5)));
defined('AK_LOG_EVENTS')    ||  define('AK_LOG_EVENTS',     true);

defined('DS')                   || define('DS',                     DIRECTORY_SEPARATOR);
defined('AK_FRAMEWORK_DIR')     || define('AK_FRAMEWORK_DIR',       AK_BASE_DIR.DS.'vendor'.DS.'akelos');
defined('AK_TESTING_NAMESPACE') || define('AK_TESTING_NAMESPACE',   'akelos');
defined('AK_TESTING_URL')       || define('AK_TESTING_URL',   'http://akelos.tests');

include_once AK_FRAMEWORK_DIR.DS.'autoload.php';

if(!AkConfig::getOption('testing_url', false))
AkConfig::setOption('testing_url', AK_TESTING_URL);
AkUnitTestSuite::checkIfTestingWebserverIsAccesible(array('base_path' => AK_TEST_DIR.DS.AK_TESTING_NAMESPACE));
AkUnitTestSuite::createTestingDatabaseIfNotAvailable();
AkUnitTestSuite::ensureTmpDirPermissions();<commit_msg>Ensuring tmp directories have write permission<commit_after><?php

defined('AK_ENVIRONMENT')   ||  define('AK_ENVIRONMENT',    'testing');
defined('AK_BASE_DIR')      ||  define('AK_BASE_DIR',       str_replace(DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php','', substr(AK_TEST_DIR,0,-5)));
defined('AK_LOG_EVENTS')    ||  define('AK_LOG_EVENTS',     true);

defined('DS')                   || define('DS',                     DIRECTORY_SEPARATOR);
defined('AK_FRAMEWORK_DIR')     || define('AK_FRAMEWORK_DIR',       AK_BASE_DIR.DS.'vendor'.DS.'akelos');
defined('AK_TESTING_NAMESPACE') || define('AK_TESTING_NAMESPACE',   'akelos');
defined('AK_TESTING_URL')       || define('AK_TESTING_URL',   'http://akelos.tests');

include_once AK_FRAMEWORK_DIR.DS.'autoload.php';

if(AK_CLI && !AK_WIN){
    // will try to set the right mode for tmp folders, git does not kee trac of this for us
    foreach ((array)glob(AK_BASE_DIR.DS.'tmp'.DS.'*'.DS.'*/') as $__folder){
        `chmod 777 $__folder`;
    }
    unset($__folder);
}

if(!AkConfig::getOption('testing_url', false))
AkConfig::setOption('testing_url', AK_TESTING_URL);
AkUnitTestSuite::checkIfTestingWebserverIsAccesible(array('base_path' => AK_TEST_DIR.DS.AK_TESTING_NAMESPACE));
AkUnitTestSuite::createTestingDatabaseIfNotAvailable();
AkUnitTestSuite::ensureTmpDirPermissions();
{'fraction_non_alphanumeric': 0.160929075072584, 'fraction_numerical': 0.002903359601824969, 'mean_word_length': 5.644628099173554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4420257', 'n_tokens_mistral': 838, 'n_tokens_neox': 818, 'n_words': 99}