Run the Normalizer.

@return mixed normalized $value
194022
public function run()
    {
        if (! $this->runPreSearch()) {
            return $this->value;
        }

        $matches = [];
        if (preg_match_all('/(?:(?:\A|[^\d])0x[a-f\d]{3,}[a-f\d]*)+/im', $this->value, $matches)) {
            foreach ($matches[0] as $match) {
                $converted = '';
                foreach (str_split($match, 2) as $hexIndex) {
                    if (preg_match('/[a-f\d]{2,3}/i', $hexIndex)) {
                        $converted .= chr(hexdec($hexIndex));
                    }
                }
                $this->value = str_replace($match, $converted, $this->value);
            }
        }
        // take care of hex encoded ctrl chars
        $this->value = preg_replace('/0x\d+/m', ' 1 ', $this->value);

        return $this->value;
    }
1321625
public function normalize()
    {
        $this->input = str_replace(str_split($this->badCharacters), '', $this->input);
        $this->inputLength = mb_strlen($this->input, $this->encoding);

        return $this;
    }
73057
public function run()
    {
        $response = array();

        if (version_compare(PHP_VERSION, self::PHP_MIN, '<')) {
            $response['php_version'] = false;
        } else {
            $response['php_version'] = PHP_VERSION;
        }

        $response['php_ini'] = php_ini_loaded_file();

        $extensions = array(
            'date',
            'json',
            'pcre',
            'phar',
            'reflection',
            'spl',
            'tokenizer',
        );

        foreach ($extensions as $extension) {
            $response[$extension . '_loaded'] = extension_loaded($extension);
        }

        if (extension_loaded('xdebug')) {
            $response['xdebug_loaded']          = true;
            $response['xdebug_profiler_enable'] = ini_get('xdebug.profiler_enable');
        }

        return $response;
    }
796062
public function normalize()
    {
        $this->normalizeSchemeCase();
        $this->normalizeUsernamePercentageEncoding();
        $this->normalizePasswordPercentageEncoding();
        $this->normalizeHostCase();
        $this->normalizePort();
        $this->normalizePathPercentageEncoding();
        $this->normalizeDotSegments();
        $this->normalizeQueryPercentageEncoding();
        $this->normalizeFragmentPercentageEncoding();

        return $this;
    }
1364548
public function run() {

        if (!$this->enable) {
            return;
        }

        $videos = $this->getItems();

        if (empty($videos)) {
            return;
        }

        if (is_array($this->range)) {
            $rangeStart = ($this->range[0] > 0) ? $this->range[0] - 1 : 0 ;
            $rangeEnd = (!isset($this->range[1])) ? 1 : $this->range[1] ;
            $videos = array_slice($videos, $rangeStart, $rangeEnd);
        }

        return $this->renderFile($this->template, [
            'data' => [
                'videos' => $videos,
            ],
        ]);
    }
1284722
public function getNormalized()
    {
        if (!isset($this->normalizedConfig)) {
            $this->normalizedConfig = $this->normalizeConfig($this->config);
        }

        return $this->normalizedConfig;
    }
690247
public function run()
	{
		$this->generator->addRaw(
			array(
				  'location'         => 'example.com',
				  'last_modified'    => '2013-01-28',
				  'change_frequency' => 'weekly',
				  'priority'         => '0.65'
			)
		);

		$this->generator->addRaw(
			array(
				  'location'         => 'example.com/test',
				  'last_modified'    => '2013-12-28',
				  'change_frequency' => 'weekly',
				  'priority'         => '0.95'
			)
		);

		$this->generator->addRaw(
			array(
				  'location'         => 'example.com/test/2',
				  'last_modified'    => '2013-12-25',
				  'change_frequency' => 'weekly',
				  'priority'         => '0.99'
			)
		);

		return $this->generator->generate();
	}
193182
public function actionRun()
    {
        $vars         = get_defined_vars();
        $vars['this'] = Yii::$app;
        $sh           = new \Psy\Shell();
        $sh->setScopeVariables($vars);
        $sh->run();

        return self::EXIT_CODE_NORMAL;
    }
