Restore custum tpl dir
This commit is contained in:
parent
81b9c01366
commit
a197ef5e02
5 changed files with 15 additions and 13 deletions
|
@ -189,7 +189,7 @@ public function write($isLoggedIn)
|
||||||
'general.title',
|
'general.title',
|
||||||
'general.header_link',
|
'general.header_link',
|
||||||
'privacy.default_private_links',
|
'privacy.default_private_links',
|
||||||
'redirector.url'
|
'redirector.url',
|
||||||
);
|
);
|
||||||
|
|
||||||
// Only logged in user can alter config.
|
// Only logged in user can alter config.
|
||||||
|
@ -296,6 +296,7 @@ protected function setDefaultValues()
|
||||||
$this->setEmpty('resource.updates', 'data/updates.txt');
|
$this->setEmpty('resource.updates', 'data/updates.txt');
|
||||||
$this->setEmpty('resource.log', 'data/log.txt');
|
$this->setEmpty('resource.log', 'data/log.txt');
|
||||||
$this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt');
|
$this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt');
|
||||||
|
$this->setEmpty('resource.raintpl_tpl', 'tpl/');
|
||||||
$this->setEmpty('resource.theme', 'default');
|
$this->setEmpty('resource.theme', 'default');
|
||||||
$this->setEmpty('resource.raintpl_tmp', 'tmp/');
|
$this->setEmpty('resource.raintpl_tmp', 'tmp/');
|
||||||
$this->setEmpty('resource.thumbnails_cache', 'cache');
|
$this->setEmpty('resource.thumbnails_cache', 'cache');
|
||||||
|
|
|
@ -40,6 +40,7 @@ class ConfigPhp implements ConfigIO
|
||||||
'resource.updates' => 'config.UPDATES_FILE',
|
'resource.updates' => 'config.UPDATES_FILE',
|
||||||
'resource.log' => 'config.LOG_FILE',
|
'resource.log' => 'config.LOG_FILE',
|
||||||
'resource.update_check' => 'config.UPDATECHECK_FILENAME',
|
'resource.update_check' => 'config.UPDATECHECK_FILENAME',
|
||||||
|
'resource.raintpl_tpl' => 'config.RAINTPL_TPL',
|
||||||
'resource.theme' => 'config.theme',
|
'resource.theme' => 'config.theme',
|
||||||
'resource.raintpl_tmp' => 'config.RAINTPL_TMP',
|
'resource.raintpl_tmp' => 'config.RAINTPL_TMP',
|
||||||
'resource.thumbnails_cache' => 'config.CACHEDIR',
|
'resource.thumbnails_cache' => 'config.CACHEDIR',
|
||||||
|
@ -99,7 +100,7 @@ function write($filepath, $conf)
|
||||||
$configStr .= '$GLOBALS[\'' . $key . '\'] = ' . var_export($conf[$key], true) . ';' . PHP_EOL;
|
$configStr .= '$GLOBALS[\'' . $key . '\'] = ' . var_export($conf[$key], true) . ';' . PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store all $conf['config']
|
// Store all $conf['config']
|
||||||
foreach ($conf['config'] as $key => $value) {
|
foreach ($conf['config'] as $key => $value) {
|
||||||
$configStr .= '$GLOBALS[\'config\'][\''. $key .'\'] = '.var_export($conf['config'][$key], true).';'. PHP_EOL;
|
$configStr .= '$GLOBALS[\'config\'][\''. $key .'\'] = '.var_export($conf['config'][$key], true).';'. PHP_EOL;
|
||||||
|
|
|
@ -172,7 +172,7 @@ <h3 id="resources">Resources</h3>
|
||||||
<strong>updates</strong>: File path for the ran updates file.<br />
|
<strong>updates</strong>: File path for the ran updates file.<br />
|
||||||
<strong>log</strong>: Log file path.<br />
|
<strong>log</strong>: Log file path.<br />
|
||||||
<strong>update_check</strong>: Last update check file path.<br />
|
<strong>update_check</strong>: Last update check file path.<br />
|
||||||
<strong>theme</strong>: Templates directory.<br />
|
<strong>raintpl_tpl</strong>: Templates directory.<br />
|
||||||
<strong>raintpl_tmp</strong>: Template engine cache directory.<br />
|
<strong>raintpl_tmp</strong>: Template engine cache directory.<br />
|
||||||
<strong>thumbnails_cache</strong>: Thumbnails cache directory.<br />
|
<strong>thumbnails_cache</strong>: Thumbnails cache directory.<br />
|
||||||
<strong>page_cache</strong>: Shaarli's internal cache directory.<br />
|
<strong>page_cache</strong>: Shaarli's internal cache directory.<br />
|
||||||
|
@ -220,7 +220,7 @@ <h2 id="configuration-file-example">Configuration file example</h2>
|
||||||
<span class="dt">"log"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">log.txt"</span><span class="fu">,</span>
|
<span class="dt">"log"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">log.txt"</span><span class="fu">,</span>
|
||||||
<span class="dt">"update_check"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">lastupdatecheck.txt"</span><span class="fu">,</span>
|
<span class="dt">"update_check"</span><span class="fu">:</span> <span class="st">"data</span><span class="ch">\/</span><span class="st">lastupdatecheck.txt"</span><span class="fu">,</span>
|
||||||
<span class="dt">"raintpl_tmp"</span><span class="fu">:</span> <span class="st">"tmp</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
|
<span class="dt">"raintpl_tmp"</span><span class="fu">:</span> <span class="st">"tmp</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
|
||||||
<span class="dt">"theme"</span><span class="fu">:</span> <span class="st">"tpl</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
|
<span class="dt">"raintpl_tpl"</span><span class="fu">:</span> <span class="st">"tpl</span><span class="ch">\/</span><span class="st">"</span><span class="fu">,</span>
|
||||||
<span class="dt">"thumbnails_cache"</span><span class="fu">:</span> <span class="st">"cache"</span><span class="fu">,</span>
|
<span class="dt">"thumbnails_cache"</span><span class="fu">:</span> <span class="st">"cache"</span><span class="fu">,</span>
|
||||||
<span class="dt">"page_cache"</span><span class="fu">:</span> <span class="st">"pagecache"</span>
|
<span class="dt">"page_cache"</span><span class="fu">:</span> <span class="st">"pagecache"</span>
|
||||||
<span class="fu">},</span>
|
<span class="fu">},</span>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
## Foreword
|
## Foreword
|
||||||
|
|
||||||
**Do not edit configuration options in index.php! Your changes would be lost.**
|
**Do not edit configuration options in index.php! Your changes would be lost.**
|
||||||
|
|
||||||
Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
|
Once your Shaarli instance is installed, the file `data/config.json.php` is generated:
|
||||||
* it contains all settings in JSON format, and can be edited to customize values
|
* it contains all settings in JSON format, and can be edited to customize values
|
||||||
|
@ -42,7 +42,7 @@ In `data/config.json.php`.
|
||||||
See also [Plugin System](Plugin-System.html).[](.html)
|
See also [Plugin System](Plugin-System.html).[](.html)
|
||||||
|
|
||||||
### Credentials
|
### Credentials
|
||||||
|
|
||||||
> You shouldn't edit those.
|
> You shouldn't edit those.
|
||||||
|
|
||||||
**login**: Login username.
|
**login**: Login username.
|
||||||
|
@ -59,12 +59,12 @@ See also [Plugin System](Plugin-System.html).[](.html)
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
**session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
|
**session_protection_disabled**: Disable session cookie hijacking protection (not recommended).
|
||||||
It might be useful if your IP adress often changes.
|
It might be useful if your IP adress often changes.
|
||||||
**ban_after**: Failed login attempts before being IP banned.
|
**ban_after**: Failed login attempts before being IP banned.
|
||||||
**ban_duration**: IP ban duration in seconds.
|
**ban_duration**: IP ban duration in seconds.
|
||||||
**open_shaarli**: Anyone can add a new link while logged out if enabled.
|
**open_shaarli**: Anyone can add a new link while logged out if enabled.
|
||||||
**trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
|
**trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy.
|
||||||
|
|
||||||
### Resources
|
### Resources
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ It might be useful if your IP adress often changes.
|
||||||
**updates**: File path for the ran updates file.
|
**updates**: File path for the ran updates file.
|
||||||
**log**: Log file path.
|
**log**: Log file path.
|
||||||
**update_check**: Last update check file path.
|
**update_check**: Last update check file path.
|
||||||
**theme**: Templates directory.
|
**raintpl_tpl**: Templates directory.
|
||||||
**raintpl_tmp**: Template engine cache directory.
|
**raintpl_tmp**: Template engine cache directory.
|
||||||
**thumbnails_cache**: Thumbnails cache directory.
|
**thumbnails_cache**: Thumbnails cache directory.
|
||||||
**page_cache**: Shaarli's internal cache directory.
|
**page_cache**: Shaarli's internal cache directory.
|
||||||
|
@ -134,7 +134,7 @@ It might be useful if your IP adress often changes.
|
||||||
"log": "data\/log.txt",
|
"log": "data\/log.txt",
|
||||||
"update_check": "data\/lastupdatecheck.txt",
|
"update_check": "data\/lastupdatecheck.txt",
|
||||||
"raintpl_tmp": "tmp\/",
|
"raintpl_tmp": "tmp\/",
|
||||||
"theme": "tpl\/",
|
"raintpl_tpl": "tpl\/",
|
||||||
"thumbnails_cache": "cache",
|
"thumbnails_cache": "cache",
|
||||||
"page_cache": "pagecache"
|
"page_cache": "pagecache"
|
||||||
},
|
},
|
||||||
|
@ -205,7 +205,6 @@ It might be useful if your IP adress often changes.
|
||||||
|
|
||||||
## Additional configuration
|
## Additional configuration
|
||||||
|
|
||||||
The playvideos plugin may require that you adapt your server's
|
The playvideos plugin may require that you adapt your server's
|
||||||
[Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) [](.html)
|
[Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) [](.html)
|
||||||
configuration to work properly.[(.html)]((.html).html)
|
configuration to work properly.[(.html)]((.html).html)
|
||||||
|
|
||||||
|
|
|
@ -123,11 +123,12 @@
|
||||||
$conf->setEmpty('general.timezone', date_default_timezone_get());
|
$conf->setEmpty('general.timezone', date_default_timezone_get());
|
||||||
$conf->setEmpty('general.title', 'Shared links on '. escape(index_url($_SERVER)));
|
$conf->setEmpty('general.title', 'Shared links on '. escape(index_url($_SERVER)));
|
||||||
$conf->setEmpty('resource.theme', 'default');
|
$conf->setEmpty('resource.theme', 'default');
|
||||||
RainTPL::$tpl_dir = 'tpl/'.$conf->get('resource.theme').'/'; // template directory
|
RainTPL::$tpl_dir = $conf->get('resource.raintpl_tpl').'/'.$conf->get('resource.theme').'/'; // template directory
|
||||||
RainTPL::$cache_dir = $conf->get('resource.raintpl_tmp'); // cache directory
|
RainTPL::$cache_dir = $conf->get('resource.raintpl_tmp'); // cache directory
|
||||||
|
|
||||||
$pluginManager = new PluginManager($conf);
|
$pluginManager = new PluginManager($conf);
|
||||||
$pluginManager->load($conf->get('general.enabled_plugins'));
|
$pluginManager->load($conf->get('general.enabled_plugins'));
|
||||||
|
|
||||||
date_default_timezone_set($conf->get('general.timezone', 'UTC'));
|
date_default_timezone_set($conf->get('general.timezone', 'UTC'));
|
||||||
|
|
||||||
ob_start(); // Output buffering for the page cache.
|
ob_start(); // Output buffering for the page cache.
|
||||||
|
|
Loading…
Reference in a new issue