本文整理汇总了PHP中UniteFunctionsRev::parseSettingsFile方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::parseSettingsFile方法的具体用法?PHP UniteFunctionsRev::parseSettingsFile怎么用?PHP UniteFunctionsRev::parseSettingsFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::parseSettingsFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBulletSetFromDir
/**
*
* get bullets set from some dir
*/
private static function getBulletSetFromDir($dir)
{
$pathSet = GlobalsUniteRev::$pathAssetsBullets . $dir . "/";
if (is_dir($pathSet) == false) {
UniteFunctionsRev::throwError("The bullet directory: {$dir} not found!");
}
$urlSet = GlobalsUniteRev::$urlAssetsBullets . $dir . "/";
//set paths
$bulletNormal = "bullet_normal.png";
$bulletActive = "bullet_active.png";
$bgLeft = "bg_left.png";
$bgRepeat = "bg_repeat.png";
$bgRight = "bg_right.png";
$preview = "preview.png";
$options = "options.ini";
//validate required paths:
if (file_exists($pathSet . $bulletNormal) == false) {
UniteFunctionsRev::throwError("{$bulletNormal} not found in bullets set: {$dir}");
}
if (file_exists($pathSet . $bulletActive) == false) {
UniteFunctionsRev::throwError("{$bulletActive} not found in bullets set: {$dir}");
}
//validate required paths:
if (file_exists($pathSet . $preview) == false) {
UniteFunctionsRev::throwError("{$preview} not found in bullets set: {$dir}");
}
//set data array
$set = array();
$set["name"] = $dir;
$set["url_normal"] = $urlSet . $bulletNormal;
$set["url_active"] = $urlSet . $bulletActive;
$set["url_preview"] = $urlSet . $preview;
//set bg
$set["url_bgleft"] = "";
$set["url_bgright"] = "";
$set["url_bgrepeat"] = "";
$set["is_bg"] = false;
if (file_exists($pathSet . $bgLeft) && file_exists($pathSet . $bgRight) && file_exists($pathSet . $bgRepeat)) {
$set["is_bg"] = true;
$set["url_bgleft"] = $urlSet . $bgLeft;
$set["url_bgright"] = $urlSet . $bgRight;
$set["url_bgrepeat"] = $urlSet . $bgRepeat;
}
//set options
$set["options"] = array();
if (file_exists($pathSet . $options)) {
$content = file_get_contents($pathSet . $options);
$arrOptions = UniteFunctionsRev::parseSettingsFile($content);
$set["options"] = $arrOptions;
}
return $set;
}