Add custom cache method using callbacks
Add custom cache method using callbacks

My framework has its own caching method with much more powerful techniques (like different caching methods (Memcached vs. file-based vs. database-based vs. something custom) depending on the cached data - and much more...), so I don't want less.php to create any files on its own. Less.php should use the provided cache method. Rather than implementing 100 different caching methods, simply add a powerful custom cache method using callbacks.

<code>		require_once(ZSIM_DIR.'3rdParty/less.php/Less.php');
$this->compiler = new \Less_Parser(array(
	'cache_method' => 'callback',
	'cache_callback' => array(
		'get' => array($this, 'getSingleLessFileCache'),
		'set' => array($this, 'setSingleLessFileCache')
	)
));

/* ... */

function getSingleLessFileCache(\Less_Parser $compiler, $filePath, $cacheIdentifier) {
	/* do something */
	return $rules;
}

function setSingleLessFileCache(\Less_Parser $compiler, $filePath, $cacheIdentifier, $ruleset) {
	/* do something */
}
</code>

oyejorge/less.php,iisisrael/less.php,atdt/less.php,TomArrow/less.php,oyejorge/less.php,TomArrow/less.php,atdt/less.php,TomArrow/less.php,iisisrael/less.php,iisisrael/less.php,oyejorge/less.php,atdt/less.php