php专区

 首页 > php专区 > PHP应用 > CMS建站 > ecshop如何解决readdir(): not a valid Directory resource i

ecshop如何解决readdir(): not a valid Directory resource i

分享到:
【字体:
导读:
          有客户ecshop网站程序在ecshop后台---模板管理*---模板选择顶部出现以下报错:Warning: readdir(): supplied argument is not a valid Directory resource in \zuimoban\ecshop\admin\te......

ecshop如何解决readdir(): not a valid Directory resource in报错

有客户ecshop网站程序在ecshop后台---模板管理*---模板选择顶部出现以下报错:

Warning: readdir(): supplied argument is not a valid Directory resource in zuimobanecshopadmintemplate.php on line 66

是第一次看到,看看代码,才知道原因,我们找admintemplate.php找到66行看代码:

  1. $tmp_bak_dir = @opendir(ROOT_PATH . 'temp/backup/library/'); 
  2.  
  3.  while ($file = readdir($tmp_bak_dir)) 
  4.  
  5.  { 
  6.  
  7.      if ($file != '.' && $file != '..' && $file != '.svn' && $file != 'index.htm' && is_file(ROOT_PATH .'temp/backup/library/' . $file) == true) 
  8.  
  9.      { 
  10.  
  11.          $code = substr($file, 0, strpos($file'-')); 
  12.  
  13.          if (!in_array($code$available_code)) 
  14.  
  15.          { 
  16.  
  17.              @unlink(ROOT_PATH . 'temp/backup/library/' . $file); 
  18.  
  19.          } //开源软件:phpfensi.com 
  20.  
  21.      } 
  22.  
  23.  }

该段代码意思 读取temp/backup/library/ 文件夹以及文件,若该文件夹不存在,就会readdir():

分享到:
ECSHOP开发中心教程:ecshop访问商品详情...
ECSHOP开发中心教程:ecshop访问商品详情内容提示登录 ECSHOP开发中心教程继上一篇ecshop如何实现只有登录用户才能访问商品详情内容后,又有新的方法和大家展示. 首先打开你根目录下的goods.php文件 加上如下代码: if($_SESSION['user_id'] == 0){  show_message(&#03...
ECSHOP商品列表商品按后台推荐排序大小排...
ECSHOP商品列表商品按后台推荐排序大小排序教程 Ecshop修改商品分类页的排序方式为推荐排序 要修改Ecshop商品分类页图片的排序方式,我们只需要修改Ecshop里category.php的$default_sort_order_type 默认的排序方式,Ecshop默认的排序方式是以商品的goods_id商品的序号来排序的,我这里呢就改为...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……