-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples in site-command #113
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,11 @@ | |
|
||
namespace EE\Site\Type; | ||
|
||
use function EE\Site\Utils\reload_global_nginx; | ||
use \Symfony\Component\Filesystem\Filesystem; | ||
use \EE\Model\Site; | ||
use function \EE\Site\Utils\auto_site_name; | ||
use function \EE\Site\Utils\get_site_info; | ||
use function \EE\Site\Utils\reload_global_nginx_proxy; | ||
use EE\Model\Site; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
use function EE\Site\Utils\auto_site_name; | ||
use function EE\Site\Utils\get_site_info; | ||
use function EE\Site\Utils\reload_global_nginx_proxy; | ||
|
||
/** | ||
* Base class for Site command | ||
|
@@ -73,6 +72,23 @@ public function __construct() { | |
* - text | ||
* --- | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # List all sites | ||
* $ ee site list | ||
* | ||
* # List enabled sites | ||
* $ ee site list --enabled | ||
* | ||
* # List disabled sites | ||
* $ ee site list --disabled | ||
* | ||
* # List all sites in JSON | ||
* $ ee site list --format=json | ||
* | ||
* # Count all sites | ||
* $ ee site list --format=count | ||
* | ||
* @subcommand list | ||
*/ | ||
public function _list( $args, $assoc_args ) { | ||
|
@@ -127,6 +143,12 @@ function ( $site ) { | |
* | ||
* [--yes] | ||
* : Do not prompt for confirmation. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Delete site | ||
* $ ee site delete example.com | ||
* | ||
*/ | ||
public function delete( $args, $assoc_args ) { | ||
|
||
|
@@ -140,14 +162,16 @@ public function delete( $args, $assoc_args ) { | |
/** | ||
* Function to delete the given site. | ||
* | ||
* @param int $level Level of deletion. | ||
* @param int $level Level of deletion. | ||
* Level - 0: No need of clean-up. | ||
* Level - 1: Clean-up only the site-root. | ||
* Level - 2: Try to remove network. The network may or may not have been created. | ||
* Level - 3: Disconnect & remove network and try to remove containers. The containers | ||
* may not have been created. Level - 4: Remove containers. Level - 5: Remove db entry. | ||
* @param string $site_url Name of the site to be deleted. | ||
* @param string $site_fs_path Webroot of the site. | ||
* | ||
* @throws \EE\ExitException | ||
*/ | ||
protected function delete_site( $level, $site_url, $site_fs_path ) { | ||
|
||
|
@@ -221,6 +245,12 @@ protected function delete_site( $level, $site_url, $site_fs_path ) { | |
* | ||
* [--force] | ||
* : Force execution of site up. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Enable site | ||
* $ ee site up example.com | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add example to re-enable and already enabled site using |
||
*/ | ||
public function up( $args, $assoc_args ) { | ||
|
||
|
@@ -252,6 +282,12 @@ public function up( $args, $assoc_args ) { | |
* | ||
* [<site-name>] | ||
* : Name of website to be disabled. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Disable site | ||
* $ ee site down example.com | ||
* | ||
*/ | ||
public function down( $args, $assoc_args ) { | ||
|
||
|
@@ -284,6 +320,12 @@ public function down( $args, $assoc_args ) { | |
* | ||
* [--nginx] | ||
* : Restart nginx container of site. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Restart all containers of site | ||
* $ ee site restart example.com | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add example to restart specific containers. |
||
*/ | ||
public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { | ||
|
||
|
@@ -321,6 +363,11 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) { | |
* [--nginx] | ||
* : Reload nginx service in container. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Reload all containers of site | ||
* $ ee site reload example.com | ||
* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add example to reload specific containers. |
||
*/ | ||
public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) { | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,13 @@ | |
|
||
namespace EE\Site\Type; | ||
|
||
use \EE\Model\Site; | ||
use \Symfony\Component\Filesystem\Filesystem; | ||
use function \EE\Site\Utils\auto_site_name; | ||
use function \EE\Site\Utils\get_site_info; | ||
use EE\Model\Site; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
use function EE\Site\Utils\auto_site_name; | ||
use function EE\Site\Utils\get_site_info; | ||
|
||
/** | ||
* Creates a simple html Website. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Create simple html site | ||
* $ ee site create example.com | ||
* Adds html site type to `site` command. | ||
* | ||
* @package ee-cli | ||
*/ | ||
|
@@ -73,11 +68,24 @@ public function __construct() { | |
* | ||
* [--wildcard] | ||
* : Gets wildcard SSL . | ||
* | ||
* [--type=<type>] | ||
* : Type of the site to be created. Values: html,php,wp etc. | ||
* | ||
* [--skip-status-check] | ||
* : Skips site status check. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Create html site | ||
* $ ee site create example.com | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
* | ||
* # Create html site with ssl from letsencrypt | ||
* $ ee site create example.com --ssl=le | ||
* | ||
* # Create html site with wildcard ssl | ||
* $ ee site create example.com --ssl=le --wildcard | ||
* | ||
*/ | ||
public function create( $args, $assoc_args ) { | ||
|
||
|
@@ -111,6 +119,12 @@ public function create( $args, $assoc_args ) { | |
* | ||
* [<site-name>] | ||
* : Name of the website whose info is required. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Display site info | ||
* $ ee site info example.com | ||
* | ||
*/ | ||
public function info( $args, $assoc_args ) { | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a new PR:
Add example which skips the prompt using
--yes
flag.