15 Commits

Author SHA1 Message Date
Qi HU
d9f1612e8e fix: Fix duplicate includes in app.php
When we use `php artisan optimize` command, it will cause duplicate includes:
```
PHP Fatal error:  Cannot redeclare function get_global_sp_state() (previously declared in include/globalfunctions.php:3) in include/globalfunctions.php on line 3

   Symfony\Component\ErrorHandler\Error\FatalError

  Cannot redeclare function get_global_sp_state() (previously declared in include/globalfunctions.php:3)

  at include/globalfunctions.php:3
      1▕ <?php
      2▕
  ➜   3▕ function get_global_sp_state()
      4▕ {
      5▕        static $global_promotion_state;
      6▕        $cacheKey = \App\Models\Setting::TORRENT_GLOBAL_STATE_CACHE_KEY;
      7▕        if (is_null($global_promotion_state)) {
      8▕         $row = \Nexus\Database\NexusDB::remember($cacheKey, 600, function () use ($cacheKey) {
      9▕             return \Nexus\Database\NexusDB::getOne('torrents_state', 1);

   Whoops\Exception\ErrorException

  Cannot redeclare function get_global_sp_state() (previously declared in include/globalfunctions.php:3)

  at include/globalfunctions.php:3
      1▕ <?php
      2▕
  ➜   3▕ function get_global_sp_state()
      4▕ {
      5▕        static $global_promotion_state;
      6▕        $cacheKey = \App\Models\Setting::TORRENT_GLOBAL_STATE_CACHE_KEY;
      7▕        if (is_null($global_promotion_state)) {
      8▕         $row = \Nexus\Database\NexusDB::remember($cacheKey, 600, function () use ($cacheKey) {
      9▕             return \Nexus\Database\NexusDB::getOne('torrents_state', 1);

      +1 vendor frames

  2   [internal]:0
      Whoops\Run::handleShutdown()
```

So we should use `require_once` instead of `require` to avoid this issue.

Signed-off-by: Qi HU <github@spcsky.com>
2025-10-02 21:46:24 +08:00
xiaomlove
403a9447a9 plugin management + user tables and torrents table text column migrate 2025-01-19 14:37:00 +08:00
xiaomlove
fa66aa5887 GLOBALS hook&plugin 2022-06-08 16:49:01 +08:00
xiaomlove
09f6e5b274 finish plugin: sticky promotion 2022-06-08 14:15:59 +08:00
xiaomlove
0e4544459f finish support with otane 2022-03-20 22:14:00 +08:00
xiaomlove
4857b799b8 api scrape + medal wearing status 2022-03-19 14:55:43 +08:00
xiaomlove
6665c98169 refactor announce 2022-03-17 18:46:49 +08:00
xiaomlove
7dee44140b define constant fix 2021-05-16 02:57:00 +08:00
xiaomlove
17e92f885b define NEXUS_START in api 2021-05-16 00:35:48 +08:00
xiaomlove
33e99516b6 torrent api + swip constants 2021-05-15 19:29:44 +08:00
xiaomlove
3737d684ee fix installation for beta5 2021-04-30 15:10:31 +08:00
xiaomlove
d1b7561aae [exam] add progress do update the same time 2021-04-27 02:44:44 +08:00
xiaomlove
63a2c71cb6 normalize-logging 2021-04-26 20:37:17 +08:00
xiaomlove
7cfde3f95b show-exam 2021-04-25 21:28:58 +08:00
xiaomlove
e48461546f integrate laravel framework 2021-04-02 19:48:41 +08:00