Implementation exec-alike function #30

Открыто
открыта 2018-07-29 13:57:36 +02:00 likoski · комментариев: 5
likoski прокомментировал(а) 2018-07-29 13:57:36 +02:00
Владелец

Aer misses some kind of exec() or system(). It might be very useful, especially on embedded devices to interact with system and other software. I think we should implements it before 1.0.

Aer misses some kind of exec() or system(). It might be very useful, especially on embedded devices to interact with system and other software. I think we should implements it before 1.0.
likoski добавил(а) метки
enhancement
idea
2018-07-29 13:57:36 +02:00
belliash прокомментировал(а) 2018-07-29 16:09:33 +02:00
Владелец

Generally speaking, I think this is good idea.

int exec(string $cmd, [string &$output]);

First argument contains command to execute, second parameter will contains output from command execution if passed by reference.

Function returns -1 if any error ocurred, or command return value.

Some other ideas?

Generally speaking, I think this is good idea. int exec(string $cmd, [string &$output]); First argument contains command to execute, second parameter will contains output from command execution if passed by reference. Function returns -1 if any error ocurred, or command return value. Some other ideas?
devnexen прокомментировал(а) 2018-07-31 17:41:32 +02:00
Участник

Should we get also a potential error reason ? (like from errno for example)

Should we get also a potential error reason ? (like from errno for example)
belliash прокомментировал(а) 2018-07-31 18:30:27 +02:00
Владелец

What kind of error do we expect? If application launched throw error it should be saved in $output and its return code should be returned by exec() function. Do we need something more?

What kind of error do we expect? If application launched throw error it should be saved in $output and its return code should be returned by exec() function. Do we need something more?
devnexen прокомментировал(а) 2018-07-31 20:07:26 +02:00
Участник

All exec* sets errno internally, was just wondering if we should return the string error as third parameter (optional).

Not forcing anything here, it is good as is too.

All exec* sets errno internally, was just wondering if we should return the string error as third parameter (optional). Not forcing anything here, it is good as is too.
belliash прокомментировал(а) 2018-07-31 20:12:34 +02:00
Владелец

This is true. I just wonder in which case it could be useful, because actually I don't find a reason why it might fail, except when exec() would be disabled.

This is true. I just wonder in which case it could be useful, because actually I don't find a reason why it might fail, except when exec() would be disabled.
Войдите, чтобы присоединиться к обсуждению.
Нет этапа
Нет назначенных лиц
3 участников
Уведомления
Срок выполнения
Срок действия недействителен или находится за пределами допустимого диапазона. Пожалуйста, используйте формат 'гггг-мм-дд'.

Срок выполнения не установлен.

Зависимости

Зависимостей нет.

Ссылка: aerscript/Aer#30
Описание отсутствует.