[array_direct_father 获取直接父级别]
@param  [type] $input   [输入级别]
@param  [type] $total   [分类好的数组]
@param  string $pidname [pid名]
@param  string $subname [子分类名]
@return [type]          [返回,未找到返回false]
323369
public static function array_direct_father($input,$total,$pidname='pid',$subname='sub'){
        if($input==0){
            return false;
        }
        foreach ($total as $key => $value) {
            if($value['id']==$input){
                if(isset($value[$subname])&&$value[$subname]){
                    unset($value[$subname]);
                }
                return $value;
            }else{
                if(isset($value[$subname])&&$value[$subname]){
                    $result =self::array_direct_father($input,$value[$subname],$pidname,$subname);
                    if(is_array($result) && $result){
                        return $result;
                    }
                }
            }
        }
        return false;
    }
883727
public function input($filename, $input)
    {
        if (substr($filename, strlen($this->_settings['ext']) * -1) !== $this->_settings['ext']) {
            return $input;
        }

        $tmpfile = tempnam(TMP, 'asset_compress_less');
        $this->_generateScript($tmpfile, $input);

        $bin = $this->_settings['node'] . ' ' . $tmpfile;
        $env = array('NODE_PATH' => $this->_settings['node_path']);
        $return = $this->_runCmd($bin, '', $env);
        unlink($tmpfile);
        return $return;
    }
807865
protected function execute(InputInterface $input, OutputInterface $output): bool
    {
        $name = $input->getArgument('name');
        $aggregated = $this->outputsAggregator->getAggregated($name);
        if ($aggregated instanceof AbstractOutput) {
            try {
                return $aggregated->apply();
            } catch (\Exception $e) {
                $output->writeln($e->getMessage());
                return false;
            }
        } else {
            $output->writeln('This output does not exists');
        }

        return true;
    }
741836
private function withParam( string$input )
	{
		return str_replace('$_FLAG_$',"__HTSL_CTRL_FLAG_{$this->id}__",preg_replace_callback('/(?<!%)%s((?:\\/.+?(?<!\\\\)\\/.+?(?<!\\\\)\\/)+)?/',function( array$matches ){
			$param= $this->param;

			if( isset($matches[1]) ){
				array_map(...[
					function($replacer)use(&$param){
						list($pattern,$replacement,)= preg_split('/(?<!\\\\)\\//',$replacer);
						$param= preg_replace(...[
							"/$pattern/",
							preg_replace('/^\\\\_$/','',$replacement),
							$param,
						]);
					},
					preg_split(
						'/(?<!\\\\)\\/\\//'
						,
						trim($matches[1],'/')
					),
				]);
			}
			return $param;
		},$input));
	}
1259806
protected function execute(InputInterface $input, OutputInterface $output)
    {
        // {{
        $this->title('配置信息');
        // }}

        $this->treeView(Config::get(''));
        $this->newLine();

        return 0;
    }
842899
private function fromCompactSerializationToSerialization($input)
    {
        $parts = explode('.', $input);
        switch (count($parts)) {
            case 3:
                return $this->fromCompactSerializationSignatureToSerialization($parts);
            case 5:
                return $this->fromCompactSerializationRecipientToSerialization($parts);
            default:
                throw new \InvalidArgumentException('Unsupported input');
        }
    }
1212202
public function compile($input, $path = null)
    {
        $compileEvent = new CompileEvent($input, $path ?: $this->getOption('filename'));
        $this->trigger($compileEvent);

        $input = $compileEvent->getInput();
        $path = $compileEvent->getPath();
        $this->importPaths = [];
        $includes = [];
        foreach ($this->getOption('includes') as $include) {
            $includes[] = $this->compileDocument(file_get_contents($include), $include);
        }

        $element = $this->compileDocument($input, $path);

        foreach (array_reverse($includes) as $include) {
            $element->prependChild($include);
        }

        $output = $this->getFormatter()->format($element);
        $output = $this->getFormatter()->formatDependencies().$output;

        $outputEvent = new OutputEvent($compileEvent, $output);
        $this->trigger($outputEvent);

        return $outputEvent->getOutput();
    }
253672
public static function array_cate_as_sequence($input,&$output,$pid=0,$pidname='pid'){

        foreach ($input as $k => $v) {
            if ($v[$pidname]==$pid){
                unset($input[$k]);
                $output[]= $v;
                self::array_cate_as_sequence($input,$output,$v['id'],$pidname);
            }
        }
        return $output;
    }
