%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/businessmultisite/wp-content/plugins/timber-library/lib/Cache/
Upload File :
Create Path :
Current File : /var/www/businessmultisite/wp-content/plugins/timber-library/lib/Cache/KeyGenerator.php

<?php

namespace Timber\Cache;

use Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface;

class KeyGenerator implements KeyGeneratorInterface {

	/**
	 * @param mixed $value
	 * @return string
	 */
	public function generateKey( $value ) {
		if ( is_a($value, 'Timber\Cache\TimberKeyGeneratorInterface') ) {
			return $value->_get_cache_key();
		}

		if ( is_array($value) && isset($value['_cache_key']) ) {
			return $value['_cache_key'];
		}

		$key = md5(json_encode($value));
		if ( is_object($value) ) {
			$key = get_class($value).'|'.$key;
		}

		return $key;
	}

}

Zerion Mini Shell 1.0