A
A
Arman2017-12-22 11:13:22
PHP
Arman, 2017-12-22 11:13:22

What is the easiest way to run console php utilities (composer) through another php file?

I need to run composer through my code i.e. I am writing a small script that should expand the site on some event, while exec and similar functions are often blocked, because. composer is an archive of php files, then I thought maybe you can just include it and run it yourself?
maybe something is ready? those. something like

<?php
$lib = new lib('./composer.phar');
$lib->run('install');

thanks
update.
While it seems to run:
$_SERVER['argv'][1] = 'install';
include __DIR__ . '/composer.phar';

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2017-12-22
@BorisKorobkov

a small script that, on some event, should expand the site

https://ru.wikipedia.org/wiki/Bash

O
OnYourLips, 2017-12-22
@OnYourLips

while exec and similar functions are often blocked
So deal with the cause, not the effect.
Disabling these features is not justified.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question