336954
public function run()
    {
        $data = $this->getData();

        $defaultProperties = $data['defaults'];
        $areas = $data['areas'];

        foreach ($areas as $slug => $desc)
        {
            // Handle quick declaration style
            if ( !is_array($desc))
            {
                // $desc is actually the title, build an array
                $desc = array('name' => $desc);
            }

            // Set name and description if not specified
            if ( !isset($desc['name']))
            {
                $desc['name'] = Strings::labelizeSlug($slug);
            }
            if ( !isset($desc['description']))
            {
                $desc['description'] = '';
            }

            // Set the slug
            $desc['id'] = $slug;

            // Merge with our default and register
            $areaProperties = array_merge($defaultProperties, $desc);

            // Internationalize what has to be internationalized
            $areaProperties['name'] = Strings::translate($areaProperties['name']);
            $areaProperties['description'] = Strings::translate($areaProperties['description']);

            register_sidebar($areaProperties);
        }
    }
958662
public function run()
    {
        try
        {
            $this['triggers']->callTrigger('before-match-request', $this);

            $this['request']->attributes->add(
                $this['router']->matchRequest($this['request'])
            );

            $this['triggers']->callTrigger('before-controller-resolver', $this);

            $this['response'] = $this->controllerResolver();
        }
        catch (ResourceNotFoundException $e)
        {
            $this['response'] = (new Controller($this))->serve404();
        }
        catch (\Exception $e)
        {
            $this['response'] = new Response();
            $this['response']->headers->set('Content-Type', 'text/plain');
            $this['response']->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
            $this['response']->setContent($e->getMessage());
        }

        if ($this['x-frame-options']) {
            $this['response']->headers->set('x-frame-options', $this['x-frame-options']);
        }

        $this['response']->prepare($this['request']);

        $this['triggers']->callTrigger('before-send-response', $this);

        $this['response']->send();
    }
739941
public function run()
    {
        if ($this->hasModel()) {
            $replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
        } else {
            $replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
        }

        $replace['{button}'] = Html::tag($this->buttonTag, $this->buttonName, $this->buttonOptions);
        $replace['{reset-button}'] = Html::tag($this->resetButtonTag, $this->resetButtonName, $this->resetButtonOptions);

        FileInputAsset::register($this->view);

        if (!empty($this->callbackBeforeInsert)) {
            $this->view->registerJs('
                $("#' . $this->options['id'] . '").on("fileInsert", ' . $this->callbackBeforeInsert . ');'
            );
        }

        $modal = $this->renderFile('@vendor/ut8ia/yii2-filemanager/views/file/modal.php', [
            'inputId' => $this->options['id'],
            'btnId' => $this->buttonOptions['id'],
            'frameId' => $this->options['id'] . '-frame',
            'frameSrc' => Url::to($this->frameSrc), 
            'thumb' => $this->thumb,
            'imageContainer' => $this->imageContainer,
            'pasteData' => $this->pasteData,
        ]);

        return strtr($this->template, $replace) . $modal;
    }
130538
public final function run()
    {
        $this->registerServices();
        $this->registerCommands();
        return $this->symfonyApplication->run($this->input, $this->output);
    }
969696
public function run() {
		$cwd = $this->cwd;

		$descriptors = array(
			0 => STDIN,
			1 => array( 'pipe', 'w' ),
			2 => array( 'pipe', 'w' ),
		);

		$proc = proc_open( $this->command, $descriptors, $pipes, $cwd, $this->env );

		$stdout = stream_get_contents( $pipes[1] );
		fclose( $pipes[1] );

		$stderr = stream_get_contents( $pipes[2] );
		fclose( $pipes[2] );

		return new ProcessRun( array(
			'stdout' => $stdout,
			'stderr' => $stderr,
			'return_code' => proc_close( $proc ),
			'command' => $this->command,
			'cwd' => $cwd,
			'env' => $this->env
		) );
	}
