本文整理汇总了PHP中DataHandler::createRecursiveFoldersIfNotExists方法的典型用法代码示例。如果您正苦于以下问题:PHP DataHandler::createRecursiveFoldersIfNotExists方法的具体用法?PHP DataHandler::createRecursiveFoldersIfNotExists怎么用?PHP DataHandler::createRecursiveFoldersIfNotExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataHandler
的用法示例。
在下文中一共展示了DataHandler::createRecursiveFoldersIfNotExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$returnResult = new HttpResult();
$returnResult->setSuccess(1);
//iniciando o resultado para o html
$retornoDaPaginaHTML = new HttpMenu();
//inicia a variavel de consulta de obj para cache
$obj = NULL;
$save_cache = TRUE;
$cache_base_folder = "cache/menu/init/";
if (Config::USE_QUERY_CACHE) {
//verifica se tem cache
$cache_folder = $cache_base_folder;
$cache_file = md5(implode("/", $this->arrayRestFolder));
/*
Debug::print_r($this->arrayRestFolder);
echo Debug::li($cache_file);
*/
$cache_location = $cache_folder . $cache_file;
if (file_exists($cache_location)) {
$resultSerial = unserialize(file_get_contents($cache_location));
//return $resultSerial;
$obj = $resultSerial;
$save_cache = FALSE;
}
}
//o cache não está gravado
if ($obj == NULL) {
$obj = $this;
//pedindo para consultar
$this->consultValues();
}
$retornoDaPaginaHTML->arrayMaterial = $obj->arrayMaterial->result;
$retornoDaPaginaHTML->arrayColor = $obj->arrayColor->result;
$retornoDaPaginaHTML->arrayStyle = $obj->arrayStyle->result;
$retornoDaPaginaHTML->arrayFormat = $obj->arrayFormat->result;
$retornoDaPaginaHTML->arrayTheme = $obj->arrayTheme->result;
$retornoDaPaginaHTML->arrayComposition = $obj->arrayComposition->result;
$retornoDaPaginaHTML->arrayTechnique = $obj->arrayTechnique->result;
$retornoDaPaginaHTML->arrayType = $obj->arrayType->result;
$botaoPromocoes = new stdClass();
$botaoPromocoes->name = "em promoção";
//echo Debug::li($this->currentQuery);exit();
if (!$this->currentQuery) {
$this->currentQuery = "SELECT count( DISTINCT `view_product_model_quadro_b`.id) as count FROM `view_product_model_quadro_b` WHERE 1 AND view_product_model_quadro_b.`active` = '1'";
}
$queryPromocao = $this->currentQuery . " AND promocao = 1 ";
//oic 2
$dbi = new DbInterface();
$rt = $dbi->query($queryPromocao);
//echo Debug::li($this->currentQuery);
if (isset($_GET["teste"])) {
Debug::print_r($rt);
}
$rt->fetchAll();
//Debug::print_r($rt);exit();
$botaoPromocoes->id = 1;
$botaoPromocoes->total = $rt->result[0]->count;
//total de produtos em promoção
$retornoDaPaginaHTML->arrayPromocoes = array($botaoPromocoes);
$retornoDaPaginaHTML->requestMaterial = $obj->requestMaterial;
$retornoDaPaginaHTML->requestColor = $obj->requestColor;
$retornoDaPaginaHTML->requestStyle = $obj->requestStyle;
$retornoDaPaginaHTML->requestFormat = $obj->requestFormat;
$retornoDaPaginaHTML->requestTheme = $obj->requestTheme;
$retornoDaPaginaHTML->requestComposition = $obj->requestComposition;
$retornoDaPaginaHTML->requestTechnique = $obj->requestTechnique;
$retornoDaPaginaHTML->requestType = $obj->requestType;
$retornoDaPaginaHTML->requestSearch = $obj->requestSearch;
$retornoDaPaginaHTML->requestResumeSearch = $obj->requestResumeSearch;
$retornoDaPaginaHTML->requestPromocao = $obj->requestPromocao;
$retornoDaPaginaHTML->arrayRestFolder = $this->arrayRestFolder;
$retornoDaPaginaHTML->arrayVariable = $this->arrayVariable;
$retornoDaPaginaHTML->url_final = $obj->url_final;
//salvando o objeto de resultado de html no retorno
$returnResult->setHttpContentResult($retornoDaPaginaHTML);
// -------------------------------------------------------------------[ BREAD CRUMB ]
// Agora criando a array de bread crumb
$retornoDaPaginaHTML->arrayBreadCrumb = $this->arrayBreadCrumb;
// E também popula os títulos, que até então ele não tinha como pegar
foreach ($retornoDaPaginaHTML->arrayBreadCrumb as $BreadCrumbInfoVO) {
//pelo tipo de item e id ele ve o nome
if (FALSE) {
//apenas para o auto completar do eclipse
$BreadCrumbInfoVO = new BreadCrumbInfoVO();
}
$BreadCrumbInfoVO->tittle = $retornoDaPaginaHTML->getNameByTypeAndId($BreadCrumbInfoVO->reference, $BreadCrumbInfoVO->id);
}
if (Config::USE_QUERY_CACHE && $save_cache) {
//grava o cache
DataHandler::createRecursiveFoldersIfNotExists($cache_folder);
//criando obj simplificado para serializar
$stdObj = new stdClass();
$stdObj->arrayMaterial = $obj->arrayMaterial;
$stdObj->arrayColor = $obj->arrayColor;
$stdObj->arrayStyle = $obj->arrayStyle;
$stdObj->arrayFormat = $obj->arrayFormat;
$stdObj->arrayTheme = $obj->arrayTheme;
$stdObj->arrayComposition = $obj->arrayComposition;
$stdObj->arrayTechnique = $obj->arrayTechnique;
//.........这里部分代码省略.........