本文整理汇总了PHP中FileUtil::writeFileContent方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtil::writeFileContent方法的具体用法?PHP FileUtil::writeFileContent怎么用?PHP FileUtil::writeFileContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtil
的用法示例。
在下文中一共展示了FileUtil::writeFileContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAdressCacheFile
public function createAdressCacheFile()
{
$addressList = $this->dbGetAllAddress();
$addressList = $addressList['resultList'];
$address = $firstAddress = null;
if ($addressList) {
foreach ($addressList as $val) {
$address[$val['id']] = $val;
$childAddress = $this->getChildAddressById($val['id'], $addressList);
if ($childAddress) {
$address[$val['id']]['child'] = $childAddress;
}
if ($val['parentid'] == 0) {
$val['child'] = $childAddress;
$firstAddress[$val['id']] = $val;
}
}
$address[0]['child'] = $firstAddress;
}
$string_start = "<?php\n \$mobileaddress=";
$string_process = var_export($address, TRUE);
$string_end = ";\n?>";
$string = $string_start . $string_process . $string_end;
FileUtil::writeFileContent($this->cacheFile, $string);
}
示例2: createCategoryCacheFile
public function createCategoryCacheFile()
{
$this->dbGetAllCategory();
$categoryList = $this->categoryList['resultList'];
$category = $firstCategory = null;
if ($categoryList) {
foreach ($categoryList as $val) {
$category[$val['id']] = $val;
$childCategory = $this->getChildCategoryById($val['id'], $categoryList);
if ($childCategory) {
$category[$val['id']]['child'] = $childCategory;
}
if ($val['parentid'] == 0) {
$val['child'] = $childCategory;
$firstCategory[$val['id']] = $val;
}
}
$category[0]['child'] = $firstCategory;
}
$string_start = "<?php\n \$showcategory=";
$string_process = var_export($category, TRUE);
$string_end = ";\n?>";
$string = $string_start . $string_process . $string_end;
FileUtil::writeFileContent($this->cacheFile, $string);
}
示例3: createMenuCacheFile
public function createMenuCacheFile()
{
$this->dbGetAllMenu();
$menu = $firstMenu = null;
$menuList = $this->menuList;
if ($menuList) {
foreach ($menuList['resultList'] as $val) {
$menu[$val['id']] = $val;
$childMenu = $this->getChildMenuById($val['id'], $menuList['resultList']);
if ($childMenu) {
$menu[$val['id']]['child'] = $childMenu;
}
if ($val['parentid'] == 0) {
$val['child'] = $childMenu;
$firstMenu[$val['id']] = $val;
}
}
$menu[0]['child'] = $firstMenu;
}
$string_start = "<?php\n \$menu=";
$string_process = var_export($menu, TRUE);
$string_end = ";\n?>";
$string = $string_start . $string_process . $string_end;
FileUtil::writeFileContent($this->cacheFile, $string);
}