E
E
Eugene2018-02-12 19:26:21
Laravel
Eugene, 2018-02-12 19:26:21

How to correctly connect a third-party PHP file (library) to Laravel (using UMI.CMS as an example)?

Perhaps my question is not quite correct, but tell me at least the right direction :).
A separate application is being developed on Laravel, but some of the data is taken from UMI.CMS. Two projects are on the same server.
In UMI.CMS, there is something in the form of a connector for using your API and with it you can already pull and work with data, this is a PHP file that is simply included and all classes and methods become available. This file itself lies in the root of the project on UMI.CMS.

include "standalone.php";
// использование API, UMI.CMS

For the test, I included this file in the Laravel project (by specifying the path directly to the neighboring project where UMI.CMS is located) into a simple test PHP file in the "public" folder, tested it - everything seems to work.
Tell me where is it better to register this include, or how to use the connection to it in controllers now?
A simple include in the controller writes an error:
Cannot redeclare startsWith() (previously declared in /vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php:664)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2018-02-12
@v_decadence

Composer Documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question