返回执行脚本名称

<pre>
Example:
请求: http://www.windwork.org/demo/index.php?app=xx
返回: index.php
</pre>

@return string
@throws Exception 当获取失败的时候抛出异常
548915
public function getScript()
    {
        if (($pos = strrpos($this->getScriptUrl(), '/')) === false) {
            $pos = -1;
        }
        
        $script = substr($this->getScriptUrl(), $pos + 1);
        return $script;
    }
942986
public function getCurrentName()
    {
        switch ($this->current) {
            case self::CURRENT_OTHER:
                $currentName = Yii::t('yuncms', 'Other');
                break;
            case self::CURRENT_WORK:
                $currentName = Yii::t('yuncms', 'Work');
                break;
            case self::CURRENT_FREELANCE:
                $currentName = Yii::t('yuncms', 'Freelance');
                break;
            case self::CURRENT_START:
                $currentName = Yii::t('yuncms', 'Start');
                break;
            case self::CURRENT_OUTSOURCE:
                $currentName = Yii::t('yuncms', 'Outsource');
                break;
            case self::CURRENT_JOB:
                $currentName = Yii::t('yuncms', 'Job');
                break;
            case self::CURRENT_STUDENT:
                $currentName = Yii::t('yuncms', 'Student');
                break;
            default:
                throw new \RuntimeException('Your database is not supported!');
        }
        return $currentName;
    }
353942
protected function getExceptionName()
    {
        if ($this->exception instanceof Exception) {
            $name = $this->exception->getName();
        } elseif ($this->exception instanceof ErrorException) {
            $name = $this->exception->getName();
        } else {
            $name = $this->defaultName;
        }
        return $name;
    }
633549
public function getRuntimePath(): string
    {
        if ($this->_runtimePath !== null) {
            return $this->_runtimePath;
        }
        $runtimePath = Yii::getAlias('@runtime');

        if ($runtimePath === false) {
            throw new Exception('There was a problem getting the vendor path.');
        }
        return $this->_runtimePath = FileHelper::normalizePath($runtimePath);
    }
143501
protected function getName(): string
    {
        if (!isset($this->name) || !$this->name) {
            $this->name = @stream_socket_get_name($this->socket, true);
        }
        return $this->name;
    }
229449
public function getUrl()
	{
		throw new \Exception('Dont use me bro.');

		$url = null;

		switch ($this->getResource()) {

			case self::RESOURCE_PAGE:
				$pageData = $this->getPage();

				if ( ! is_null($pageData)) {
					$url = $this->getPageFullPath($pageData);
				}
				break;

			case self::RESOURCE_FILE:
				$file = $this->getFile();

				if ($file instanceof File) {
					$fs = ObjectRepository::getFileStorage($this);
					$url = $fs->getWebPath($file);
				}

				break;

			case self::RESOURCE_LINK:
			case self::RESOURCE_EMAIL:
				$url = $this->getHref();
				break;

//			case self::RESOURCE_RELATIVE_PAGE:
//				$page = $this->getPage();
//
//				if (is_null($page)) {
//					$this->log()->warn("No page ID set or found for relative link #", $this->getId());
//					throw new ResourceNotFoundException("Invalid redirect");
//				}
//
//				$pageChildren = $page->getPublicChildren();
//
//				if ( ! $pageChildren->isEmpty()) {
//					$type = $this->getHref();
//					$relativeChild = null;
//
//					if ($type == self::RELATIVE_FIRST) {
//						$relativeChild = $pageChildren->first();
//					} else {
//						$relativeChild = $pageChildren->last();
//					}
//
//					$url = $this->getPageFullPath($relativeChild);
//				} else {
//					//throw new ResourceNotFoundException('Valid relative redirect child was not found');
//					return null;
//				}
//				break;

			default:
				$this->log()->warn("Unrecognized resource for supra html markup link tag, data: $this");
		}

		return $url;
	}
312245
protected function buildSql()
    {
        $query = $this->getQuery();
        if (
            !isset($query['table']) || empty($query['table'])
            || !isset($query['where']) || empty($query['where'])
        ) {
            throw new Exception(str_cover('"{type}"查询参数不完整', [
                '{type}' => 'delete'
            ]), 101300401);
        }
        return 'DELETE FROM ' . $this->quoteTableName($query['table']) . ' WHERE ' . $query['where'];
    }
