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


PHP checkdir函数代码示例

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


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

示例1: permissioncheck

function permissioncheck()
{
    global $root;
    if (file_exists('step0.lock')) {
        header('Location: index.php?step=1');
    }
    $dirs = array($root . 'dir_list/' => 0, $root . 'imdb/' => 0, $root . 'cache/' => 0, $root . 'torrents/' => 0, $root . 'uploads/' => 0, $root . 'include/backup/' => 0, $root . 'logs/' => 0, $root . 'install/' => 0, $root . 'install/extra/' => 0, $root . 'include/' => 0);
    checkdir($dirs);
    $continue = true;
    $out = '<fieldset><legend>Directory check</legend>';
    foreach ($dirs as $dir => $state) {
        if (!$state) {
            $continue = false;
        }
        $out .= '<div class="' . ($state ? 'readable' : 'notreadable') . '">' . $dir . '</div>';
    }
    if (!$continue) {
        $out .= '<div class="info" style="text-align:center">It looks like you need to chmod some directories!<br/>all directories marked in red should be chmoded 0777<br/><input type="button" value="Reload" onclick="window.location.reload()"/></div>';
    }
    $out .= '</fieldset>';
    if ($continue) {
        $out .= '<fieldset><div style="text-align:center"><input type="button" onclick="window.location.href=\'index.php?step=1\'" value="Next step" /></div></fieldset>';
        file_put_contents('step0.lock', '1');
    }
    return $out;
}
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:26,代码来源:permissioncheck.php

示例2: checkdir

