2016-10-28 21:49:11 +02:00
|
|
|
<?php
|
2019-01-31 09:04:57 +01:00
|
|
|
|
2016-10-28 21:49:11 +02:00
|
|
|
/**
|
2019-01-31 09:04:57 +01:00
|
|
|
* @package Grav\Common\File
|
2016-10-28 21:49:11 +02:00
|
|
|
*
|
2023-01-02 19:09:32 +01:00
|
|
|
* @copyright Copyright (c) 2015 - 2023 Trilby Media, LLC. All rights reserved.
|
2016-10-28 21:49:11 +02:00
|
|
|
* @license MIT License; see LICENSE file for details.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Grav\Common\File;
|
|
|
|
|
|
|
|
|
|
use RocketTheme\Toolbox\File\JsonFile;
|
|
|
|
|
|
2020-09-20 21:04:40 +02:00
|
|
|
/**
|
|
|
|
|
* Class CompiledJsonFile
|
|
|
|
|
* @package Grav\Common\File
|
|
|
|
|
*/
|
2016-10-28 21:49:11 +02:00
|
|
|
class CompiledJsonFile extends JsonFile
|
|
|
|
|
{
|
|
|
|
|
use CompiledFile;
|
2016-11-01 20:03:43 +01:00
|
|
|
|
2016-11-04 13:47:27 +01:00
|
|
|
/**
|
|
|
|
|
* Decode RAW string into contents.
|
|
|
|
|
*
|
|
|
|
|
* @param string $var
|
|
|
|
|
* @param bool $assoc
|
2019-11-15 08:00:48 +01:00
|
|
|
* @return array
|
2016-11-04 13:47:27 +01:00
|
|
|
*/
|
|
|
|
|
protected function decode($var, $assoc = true)
|
2016-11-01 20:03:43 +01:00
|
|
|
{
|
2019-01-31 16:32:06 +01:00
|
|
|
return (array)json_decode($var, $assoc);
|
2016-11-01 20:03:43 +01:00
|
|
|
}
|
2016-10-28 21:49:11 +02:00
|
|
|
}
|