mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 12:22:15 +09:00
Add comments to cache files
This commit is contained in:
parent
273671cf4e
commit
568151b5ee
3 changed files with 13 additions and 9 deletions
|
|
@ -259,11 +259,16 @@ class Storage
|
|||
*
|
||||
* @param string $filename
|
||||
* @param mixed $data
|
||||
* @param string $comment (optional)
|
||||
* @return string|false
|
||||
*/
|
||||
public static function writePHPData($filename, $data)
|
||||
public static function writePHPData($filename, $data, $comment = null)
|
||||
{
|
||||
return self::write($filename, '<' . '?php return unserialize(' . var_export(serialize($data), true) . ');');
|
||||
if ($comment !== null)
|
||||
{
|
||||
$comment = "/* $comment */\n";
|
||||
}
|
||||
return self::write($filename, '<' . '?php ' . $comment . 'return unserialize(' . var_export(serialize($data), true) . ');');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue