This commit is contained in:
2018-12-17 14:43:33 +01:00
parent 206d1fb0d0
commit 287a7ccd0c
6 changed files with 65 additions and 68 deletions
@@ -82,4 +82,28 @@ trait CompiledFile
return parent::content($var);
}
/**
* Serialize file.
*/
public function __sleep()
{
return [
'filename',
'extension',
'raw',
'content',
'settings'
];
}
/**
* Unserialize file.
*/
public function __wakeup()
{
if (!isset(static::$instances[$this->filename])) {
static::$instances[$this->filename] = $this;
}
}
}
@@ -47,7 +47,7 @@ class InitializeProcessor extends ProcessorBase implements ProcessorInterface
// Redirect pages with trailing slash if configured to do so.
$path = $uri->path() ?: '/';
if ($path !== '/' && $config->get('system.pages.redirect_trailing_slash', false) && Utils::endsWith($path, '/')) {
$this->container->redirect(rtrim($path, '/'));
$this->container->redirectLangSafe(rtrim($path, '/'));
}
$this->container->setLocale();
+25
View File
@@ -286,4 +286,29 @@ class User extends Data
return 'https://www.gravatar.com/avatar/' . md5($this->email);
}
/**
* Serialize user.
*/
public function __sleep()
{
return [
'items',
'storage'
];
}
/**
* Unserialize user.
*/
public function __wakeup()
{
$this->gettersVariable = 'items';
$this->nestedSeparator = '.';
if (null === $this->blueprints) {
$blueprints = new Blueprints;
$this->blueprints = $blueprints->get('user/account');
}
}
}