src/Webtrees/Cache.php
protected function init() {		
	    if(Apc::isAvailable()) {
		    $driver = new Apc();
		} else {
			if (!is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) {
				// We may not have permission - especially during setup, before we instruct
				// the user to "chmod 777 /data"
				@mkdir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache');
			}
			if (is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) {
			    $driver = new FileSystem(array('path' => WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache'));
			} else {
				// No cache available, let's just use a basic one :-(
				$driver = new Ephemeral();
			}
		}		

		$this->cache = new \Stash\Pool($driver);		
		$this->is_init = true;
	}
protected function init() {		
	    if(Apc::isAvailable()) {
		    $driver = new Apc();
		} else {
			if (!is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) {
				// We may not have permission - especially during setup, before we instruct
				// the user to "chmod 777 /data"
				@mkdir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache');
			}
			if (is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) {
			    $driver = new FileSystem(array('path' => WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache'));
			} else {
				// No cache available, let's just use a basic one :-(
				$driver = new Ephemeral();
			}
		}		

		$this->cache = new \Stash\Pool($driver);		
		$this->is_init = true;
	}
protected function init ( ) { if ( Apc :: isAvailable ( ) ) { $ driver = new Apc ( ) ; } else { if ( ! is_dir ( WT_DATA_DIR . DIRECTORY_SEPARATOR . 'cache' ) ) { // We may not have permission - especially during setup, before we instruct // the user to "chmod 777 /data" @ mkdir ( WT_DATA_DIR . DIRECTORY_SEPARATOR . 'cache' ) ; } if ( is_dir ( WT_DATA_DIR . DIRECTORY_SEPARATOR . 'cache' ) ) { $ driver = new FileSystem ( array ( 'path' => WT_DATA_DIR . DIRECTORY_SEPARATOR . 'cache' ) ) ; } else { // No cache available, let's just use a basic one :-( $ driver = new Ephemeral ( ) ; } } $ this -> cache = new \ Stash \ Pool ( $ driver ) ; $ this -> is_init = true ; }
Initialise the Cache class
Initialise the Cache class