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


PHP FileSystem::perm_compare方法代码示例

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


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

示例1: CheckFile

 function CheckFile($path, $type = 'dir')
 {
     $current = '?';
     $expected = '777';
     $euid = '?';
     if (FileSystem::HasFunctions()) {
         $current = @substr(decoct(@fileperms($path)), -3);
         if ($type == 'file') {
             $expected = FileSystem::getExpectedPerms_file($path);
         } else {
             $expected = FileSystem::getExpectedPerms($path);
         }
         if (FileSystem::perm_compare($expected, $current)) {
             $this->passed_count++;
             return;
         }
         $euid = FileSystem::file_uid($path);
     } elseif (gp_is_writable($path)) {
         $this->passed_count++;
         return;
     }
     $this->failed_count++;
     if ($this->failed_count > $this->show_failed_max) {
         return;
     }
     echo '<tr><td>';
     echo substr($path, $this->check_dir_len);
     echo '</td><td>';
     echo $current;
     echo '</td><td>';
     echo $expected;
     echo '</td><td>';
     echo $euid;
     echo '</td><td>';
     echo $this->euid;
     echo '</td></tr>';
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:37,代码来源:admin_rm.php

示例2: CheckDataFolder

 function CheckDataFolder()
 {
     global $ok, $dataDir, $langmessage;
     echo '<tr>';
     echo '<td class="nowrap">';
     $folder = $dataDir . '/data';
     if (strlen($folder) > 23) {
         $show = '...' . substr($folder, -20);
     } else {
         $show = $folder;
     }
     echo sprintf($langmessage['Permissions_for'], $show);
     echo ' &nbsp; ';
     echo '</td>';
     if (!is_dir($folder)) {
         if (!@mkdir($folder, 0777)) {
             echo '<td class="passed_orange">' . $langmessage['See_Below'] . ' (0)</td>';
             $this->can_write_data = $ok = false;
         } else {
             echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
         }
     } elseif (gp_is_writable($folder)) {
         echo '<td class="passed">' . $langmessage['Passed'] . '</td>';
     } else {
         echo '<td class="passed_orange">' . $langmessage['See_Below'] . ' (1)</td>';
         $this->can_write_data = $ok = false;
     }
     //show current info
     $expected = '777';
     if (file_exists($folder) && ($current = @substr(decoct(fileperms($folder)), -3))) {
         $expected = FileSystem::getExpectedPerms($folder);
         if (FileSystem::perm_compare($expected, $current)) {
             echo '<td class="passed">';
             echo $current;
         } else {
             echo '<td class="passed_orange">';
             echo $current;
         }
     } else {
         echo '<td class="passed_orange">';
         echo '???';
     }
     echo '</td>';
     echo '<td>';
     echo $expected;
     echo '</td>';
     echo '</tr>';
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:48,代码来源:install.php


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