<?php
class SmartyObject extends Smarty {
function SmartyObject() {
$this->Smarty();
$this->template_dir = ENQUETE_HOME_DIR . 'template/web';
$this->config_dir = ENQUETE_HOME_DIR . 'config';
$path= ENQUETE_HOME_DIR . "templates_c";
if(!file_exists($path)){
mkdir($path);
}
// if from http server
if(isset($_SERVER["REQUEST_URI"])){
$uri = $_SERVER["REQUEST_URI"];
$uri = str_replace(" ", "", $uri);
$pos = strrpos($uri, "/");
$compileDir= substr($uri, 0, $pos);
$dirs = split("/", $compileDir);
foreach($dirs as $dir){
if(!empty($dir)){
$path .= DIRECTORY_SEPARATOR . $dir;
if(!file_exists($path)){
mkdir($path);
}
}
}
}
$this->compile_dir = $path;
}
}
?>
class SmartyObject extends Smarty {
function SmartyObject() {
$this->Smarty();
$this->template_dir = ENQUETE_HOME_DIR . 'template/web';
$this->config_dir = ENQUETE_HOME_DIR . 'config';
$path= ENQUETE_HOME_DIR . "templates_c";
if(!file_exists($path)){
mkdir($path);
}
// if from http server
if(isset($_SERVER["REQUEST_URI"])){
$uri = $_SERVER["REQUEST_URI"];
$uri = str_replace(" ", "", $uri);
$pos = strrpos($uri, "/");
$compileDir= substr($uri, 0, $pos);
$dirs = split("/", $compileDir);
foreach($dirs as $dir){
if(!empty($dir)){
$path .= DIRECTORY_SEPARATOR . $dir;
if(!file_exists($path)){
mkdir($path);
}
}
}
}
$this->compile_dir = $path;
}
}
?>