Last active
July 22, 2016 01:25
-
-
Save frostbitten/957b32a91860c58519ab81188dcd3d11 to your computer and use it in GitHub Desktop.
try some sitesettings caching
This file contains hidden or 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
<?php | |
$stash_options = array('path' => $app->config('base.path') . DIRECTORY_SEPARATOR . 'stash-cache'); | |
$stash_driver = new \Stash\Driver\FileSystem($stash_options); | |
$app->pool = new \Stash\Pool($stash_driver); | |
error_log('before sitesettings: '.microtime(1)); | |
$uri_public_root = $app->config('uri')['public']; | |
$item = $app->pool->getItem('UserFrosting SiteSettings '.urlencode($uri_public_root)); | |
if($item->isMiss()) | |
{ | |
//is not valid | |
$item->set(new \UserFrosting\SiteSettings($setting_values, $setting_descriptions)); | |
$app->pool->save($item); | |
}else{ | |
//is valid | |
} | |
$app->site = $item->get(); | |
error_log('after sitesettings: '.microtime(1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment