Create custom php file with global variables (Entry point is not fine)

Hello Everyone!

I want create a callable php file which know all global variables and functions (like log, db, app_list_string etc) which i call call from command line.
I found the ROBO, but i can’t require for example index.php which build the whole framework, because i got error message, that not valid entrypoint.

How cal i call one custom php file from command line, which known every global variable and function?

Why entry point is not fine for me.: I want run big imports which runs for hours.

php: 7.2
sugar_version: 6.5.25
suitecrm_version: 7.11.7

Br,
Balázs

Hi and welcome!
could you provide some more details on what you’re trying to do? Maybe there are some other workarounds we could suggest.

But besides that: an entry point should offer all framework features like global variables, so if your script takes that long, maybe updating the max_execution_time does the trick for you.

Otherwise, if you’re mainly interested in field definitions and such, you could create a script that dumps all those information in a table for you - from there, it should be quite easy to integrate with other applications (e.g. two tables, one that stores all fields / field types / labels, one that stores all dropdown lists).

Hello!

I have 5 different import process which are storing and updating thousands data in database, so exactly i only need the database connection.
And these processes runs only when we get data from our partners, on process every week, another import process monthly, so the scheduler not right for me, i want to trigger when script are run.
Therefore i inspect the entry point, but the browser stop it even the max_execution_time is set, depends on browser type, it takes 1-2 hour. But my script runs average time is 5-6 hour.

Therefore i want to call it from command line, like on Task, or like in Laravel, one artisan command.

What do you think, how can i solve it?

Maybe try a custom scheduled job?