getSchemeAndHttpHost() public static method

If the URL was called with basic authentication, the user and the password are not added to the generated string.
public static getSchemeAndHttpHost ( ) : string
return string The scheme and HTTP host
 /**
  * @inheritdoc
  */
 public function getConfig()
 {
     $config = config(C::NAME, []);
     /** @noinspection PhpUndefinedClassInspection */
     $config[C::JSON][C::JSON_URL_PREFIX] = \Request::getSchemeAndHttpHost();
     return $config;
 }
Example #2
0
 /**
  * Constructor
  *
  * @param   object  $db
  * @return  void
  * @throws  Exception
  */
 public function __construct($db = null)
 {
     if (!$db) {
         $db = \App::get('db');
     }
     if (!$db instanceof \Hubzero\Database\Driver && !$db instanceof \JDatabase) {
         throw new \Exception(\Lang::txt('Database must be of type JDatabase'), 500);
     }
     $this->database = $db;
     if (is_null(self::$base)) {
         self::$base = rtrim(\Request::getSchemeAndHttpHost(), '/');
     }
 }
Example #3
0
     // Check if a method exist (using JPlugin style)
     $obj = 'plgWhatsnew' . ucfirst($this->cats[$k]['category']);
     if (function_exists($func)) {
         $html .= $func($row, $this->period);
     } elseif (method_exists($obj, 'out')) {
         $html .= call_user_func(array($obj, 'out'), $row, $this->period);
     } else {
         if (strstr($row->href, 'index.php')) {
             $row->href = Route::url($row->href);
         }
         $html .= "\t" . '<li>' . "\n";
         $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
         if ($row->text) {
             $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(strip_tags(\Hubzero\Utility\Sanitize::stripAll(stripslashes($row->text))), 200) . '</p>' . "\n";
         }
         $html .= "\t\t" . '<p class="href">' . rtrim(Request::getSchemeAndHttpHost(), '/') . '/' . ltrim($row->href, '/') . '</p>' . "\n";
         $html .= "\t" . '</li>' . "\n";
     }
 }
 $html .= '</ol>' . "\n";
 // Initiate paging if we we're displaying an active category
 if ($dopaging) {
     $pageNav = $this->pagination($this->total, $this->start, $this->limit);
     $pageNav->setAdditionalUrlParam('category', urlencode(strToLower($this->active)));
     $pageNav->setAdditionalUrlParam('period', $this->period);
     $html .= $pageNav->render();
     $html .= '<div class="clearfix"></div>';
 } else {
     $html .= '<p class="moreresults">' . Lang::txt('COM_WHATSNEW_TOP_SHOWN', $amt);
     // Add a "more" link if necessary
     $ttl = 0;
Example #4
0
<?php

return ['filename_generator' => 'TippingCanoe\\Phperclip\\FileNameGenerator', 'processors' => ['TippingCanoe\\Phperclip\\Processes\\ImageProcessor'], 'storage' => ['TippingCanoe\\Phperclip\\Storage\\Filesystem' => ['root' => public_path() . '/uploads', 'public_prefix' => sprintf('%s/uploads', Request::getSchemeAndHttpHost())]]];
 /**
  * @inheritdoc
  */
 protected function getBaseSelfUrl($resource)
 {
     // NOTE: You can dynamically set resource urls
     return \Request::getSchemeAndHttpHost() . $this->baseSelfUrl . '/';
 }
Example #6
0
 /**
  * @return mixed
  */
 private function setLogoPath()
 {
     if (isset($this->settings['logo']['path'])) {
         $this->settings['logo']['path'] = str_replace('%PUBLIC%', \Request::getSchemeAndHttpHost(), $this->settings['logo']['path']);
     }
 }
 /**
  * @return array
  */
 protected function gatherConsoleStatistics()
 {
     $_stats = ['uri' => config('app.url', \Request::getSchemeAndHttpHost()), 'user' => ServiceUser::count(), 'mount' => Mount::count(), 'server' => Server::count(), 'cluster' => Cluster::count(), 'limit' => Limit::count(), 'instance' => Instance::count()];
     return $_stats;
     //  The new way
     //return $this->telemetry->make('console')->getTelemetry();
 }
 /**
  * Add URL prefix to document links.
  */
 protected function getConfig()
 {
     $config = $this->traitGetConfig();
     $config[C::JSON][C::JSON_URL_PREFIX] = \Request::getSchemeAndHttpHost();
     return $config;
 }
Example #9
0
 /**
  * Send a new message using a view.
  *
  * @param string|array    $view
  * @param array           $data
  * @param \Closure|string $callback
  *
  * @return void
  */
 public function send($view, array $data = [], $callback)
 {
     $this->settings['logo']['path'] = str_replace('%PUBLIC%', \Request::getSchemeAndHttpHost(), $this->settings['logo']['path']);
     $data = array_merge($data, $this->settings);
     $this->mailer->send($view, $data, $callback);
 }
 /**
  * Returns an array, indexed by provider name, of telemetry data gathered during the period defined by $start to $end
  *
  * @param string|array|null $providers The providers to query
  * @param string|int|null   $start     The period start (greater or equal to >=). Null == today
  * @param string|int|null   $end       The period end (less than <). Null == today
  * @param bool              $store     If true, the response is stored for posterity
  *
  * @return array
  */
 public function getTelemetry($providers = null, $start = null, $end = null, $store = true)
 {
     $_providers = $providers ?: $this->providers;
     is_string($_providers) && ($_providers = [$_providers]);
     //  Identify our data
     $_telemetry = ['_meta' => ['source-uri' => config('app.url', \Request::getSchemeAndHttpHost()), 'request-timestamp' => Carbon::now(), 'request-host' => 'cli' == PHP_SAPI ? 'localhost' : \Request::getSchemeAndHttpHost(), 'request-ip' => 'cli' == PHP_SAPI ? ['127.0.0.1'] : \Request::getClientIps()]];
     foreach ($_providers as $_provider) {
         $_telemetry[$_provider] = $this->make($_provider)->getTelemetry();
     }
     $store && Telemetry::storeTelemetry(TelemetryServiceProvider::IOC_NAME, $_telemetry);
     return is_string($providers) ? current($_telemetry) : $_telemetry;
 }
Example #11
0
<?php

return ['driver' => 'gd', 'storage' => ['TippingCanoe\\Imager\\Storage\\Filesystem' => ['root' => public_path() . '/imager', 'public_prefix' => sprintf('%s/imager', Request::getSchemeAndHttpHost())]]];