Obtains suitable name for media. Uses specified name if there is one,
otherwise makes one up.
@param string $name User-specified name ('' if none)
@param array $urls Array of moodle_url used to make up name
@return string Name
16789
protected function get_name($name, $urls) {
        // If there is a specified name, use that.
        if ($name) {
            return $name;
        }

        // Get filename of first URL.
        $url = reset($urls);
        $name = core_media_manager::instance()->get_filename($url);

        // If there is more than one url, strip the extension as we could be
        // referring to a different one or several at once.
        if (count($urls) > 1) {
            $name = preg_replace('~\.[^.]*$~', '', $name);
        }

        return $name;
    }
299465
public function name($name){
        return isset($this->routes[$name]) ? $this->routes[$name] : false;
    }
924693
public function staticRef($name, $params = null)
    {
        $name = (string)$name;
        if (!isset($this->static_refs[$name])) {
            try {
                $this->static_refs[$name] = $this->provider->url($name);
            } catch (UnsupportedException $e) {
                $this->static_refs[$name] = '/[static_reference: ' . $name . ']';
            }
        }

        $ret = $this->static_refs[$name];
        if ($params) {
            $ret .= '?' . http_build_query($params, 0, '&');
        }

        return $ret;
    }
420132
public function post(string $name): string {
        if (!isset($this->post[$name])) {
            return "";
        }
        return $this->post[$name];
    }
1116737
public static function url($name, $parameters = []) {
		return URequest::getUrl ( self::getRouteByName ( $name, $parameters, false ) );
	}
1276845
protected function createClassName(string $name): string
    {
        $result = str_replace('_', ' ', $name);

        return str_replace(' ', '', ucwords($result));
    }
805156
public static function get(string $name)
    {
        return (isset($_GET[$name]) && $_GET[$name] != '') ? $_GET[$name] : '';
    }
1215827
public function get(string $name): string
    {
        $name = strtolower($name);
        return isset($this->headers[$name]) ? $this->headers[$name] : '';
    }
194767
public function name(?string $name = null, ?bool $extension = false)
  {
    if ($name !== null) {
      $this->info['name'] = $name . ($extension ? '.' . pathinfo($this->info['name'], PATHINFO_EXTENSION) : '');
      return $this;
    }

    return $this->info['name'];
  }
1269824
public static function request($name)
    {
        if (app()->config->get('request.csrf')) {
            $name = self::hash($name);
        }

        return $name;
    }
864552
private function _parseUrl($name)
    {
        if (isset($_GET[$name])) {
            return explode('/', filter_var(rtrim($_GET[$name], '/'), FILTER_SANITIZE_URL));
        }

        return false;
    }
538224
static public function url($name, $value=null, $settings=[])
    {
        $settings['media_type'] = 'url';
        $settings['with_input'] = isset($settings['with_input']) ? $settings['with_input'] : 'text';
        return static::select($name, $value, $settings);
    }
1073228
protected function normalizeName($name)
    {
        $name = strtr(strtolower($name), '_', '-');

        if (strpos($name, 'http-') === 0) {
            $name = substr($name, 5);
        }

        return $name;
    }
784173
public function server(string $name): string {
        if (!isset($this->server[$name])) {
            return "";
        }
        return $this->server[$name];
    }
1225002
public function setName(string $name): string
    {
        $this->current->setName($this->prefix . $name);

        return $this->getName();
    }
1144733
protected function getResourcePrefix($name)
	{
		$segments = explode('/', $name);

		// To get the prefix, we will take all of the name segments and implode them on
		// a slash. This will generate a proper URI prefix for us. Then we take this
		// last segment, which will be considered the final resources name we use.
		$prefix = implode('/', array_slice($segments, 0, -1));

		return array($segments[count($segments) - 1], $prefix);
	}
525549
private function parse_name($name) {
        $bits = explode('/', $name);
        $name = array_pop($bits);
        $plugin = '';
        if ($bits) {
            $plugin = array_pop($bits);
            if ($plugin === 'moodle') {
                $plugin = '';
            }
        }
        return 's_'.$plugin.'_'.$name;
    }