Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] evo()->getConfig('site_url') некорректно работает в консольной команде #502

Closed
0test opened this issue Jan 15, 2025 · 3 comments
Labels
wontfix This will not be worked on

Comments

@0test
Copy link

0test commented Jan 15, 2025

Описание

evo()->getConfig('site_url') возвращает http://localhost./
Возможно, что-то ещё не берёт из конфига. Имхо, как-то связано с тем ишью про .env и cli, но не уверен

Как воспроизвести.

В сервис-провайдере делаем свою команду

    public function boot()
    {
        $this->commands([
            SendLetters::class, 
        ]);
    }

В классе

class SendLetters extends Command
{
    protected $signature = 'send:letters';
    protected $name = 'send';
    protected $description = 'Отправка новостей на почты подписчиков';
 

    public function handle()
    {
        dd(evo()->getConfig('site_url'));

Наблюдаемое поведение

No response

Ожидаемое поведение

No response

Связанные issue(s)/PR(s)

#488

Версия EvoCMS

Evolution CE 3.1.29

Версия Apache/nginx

No response

Версия PHP

8+

Версия MySQL

No response

Другая информация

No response

@0test 0test added bug Something isn't working not confirmed This issue is not confirmed labels Jan 15, 2025
@Pathologic
Copy link
Contributor

Для консоли нужно вручную задавать MODX_SITE_URL.

@0test
Copy link
Author

0test commented Jan 15, 2025

MODX_BASE_PATH корректный.
MODX_SITE_URL - не то.
Задавать как? Прям руками вколачивать?

@Pathologic Pathologic added wontfix This will not be worked on and removed bug Something isn't working not confirmed This issue is not confirmed labels Feb 12, 2025
@Pathologic
Copy link
Contributor

Да. В core/custom/define.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants