PHP code example of sven / forge-cli

1. Go to this page and download the library: Download sven/forge-cli library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sven / forge-cli example snippets

bash
$ composer global 
bash
$ forge site:list {serverId}

+--------+-----------------+------+-----------------------------+--------+
| Id     | Name            | Type | Repository                  | Branch |
+--------+-----------------+------+-----------------------------+--------+
| 303243 | default         | php  | -                           | -      |
| 303246 | svenluijten.com | html | svenluijten/svenluijten.com | master |
| 303247 | pkgst.co        | php  | svenluijten/slack-packagist | master |
+--------+-----------------+------+-----------------------------+--------+
bash
$ forge show:daemon {serverId} {daemonId}

Status:  installing
Command: echo 'hello world' >> /dev/null
Created: 2017-03-21 18:26:33
bash
$ forge job:make {serverId}
    --user="forge"
    --command="echo 'hello world' > /dev/null"
    --frequency="hourly"
bash
$ forge deploy-script:get {serverId} {siteId} > file.txt
bash
$ forge deploy-script:set {serverId} {siteId}
    --file=file.txt
bash
$ forge deploy-script:set {serverId} {siteId} < file.txt
bash
$ forge recipe:make
    --name="My Recipe"
    --user=forge
    --script="echo 'hi' >> /dev/null"