javascript - Push my project into Git hub repository via another php application -
javascript - Push my project into Git hub repository via another php application -
i have html5/javascript/php
application ready. want force other projects github
repository via existing application.
so want create repo (stage
, commit
, push
, update
) steps existing application.
how can that?
since utilize php, php can phone call external commands via exec
or system
, utilize these functions phone call git commands arguments (e.g repository need) , fetch results (if failed example).
i used similar create subversion web application client.
for illustration have html/javascript create interface user can set repository parameters , arguments , pass (or post these) php. php utilize exec
or system
(with necessary validation , escaping of course) phone call git commands repository , homecoming results php php js app (via ajax example).
further info: if git commands need take time finish (have timeout, or need communicate remote repositories , on), solution utilize central info management (i.e database 1 table pending_processes example) this:
have js post git request php, have php add together entry pending_processes
db table current process , set status
pending
. have php homecoming id
of (git) process. have same php script, utilize exec
(or system
) (fork and) execute git command , wait (or poll) git command completion. when git completes, same (forked) php script, updates central db table proces new status
(e.g completed
or failed
, whatever suits needs , use-cases). optionaly can add together result or output of git command.
have js in meantime poll (e.g via ajax calls) status
of command via php script accepts id
, checks central processes table status
of process. if status
completed
, can optionaly fetch output or result js app. js show result of command user.
hope clear , helpful you. can complex application, needing synchronise different parts in various levels of web stack (i.e client/server/php/js/gti , on). trick have general outline , scheme , start simple progressively build more complex interaction.
javascript php github
Comments
Post a Comment