Esempio n. 1
0
 /**
  * Convert given time to user from localtime, however if it a guest user
  * return based on default timezone.
  *
  * @param  mixed  $datetime
  *
  * @return \Carbon\Carbon
  */
 public function fromLocalTime($datetime)
 {
     $appTimeZone = $this->config->get('app.timezone', 'UTC');
     if ($this->auth->guest()) {
         return $this->convertToDateTime($datetime, $appTimeZone);
     }
     $userId = $this->auth->user()->id;
     $userTimeZone = $this->memory->get("timezone.{$userId}", $appTimeZone);
     $datetime = $this->convertToDateTime($datetime, $userTimeZone);
     $datetime->timezone = $appTimeZone;
     return $datetime;
 }
Esempio n. 2
0
 /**
  * Refresh application for Orchestra Platform.
  *
  * @return void
  */
 protected function refreshApplication()
 {
     if (!$this->foundation->installed()) {
         return;
     }
     $extensions = $this->memory->get('extensions.active', []);
     foreach ($extensions as $extension => $config) {
         $options = ['name' => $extension, '--force' => true];
         $this->call('extension:refresh', $options);
         $this->call('extension:update', $options);
     }
 }
Esempio n. 3
0
 /**
  * Refresh application for Orchestra Platform.
  *
  * @return void
  */
 protected function refreshApplication()
 {
     if (!$this->foundation->installed()) {
         return;
     }
     $this->call('extension:detect', ['--quiet' => true]);
     $extensions = $this->memory->get('extensions.active', []);
     foreach ($extensions as $extension => $config) {
         $options = ['name' => $extension, '--force' => true];
         $this->call('extension:refresh', $options);
         $this->call('extension:update', $options);
     }
     $this->foundation->make('orchestra.extension.provider')->writeFreshManifest();
 }
Esempio n. 4
0
 /**
  * Refresh application for Orchestra Platform.
  *
  * @return void
  */
 protected function refreshApplication()
 {
     if (!$this->foundation->installed()) {
         return;
     }
     $this->call('extension:detect', ['--quiet' => true]);
     $extensions = $this->memory->get('extensions.active', []);
     try {
         foreach ($extensions as $extension => $config) {
             $options = ['name' => $extension, '--force' => true];
             $this->call('extension:refresh', $options);
             $this->call('extension:update', $options);
         }
         $this->laravel->make('orchestra.extension.provider')->writeFreshManifest();
     } catch (PDOException $e) {
         // Skip if application is unable to make connection to the database.
     }
 }