tonic icon indicating copy to clipboard operation
tonic copied to clipboard

MetaDataCache suggestion

Open drkibitz opened this issue 11 years ago • 2 comments

I really like the cache feature, and that you can pass resources directly in options ;)

But just a suggestion to maybe create another class called MetadataCacheInclude or something.

Basically it writes a PHP file to disk, and includes it next time around. Even more simple alternative to MetadataCacheFile.

Too much kool-aid?

drkibitz avatar Jul 01 '13 08:07 drkibitz

Not sure what you mean, can you explain?

peej avatar Jul 01 '13 21:07 peej

Something like:

public function save($resources)
{
    return file_put_contents($this->filename, '<?php return ' . var_export($resources, true) . ';');
}

public function load()
{
    return include $this->filename;
}

drkibitz avatar Jul 01 '13 22:07 drkibitz