This repository has been archived by the owner on Jun 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
override application to make sure we can edit the configuration, boot…
…strap and storage paths.
- Loading branch information
Cédric Verstraeten
committed
Jun 21, 2017
1 parent
a20dd91
commit 0a869e7
Showing
3 changed files
with
72 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php namespace App; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Check if running on KiOS | ||
|-------------------------------------------------------------------------- | ||
| | ||
| If running on KiOS, data folders are on a different location. | ||
| Therefore we should have a different storage and config directory. | ||
| | ||
*/ | ||
|
||
class Application extends \Illuminate\Foundation\Application | ||
{ | ||
protected $kios = '/data/etc/kios.conf'; | ||
|
||
/** | ||
* Get the path to the storage directory. | ||
* | ||
* @return string | ||
*/ | ||
|
||
public function storagePath() | ||
{ | ||
if(file_exists($this->kios)) | ||
{ | ||
return '/data/web/storage'; | ||
} | ||
|
||
return $this->storagePath ?: $this->basePath.DIRECTORY_SEPARATOR.'storage'; | ||
} | ||
|
||
/** | ||
* Get the path to the application configuration files. | ||
* | ||
* @param string $path Optionally, a path to append to the config path | ||
* @return string | ||
*/ | ||
public function configPath($path = '') | ||
{ | ||
if(file_exists($this->kios)) | ||
{ | ||
return '/data/web/config'; | ||
} | ||
|
||
return $this->basePath.DIRECTORY_SEPARATOR.'config'.($path ? DIRECTORY_SEPARATOR.$path : $path); | ||
} | ||
|
||
/** | ||
* Get the path to the bootstrap directory. | ||
* | ||
* @param string $path Optionally, a path to append to the bootstrap path | ||
* @return string | ||
*/ | ||
public function bootstrapPath($path = '') | ||
{ | ||
if(file_exists($this->kios)) | ||
{ | ||
return '/data/web/bootstrap'; | ||
} | ||
|
||
return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'.($path ? DIRECTORY_SEPARATOR.$path : $path); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters