本文整理汇总了PHP中category::compile方法的典型用法代码示例。如果您正苦于以下问题:PHP category::compile方法的具体用法?PHP category::compile怎么用?PHP category::compile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::compile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderd_gen_conf
function renderd_gen_conf() {
global $root_path;
global $lists_dir;
$conf=fopen("$root_path/data/renderd.conf", "w");
if(file_exists("$root_path/data/renderd.conf.template"))
$template=file_get_contents("$root_path/data/renderd.conf.template");
else
$template=file_get_contents("$root_path/src/renderd.conf.template");
fwrite($conf, $template);
if(file_exists("$root_path/data/renderd.conf.local")) {
$template=file_get_contents("$root_path/data/renderd.conf.local");
fwrite($conf, $template);
}
foreach(category_list() as $f=>$tags) {
print "check state of category '$f'\n";
$category=new category($f);
$cat_version=$category->get_newest_version();
$recompile=false;
if(!file_exists("$lists_dir/$f.renderd")) {
$recompile=true;
}
else {
$c=$category->get_renderd_config();
if((!isset($c['VERSION']))||($cat_version!=$c['VERSION']))
$recompile=true;
}
if($recompile) {
print " (re-)compiling $f\n";
$category->compile();
}
$conf_part=file_get_contents("$lists_dir/$f.renderd");
fwrite($conf, $conf_part);
}
global $renderd_files;
if($renderd_files) foreach($renderd_files as $file) {
if(file_exists($file)) {
fwrite($conf, file_get_contents($file));
}
}
$renderd=array();
call_hooks("renderd_get_maps", &$renderd);
foreach($renderd as $id=>$entry) {
fwrite($conf, renderd_print_entry($id, $entry));
}
// generate dummy entry in renderd.conf to avoid renderd-bug
global $data_path;
fwrite($conf, "[dummy]\n");
fwrite($conf, "URI=/tiles/dummy/\n");
fwrite($conf, "XML=/home/osm/data/render_dummy.xml\n");
fwrite($conf, "HOST=dummy.host\n");
fclose($conf);
}
示例2: categories_has_saved
function categories_has_saved($id) {
print "Detect saving of $id -> compile\n";
$cat=new category($id);
$cat->compile();
renderd_restart();
}