Example #1
0
function TestIsFileDir($dirname)
{
    $dirs = array('name' => '', 'isdir' => false, 'writeable' => false);
    $dirs['name'] = $dirname;
    if (is_dir($dirname)) {
        $dirs['isdir'] = true;
        $dirs['writeable'] = TestWriteAble($dirname);
    }
    return $dirs;
}
Example #2
0
function TestIsFileDir($dirname)
{
    $dirs = array('name' => '', 'isdir' => FALSE, 'writeable' => FALSE);
    $dirs['name'] = $dirname;
    if (is_dir($dirname)) {
        $dirs['isdir'] = TRUE;
        $dirs['writeable'] = TestWriteAble($dirname);
    }
    return $dirs;
}
Example #3
0
 //检测需要的目录权限
 foreach ($filelists as $v) {
     $prvdir = preg_replace("#\\/([^\\/]*)\$#", '/', $v['name']);
     if (!preg_match("#^\\.#", $prvdir)) {
         $prvdir = './';
     }
     $n = TRUE;
     foreach ($incdir as $k => $v) {
         if (preg_match("#^" . $v . "#i", $prvdir)) {
             $n = FALSE;
             break;
         }
     }
     if (!isset($prvdirs[$prvdir]) && $n && is_dir($prvdir)) {
         $prvdirs[$prvdir][0] = 1;
         $prvdirs[$prvdir][1] = TestWriteAble($prvdir);
     }
 }
 $prvdir = "<table cellpadding='1' cellspacing='1' width='350' bgcolor='#cfcfcf' style='margin-top:5px;'>\r\n";
 $prvdir .= "<tr style='background:#FBFCE2'><th width='270'>目录</td><th align='center'>可写</td></tr>\r\n";
 foreach ($prvdirs as $k => $v) {
     if ($v) {
         $cw = '√';
     } else {
         $cw = '<font color="red">×</font>';
     }
     $prvdir .= "<tr bgcolor='#ffffff'><td >{$k}</td>";
     $prvdir .= "<td align='center' >{$cw}</td></tr>\r\n";
 }
 $prvdir .= "</table>";
 $win = new OxWindow();