Created
March 15, 2016 14:26
-
-
Save mjrider/880ee40feba6dfd42f55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface ar_core_templateStoreInterface { | |
public function __construct($options); | |
// save template in store | |
public function save( $path, $template, $name, $type = "pobject", $nls = "any"); | |
// retrieve a template defined by a previous save | |
public function get( $path, $name, $type, $nls ); | |
// does an template exists, mainly for fast checking | |
public function exists( $path, $name, $type, $nls ); | |
// return a list of templates defined | |
// returns a array structure | |
// return [ $name ] [ $type ] [ $nls ] | |
public function list(); | |
// return a closure | |
public function import( $path, $name, $type, $nls); | |
} | |
class ar_core_templateFilestore implements ar_core_templateStoreInterface { | |
private $filestore = null; | |
private $cache = []; | |
const $templateFileName = "%s.%s.%s.pinp"; | |
public function __construct($options){ | |
$this->filestore = $options['filestore']; | |
} | |
// save template in store | |
public function save( $template, $name, $type = "pobject", $nls = "any"){ | |
$filename = sprintf(self::$templateFileName,$type,$name,$nls); | |
// FIXME save in filestore | |
} | |
// retrieve a closure defined by a previous save | |
public function get( $template, $type, $nls ); | |
// does an template exists, mainly for | |
public function exists( $template, $type, $nls ); | |
// return a list of templates defined | |
public function list(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment