A
A
Anton2016-07-03 20:43:30
Laravel
Anton, 2016-07-03 20:43:30

How to call a class from another project?

Good evening!
To make it clear what I mean, this can be said to be a continuation of this question - How to install Laravel in the folder I specified from ...
After I installed laravel from 1 project (test.ru folder) to another folder (test2.ru), then I need to access the classes of the second installed project from 1 project. For example: I pressed the "Install Laravel" button, laravel was installed on the server in the test2.ru folder, after which the site became available. In my first project, I display information on the screen about which projects and in which folders I installed. The description should include, for example, the version of the framework. You can display the version of the installed framework like this:
App::version()
But with this code, I will display the version of the framework of the project in which I call this method. And how do I access the App of another project to get its version, and not the current project?
----
If you have any questions, I will definitely answer. I really want to understand how to implement this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D', 2016-07-03
@Yadalay

Options:
1) Use console commands (artisan). Call all sorts of system("php artisan command"). You can write your own command that will display information in the desired format
2) Use the API (the same REST) ​​and get the necessary information via the API The
2nd option is universal, as it allows you to manage projects not only locally, but also on remote servers.

I
index0h, 2016-07-03
@index0h

Похоже на какую-то херню, если честно. Если у вас в проект А не включен проект Б - то видимо это так задумано, иначе вы бы просто подключили Б как зависимость в композере.
То, что хотите несколько раз подключать классы из одних и тех же неймспейсов - плохая идея, работать НЕ будет.
Покретно под ваш кейс использования - вам ничто не мешает в каталоге каждого проекта завести например yml, или json файлик с мета информацией о проекте.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question