您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP脚本实现Magento权限设置与缓存清理

2025/11/23 9:29:01发布24次查看
php脚本实现magento权限设置与缓存清理的实例代码有需要的朋友可参考一下.php实例代码如下:
isdir() ) chmod( $path, $dirmodes ); else if( is_file( $path ) ) chmod( $path, $filemodes ); } } ## 清除指定目录 function cleandir($dir) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && is_file($dir.'/'.$file)) { if (unlink($dir.'/'.$file)) { } else { echo $dir . '/' . $file . ' (file) not deleted!
'; } } else if ($file != '.' && $file != '..' && is_dir($dir.'/'.$file)) { cleandir($dir.'/'.$file); if (rmdir($dir.'/'.$file)) { } else { echo $dir . '/' . $file . ' (directory) not deleted!
'; } } } closedir($handle); } } ## 判断目录是否为空 function isdirempty($dir){ return (($files = @scandir($dir)) && count($files) <= 2); } echo ----------------------- cleanup start -------------------------
; $start = (float) array_sum(explode(' ',microtime())); echo
*************** setting permissions ***************
; echo setting all folder permissions to 755
; echo setting all file permissions to 644
; alldirchmod( . ); echo setting pear permissions to 550
; chmod(pear, 550); echo
****************** clearing cache ******************
; if (file_exists(var/cache)) { echo clearing var/cache
; cleandir(var/cache); } if (file_exists(var/session)) { echo clearing var/session
; cleandir(var/session); } if (file_exists(var/minifycache)) { echo clearing var/minifycache
; cleandir(var/minifycache); } if (file_exists(downloader/pearlib/cache)) { echo clearing downloader/pearlib/cache
; cleandir(downloader/pearlib/cache); } if (file_exists(downloader/pearlib/download)) { echo clearing downloader/pearlib/download
; cleandir(downloader/pearlib/download); } if (file_exists(downloader/pearlib/pear.ini)) { echo removing downloader/pearlib/pear.ini
; unlink (downloader/pearlib/pear.ini); } echo
************** checking for extensions ***********
; if (!isdirempty(app/code/local/)) { echo -= warning =- overrides or extensions exist in the app/code/local folder
; } if (!isdirempty(app/code/community/)) { echo -= warning =- overrides or extensions exist in the app/code/community folder
; } $end = (float) array_sum(explode(' ',microtime())); echo
------------------- cleanup completed in:. sprintf(%.4f, ($end-$start)). seconds ------------------
;
文章地址:
转载随意^^请带上本文地址!
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product