A
A
Alexander Drek2015-12-30 18:49:46
PHP
Alexander Drek, 2015-12-30 18:49:46

How to update php code via git using php?

I have some code that I use a lot, you can call it PHP Framework. I have implemented a php script that updates versions of this framework from my server. But for this to work, I need to constantly manually search for the corrected files and upload them to my server so that everything is updated everywhere.
In order not to suffer, it was decided to use github. But there was a difficulty - I need the framework itself to update the versions (for example, when the admin visits the site). Installing git on every server is not an option. Can you tell me how to check the version and download the necessary updates for the framework using php?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Galkin, 2015-12-30
@drekon

You need at least one server with git. on the github for the project, you install a webhook that will send a request with information about the commit to the branch to the specified Http address. every commit of every branch of the project, to be exact. in the receiver script, you filter out the desired branch, you get a list of changed files and upload them to others via FTP, for example.

I
index0h, 2015-12-31
@index0h

What people do not go to not use composer

P
Puma Thailand, 2015-12-30
@opium

system exec git pull origin master

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question