function checkdir($basedir)
{
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (!is_dir($basedir . "/" . $file)) {
                    echo "filename: {$basedir}/\r\n\r\n{$file} " . checkBOM("{$basedir}/{$file}") . " <br>";
                } else {
                    $dirname = $basedir . "/" . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
}
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:16,代码来源:zmr.php

示例3: checkdir

function checkdir($basedir)
{
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (!is_dir($basedir . '/' . $file)) {
                    $filename = $basedir . '/' . $file;
                    echo 'filename:' . $basedir . '/' . $file . checkBOM($filename) . '<br>';
                } else {
                    $dirname = $basedir . '/' . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
}
开发者ID:976112643,项目名称:manor,代码行数:17,代码来源:clearBOM.php

示例4: checkdir

function checkdir($dir, $filter = '/(\\.php|\\.xml|\\.js)$/')
{
    $checklist = array();
    $files = scandir($dir);
    foreach ($files as $file) {
        if ($file[0] == '.') {
            continue;
        }
        $path = "{$dir}/{$file}";
        if (is_dir($path)) {
            $checklist += checkdir($path, $filter);
        } elseif (preg_match($filter, $file)) {
            $checklist[$path] = 1;
        }
    }
    return $checklist;
}
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:17,代码来源:convertlanguage.php

示例5: checkdir

function checkdir($basedir)
{
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..' && $file != '.svn') {
                if (!is_dir($basedir . "/" . $file)) {
                    if (checkBOM("{$basedir}/{$file}") == 1) {
                        echo "filename: {$basedir}/{$file} <font color=red>tồn tại, đã tự động xóa.</font> <br>";
                    }
                } else {
                    $dirname = $basedir . "/" . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
}
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:18,代码来源:cleanbom.php

示例6: checkdir

function checkdir($basedir)
{
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (!is_dir($basedir . "/" . $file)) {
                    if (checkBOM("{$basedir}/{$file}") == 1) {
                        echo "filename: {$basedir}/{$file}<font color=red>found bom and remove!</font><br>";
                    }
                } else {
                    $dirname = $basedir . "/" . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
}
开发者ID:babyhuangshiming,项目名称:webserver,代码行数:18,代码来源:del_bom.php

示例7: checkdir

function checkdir($basedir)
{
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..' && $file != '.svn') {
                if (!is_dir($basedir . "/" . $file)) {
                    $res = checkBOM("{$basedir}/{$file}");
                    if ($res != 'BOM Not Found.') {
                        echo "filename: {$basedir}/{$file} " . $res . " <br>";
                    }
                } else {
                    $dirname = $basedir . "/" . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
}
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:19,代码来源:bom.php

示例8: checkdir

function checkdir($basedir = '', $loop = true)
{
    $basedir = empty($basedir) ? '.' : $basedir;
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (!is_dir($basedir . '/' . $file)) {
                    echo '文件: ' . $basedir . '/' . $file . checkBOM($basedir . '/' . $file) . ' <br>';
                } else {
                    if (!$loop) {
                        continue;
                    }
                    $dirname = $basedir . '/' . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
}
开发者ID:zhxiho,项目名称:Work,代码行数:20,代码来源:newfile.php

示例9: permissioncheck

function permissioncheck()
{
    global $root;
    if (file_exists('step0.lock')) {
        header('Location: index.php?step=1');
    }
    $dirs = array($root . 'dir_list/' => 0, $root . 'imdb/' => 0, $root . 'cache/' => 0, $root . 'torrents/' => 0, $root . 'uploads/' => 0, $root . 'include/backup/' => 0, $root . 'sqlerr_logs/' => 0, $root . 'install/' => 0, $root . 'install/extra/' => 0, $root . 'include/' => 0);
    checkdir($dirs);
    $continue = true;
    $out = '<fieldset><legend>Directory check</legend>';
    $cmd = 'chmod 0777';
    foreach ($dirs as $dir => $state) {
        if (!$state) {
            $continue = false;
            $cmd .= ' ' . $dir;
        }
        $out .= '<div class="' . ($state ? 'readable' : 'notreadable') . '">' . $dir . '</div>';
    }
    if (!$continue) {
        $out .= '<div class="info">It looks like you need to chmod some directories!<br/>all directories marked in red should be chmoded 0777<br/>' . '<label for="show-chmod" class="btn">Show me the CHMOD command</label><input type="checkbox" id="show-chmod">' . '<pre class="chmod-cmd">' . $cmd . '</pre>' . '<input type="button" value="Reload" onclick="window.location.reload()"/>' . '</div>';
    }
    $out .= '</fieldset>';
    $out .= '<fieldset><legend>Module check</legend>';
    $memcached_loaded = true;
    if (!extension_loaded('memcached')) {
        $continue = $memcached_loaded = false;
        $out .= '<div class="notreadable">memcached</div>';
    } else {
        $out .= '<div class="readable">memcached</div>';
    }
    if ($memcached_loaded) {
        $out .= '<div class="info">The memcached module for PHP is not installed and is required for u232<br/>' . '<input type="button" value="Reload" onclick="window.location.reload()"/>' . '</div>';
    }
    $out .= '</fieldset>';
    if ($continue) {
        $out .= '<fieldset><div><input type="button" onclick="window.location.href=\'index.php?step=1\'" value="Next step" /></div></fieldset>';
        file_put_contents('step0.lock', '1');
    }
    return $out;
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:40,代码来源:permissioncheck.php

示例10: log_file

function log_file($msg, $filename)
{
    $msg = date('Y-m-d H:i:s') . $msg;
    checkdir($filename);
    file_put_contents($filename, $msg . "\n", FILE_USE_INCLUDE_PATH | FILE_APPEND);
}
开发者ID:AkeEvoX,项目名称:prakongmitt,代码行数:6,代码来源:logger.php

示例11: wp_delete_option

/**
* Deletes an option file
**/
function wp_delete_option($option)
{
    $dirchk = checkdir();
    if ($dirchk == false) {
        return false;
    } elseif (!file_exists(WIPIOPTSPATH . "/{$option}.wp")) {
        return false;
    } else {
        unlink(WIPIOPTSPATH . "/{$option}.wp");
        return true;
    }
}
开发者ID:jojospaghettio,项目名称:wicketpixie,代码行数:15,代码来源:wipioptions.php

示例12: checkdir

function checkdir($basedir)
{
    static $num = 0;
    if ($dh = opendir($basedir)) {
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (!is_dir($basedir . "/" . $file)) {
                    if (file_ext($file) == 'php' && checkBOM("{$basedir}/{$file}", false)) {
                        echo "filename: {$basedir}/{$file} <b style='color:red'>bom found.</b><br/>";
                        $num++;
                    }
                } else {
                    $dirname = $basedir . "/" . $file;
                    checkdir($dirname);
                }
            }
        }
        closedir($dh);
    }
    return $num;
}
开发者ID:project-store,项目名称:phpsite,代码行数:21,代码来源:t.php

示例13: function_exists

    $smarty->assign('dg_ttf', function_exists('imagettftext'));
    $smarty->assign('gd_image', $pass_img);
} else {
    $smarty->assign('gd_image', $fail_img);
}
// directories
$smarty->assign('dir_writable', is_writeable('../cache'));
if (is_writeable('../cache')) {
    $text = checkdir('../cache/SQL');
    $text .= checkdir('../cache/api');
    $text .= checkdir('../cache/data');
    $text .= checkdir('../cache/mails');
    $text .= checkdir('../cache/img');
    $text .= checkdir('../cache/img/map');
    $text .= checkdir('../cache/store');
    $text .= checkdir('../cache/templates_c');
    $smarty->assign('dir_text', $text);
    $smarty->assign('dir_image', $pass_img);
} else {
    $stoppage = true;
    $smarty->assign('dir_image', $fail_img);
}
//config file
$smarty->assign('conf_exists', file_exists('../kbconfig.php'));
if (!file_exists('../kbconfig.php')) {
    $stoppage = true;
    $smarty->assign('conf_image', $fail_img);
} elseif (is_writeable('../kbconfig.php')) {
    $smarty->assign('conf_image', $pass_img);
} else {
    $stoppage = true;
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:install_step2.php

示例14: checkdir

function checkdir($dir = '') {
  global $lang_dir, $fromlang, $tolang;

  $dir = str_replace('\\','/',$dir);	// Replace Backslash with right slash
  $dir = preg_replace('/\/$/','',$dir);	// Remove trailing slash

  $sourcedir = $lang_dir . '/' . $fromlang;
  $targetdir = $lang_dir . '/' . $tolang;

  if($dir) {
    $sourcedir .= '/' . $dir;
    $targetdir .= '/' . $dir;
  }


//DEBUG
//echo "<pre>";
//echo 'checkdir dir=', $dir, "\n";
//echo "sourcedir=", $sourcedir, "\n";    
//echo "targetdir=", $targetdir, "\n";    
//echo "</pre>";


  $indent = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

  if(!is_dir($sourcedir)) {
    error('Source directory <b>' . $sourcedir . '</b> NOT FOUND!');
    return;
  }

  if(!is_dir($targetdir)) {
    error('Target directory <b>' . $targetdir . '</b> NOT FOUND!');
    return;
  }

  //----------------------------------------------------

  $d = opendir($sourcedir);

  while($file = readdir($d)) {

    if($file == '.' || $file == '..') continue;

    $sourcefile = $sourcedir . '/' . $file;
    $targetfile = $targetdir . '/' . $file;

//DEBUG
//echo "<pre>";
//echo "sourcefile=", $sourcefile, "\n";    
//echo "targetfile=", $targetfile, "\n";    
//echo "</pre>";


    if(is_dir($sourcefile)) {

      $newdir = ($dir ? $dir . '/' : '') . $file;
      checkdir($newdir);

    } else if( substr($file, -4) == '.php') {

      $error = 0;
      $left  = str_replace($lang_dir,'',$sourcefile);
      $right = str_replace($lang_dir,'',$targetfile);
      $source = array();
      $target = array();
      $class = '';
      $right_exists = false;

      //--------------------------------

      unset($lang);
      unset($extend_lang);
      
      include $sourcefile;

      if (isset($lang)) {
        $source = $lang;

      } elseif (isset($extend_lang)) {
        $source = $extend_lang;

      } else {
        $error = 1;
        $left .= '<br>is NOT LANG file!!!';
      }
        
      //--------------------------------

      if (!is_file($targetfile)) {
        $error = 1;
        $right .= '<br>FILE NOT FOUND!!!';

      } else {

        unset($lang);
        unset($extend_lang);
        $right_exists = true;

        include ($targetfile);

//.........这里部分代码省略.........
开发者ID:xDiglett,项目名称:discuzx30,代码行数:101,代码来源:_langdiff.php


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