• Dev
  • Extended development issues

davwheat
I used the command flarum-cli init to generate the extension, and the configuration should be automatically generated. I just generated another extension automatically, and there is nothing in it. It’s just a simple framework. After I installed it through composer, I still didn’t execute extend.php. But I just found another installed extension, echo some text in extend.php, it can be output without clearing the cache, which makes me very puzzled

    l25359423 okay:

    • can you show the contents of your root composer.json the one where you added the repositories entry
    • can share the folder structure of that directory

    Otherwise it would probably be best if you DM me through discord.

      luceos
      my composer.json

      {
          "name": "flarum/flarum",
          "description": "Delightfully simple forum software.",
          "type": "project",
          "keywords": [
              "forum",
              "discussion"
          ],
          "homepage": "https://flarum.org/",
          "license": "MIT",
          "authors": [
              {
                  "name": "Flarum",
                  "email": "info@flarum.org",
                  "homepage": "https://flarum.org/team"
              }
          ],
          "support": {
              "issues": "https://github.com/flarum/core/issues",
              "source": "https://github.com/flarum/flarum",
              "docs": "https://flarum.org/docs/"
          },
          "require": {
              "afrux/asirem": "^0.1.7",
              "afrux/online-users-widget": "*",
              "archlinux-de/flarum-theme-archlinux": "^1.1",
              "askvortsov/flarum-auto-moderator": "*",
              "cccyun/flarum-clogin-oauth": "^1.0",
              "clarkwinkelmann/catch-the-fish": "^1.1",
              "clarkwinkelmann/flarum-ext-comicsans": "^1.0",
              "clarkwinkelmann/flarum-ext-emojionearea": "^1.0",
              "clarkwinkelmann/flarum-ext-group-invitation": "^1.0",
              "clarkwinkelmann/flarum-local-extenders": "^1.0",
              "darkle/fancybox": "^1.0",
              "datlechin/flarum-scroll-buttons": "*",
              "dem13n/discussion-cards": "^0.3.8",
              "flarum-lang/chinese-simplified": "v1.0.4.1009",
              "flarum/approval": "*",
              "flarum/bbcode": "*",
              "flarum/core": "^1.2",
              "flarum/emoji": "*",
              "flarum/flags": "*",
              "flarum/lang-english": "*",
              "flarum/likes": "*",
              "flarum/lock": "*",
              "flarum/markdown": "*",
              "flarum/mentions": "*",
              "flarum/nicknames": "*",
              "flarum/pusher": "*",
              "flarum/statistics": "*",
              "flarum/sticky": "*",
              "flarum/subscriptions": "*",
              "flarum/suspend": "*",
              "flarum/tags": "*",
              "flarumite/simple-spoilers": "*",
              "flarumtr/flarum-ext-mobile-search": "^1.2",
              "fof/formatting": "^1.0",
              "fof/links": "^1.0",
              "fof/moderator-notes": "*",
              "fof/nightmode": "^1.1",
              "fof/pages": "^1.0",
              "fof/pretty-mail": "^1.0",
              "fof/profile-image-crop": "*",
              "fof/sitemap": "^1.0",
              "fof/socialprofile": "^1.1",
              "fof/upload": "^1.0",
              "fof/user-bio": "^1.0",
              "fof/user-directory": "*",
              "fof/username-request": "^1.0",
              "ganuonglachanh/sonic": "^0.1.5",
              "hehongyuanlove/flarum-auth-qq": "^2.3",
              "ianm/level-ranks": "*",
              "ianm/synopsis": "^1.2",
              "isaced/flarum-ext-email-verification-switch": "*",
              "itnt/flarum-uitab": "^0.4.2",
              "jslirola/flarum-ext-login2seeplus": "^0.2.0",
              "justoverclock/christmas-snow-effect": "*",
              "justoverclock/custom-header": "*",
              "justoverclock/discussion-info": "*",
              "justoverclock/events-countdown": "*",
              "justoverclock/flachat": "*",
              "justoverclock/flarum-ext-welcomebox": "^1.3",
              "justoverclock/geo-weather": "*",
              "justoverclock/header-slideshow": "*",
              "justoverclock/hot-discussions": "*",
              "justoverclock/thread-read-time": "*",
              "kyrne/whisper": "^0.1.3",
              "lawaxi/harmony": "*",
              "madchatthew/themelightshadow": "^0.2.1",
              "malago/flarum-linkpreview": "^0.2.1",
              "matteocontrini/flarum-imgur-upload": "^3.9",
              "nearata/flarum-ext-cakeday": "^2.0",
              "nearata/flarum-ext-embed-video": "^3.0",
              "pipecraft/flarum-ext-id-slug": "^1.1",
              "serakoi/flarumdiscordtheme": "^0.1.0",
              "shuke/test2": "@dev",
              "sycho/flarum-profile-cover": "^1.3",
              "v17development/flarum-seo": "^1.8",
              "v17development/flarum-user-badges": "^1.0",
              "webbinaro/flarum-calendar": "^1.0",
              "whydesd/reply-to-see": "^1.1",
              "xelson/flarum-ext-chat": "^1.1",
              "yannisme/confixtheme": "^2.3",
              "yannisme/oxotheme": "^2.0",
              "zequeen/acgembed-remastered": "^1.1",
              "zerosonesfun/flarum-bbcode-audio": "^2.1",
              "zerosonesfun/flarum-essential-audio": "^0.3.0",
              "zerosonesfun/flarum-featured-card": "^1.0",
              "zerosonesfun/flarum-inline-audio": "*",
              "zerosonesfun/flarum-theme-nes": "*"
          },
          "config": {
              "preferred-install": "dist",
              "sort-packages": true
          },
          "repositories": [
              {
                  "type": "path",
                  "url": "/var/www/ares_forum/packages/*"
              }
          ]
      }

      luceos
      Do you want to see the contents in the /var/www/ares_forum/packages/ directory?

      luceos
      my /var/www/ares_forum/packages/

      .
      ├── daily-music
      │   ├── composer.json
      │   ├── extend.php
      │   ├── js
      │   ├── migrations
      │   ├── resources
      │   └── src
      ├── test
      │   ├── composer.json
      │   ├── extend.php
      │   ├── js
      │   ├── less
      │   ├── LICENSE.md
      │   ├── locale
      │   ├── README.md
      │   ├── tests
      │   └── vendor
      └── test2
          ├── composer.json
          ├── composer.lock
          ├── extend.php
          ├── js
          ├── less
          ├── LICENSE.md
          ├── locale
          ├── README.md
          └── vendor

        l25359423 can you get in touch with me over discord luceos#0001? I think I would need to see the system to understand why it's not working.

        PS shuke/daily-music isn't in your composer.json require section now. Not sure you did that for testing..?

          luceos
          I've added your discord account. Mine is: shuke#5138
          Yes, I removed shuke/daily-music in composer. Json for testing purposes

          If you find your solution can you please post it on here. I am interested in making my own extensions in the future and I've been following this thread to get a good idea of how to get started and trouble shoot. 😃

            luceos

            Wellwisher

            Thank goodness, finally solved it! I changed Shuke\DailyMusic to Leo\DailyMusic, you read that right, Shuke -> Leo, that's all, it works fine. I still don't know why shuke doesn't work, is it a keyword? But it does work now, thanks luceos for your help, thanks for your patience, I'm almost giving up, you can add requests via my discord, I think we'll talk again

              luceos

              I tried to modify it again, Shuke -> ShuKe, it works, the k should be capitalized, I think flarum does special treatment to the namespace when it is called?

                luceos
                I still have a question, I want to implement the function of automatic posting in the extension, is there a method like api/discussions that can be called in the background, I didn't find it in the documentation

                  l25359423 not really. Mac/OSX isn't really case sensitive, linux is. So when you development you should provision a partition that is case sensitive, eg look at this outdated article: https://www.aaronsaray.com/2017/add-case-sensitive-disk-in-macos

                  l25359423 glad you solved it 👍

                  l25359423 yeah there's an api for that /api/discussions with a POST. If you use PHP you might as well use the client https://github.com/maicol07/flarum-api-client

                  A better solution from the extension is to either use the internal API client or to directly use Discussion::reply method.