File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
phpfastcache/3.0.0/drivers Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ function driver_stats($option = array()) {
143143
144144 $ total = 0 ;
145145 $ removed = 0 ;
146+ $ content = array ();
146147 while ($ file =@readdir ($ dir )) {
147148 if ($ file !=". " && $ file !=".. " && is_dir ($ path ."/ " .$ file )) {
148149 // read sub dir
@@ -156,6 +157,16 @@ function driver_stats($option = array()) {
156157 $ file_path = $ path ."/ " .$ file ."/ " .$ f ;
157158 $ size = @filesize ($ file_path );
158159 $ object = $ this ->decode ($ this ->readfile ($ file_path ));
160+
161+ if (strpos ($ f ,". " ) === false ) {
162+ $ key = $ f ;
163+ }
164+ else {
165+ //Because PHP 5.3, this cannot be written in single line
166+ $ key = explode (". " , $ f );
167+ $ key = $ key [0 ];
168+ }
169+ $ content [$ key ] = array ("size " =>$ size ,"write_time " =>$ object ["write_time " ]);
159170 if ($ this ->isExpired ($ object )) {
160171 @unlink ($ file_path );
161172 $ removed += $ size ;
@@ -172,6 +183,7 @@ function driver_stats($option = array()) {
172183 "Expired and removed [bytes] " => $ removed ,
173184 "Current [bytes] " => $ res ['size ' ],
174185 );
186+ $ res ["data " ] = $ content ;
175187 return $ res ;
176188 }
177189
You can’t perform that action at this time.
0 commit comments