@param string $path
@param array $args
@param bool $echo

@return string
483289
public function img( $path, $args = [], $echo = true ) {
		return $this->assets( $this->get_img_url( $path ), 'include/img', $args, 'src', $echo );
	}
76285
function abspath( $path = false ) {
		if ( ! $path )
			$path = ABSPATH;
		$folder = $this->find_folder( $path );

		// Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
		if ( ! $folder && $this->is_dir('/wp-includes') )
			$folder = '/';
		return $folder;
	}
561264
private function replaceDynamicArgs(string $vars, Route $route, array $args) : string
    {
        return preg_replace_callback('`<([A-Za-z_0-9]+)>`', function ($match) use ($route, $args) {
            if (!isset($args[$match[1]])) {
                throw new \InvalidArgumentException(sprintf(
                    "Invalid route name '%s', missing dynamics controller param '%s'",
                    $route->getName(),
                    $match[1]
                ));
            }

            return str_replace('/', '\\', $args[$match[1]]);
        }, $vars);
    }
275781
public function getUrl($path): string
    {
        \assert('is_string($path)');
        if (strpos($path, ':') === 0) {
            $key = substr($path, 0, strpos($path, '/') ?: \strlen($path));
            $path = $key === $path ? '' : (string)substr($path, \strlen($key));
        } else {
            $key = ':dist';
        }
        if (!isset($this->map[$key])) {
            throw new \InvalidArgumentException(sprintf('No path "%s" for subpackage "%s".', $path, $key));
        }
        return parent::getUrl(substr($key, 1) . $path);
    }
159804
public static function a($path, $text = NULL, $base_path = true, array $attrs = array())
    {
        if($base_path)
            $path = self::getBaseSite() . ltrim($path, '/');
        $attrs['href'] = $path;
            
        return self::tag('a', $text, false, false, $attrs);
    }
1027458
function binary($path) {
        if (function_exists('exec')) {
            exec($path.' -v 2>&1',$out,$ret);
            if ($ret==0 && preg_match('/cli/',@$out[0],$out))
                $this->binary=$path;
        }
        return $this->binary;
    }
517326
function $path(params) {
    if (params == null) {
        return params;
    }
    if (typeof params === 'string') {
        const path = require('path');
        if (path.isAbsolute(params)) {
            return params;
        }

        return path.resolve(process.cwd(), params);
    }
    throw new Error('$path expects a string');
}
646825
public static final function ppath ($path){
		while (!is_dir($path) && strlen($path) > 0){
			$path = preg_replace('/[^\/]+\/?$/', null, $path);
		}

		return !empty($path) ? $path : false;
	}
816853
def echo(*args, **kwargs):
    
    msg = args[:-1]
    path = fs.path(args[-1])
    append = kwargs.pop("append", False)

    if append:
        with open(path, "a") as file:
            print(*msg, file=file, **kwargs)
    else:
        with open(fs.path(path), "w") as file:
            print(*msg, file=file, **kwargs)
477020
public function append($path)
    {
        //argument 1 must be a string
        $argument = Argument::i()->test(1, 'string');

        //each argument will be a path
        $paths = func_get_args();

        //for each path
        foreach ($paths as $i => $path) {
            //check for type errors
            $argument->test($i + 1, $path, 'string');
            //add to path
            $this->data .= $this->format($path);
        }

        return $this;
    }
153978
private function buildCommand($cmd, $args = array()) {
    while(list($name, $data) = each($args)) {
    $safeData = false;
      $filterType = mb_substr($name, 0, 1);
      switch($filterType) {
        case '%':
          $safeData = escapeshellarg($data);
          break;
        case '!':
          $safeData = escapeshellcmd($data);
          break;
        default:
          throw new \phpSec\Exception\InvalidArgumentException('Unknown variable type');
          break;
      }
      if($safeData !== false) {
        $cmd = str_replace($name, $safeData, $cmd);
      }
    }
    return $cmd;
  }
475278
final public static function exec(string $cmd, array $args=[]) {
		foreach ($args as $key => $val)
			$args[$key] = escapeshellarg($val);
		$cmd = vsprintf($cmd, $args);
		exec($cmd, $output, $retcode);
		if ($retcode !== 0)
			return false;
		return $output;
	}
675157
public function asset(string $path, string $assetSite = null): string
    {
        if (strlen($path) == 0) {
            throw new \InvalidArgumentException('Expected non-empty string');
        }

        // if you pass the full URL that contains "//" part, it'll be immediately
        // returned without any kind of building or parsing

        $pos = strpos($path, '//');
        if (($pos !== false && $pos < 10) || substr($path, 0, 2) == '//') {
            return $path;
        }

        $assets = Application::getConfig('application')->get('assets') ?? [];

        if ($path[0] != '/') {
            $path = '/' . $path;
        }

        $url = null;

        if ($assetSite != null) {
            if (isset($assets[$assetSite])) {
                $url = $assets[$assetSite];
            } else {
                $backtrace = debug_backtrace();
                $caller = $backtrace[1]['function'] ?? '[unknown caller]'; // TODO: Possible fix needed
                Log::warning("Asset site {$assetSite} is used in {$caller}, but not set in application config; using first asset site if any");

                if (count($assets) > 0) {
                    $url = array_values($assets)[0];
                }
            }
        } else {
            if (count($assets) > 0) {
                $url = array_values($assets)[0];
            }
        }

        if ($url == null) {
            return static::makeUrl($path);
        } else {
            if (substr($url, -1) != '/') {
                $url .= '/';
            }

            if (substr($path, 0, 1) == '/') {
                $path = substr($path, 1);
            }

            return $url . $path;
        }
    }
1199219
public static function prepareCommand(array $args)
    {
        $return = '*' . \count($args) . "\r\n";
        foreach ($args as $arg) {
            $return .= '$' . \strlen($arg) . "\r\n" . $arg . "\r\n";
        }

        return $return;
    }
1224962
public function execute($path = null)
    {
        $content = '';

        /*
         * Let's first take out strings, comments and regular expressions.
         * All of these can contain JS code-like characters, and we should make
         * sure any further magic ignores anything inside of these.
         *
         * Consider this example, where we should not strip any whitespace:
         * var str = "a   test";
         *
         * Comments will be removed altogether, strings and regular expressions
         * will be replaced by placeholder text, which we'll restore later.
         */
        $this->extractStrings('\'"`');
        $this->stripComments();
        $this->extractRegex();

        // loop files
        foreach ($this->data as $source => $js) {
            // take out strings, comments & regex (for which we've registered
            // the regexes just a few lines earlier)
            $js = $this->replace($js);

            $js = $this->propertyNotation($js);
            $js = $this->shortenBools($js);
            $js = $this->stripWhitespace($js);

            // combine js: separating the scripts by a ;
            $content .= $js.";";
        }

        // clean up leftover `;`s from the combination of multiple scripts
        $content = ltrim($content, ';');
        $content = (string) substr($content, 0, -1);

        /*
         * Earlier, we extracted strings & regular expressions and replaced them
         * with placeholder text. This will restore them.
         */
        $content = $this->restoreExtractedData($content);

        return $content;
    }
972016
public function execute($path, array $args = [], array $envs = [])
    {
        if (false === @pcntl_exec($path, $args, $envs)) {
            throw new RuntimeException('Error when executing command');
        }
    }
286386
public function execute(array $args, array $options = [])
    {
        if (empty($args) || strpos($args[0], '/') < 1) {
            throw new \InvalidArgumentException('please input action');
        }
        Route::setPathInfo(explode('/', trim(trim($args[0], '/\\'))));
        return 'don_not_exit';
    }