本文整理汇总了PHP中URL::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::getURL方法的具体用法?PHP URL::getURL怎么用?PHP URL::getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::getURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: done
function done($locator)
{
$response = $locator->get('Response');
$url = new URL('action');
$response->setRedirect($url->getURL('foo'));
# echo 'Form1View: DoneHandler: STATE DONE<br/>';
}
示例2: alterar
public function alterar(URL $url)
{
$where = "WHERE " . self::ID . " = '" . $url->getId() . "'";
$this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::URL, $url->getURL(), $where);
$this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::TABELA, $url->tabela, $where);
$this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::CAMPO, $url->campo, $where);
$this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::VALOR, $url->valor, $where);
}
示例3: getFrobURL
/**
* Get FROB URL
*
* @param &com.flickr.xmlrpc.Client client
* @return string url
*/
public function getFrobURL($client)
{
$arguments = array('frob' => $this->getFrobValue(), 'perms' => 'read');
$arguments = $client->signArray($arguments);
$url = new URL('http://flickr.com/services/auth');
$url->addParams($arguments);
return $url->getURL();
}
示例4: __construct
/**
* Constructor
*
* @param util.cmd.ParamString args
*/
public function __construct(ParamString $args)
{
$url = new URL($args->value(0));
// If protocol string does not contain port number, set default.
if (self::ESDL_PORT === $url->getPort(self::ESDL_PORT)) {
$url->setPort(self::ESDL_PORT);
}
// Check given URL to inform user if invalid port used.
if (self::ESDL_PORT !== $url->getPort()) {
Console::$err->writeLine('Notice: using non-standard port ' . $url->getPort() . ', ESDL services are usually available at port 6449.');
}
$this->remote = Remote::forName($url->getURL());
$this->jndi = $args->value(1);
$this->processor = new DomXSLProcessor();
$this->processor->setXSLBuf($this->getClass()->getPackage()->getResource($args->value('lang', 'l', 'xp5') . '.xsl'));
}
示例5: extract
/**
* Extract a ".ar" file into a given target directory
*
* @param string base
* @param string ar
* @param io.Folder target
* @throws lang.IllegalStateException in case the target is not found
* @throws lang.FormatException in case the .ar-file is not parseable
*/
protected function extract($base, $ar, Folder $target)
{
// Open a HTTP connection
$url = new URL($base . $ar . '.ar');
$r = create(new HttpConnection($url))->get();
if (HttpConstants::STATUS_OK != $r->getStatusCode()) {
throw new IllegalStateException(sprintf('Unexpected response %d:%s for %s', $r->getStatusCode(), $r->getMessage(), $url->getURL()));
}
$in = new BufferedInputStream($r->getInputStream());
do {
// Seach for first section header, --[LENGTH]:[FILENAME]-- and parse it
do {
$line = $this->readLine($in);
if (!$in->available()) {
throw new FormatException('Cannot locate section header');
}
} while (2 !== sscanf($line, '--%d:%[^:]--', $length, $filename));
// Calculate target file
$file = new File($target, $filename);
$folder = new Folder($file->getPath());
$folder->exists() || $folder->create();
Console::writef(' >> [%-10s] %s (%.2f kB) [%s]%s', $ar, $filename, $length / 1024, str_repeat('.', self::PROGRESS_INDICATOR_WIDTH), str_repeat("", self::PROGRESS_INDICATOR_WIDTH + 1));
// Transfer length bytes into file
$c = 0;
$out = $file->getOutputStream();
$size = 0;
while ($size < $length) {
$chunk = $in->read(min(0x1000, $length - $size));
$size += strlen($chunk);
$out->write($chunk);
// Update progress
$d = ceil($size / $length * self::PROGRESS_INDICATOR_WIDTH);
if ($d == $c) {
continue;
}
Console::write(str_repeat('#', $d - $c));
$c = $d;
}
$out->close();
Console::writeLine();
} while ($in->available() > 0);
$in->close();
}
示例6:
$lastUrl = "users";
} else {
if (URL::getURL(1) == "config") {
$lastUrl = "config";
} else {
if (URL::getURL(1) == "modulos") {
$lastUrl = "modulos";
}
}
}
}
if (URL::getURL(0) == "perfil") {
$lastUrl = "perfil";
}
if (URL::getURL(0) == "modulos") {
$lastUrl = URL::getURL(1);
}
?>
<li><a <?php
if ($lastUrl === 'perfil') {
echo 'class="active"';
}
?>
href="<?php
echo URL::getBase();
?>
perfil/"><i class="fa fa-fw fa-book"></i><span class="title">Perfil</span></a></li>
<li>
<a <?php
if ($lastUrl === 'modulo') {
echo 'class="active"';
示例7:
if ($stmt->num_rows > 0) {
if (file_exists(MODULOS . "_modulos/_{$modulo}/" . $app . ".php")) {
//carrega a pagina
require_once MODULOS . "_modulos/_{$modulo}/" . $app . ".php";
} else {
require_once "erro404.php";
}
} else {
require_once "erro503admin.php";
}
}
}
}
}
} else {
$system = URL::getURL(3);
if ($system == null) {
$system = "index";
}
if ($privilegio === 'administrador') {
//carrega a pagina indicada na url
if (file_exists(MODULOS . "_modulos/_{$modulo}/_{$app}/" . $system . ".php")) {
//carrega a pagina
require_once MODULOS . "_modulos/_{$modulo}/_{$app}/" . $system . ".php";
} else {
require_once "erro404.php";
}
} else {
//carrega os menu dos modulos de acordo com a permissão do susuário
if ($stmt = $mysqli->prepare("SELECT codigo, nome FROM modulo INNER JOIN modulo_permissao mp ON (mp.codigo_modulo = modulo.codigo) WHERE mp.codigo_usuario = ? AND modulo.codigo = 1 AND `modulo`.`status` = 'ativo' ")) {
$stmt->bind_param('i', $user_id);
示例8:
<?php
$systemUser = URL::getURL(2);
if ($systemUser == null) {
$systemUser = "users";
}
//carrega a pagina indicada na url
if (file_exists(MODULOS . "_administrador/_users/" . $systemUser . ".php")) {
//carrega a pagina
require_once MODULOS . "_administrador/_users/" . $systemUser . ".php";
} else {
require_once "erro404admin.php";
}
示例9:
/*Processo precisa ser adicionado manualmente*/
if ($ajaxsubmodulo != "app") {
//pasta administrador
if ($ajaxsubmodulo == "users" || $ajaxsubmodulo == "modulos" || $ajaxsubmodulo == "config") {
$pathAjax = "_administrador/";
}
//referente ao perfil
if ($ajaxsubmodulo == "perfil") {
$pathAjax = "_perfil/";
}
/*Os modulos serгo ordenados por numeraзгo. Cada vez que um mуdulo for adicionado, incrementar com o seu devido diretуrio*/
//carrega a pagina indicada na url
if (file_exists(MODULOS . $pathAjax . $ajaxsubmodulo . ".php")) {
//carrega a pagina
require_once MODULOS . $pathAjax . $ajaxsubmodulo . ".php";
} else {
require_once "erro404admin.php";
}
} else {
$pathAjax = "_modulos/";
$pathModulo = "_" . URL::getURL(2) . "/";
$pathApp = "_" . URL::getURL(3) . "/";
$ajaxApp = URL::getURL(4);
if (file_exists(MODULOS . $pathAjax . $pathModulo . $pathApp . $ajaxApp . ".php")) {
//carrega a pagina
require_once MODULOS . $pathAjax . $pathModulo . $pathApp . $ajaxApp . ".php";
} else {
require_once "erro404admin.php";
}
}
}
示例10: doCreate
public function doCreate()
{
$req = $this->newRequest('GET', new URL('http://localhost/'));
$res = new HttpScriptletResponse();
$s = newinstance('scriptlet.xml.XMLScriptlet', array(), '{
public function needsSession($request) { return TRUE; }
}');
$s->service($req, $res);
$this->assertEquals(HttpConstants::STATUS_FOUND, $res->statusCode);
// Check URL from Location: header contains the session ID
with($redirect = new URL(substr($res->headers[0], strlen('Location: '))));
$this->assertEquals('http', $redirect->getScheme());
$this->assertEquals('localhost', $redirect->getHost());
$this->assertEquals(sprintf('/xml/psessionid=%s/static', session_id()), $redirect->getPath());
$this->assertEquals(array(), $redirect->getParams(), $redirect->getURL());
}
示例11:
<?php
$systemModule = URL::getURL(2);
if ($systemModule == null) {
$systemModule = "config";
}
//carrega a pagina indicada na url
if (file_exists(MODULOS . "_administrador/_config/" . $systemModule . ".php")) {
//carrega a pagina
require_once MODULOS . "_administrador/_config/" . $systemModule . ".php";
} else {
require_once "erro404admin.php";
}
示例12:
<?php
$perfilUser = URL::getURL(2);
if ($perfilUser == null) {
$perfilUser = "perfil";
}
//carrega a pagina indicada na url
if (file_exists(MODULOS . "_perfil/_perfil/" . $perfilUser . ".php")) {
//carrega a pagina
require_once MODULOS . "_perfil/_perfil/" . $perfilUser . ".php";
} else {
require_once "erro404admin.php";
}
示例13:
<?php
$submodulo = URL::getURL(1);
if ($submodulo == null) {
$submodulo = "perfil";
}
//carrega a pagina indicada na url
if (file_exists(MODULOS . "_perfil/" . $submodulo . ".php")) {
//carrega a pagina
require_once MODULOS . "_perfil/" . $submodulo . ".php";
} else {
require_once "erro404admin.php";
}
示例14: getURL
/**
* Returns string representation for the URL
*
* The URL is build by using sprintf() and the following
* parameters:
* <pre>
* Ord Fill Example
* --- --------------- --------------------
* 1 scheme http
* 2 host host.foo.bar
* 3 path /foo/bar/index.html
* 4 dirname(path) /foo/bar/
* 5 basename(path) index.html
* 6 query a=b&b=c
* 7 session id cb7978876218bb7
* 8 fraction #test
* </pre>
*
* @return string
*/
public function getURL()
{
$sessionId = $this->getSessionId();
if ($sessionId) {
$cloned = clone $this;
$cloned->setParam('psessionid', $sessionId);
$cloned->setSessionId(NULL);
return $cloned->getURL();
}
return parent::getURL();
}
示例15: sec_session_start
<?php
require_once "load.php";
sec_session_start();
//verifica se ja foi logado
$mysqli = conectabd(BD_PRINCIPAL);
$modulo = URL::getURL(0);
//qualquer url direcionada no admin voltara para o login se n�o estiver logado
if (!login_check($mysqli) && $modulo != null) {
header("Location: " . URL::getBase());
}
//verifica se foi autenticado
if (login_check($mysqli)) {
if ($modulo == null) {
$modulo = "index";
}
if ($modulo == "ajax" && file_exists(MODULOS . $modulo . ".php")) {
require_once MODULOS . $modulo . ".php";
} else {
if (file_exists(MODULOS . $modulo . ".php")) {
//carrega o header
require_once MODULOS . 'header.php';
//carrega a pagina
require_once MODULOS . $modulo . ".php";
//carrega o footer
require_once MODULOS . 'footer.php';
} else {
require_once "erro404admin.php";
}
}
} else {