456279
private function getOptions()
    {
        $inputString = (string) $this->input;
        $options     = [];

        // Remove the first two arguments from the array (c/call and the name)
        $content = explode(' ', $inputString, 3);
        if (sizeof($content) > 2 && strpos($inputString, '=') === false) {
            throw new \Exception("Option syntax should contain an equal sign. Ex: --executable=php");
        }
        if (sizeof($content) > 2 && strpos($inputString, '--') === false) {
            throw new \Exception("Option syntax should contain double dashes. Ex: --executable=php");
        }

        // Parse out all of the options
        $pieces = explode('--', $content[2]);
        array_shift($pieces);

        foreach ($pieces as $piece) {
            $piece = trim($piece);
            list($name, $value) = explode('=', $piece, 2);

            if (strpos($value, "'[") === 0 && strpos($value, "]'") === (strlen($value) - 2)) {
                $csv   = trim(str_replace(['[', ']'], '', $value), "'");
                $value = str_getcsv($csv, ',');
            }

            $options[$name] = $value;
        }

        return $options;
    }
128790
public function toString()
    {
        if (!$this->getPath()) {
            return '';
        }

        $path = preg_replace('/^\\\/', '', $this->getPath());

        $namespace = $this->getDocBlock()->setTabulation($this->getTabulation())->toString()
            . $this->getTabulationFormatted()
            . 'namespace '
            . $path
            . ';' . PHP_EOL;

        return $namespace;
    }
768315
public function toHeader()
    {
        $out = 'Authorization: OAuth realm=""';
        foreach ($this->parameters as $k => $v) {
            if (substr($k, 0, 5) != "oauth") {
                continue;
            }
            if (is_array($v)) {
                throw new Exception('Arrays not supported in headers');
            }
            $out .= ',' .
                Util::urlencodeRfc3986($k) .
                '="' .
                Util::urlencodeRfc3986($v) .
                '"';
        }
        return $out;
    }
954758
public function getSQL(): string
    {
        if ($this->query === null) {
            throw new Exception('Query wasn\'t set');
        }

        if (is_object($this->query)) {
            if (method_exists($this->query, '__toString')) {
                return $this->query->__toString();
            }
        } else {
            return trim($this->query);
        }

        $className = get_class($this->query);
        throw new Exception("Can not use class={$className} as database query because it can't be used as string");
    }
1172100
public function ToString()
	{
		$result = $this->LocalName;

		if ( ! empty( $this->Prefix ) )
		{
		    $result = $this->Prefix . ':' . $result;
		}
		return $result;
	}
371734
public function getURL()
    {
        phpCAS::traceBegin();
        // the URL is built when needed only
        if ( empty($this->_url) ) {
            $final_uri = '';
            // remove the ticket if present in the URL
            $final_uri = ($this->_isHttps()) ? 'https' : 'http';
            $final_uri .= '://';

            $final_uri .= $this->_getClientUrl();
            $request_uri	= explode('?', $_SERVER['REQUEST_URI'], 2);
            $final_uri		.= $request_uri[0];

            if (isset($request_uri[1]) && $request_uri[1]) {
                $query_string= $this->_removeParameterFromQueryString('ticket', $request_uri[1]);

                // If the query string still has anything left,
                // append it to the final URI
                if ($query_string !== '') {
                    $final_uri	.= "?$query_string";
                }
            }

            phpCAS::trace("Final URI: $final_uri");
            $this->setURL($final_uri);
        }
        phpCAS::traceEnd($this->_url);
        return $this->_url;
    }
1298109
public function getAsString(): string
    {
        if ('php://stdin' !== $this->filename) {
            if (!file_exists($this->filename)) {
                throw new SourceException(sprintf('File "%s" not exists', $this->filename));
            }

            if (!is_readable($this->filename)) {
                throw new SourceException(sprintf('File "%s" is not readable', $this->filename));
            }
        }

        return file_get_contents($this->filename);
    }
