File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -280,13 +280,9 @@ protected function readfile($file) {
280
280
throw new Exception ("Can't Read File " ,96 );
281
281
282
282
}
283
- if (flock ($ file_handle , LOCK_SH | LOCK_NB )) {
284
- while (!feof ($ file_handle )) {
285
- $ line = fgets ($ file_handle );
286
- $ string .= $ line ;
287
- }
288
- } else {
289
- throw new Exception ("Can't Read File " ,96 );
283
+ while (!feof ($ file_handle )) {
284
+ $ line = fgets ($ file_handle );
285
+ $ string .= $ line ;
290
286
}
291
287
fclose ($ file_handle );
292
288
Original file line number Diff line number Diff line change @@ -52,15 +52,13 @@ private function getFilePath($keyword, $skip = false) {
52
52
* Skip Create Sub Folders;
53
53
*/
54
54
if ($ skip == false ) {
55
- if (!@ file_exists ( $ path )) {
56
- if (!@mkdir ($ path ,$ this ->__setChmodAuto ())) {
55
+ //if it doesn't exist, I can't create it, and nobody beat me to creating it:
56
+ if (!@is_dir ( $ path ) && !@ mkdir ($ path ,$ this ->__setChmodAuto ()) && !@ is_dir ( $ path )) {
57
57
throw new Exception ("PLEASE CHMOD " .$ this ->getPath ()." - 0777 OR ANY WRITABLE PERMISSION! " ,92 );
58
- }
59
-
60
- } elseif (!is_writeable ($ path )) {
61
- if (!chmod ($ path ,$ this ->__setChmodAuto ())) {
58
+ }
59
+ //if it does exist (after someone beat me to it, perhaps), but isn't writable or fixable:
60
+ if (@is_dir ($ path ) && !is_writeable ($ path ) && !@chmod ($ path ,$ this ->__setChmodAuto ())) {
62
61
throw new Exception ("PLEASE CHMOD " .$ this ->getPath ()." - 0777 OR ANY WRITABLE PERMISSION! " ,92 );
63
- }
64
62
}
65
63
}
66
64
You can’t perform that action at this time.
0 commit comments