本文整理汇总了PHP中Request::fullUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::fullUrl方法的具体用法?PHP Request::fullUrl怎么用?PHP Request::fullUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::fullUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply
public function apply(Transformable $transformable)
{
$file = \File::get(public_path('assets/img/borders.png'));
$img = base64_encode($file);
$data = str_ireplace(["\r", "\n"], '', $transformable->getContents());
$data = preg_replace("~<(/?(br|p|dd))[^>]*?>~i", '<\\1>', $data);
$data = preg_replace("~</(p|dd)>~i", '', $data);
$data = preg_replace("~<(br|p|dd)>~i", static::LINEBREAK, $data);
$data = preg_replace('/[ ]{2,}/', ' ', $data);
$data = preg_replace("/" . static::LINEBREAK . "[ ]+/s", static::LINEBREAK . " ", $data);
$data = str_replace(static::LINEBREAK, '<p>', $data);
$page = $transformable->page;
$author = $page->author;
$charset = $transformable->charset ?: 'utf-8';
$title = $author->fio . " - " . $page->title;
$link = \HTML::link(path_join("http://samlib.ru", $author->absoluteLink()), $author->fio) . " - " . \HTML::link(path_join("http://samlib.ru", $page->absoluteLink()), $page->title);
$annotation = $page->annotation;
$contents = $data;
$downloaded = \Lang::get('pages.pages.downloaded', ['url' => \Request::fullUrl()]);
if ($charset != 'utf-8') {
$e = app('charset-encoder');
$c = $e->remap($charset, true);
$title = $e->transform($title, 'utf-8', $c);
$link = $e->transform($link, 'utf-8', $c);
$annotation = $e->transform($annotation, 'utf-8', $c);
$downloaded = $e->transform($downloaded, 'utf-8', $c);
}
$view = view('pages.html-download', compact('img', 'charset', 'title', 'link', 'annotation', 'contents', 'downloaded'));
$transformable->setContents((string) $view);
$transformable->setType(static::EXTENSION);
return $transformable;
}
示例2: setSharedVariables
/**
* Share common view variables
*/
protected function setSharedVariables()
{
view()->share('currentLocale', app()->getLocale());
view()->share('currentUser', auth()->user());
view()->share('currentRouteName', \Route::currentRouteName());
view()->share('currentUrl', \Request::fullUrl());
}
示例3: onFinish
public function onFinish()
{
if ($this->_queriesCount < $this->_limit) {
return;
}
$filename = storage_path('/logs/query.' . date('d.m.y') . '.request.log');
$string = '[' . date('H:i:s') . '] ' . \Request::fullUrl() . ': ' . $this->_queriesCount . ' queries in ' . $this->_totalTime . 'ms.' . PHP_EOL;
\File::append($filename, $string);
}
示例4: set
public function set($key = '', $current_url = '')
{
if (empty($key)) {
$key = \Request::route()->getName();
}
if (empty($current_url)) {
$current_url = \Request::fullUrl();
}
$session_key = $this->session_key($key);
\Session::put($session_key, $current_url);
}
示例5: helper_links
/**
* Array View Helper
*
* @param array $items
* @return array
*/
function helper_links($items = [])
{
$hrefSelf = Request::fullUrl();
$links = ['self' => ['href' => $hrefSelf, 'type' => 'application/json; version=1.0']];
if (count($items)) {
$last = $items[count($items) - 1];
$currentRoute = Route::current();
$queries = Input::all();
$queries = array_merge($queries, ['cursor' => $last->id]);
$hrefNext = url($currentRoute->getPath()) . '?' . http_build_query($queries);
$links['next'] = ['href' => $hrefNext, 'type' => 'application/json; version=1.0'];
}
return $links;
}
示例6: getJsapiConfig
/**
* 获得微信jsapi的配置信息
* @return stdClass
*/
public function getJsapiConfig()
{
$mq = new MQ();
$jsapiTicket = $mq->getWeixinJsapiTicketByName('buyer');
$url = \Request::fullUrl();
$noncestr = Tool::getRandChar(16);
$timestamp = time();
$weixinClient = new WeixinClient();
$signature = $weixinClient->getSignature($jsapiTicket, $url, $noncestr, $timestamp);
$config = new \stdClass();
$config->jsapiTicket = $jsapiTicket;
$config->url = $url;
$config->noncestr = $noncestr;
$config->timestamp = $timestamp;
$config->signature = $signature;
$config->appid = \Config::get('weixin.buyer.appid');
return $config;
}
示例7: enviarError
public static function enviarError(Exception $exception, $code)
{
$arr = explode('\\', get_class($exception));
$stackFinal = $exception->getTraceAsString();
$stackFinal .= "<br>Linea: " . $exception->getLine();
$stackFinal .= "<br>Archivo: " . $exception->getFile();
$stackFinal .= "<br>Mensaje: " . $exception->getMessage();
$stackFinal .= "<br>Código: " . $code;
$data = array('EXCEPCION' => $arr[count($arr) - 1], 'STACK' => $stackFinal, 'URL' => Request::fullUrl() . ' (' . Request::method() . ')', 'PARAMETROS' => json_encode(Input::all()));
$url = Configuracion::get('urlactualizacion') . 'error?CLAVEPROYECTO=' . Configuracion::get('claveproyecto') . '&AMBIENTE=' . Configuracion::get('ambiente') . '&VERSION=' . Configuracion::get('version');
$ch = curl_init();
$optArray = array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_NOBODY => false, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $data);
curl_setopt_array($ch, $optArray);
$curl = new AyudanteCurl();
$curl->respuesta = substr(curl_exec($ch), curl_getinfo($ch, CURLINFO_HEADER_SIZE));
$curl->codigoRespuesta = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curl->respuestaObj = json_decode($curl->respuesta);
if ($curl->codigoRespuesta != 200) {
throw new CurlException($curl);
}
curl_close($ch);
return $curl->respuestaObj->mensaje;
}
示例8: index
public function index()
{
// Get the base url. We do it this way cause Request::getBaseUrl()
// doesn't seem to work in all cases.
$fullUrl = Request::fullUrl();
$url = substr($fullUrl, 0, strpos($fullUrl, '/install'));
$local = true;
if (!isUsingLocalStorage()) {
$local = false;
$keys = ['database_database', 'database_default', 'database_host', 'database_username', 'database_password', 'app_key', 'app_url', 'services_phaxio_public', 'services_phaxio_secret', 'mail_driver', 'mail_from_address', 'mail_from_name', 'mail_host', 'mail_port', 'mail_username', 'mail_password', 'services_mailgun_domain', 'services_mailgun_secret'];
$envErrors = [];
foreach ($keys as $key) {
if (!isset($_ENV[$key])) {
$envErrors[] = "The key <strong>{$key}</strong> must be set in your environment variables";
} else {
$env[$key] = $_ENV[$key];
}
}
if ($envErrors) {
return View::make('install.envErrors', compact('envErrors'));
}
}
return View::make('install.index', compact('url', 'env', 'local'));
}
示例9: ajaxRedirect
private static function ajaxRedirect($object = false, $action = false, $quickEdit = false)
{
$data = array('success' => true, 'returnToParent' => false, 'quickEdit' => $quickEdit, 'objectRow' => false, 'objectId' => false);
if (!self::$modelConfig->relatedModels) {
$data['returnToParent'] = true;
}
if (config('gtcms.preventRedirectOnSave') || $quickEdit) {
$data['returnToParent'] = false;
}
/** @var \App\BaseModel $object */
if (config('gtcms.premium') && $quickEdit) {
GtcmsPremium::setQuickEditReturnData($data, $object, self::$modelConfig);
}
// If object has just been successfully added
if ($action == 'add' && !$data['returnToParent'] && self::$modelConfig->name != "GtcmsSetting") {
$printProperty = self::$modelConfig->printProperty;
$data['replaceCurrentHistory'] = array('modelName' => self::$modelConfig->hrName, 'objectName' => $printProperty ? $object->{$printProperty} : false);
$fullUrl = str_replace("/edit/new", "/edit/" . $object->id, \Request::fullUrl());
$data['replaceUrl'] = $fullUrl;
$data['objectId'] = $object->id;
AdminHistoryManager::replaceAddLink($fullUrl, self::$modelConfig->name);
}
return \Response::json($data);
}
示例10: attemptAuth
/**
* Attempt to authenticate. True on success, also sets $this->user to authenticated user
* @return bool whether user authentication was successful
*/
private function attemptAuth()
{
$guid = Request::segment(2);
$method = Request::segment(3, 'empty');
$ip_address = Request::ip();
$fullUrl = Request::fullUrl();
// if request fails, only then log the full query string
if (Input::get('cryptotype')) {
$this->crypto_type_id = Input::get('cryptotype');
}
$error = $this->checkQueryRequiredArgs();
if ($error) {
Log::error("Query arguments not correct. Error: {$error}. Arguments - GUID: {$guid}, method: {$method}, ipAddress: {$ip_address}. Full URL: {$fullUrl}");
return false;
}
$user_valid = $this->validateUser($guid);
// error is printed inside #validateUser function
if ($user_valid['status'] == 'error') {
Log::error('User not validated. Error: ' . $user_valid['message'] . ". Arguments - GUID: {$guid}, method: {$method}, ipAddress: {$ip_address}. Full URL: {$fullUrl}");
return false;
}
return true;
}
示例11: it_redirect_to_login_page_without_login
/** @test */
public function it_redirect_to_login_page_without_login()
{
$this->visit(route('home'))->seePageIs(\Request::fullUrl());
}
示例12: function
<?php
/**
* Array View Helper
*
* @param array $items
* @return array
*/
return function ($items = []) {
$hrefSelf = Request::fullUrl();
$links = ['self' => ['href' => $hrefSelf, 'type' => 'application/json; version=1.0']];
if (count($items)) {
$last = $items[count($items) - 1];
$queries = Input::all();
$queries = array_merge($queries, ['cursor' => $last->id]);
$hrefNext = url(Request::url()) . '?' . http_build_query($queries);
$links['next'] = ['href' => $hrefNext, 'type' => 'application/json; version=1.0'];
}
return $links;
};
示例13: printCategory
/**
* return function that return html to the list of categories in wpanel.
*
* @param array|collection $categories All Categories
*
* @return function
*/
public static function printCategory($categories = [])
{
$url = \Request::fullUrl();
$printCategory = function ($row) use(&$printCategory, $categories, $url) {
if (count($categories) > 0 && $row['category_id']) {
foreach ($categories as $category) {
if ($row['category_id'] == $category['id']) {
$father = '<a href="' . $url . '#category' . $category['id'] . '">' . $category['name'] . '</a>';
break;
}
}
} else {
$father = '';
//trans('globals.action')
}
echo '<li class="list-group-item" ng-init="str' . $row['id'] . '=\'' . $row['name'] . '\'" ng-show="(search==\'\'||(str' . $row['id'] . '.toLowerCase().indexOf(search.toLowerCase())>-1))?true:false">
<div class="row">
<div class="col-md-1"><span class="label label-default visible-xs-inline">#ID:</span> ' . $row['id'] . '</div>
<div class="col-md-3"><span class="label label-default visible-xs-inline">' . trans('product.inputs_view.name') . ':</span> <a name="category' . $row['id'] . '">' . $row['name'] . '</a></div>
<div class="col-md-2"><span class="label label-default visible-xs-inline">' . trans('globals.status') . ':</span> ' . ($row['status'] == 1 ? '<span class="label label-success">' . trans('globals.active') . '</span>' : '<span class="label label-danger">' . trans('globals.inactive') . '</span>') . '</div>
<div class="col-md-2"><span class="label label-default visible-xs-inline">' . trans('store.father') . ':</span> ' . $father . '</div>
<div class="col-md-2"><span class="label label-default visible-xs-inline">' . trans('globals.type') . ':</span> ' . $row['type'] . '</div>
<div class="col-md-2"><a href="' . route('wpanel.category.edit', $row['id']) . '">Edit</a></div>
</div>
</li>';
if (isset($row['sub']) && count($row['sub']) > 0) {
foreach ($row['sub'] as $subRow) {
$printCategory($subRow);
}
}
};
return $printCategory;
}
示例14: obtainAuthCodeGrant
function obtainAuthCodeGrant(ApiTester $I)
{
$user = factory(App\Models\User::class, 1)->create();
$user->password = 'password';
$user->save();
$I->amLoggedAs($user);
$client = factory(App\Models\OAuthClient::class, 1)->create();
$grant = \App\Models\OAuthGrant::find('authorization_code');
$client->oauth_grants()->attach($grant);
$scope = \App\Models\OAuthScope::find('user_read');
$client->oauth_scopes()->attach($scope);
$endpoint = factory(App\Models\OAuthClientEndpoint::class, 1)->make();
$endpoint->oauth_client()->associate($client);
$endpoint->save();
$I->wantTo('Perform a full 3rd party authorisation flow and get an access token');
$I->amOnPage('authorize?client_id=' . $client->id . '&redirect_uri=' . $endpoint->redirect_uri . '&response_type=code&scope=user_read');
$I->click('approve');
$I->seeInCurrentUrl('code=');
$url = Request::fullUrl();
$parts = parse_url($url);
parse_str($parts['query'], $query);
$code = $query['code'];
$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
$I->sendPOST('oauth/access_token', ['grant_type' => 'authorization_code', 'client_id' => $client->id, 'client_secret' => $client->secret, 'redirect_uri' => $endpoint->redirect_uri, 'code' => $code]);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseMatchesJsonType(['access_token' => 'string']);
}
示例15: rememberDesiredUrl
public function rememberDesiredUrl()
{
$desiredUrl = \Request::fullUrl();
\Session::flash('url.intended', $desiredUrl);
}