Есть ли динамический способ потребовать/включить файл php? ⇐ Php
Есть ли динамический способ потребовать/включить файл php?
Im developing a rest API using PHP and I needed to use a file in two differents endPoints. In the case I have a Login/Register endpoint and a Orders endpoint that are using my tokenService that I'm showing bellow.
The problem is that my structure of folders make the
require_once('../../index.php') work only when requiring the token service by the auth endpoints, because they're in Src/Routes/Auth folder, and work with
require_once('../index.php') when accessed by the order endpoint, which is just in Src/Routes.
Источник: https://stackoverflow.com/questions/780 ... a-php-file
Im developing a rest API using PHP and I needed to use a file in two differents endPoints. In the case I have a Login/Register endpoint and a Orders endpoint that are using my tokenService that I'm showing bellow.
The problem is that my structure of folders make the
require_once('../../index.php') work only when requiring the token service by the auth endpoints, because they're in Src/Routes/Auth folder, and work with
require_once('../index.php') when accessed by the order endpoint, which is just in Src/Routes.
Источник: https://stackoverflow.com/questions/780 ... a-php-file
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как мне потребовать собственный репозиторий в моем композиторе.json? [дубликат]
Anonymous » » в форуме Php - 0 Ответы
- 21 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как я могу потребовать, чтобы хотя бы один флажок был установлен перед отправкой формы?
Anonymous » » в форуме CSS - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как потребовать предопределенные строковые значения в базовых моделях Python pydantic?
Anonymous » » в форуме Python - 0 Ответы
- 10 Просмотры
-
Последнее сообщение Anonymous
-