153293
private function parse($input)
    {
        $in_comment = false;

        $in_single_quote = false;
        $in_double_quote = false;

        $skip_char = [
            '{', '}', '[', ']', '>',
            '(', ')', ':', ';', ',',
            '+', '=', '~', '"', "'"
        ];

        $input = str_replace(["\r\n", "\r"], "\n", $input);
        $output = '';

        for ($i = 0;$i < strlen($input);$i++) {
            $char = substr($input, $i, 1);
            $pre_input_char = $i != 0 ? substr($input, $i - 1, 1) : null;
            $pre_output_char = substr($output, -1);

            /**
             * Handle comment block and check end tag
             */
            if ($in_comment) {
                if ('*/' === $pre_input_char . $char) {
                    $in_comment = false;
                }

                continue;
            }

            /**
             * Handle quote block and check end tag
             */
            if ($in_single_quote) {
                if ("'" === $char && '\\' !== $pre_output_char) {
                    $in_single_quote = false;
                }

                $output .= $char;
                continue;
            }

            if ($in_double_quote) {
                if ('"' === $char && '\\' !== $pre_output_char) {
                    $in_double_quote = false;
                }

                $output .= $char;
                continue;
            }

            /**
             * Check start tag of comment block
             */
            if ('/*' === $pre_output_char . $char) {
                $in_comment = true;

                $output = substr($output, 0, strlen($output) - 1);
                continue;
            }

            /**
             * Check start tag of quote block
             */
            if ("'" === $char) {
                if (' ' === $pre_output_char) {
                    $output = substr($output, 0, strlen($output) - 1);
                }

                $in_single_quote = true;

                $output .= $char;
                continue;
            }

            if ('"' === $char) {
                if (' ' === $pre_output_char) {
                    $output = substr($output, 0, strlen($output) - 1);
                }

                $in_double_quote = true;

                $output .= $char;
                continue;
            }

            /**
             * Handle normal block
             */
            if ("\n" === $char || "\t" === $char) {
                continue;
            }

            if (' ' === $char && ' ' === $pre_output_char) {
                continue;
            }

            if (' ' === $char && in_array($pre_output_char, $skip_char)) {
                continue;
            }

            if (' ' === $pre_output_char && in_array($char, $skip_char)) {
                $output = substr($output, 0, strlen($output) - 1);
            }

            if ('(' === $char && 'and' === substr($output, -3)) {
                $char = ' (';
            }

            $output .= $char;
        }

        return trim($output);
    }
498907
protected function belongsToSubnet($input): bool
    {
        $range = $this->networkRange;
        $min = sprintf('%032b', ip2long($range['min']));
        $input = sprintf('%032b', ip2long($input));

        return ($input & $range['mask']) === ($min & $range['mask']);
    }
1003187
protected function checkFiles(InputInterface $input, array $files): int
    {
        $filesPerLine = TypeCast::castInt($input->getOption('files-per-line'));
        $totalFiles = count($files);

        /** @var SplFileInfo[] $chunkFiles */
        $chunkFiles = array_chunk($files, $filesPerLine);

        $this->processFiles($chunkFiles, $filesPerLine, $totalFiles);

        return $totalFiles;
    }
1090872
public static function getThumbnails($input, $output, $count = 5, $format = 'png')
    {
        // Round user input
        $count = round($count);

        // Return false if user requests 0 frames or round function fails
        if ($count < 1) 
        {
            return false;
        }

        // Execute thumbnail generator command
        $command = self::getConverterPath().' -i '.$input.' -vf "select=gt(scene\,0.5)" -frames:v '.$count.' -vsync vfr '.$output.'-%02d.'.$format;
        shell_exec($command);
        return true;
    }
911955
private function combine(array $input)
    {
        $inputLength = count($input);
        if (0 === $inputLength) {
            return false;
        }

        foreach ($this->namePrepData->replaceMaps as $namePrepSource => $namePrepTarget) {
            if ($namePrepTarget[0] !== $input[0]) {
                continue;
            }
            if (count($namePrepTarget) !== $inputLength) {
                continue;
            }
            $hit = false;
            foreach ($input as $k2 => $v2) {
                if ($v2 === $namePrepTarget[$k2]) {
                    $hit = true;
                } else {
                    $hit = false;
                    break;
                }
            }
            if ($hit) {
                return $namePrepSource;
            }
        }

        return false;
    }
962911
public static function array_cate_in_sub($input,$total,$pid=0,$pidname='pid',$subname='sub'){

        $result=self::array_cate_as_subarray_killold($input,$pid,$pidname,$subname);
        $total =self::array_cate_as_subarray($total,$pid,$pidname,$subname);

        if($input){
            $pid_input=[];
            $sub=[];
            foreach($input as $key=>$value){
                if(in_array($value[$pidname], $pid_input)){
                    $sub[$value[$pidname]][]=$value;
                }else{
                    $pid_input[]=$value[$pidname];
                    $sub[$value[$pidname]][]=$value;
                }
            }
            foreach ($sub as $key => $value) {

                $result[]=self::array_all_father($key,$total,$value,$pidname,$subname);
            }
        }
        return self::array_cate_merge_father($result,$subname);
    }
1236987
public static function addAbs($input)
    {
        $tmp = 0;
        $sum = 0;
        foreach($input as $tmp){
            $sum = $sum + abs($tmp);
        }
        return $sum;
    }
1280479
public function parentsUntil($input = null, $selector = null): NodeList {
        return $this->_walkPathUntil('parentNode', $input, $selector);
    }
563538
public function getLength($input)
    {
        if (is_scalar($input)) {
            if ($this->countByChars) {
                return mb_strlen($input, $this->charset);
            } else {
                return strlen($input);
            }
        } elseif (is_array($input) || $input instanceof \Countable) {
            return count($input);
        } else {
            return false;
        }
    }