Есть ли динамический способ потребовать/включить файл php?Php

Кемеровские программисты php общаются здесь
Anonymous
Есть ли динамический способ потребовать/включить файл php?

Сообщение Anonymous »


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

Вернуться в «Php»