mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Revert "Fixed broken file_write function (#736)"
This reverts commit 68ee788d32
.
This commit is contained in:
parent
68ee788d32
commit
039ec555f2
42 changed files with 7 additions and 51 deletions
17
common.php
17
common.php
|
@ -212,22 +212,19 @@ function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replac
|
|||
{
|
||||
$bytes_written = false;
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if ($max_size && file_exists($file) && filesize($file) >= $max_size) {
|
||||
$file_parts = pathinfo($file);
|
||||
$new_name = ($file_parts['filename'] . '_[old]_' . date('Y-m-d_H-i-s_') . getmypid() . '.' . $file_parts['extension']);
|
||||
|
||||
$old_name = $file;
|
||||
$ext = '';
|
||||
if (preg_match('#^(.+)(\.[^\\\/]+)$#', $file, $matches)) {
|
||||
[$old_name, $ext] = $matches;
|
||||
}
|
||||
$new_name = $old_name . '_[old]_' . date('Y-m-d_H-i-s_') . getmypid() . $ext;
|
||||
clearstatcache();
|
||||
|
||||
if (!file_exists($new_name)) {
|
||||
rename($file, $new_name);
|
||||
}
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if (!file_exists($file) && bb_mkdir(dirname($file))) {
|
||||
if (!file_exists($file) && $dir_created = bb_mkdir(dirname($file))) {
|
||||
$fp = fopen($file, 'ab+');
|
||||
}
|
||||
if (isset($fp)) {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
|
@ -1 +0,0 @@
|
|||
111111111111
|
Loading…
Add table
Add a link
Reference in a new issue