json_encode() is faster than serialize()

ref: http://stackoverflow.com/a/7723730/2566213
This commit is contained in:
Jan Chren
2014-09-05 16:17:05 +02:00
parent 0b0ce2eb27
commit e5037eb69b
2 changed files with 2 additions and 2 deletions

View File

@@ -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.

View 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);
}