<commit_before><?php
/**
 * Return application instance with development setup
 *
 * @global $mode
 *
 */

use BEAR\Package\Dev\Dev;

error_reporting(E_ALL);
ini_set('display_errors', 1);

require dirname(__DIR__) . '/bootstrap.php';

// fatal error handler
Dev::registerFatalErrorHandler();

// syntax error instant edit
Dev::registerSyntaxErrorEdit();

// exception handler
$logDir = dirname(dirname(__DIR__)) . '/data/log';
Dev::registerExceptionHandler($logDir);

// console args
$mode = isset($argv[3]) ? $argv[3] : $mode;
$app = require dirname(__DIR__) . '/instance.php';

// Use cli parameter for routing (web.php get /)
if (PHP_SAPI === 'cli') {
    $app->router->setArgv($argv);
} else {
    $app->router->setGlobals($GLOBALS);
    $argv = [];
}

$dev = new Dev($argv);

// direct file for built in web server
if ($dev->directAccessFile() === false) {
    return false;
}

// /dev web service
$dev->setApp($app)->webService();

return $app;
<commit_msg>suppress xhprof warning<commit_after><?php
/**
 * Return application instance with development setup
 *
 * @global $mode
 *
 */

use BEAR\Package\Dev\Dev;

error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('xhprof.output_dir', sys_get_temp_dir());

require dirname(__DIR__) . '/bootstrap.php';

// fatal error handler
Dev::registerFatalErrorHandler();

// syntax error instant edit
Dev::registerSyntaxErrorEdit();

// exception handler
$logDir = dirname(dirname(__DIR__)) . '/data/log';
Dev::registerExceptionHandler($logDir);

// console args
$mode = isset($argv[3]) ? $argv[3] : $mode;
$app = require dirname(__DIR__) . '/instance.php';

// Use cli parameter for routing (web.php get /)
if (PHP_SAPI === 'cli') {
    $app->router->setArgv($argv);
} else {
    $app->router->setGlobals($GLOBALS);
    $argv = [];
}

$dev = new Dev($argv);

// direct file for built in web server
if ($dev->directAccessFile() === false) {
    return false;
}

// /dev web service
$dev->setApp($app)->webService();

return $app;

{'fraction_non_alphanumeric': 0.1797583081570997, 'fraction_numerical': 0.0030211480362537764, 'mean_word_length': 4.399456521739131, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1775762', 'n_tokens_mistral': 667, 'n_tokens_neox': 662, 'n_words': 158}