本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
示例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 = ' ';
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);
//.........这里部分代码省略.........