Restore custum tpl dir

This commit is contained in:
Knah Tsaeb 2016-12-08 10:03:46 +01:00
parent 81b9c01366
commit a197ef5e02
5 changed files with 15 additions and 13 deletions

View File

@ -189,7 +189,7 @@ class ConfigManager
'general.title',
'general.header_link',
'privacy.default_private_links',
'redirector.url'
'redirector.url',
);
// Only logged in user can alter config.
@ -296,6 +296,7 @@ class ConfigManager
$this->setEmpty('resource.updates', 'data/updates.txt');
$this->setEmpty('resource.log', 'data/log.txt');
$this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt');
$this->setEmpty('resource.raintpl_tpl', 'tpl/');
$this->setEmpty('resource.theme', 'default');
$this->setEmpty('resource.raintpl_tmp', 'tmp/');
$this->setEmpty('resource.thumbnails_cache', 'cache');

View File

@ -40,6 +40,7 @@ class ConfigPhp implements ConfigIO
'resource.updates' => 'config.UPDATES_FILE',
'resource.log' => 'config.LOG_FILE',
'resource.update_check' => 'config.UPDATECHECK_FILENAME',
'resource.raintpl_tpl' => 'config.RAINTPL_TPL',
'resource.theme' => 'config.theme',
'resource.raintpl_tmp' => 'config.RAINTPL_TMP',
'resource.thumbnails_cache' => 'config.CACHEDIR',
@ -99,7 +100,7 @@ class ConfigPhp implements ConfigIO
$configStr .= '$GLOBALS[\'' . $key . '\'] = ' . var_export($conf[$key], true) . ';' . PHP_EOL;
}
}
// Store all $conf['config']
foreach ($conf['config'] as $key => $value) {
$configStr .= '$GLOBALS[\'config\'][\''. $key .'\'] = '.var_export($conf['config'][$key], true).';'. PHP_EOL;

View File

@ -172,7 +172,7 @@ It might be useful if your IP adress often changes.<br />
<strong>updates</strong>: File path for the ran updates file.<br />
<strong>log</strong>: Log 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>thumbnails_cache</strong>: Thumbnails cache directory.<br />
<strong>page_cache</strong>: Shaarli's internal cache directory.<br />
@ -220,7 +220,7 @@ It might be useful if your IP adress often changes.<br />
<span class="dt">&quot;log&quot;</span><span class="fu">:</span> <span class="st">&quot;data</span><span class="ch">\/</span><span class="st">log.txt&quot;</span><span class="fu">,</span>
<span class="dt">&quot;update_check&quot;</span><span class="fu">:</span> <span class="st">&quot;data</span><span class="ch">\/</span><span class="st">lastupdatecheck.txt&quot;</span><span class="fu">,</span>
<span class="dt">&quot;raintpl_tmp&quot;</span><span class="fu">:</span> <span class="st">&quot;tmp</span><span class="ch">\/</span><span class="st">&quot;</span><span class="fu">,</span>
<span class="dt">&quot;theme&quot;</span><span class="fu">:</span> <span class="st">&quot;tpl</span><span class="ch">\/</span><span class="st">&quot;</span><span class="fu">,</span>
<span class="dt">&quot;raintpl_tpl&quot;</span><span class="fu">:</span> <span class="st">&quot;tpl</span><span class="ch">\/</span><span class="st">&quot;</span><span class="fu">,</span>
<span class="dt">&quot;thumbnails_cache&quot;</span><span class="fu">:</span> <span class="st">&quot;cache&quot;</span><span class="fu">,</span>
<span class="dt">&quot;page_cache&quot;</span><span class="fu">:</span> <span class="st">&quot;pagecache&quot;</span>
<span class="fu">},</span>

View File

@ -3,7 +3,7 @@
## 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:
* 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)
### Credentials
> You shouldn't edit those.
**login**: Login username.
@ -59,12 +59,12 @@ See also [Plugin System](Plugin-System.html).[](.html)
### 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.
**ban_after**: Failed login attempts before being IP banned.
**ban_duration**: IP ban duration in seconds.
**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
@ -73,7 +73,7 @@ It might be useful if your IP adress often changes.
**updates**: File path for the ran updates file.
**log**: Log file path.
**update_check**: Last update check file path.
**theme**: Templates directory.
**raintpl_tpl**: Templates directory.
**raintpl_tmp**: Template engine cache directory.
**thumbnails_cache**: Thumbnails 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",
"update_check": "data\/lastupdatecheck.txt",
"raintpl_tmp": "tmp\/",
"theme": "tpl\/",
"raintpl_tpl": "tpl\/",
"thumbnails_cache": "cache",
"page_cache": "pagecache"
},
@ -205,7 +205,6 @@ It might be useful if your IP adress often changes.
## 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)
configuration to work properly.[(.html)]((.html).html)

View File

@ -123,11 +123,12 @@ $conf = new ConfigManager();
$conf->setEmpty('general.timezone', date_default_timezone_get());
$conf->setEmpty('general.title', 'Shared links on '. escape(index_url($_SERVER)));
$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
$pluginManager = new PluginManager($conf);
$pluginManager->load($conf->get('general.enabled_plugins'));
date_default_timezone_set($conf->get('general.timezone', 'UTC'));
ob_start(); // Output buffering for the page cache.