mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
log path support env specific
This commit is contained in:
@@ -68,13 +68,13 @@ class ModpanelTableSeeder extends Seeder
|
|||||||
'url' => 'testip.php',
|
'url' => 'testip.php',
|
||||||
'info' => 'Test if IP is banned',
|
'info' => 'Test if IP is banned',
|
||||||
),
|
),
|
||||||
7 =>
|
// 7 =>
|
||||||
array (
|
// array (
|
||||||
'id' => 8,
|
// 'id' => 8,
|
||||||
'name' => 'Add Bonus Points',
|
// 'name' => 'Add Bonus Points',
|
||||||
'url' => 'amountbonus.php',
|
// 'url' => 'amountbonus.php',
|
||||||
'info' => 'Add Bonus Points to one or All Users.',
|
// 'info' => 'Add Bonus Points to one or All Users.',
|
||||||
),
|
// ),
|
||||||
8 =>
|
8 =>
|
||||||
array (
|
array (
|
||||||
'id' => 9,
|
'id' => 9,
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ class SysoppanelTableSeeder extends Seeder
|
|||||||
\DB::table('sysoppanel')->delete();
|
\DB::table('sysoppanel')->delete();
|
||||||
|
|
||||||
\DB::table('sysoppanel')->insert(array (
|
\DB::table('sysoppanel')->insert(array (
|
||||||
0 =>
|
// 0 =>
|
||||||
array (
|
// array (
|
||||||
'id' => 1,
|
// 'id' => 1,
|
||||||
'name' => 'Delete disabled users',
|
// 'name' => 'Delete disabled users',
|
||||||
'url' => 'deletedisabled.php',
|
// 'url' => 'deletedisabled.php',
|
||||||
'info' => 'Delete all disabled users',
|
// 'info' => 'Delete all disabled users',
|
||||||
),
|
// ),
|
||||||
1 =>
|
1 =>
|
||||||
array (
|
array (
|
||||||
'id' => 2,
|
'id' => 2,
|
||||||
@@ -99,9 +99,9 @@ class SysoppanelTableSeeder extends Seeder
|
|||||||
11 =>
|
11 =>
|
||||||
array (
|
array (
|
||||||
'id' => 12,
|
'id' => 12,
|
||||||
'name' => 'Add Upload',
|
'name' => 'Add Bonus/Attend card/Invite/upload',
|
||||||
'url' => 'amountupload.php',
|
'url' => 'increment-bulk.php',
|
||||||
'info' => 'Add upload to certain classes',
|
'info' => 'Add Bonus/Attend card/Invite/upload to certain classes',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -229,8 +229,14 @@ function getLogFile()
|
|||||||
return $logFile;
|
return $logFile;
|
||||||
}
|
}
|
||||||
$config = nexus_config('nexus');
|
$config = nexus_config('nexus');
|
||||||
$logFile = sys_get_temp_dir() . '/nexus_' . date('Y-m-d') . '.log';
|
$path = getenv('NEXUS_LOG_DIR', true);
|
||||||
if (!empty($config['log_file'])) {
|
$fromEnv = true;
|
||||||
|
if ($path === false) {
|
||||||
|
$fromEnv = false;
|
||||||
|
$path = sys_get_temp_dir();
|
||||||
|
}
|
||||||
|
$logFile = rtrim($path, '/') . '/nexus_' . date('Y-m-d') . '.log';
|
||||||
|
if (!$fromEnv && !empty($config['log_file'])) {
|
||||||
$logFile = $config['log_file'];
|
$logFile = $config['log_file'];
|
||||||
}
|
}
|
||||||
$lastDotPos = strrpos($logFile, '.');
|
$lastDotPos = strrpos($logFile, '.');
|
||||||
|
|||||||
Reference in New Issue
Block a user