319447
public function getDriver(): string
    {
        // Extract driver name from current config
        $driver = $this->getConfig('driver');

        try {
            if (!\is_string($driver)) {
                throw new Exception('Wrong type of "driver" item in config, must be a string');
            }

            if (!\in_array($driver, self::ALLOWED_DRIVERS, false)) {
                $allowed = implode(',', self::ALLOWED_DRIVERS);
                throw new Exception("Driver \"$driver\" is not in allowed list [" . $allowed . ']');
            }
        } catch (Exception $e) {
            // __constructor
        }

        return __NAMESPACE__ . '\\Drivers\\' . ucfirst(strtolower($driver));
    }
527763
public function getName()
    {
        if (!array_key_exists(self::NAME, $this->group)) {
            throw new \Exception('Could not get group name from group id.');
        }
        return $this->group[self::NAME];
    }
70765
public function getWSDL() 
	{
		if (empty($this->service_name)) {
			throw new Exception('No service name.');
		}
		$headerWSDL = "<?xml version=\"1.0\" ?>\n";
		$headerWSDL.= "<definitions name=\"$this->service_name\" targetNamespace=\"urn:$this->service_name\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tns=\"urn:$this->service_name\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\">\n";
		$headerWSDL.= "<types xmlns=\"http://schemas.xmlsoap.org/wsdl/\" />\n";
        
		if (empty($this->class_name)) {
			throw new Exception('No class name.');
		}
		
		$class = new ReflectionClass($this->class_name);
		
		if (!$class->isInstantiable()) {
			throw new Exception('Class is not instantiable.');
		}
		
		$methods = $class->getMethods();
		
		$portTypeWSDL = '<portType name="'.$this->service_name.'Port">';
		$bindingWSDL = '<binding name="'.$this->service_name.'Binding" type="tns:'.$this->service_name."Port\">\n<soap:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\" />\n";
		//$serviceWSDL = '<service name="'.$this->service_name."\">\n<documentation />\n<port name=\"".$this->service_name.'Port" binding="tns:'.$this->service_name."Binding\"><soap:address location=\"http://".$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF']."\" />\n</port>\n</service>\n";
		$address_location = $this->service_url;
		$serviceWSDL = '<service name="'.$this->service_name."\">\n<documentation />\n<port name=\"".$this->service_name.'Port" binding="tns:'.$this->service_name."Binding\"><soap:address location=\"".$address_location."\" />\n</port>\n</service>\n";
		
		$messageWSDL = '';
		foreach ($methods as $method) {
			if ($method->isPublic() && !$method->isConstructor()) {
				$portTypeWSDL.= '<operation name="'.$method->getName()."\">\n".'<input message="tns:'.$method->getName()."Request\" />\n<output message=\"tns:".$method->getName()."Response\" />\n</operation>\n";
				$bindingWSDL.= '<operation name="'.$method->getName()."\">\n".'<soap:operation soapAction="urn:'.$this->service_name.'#'.$this->class_name.'#'.$method->getName()."\" />\n<input><soap:body use=\"encoded\" namespace=\"urn:$this->service_name\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\n</input>\n<output>\n<soap:body use=\"encoded\" namespace=\"urn:$this->service_name\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\n</output>\n</operation>\n";
			    $messageWSDL.= '<message name="'.$method->getName()."Request\">\n";
				$parameters = $method->getParameters();
				foreach ($parameters as $parameter) {
					$messageWSDL.= '<part name="'.$parameter->getName()."\" type=\"xsd:string\" />\n";
				}
				$messageWSDL.= "</message>\n";
				$messageWSDL.= '<message name="'.$method->getName()."Response\">\n";
				$messageWSDL.= '<part name="'.$method->getName()."\" type=\"xsd:string\" />\n";
				$messageWSDL.= "</message>\n";
			}
		}
		$portTypeWSDL.= "</portType>\n";
		$bindingWSDL.= "</binding>\n";
		return sprintf('%s%s%s%s%s%s', $headerWSDL, $portTypeWSDL, $bindingWSDL, $serviceWSDL, $messageWSDL, '</definitions>');
	}