mirror of
https://github.com/getgrav/grav.git
synced 2026-02-23 07:01:26 +01:00
json_encode() is faster than serialize()
ref: http://stackoverflow.com/a/7723730/2566213
This commit is contained in:
@@ -55,7 +55,7 @@ class Config extends Data
|
||||
{
|
||||
// Build file map.
|
||||
$files = $this->build();
|
||||
$key = md5(serialize($files) . GRAV_VERSION);
|
||||
$key = md5(json_encode($files) . GRAV_VERSION);
|
||||
|
||||
if ($force || $key != $this->key) {
|
||||
// First take non-blocking lock to the file.
|
||||
|
||||
@@ -173,7 +173,7 @@ class Pages
|
||||
{
|
||||
$items = $collection->toArray();
|
||||
|
||||
$lookup = md5(serialize($items));
|
||||
$lookup = md5(json_encode($items));
|
||||
if (!isset($this->sort[$lookup][$orderBy])) {
|
||||
$this->buildSort($lookup, $items, $orderBy, $orderManual);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user