<commit_before><?php

namespace luya\web;

use Yii;

/**
 * Luya Request Component to provide a differentiation for frontend/admin context.
 *
 * @author nadar
 */
class Request extends \yii\web\Request
{
    /**
     * @var bool force web request to enable unit tests with simulated web requests
     */
    public $forceWebRequest = false;

    public $cookieValidationKey = 'luya-1.0.0-beta5-cookie-validation-key';
    
    public $parsers = [
        'application/json' => 'yii\web\JsonParser',
    ];

    /**
     * Resolve the current url request and check if admin context.
     *
     * @return bool if admin context available?
     */
    public function isAdmin()
    {
        if ($this->getIsConsoleRequest() && !$this->forceWebRequest) {
            return false;
        }

        $resolver = Yii::$app->composition->getResolvedPathInfo($this);

        $pathInfo = $resolver['route'];
        $parts = explode('/', $pathInfo);
        $first = reset($parts);
        
        if (preg_match('/admin/i', $first, $results)) {<commit_msg>change default cookie validation key<commit_after><?php

namespace luya\web;

use Yii;

/**
 * Luya Request Component to provide a differentiation for frontend/admin context.
 *
 * @author nadar
 */
class Request extends \yii\web\Request
{
    /**
     * @var bool force web request to enable unit tests with simulated web requests
     */
    public $forceWebRequest = false;

    public $cookieValidationKey = <KEY>';
    
    public $parsers = [
        'application/json' => 'yii\web\JsonParser',
    ];

    /**
     * Resolve the current url request and check if admin context.
     *
     * @return bool if admin context available?
     */
    public function isAdmin()
    {
        if ($this->getIsConsoleRequest() && !$this->forceWebRequest) {
            return false;
        }

        $resolver = Yii::$app->composition->getResolvedPathInfo($this);

        $pathInfo = $resolver['route'];
        $parts = explode('/', $pathInfo);
        $first = reset($parts);
        
        if (preg_match('/admin/i', $first, $results)) {
{'fraction_non_alphanumeric': 0.13078758949880667, 'fraction_numerical': 0.0019093078758949881, 'mean_word_length': 2.4817275747508307, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, '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': '1637426', 'n_tokens_mistral': 620, 'n_tokens_neox': 604, 'n_words': 166}