Ver Fonte

rev.34 for LogViewer

Visman há 4 anos atrás
pai
commit
2827aace31
3 ficheiros alterados com 44 adições e 2 exclusões
  1. 33 1
      app/Models/Pages/Admin/Update.php
  2. 1 1
      app/bootstrap.php
  3. 10 0
      app/config/main.dist.php

+ 33 - 1
app/Models/Pages/Admin/Update.php

@@ -1260,7 +1260,7 @@ class Update extends Admin
         $coreConfig->add(
             'shared=>Log',
             [
-                'class'  => '\ForkBB\Core\Log::class',
+                'class'  => '\\ForkBB\\Core\\Log::class',
                 'config' => [
                     'path'       => '\'%DIR_LOG%/{Y-m-d}.log\'',
                     'lineFormat' => '"\\\\%datetime\\\\% [\\\\%level_name\\\\%] \\\\%message\\\\%\\t\\\\%context\\\\%\\n"',
@@ -1272,6 +1272,38 @@ class Update extends Admin
 
         $coreConfig->save();
 
+        return null;
+   }
+
+    /**
+     * rev.33 to rev.34
+     */
+    protected function stageNumber33(array $args): ?int
+    {
+        $coreConfig = new CoreConfig($this->configFile);
+
+        $coreConfig->add(
+            'shared=>LogViewer',
+            [
+                'class'  => '\\ForkBB\\Core\\LogViewer::class',
+                'config' => [
+                    'dir'        => '\'%DIR_LOG%\'',
+                    'pattern'    => '\'*.log\'',
+                    'lineFormat' => '"\\\\%datetime\\\\% [\\\\%level_name\\\\%] \\\\%message\\\\%\\t\\\\%context\\\\%\\n"',
+                ],
+                'cache' => '\'%Cache%\'',
+            ],
+            'Log'
+        );
+
+        $coreConfig->add(
+            'multiple=>AdminLogs',
+            '\\ForkBB\\Models\\Pages\\Admin\\Logs::class',
+            'AdminParserBBCode'
+        );
+
+        $coreConfig->save();
+
         return null;
    }
 }

+ 1 - 1
app/bootstrap.php

@@ -52,7 +52,7 @@ if (
 }
 $c->PUBLIC_URL = $c->BASE_URL . $forkPublicPrefix;
 
-$c->FORK_REVISION = 33;
+$c->FORK_REVISION = 34;
 $c->START         = $forkStart;
 $c->DIR_APP       = __DIR__;
 $c->DIR_PUBLIC    = \realpath(__DIR__ . '/../public');

+ 10 - 0
app/config/main.dist.php

@@ -120,6 +120,15 @@ return [
                 'timeFormat' => 'Y-m-d H:i:s',
             ],
         ],
+        'LogViewer' => [
+            'class'  => \ForkBB\Core\LogViewer::class,
+            'config' => [
+                'dir'        => '%DIR_LOG%',
+                'pattern'    => '*.log',
+                'lineFormat' => "\\%datetime\\% [\\%level_name\\%] \\%message\\%\t\\%context\\%\n",
+            ],
+            'cache' => '%Cache%',
+        ],
 
         'config'        => '@ConfigModel:init',
         'bans'          => '@BanListModel:init',
@@ -250,6 +259,7 @@ return [
         'AdminParser'     => \ForkBB\Models\Pages\Admin\Parser\Edit::class,
         'AdminParserSmilies' => \ForkBB\Models\Pages\Admin\Parser\Smilies::class,
         'AdminParserBBCode' => \ForkBB\Models\Pages\Admin\Parser\BBCode::class,
+        'AdminLogs'       => \ForkBB\Models\Pages\Admin\Logs::class,
 
         'ConfigModel'     => \ForkBB\Models\Config\Model::class,
         'ConfigModelLoad' => \ForkBB\Models\Config\Load::class,