219726
public function run()
	{
		$this->say('Updating ' . $this->getJConfig()->extension . " to " . $this->getJConfig()->version);

		// Reusing the header config here
		$exclude = explode(",", trim($this->getJConfig()->header->exclude));

		$path      = realpath($this->getJConfig()->source);
		$fileTypes = explode(",", trim($this->getJConfig()->header->files));

		$changedFiles = 0;

		foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path)) as $filename)
		{
			if (substr($filename, 0, 1) == '.')
			{
				continue;
			}

			$file = new \SplFileInfo($filename);

			if (!in_array($file->getExtension(), $fileTypes))
			{
				continue;
			}

			// Skip directories in exclude list
			if (isset($exclude) && count($exclude))
			{
				$relative = str_replace(realpath($path), "", $file->getPath());

				// It is possible to have multiple exclude directories
				foreach ($exclude as $e)
				{
					if (stripos($relative, $e) !== false)
					{
						$this->say("Excluding " . $filename);
						continue 2;
					}
				}
			}

			// Load the file
			$fileContents = file_get_contents($file->getRealPath());

			if (preg_match('#__DEPLOY_VERSION__#', $fileContents))
			{
				$fileContents = preg_replace('#__DEPLOY_VERSION__#', $this->getJConfig()->version, $fileContents);

				$this->say('Updating file: ' . $file->getRealPath());

				file_put_contents($file->getRealPath(), $fileContents);

				$changedFiles++;
			}
		}

		$this->say('Updated ' . $changedFiles . ' files');

		return true;
	}
839920
public function run()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;

        $id = Yii::$app->request->post('id', 0);
        $languageId = Yii::$app->request->post('language_id', Yii::$app->language);

        $languageTranslate = LanguageTranslate::findOne(['id' => $id, 'language' => $languageId]) ?:
            new LanguageTranslate(['id' => $id, 'language' => $languageId]);

        $languageTranslate->translation = Yii::$app->request->post('translation', '');
        if ($languageTranslate->validate() && $languageTranslate->save()) {
            $generator = new Generator($this->controller->module, $languageId);

            $generator->run();
        }

        return $languageTranslate->getErrors();
    }
900734
protected function normalizeDirArray()
    {
        if (!isset($this->dir['iterate'])) {
            $this->dir['iterate'] = self::DEFAULT_ITERATE;
        }
        if (!isset($this->dir['path'])) {
            $this->dir['path'] = self::DEFAULT_PATH;
        }
        if (!isset($this->dir['recursive'])) {
            $this->dir['recursive'] = self::DEFAULT_RECURSIVE;
        }
    }
1223942
public function run()
    {
        $isPost = $_SERVER["REQUEST_METHOD"] == 'POST';
        $src    = $_SERVER["REQUEST_METHOD"] == 'POST' ? $_POST : $_GET;
        $cmd    = isset($src['cmd']) ? $src['cmd'] : '';
        $args   = array();

        if (!function_exists('json_encode')) {
            $error = $this->elFinder->error(elFinder::ERROR_CONF, elFinder::ERROR_CONF_NO_JSON);
            $this->output(array('error' => '{"error":["'.implode('","', $error).'"]}', 'raw' => true));
        }

        if (!$this->elFinder->loaded()) {
            $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_CONF, elFinder::ERROR_CONF_NO_VOL), 'debug' => $this->elFinder->mountErrors));
        }

        // telepat_mode: on
        if (!$cmd && $isPost) {
            $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_UPLOAD, elFinder::ERROR_UPLOAD_TOTAL_SIZE), 'header' => 'Content-Type: text/html'));
        }
        // telepat_mode: off

        if (!$this->elFinder->commandExists($cmd)) {
            $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_UNKNOWN_CMD)));
        }

        // collect required arguments to exec command
        foreach ($this->elFinder->commandArgsList($cmd) as $name => $req) {
            $arg = $name == 'FILES'
                ? $_FILES
                : (isset($src[$name]) ? $src[$name] : '');

            if (!is_array($arg)) {
                $arg = trim($arg);
            }
            if ($req && (!isset($arg) || $arg === '')) {
                $this->output(array('error' => $this->elFinder->error(elFinder::ERROR_INV_PARAMS, $cmd)));
            }
            $args[$name] = $arg;
        }

        $args['debug'] = isset($src['debug']) ? !!$src['debug'] : false;

        $this->output($this->elFinder->exec($cmd, $args));
    }