Skip to content
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 doc comments #5

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions src/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace EE\Site\Type;

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 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 PHP Website.
Expand Down Expand Up @@ -121,6 +121,24 @@ public function __construct() {
*
* [--force]
* : Resets the remote database if it is not empty.
*
* ## EXAMPLES
*
* # Create php site (without db)
* $ ee site create example.com --type=php
*
* # Create php site with db
* $ ee site create example.com --type=php --with-db
*
* # Create php site with ssl from letsencrypt
* $ ee site create example.com --type=php --ssl=le
*
* # Create php site with wildcard ssl
* $ ee site create example.com --type=php --ssl=le --wildcard
*
* # Create php site with remote database
* $ ee site create example.com --type=php --with-db --dbhost=localhost --dbuser=username --dbpass=password
*
*/
public function create( $args, $assoc_args ) {

Expand Down Expand Up @@ -190,6 +208,12 @@ private function create_site_db_user( string $site_url ): string {
*
* [<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 ) {

Expand Down Expand Up @@ -456,6 +480,15 @@ private function create_site_db_entry() {
*
* [--db]
* : Restart db container of site.
*
* ## EXAMPLES
*
* # Restart all containers of site
* $ ee site restart example.com
*
* # Restart single container of site
* $ ee site restart example.com --nginx
*
*/
public function restart( $args, $assoc_args, $whitelisted_containers = [] ) {

Expand Down Expand Up @@ -485,6 +518,15 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) {
*
* [--php]
* : Reload php container of site.
*
* ## EXAMPLES
*
* # Reload all containers of site
* $ ee site reload example.com
*
* # Reload single containers of site
* $ ee site reload example.com --nginx
*
*/
public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) {
$whitelisted_containers = [ 'nginx', 'php' ];
Expand Down