* fix glob error.

This commit is contained in:
wangyidong
2015-02-10 16:09:32 +08:00
parent 33f5ca6e73
commit 13e6b3d91b
5 changed files with 33 additions and 15 deletions
+13 -9
View File
@@ -43,18 +43,22 @@ class backup extends control
$backups = array();
if(empty($this->view->error))
{
foreach(glob("{$this->backupPath}*.sql.php") as $file)
$sqlFiles = glob("{$this->backupPath}*.sql.php");
if(!empty($sqlFiles))
{
$backupFile = new stdclass();
$backupFile->time = filemtime($file);
$backupFile->name = str_replace('.sql.php', '', basename($file));
$backupFile->files[$file] = filesize($file);
if(file_exists($this->backupPath . $backupFile->name . '.file.zip.php'))
foreach($sqlFiles as $file)
{
$backupFile->files[$this->backupPath . $backupFile->name . '.file.zip.php'] = filesize($this->backupPath . $backupFile->name . '.file.zip.php');
}
$backupFile = new stdclass();
$backupFile->time = filemtime($file);
$backupFile->name = str_replace('.sql.php', '', basename($file));
$backupFile->files[$file] = filesize($file);
if(file_exists($this->backupPath . $backupFile->name . '.file.zip.php'))
{
$backupFile->files[$this->backupPath . $backupFile->name . '.file.zip.php'] = filesize($this->backupPath . $backupFile->name . '.file.zip.php');
}
$backups[$backupFile->name] = $backupFile;
$backups[$backupFile->name] = $backupFile;
}
}
}
krsort($backups);
+5 -1
View File
@@ -60,7 +60,11 @@ class editorModel extends model
elseif(is_dir($moduleFullFile))
{
$ext = ($moduleFile == 'js' or $moduleFile == 'css') ? $moduleFile : 'php';
foreach(glob($moduleFullFile . $this->pathFix . "*.$ext") as $fileName) $allModules[$moduleFullDir][$moduleFullFile][$fileName] = basename($fileName);
$extFiles = glob($moduleFullFile . $this->pathFix . "*.$ext");
if(!empty($extFiles))
{
foreach($extFiles as $fileName) $allModules[$moduleFullDir][$moduleFullFile][$fileName] = basename($fileName);
}
}
else
{
+7 -2
View File
@@ -87,5 +87,10 @@
</div>
<div id='querybox' class='<?php if($browseType == 'bysearch') echo 'show';?>'></div>
</div>
<?php foreach(glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php") as $fileName) include_once $fileName; ?>
<?php
$headerHooks = glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php");
if(!empty($headerHooks))
{
foreach($headerHooks as $fileName) helper::import($fileName);
}
?>
+1 -1
View File
@@ -58,7 +58,7 @@
<?php
$headerHooks = glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php");
if(is_array($headerHooks))
if(!empty($headerHooks))
{
foreach($headerHooks as $fileName) helper::import($fileName);
}
+7 -2
View File
@@ -39,5 +39,10 @@
</div>
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
</div>
<?php foreach(glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php") as $fileName) include_once $fileName; ?>
<?php
$headerHooks = glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php");
if(!empty($headerHooks))
{
foreach($headerHooks as $fileName) helper::import($fileName);
}
?>