Ham::__construct PHP Method

__construct() public method

Create a Ham application.
public __construct ( string $name = 'default', mixed $cache = False, boolean $log = False )
$name string a canonical name for this app. Must not be shared between apps or cache collisions will happen. Unless you want that.
$cache mixed
$log boolean
    public function __construct($name = 'default', $cache = False, $log = False)
    {
        $this->name = $name;
        if ($cache === False) {
            $cache = static::create_cache($this->name);
        }
        $this->cache = $cache;
        if ($log) {
            $this->logger = static::create_logger($log);
        }
    }

Usage Example

Beispiel #1
0
 public function __construct($name, $cache = null, $logger = null)
 {
     $this->_twig_env = new Twig_Environment(new Twig_Loader_Filesystem($this->template_paths));
     parent::__construct();
 }