当前位置: 首页>>代码示例>>PHP>>正文


PHP Safe::is_writable方法代码示例

本文整理汇总了PHP中Safe::is_writable方法的典型用法代码示例。如果您正苦于以下问题:PHP Safe::is_writable方法的具体用法?PHP Safe::is_writable怎么用?PHP Safe::is_writable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Safe的用法示例。


在下文中一共展示了Safe::is_writable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

 $files[] = './parameters/feeds.include.php';
 $files[] = './parameters/files.include.php';
 $files[] = './parameters/hooks.include.php';
 $files[] = './parameters/hooks.xml';
 $files[] = './parameters/letters.include.php';
 $files[] = './parameters/scripts.include.php';
 $files[] = './parameters/servers.include.php';
 $files[] = './parameters/services.include.php';
 $files[] = './parameters/skins.include.php';
 $files[] = './parameters/switch.on';
 $files[] = './parameters/users.include.php';
 $files[] = './temporary/debug.txt';
 $files[] = './temporary/log.txt';
 foreach ($files as $file) {
     // test one file at a time
     if (!Safe::is_writable($file)) {
         $context['text'] .= sprintf(i18n::s('Impossible to write to %s.'), $file) . BR;
         $can_write = FALSE;
     }
 }
 // please chmod or chown files
 if (!$can_write) {
     // provide instructions
     $context['text'] .= '<p>' . i18n::s('WARNING: YACS cannot write to files. If you are running some Unix, please ensure that permissions have been properly set. This issue can also be due to server running in safe mode.') . "</p>\n";
     $context['text'] .= '<p>' . sprintf(i18n::s('Check the provided %s file to find more help on file permissions.'), '<a href="' . i18n::s('readme.txt') . '">' . i18n::s('readme.txt') . '</a>') . "</p>\n";
     $context['text'] .= '<p class="details"><a href="setup.php">' . i18n::s('Check again our ability to write to files') . "</a></p>\n";
     // check
     $value = i18n::s('Configuration files cannot be changed');
     $check = i18n::s('WARNING');
 } else {
     $value = i18n::s('May change configuration files');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:setup.php


注:本文中的Safe::is_writable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。