本文整理汇总了PHP中main::perms方法的典型用法代码示例。如果您正苦于以下问题:PHP main::perms方法的具体用法?PHP main::perms怎么用?PHP main::perms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main
的用法示例。
在下文中一共展示了main::perms方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: conf_perms
public function conf_perms()
{
if (is_writable(INC . "/conf.inc.php")) {
if (main::perms(INC . "/conf.inc.php", 0444)) {
main::errors("Configuration File made unwritable.");
} else {
main::errors("Failed to make the configuration file unwritable.");
}
} else {
main::errors("Configuration File is already unwritable.");
}
echo style::replaceVar('tpl/admin/system/perms-tools.tpl');
}
示例2: checkPerms
public function checkPerms($file)
{
if (is_writable($file)) {
return true;
} else {
main::perms($file, 0777);
if (is_writable($file)) {
return true;
} else {
main::perms($file, 0777);
return false;
}
}
}
示例3: generateSiteUrl
include INC . "/conf.inc.php";
if (!writeconfig($sql['host'], $sql['user'], $sql['pass'], $sql['db'], $sql['pre'], "false")) {
$install_array['ANYTHING'] = "Your {$link} isn't writeable or does not exist. Please make it writable and make sure it exists.";
$disable = true;
} else {
$install_array['ANYTHING'] = "Since you've already ran the installer, your config has been re-written to the \"not installed\" state. If you are upgrading, this is normal!<br>";
}
}
if (!file_exists($link)) {
if (!fopen($link, "w+")) {
$install_array["ANYTHING"] = "Your {$link} file doesn't exist. Please create it as a blank file and make it writable.";
$disable = true;
}
}
if (!is_writable($link)) {
if (!main::perms($link, 0666)) {
$install_array["ANYTHING"] = "Your {$link} isn't writeable. Please make it writable.";
$disable = true;
}
}
echo style::get("header.tpl");
if ($disable) {
echo '<script type="text/javascript">$(function(){
$(".twobutton").attr("disabled", "true");$("#method").attr("disabled", "true");}
);</script>';
}
$install_array["GENERATED_URL"] = generateSiteUrl();
echo style::replaceVar("../install/includes/tpl/install.tpl", $install_array);
echo style::get("footer.tpl");
include INC . "/output.php";
//Output it
示例4: checkPerms
private function checkPerms($file)
{
if (is_writable($file)) {
if (main::perms($file, 0444)) {
return "";
} else {
return "<div class='warn'><img src='../themes/icons/error.png' alt='' /> Warning: Configuration file (conf.inc.php) is still writable!</div>";
}
} else {
return "";
}
}