From 8f81bad1068f58ca41e2dd56835077f2a3e47018 Mon Sep 17 00:00:00 2001 From: Abhijit Rakas Date: Mon, 10 Sep 2018 19:15:50 +0530 Subject: [PATCH 1/3] Modify path constant --- src/Site_PHP_Docker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Site_PHP_Docker.php b/src/Site_PHP_Docker.php index 1216814..609a06f 100644 --- a/src/Site_PHP_Docker.php +++ b/src/Site_PHP_Docker.php @@ -188,7 +188,7 @@ public function generate_docker_compose_yml( array $filters = [] ) { 'network' => true, ]; - $docker_compose_yml = mustache_render( SITE_WP_TEMPLATE_ROOT . '/docker-compose.mustache', $binding ); + $docker_compose_yml = mustache_render( SITE_PHP_TEMPLATE_ROOT . '/docker-compose.mustache', $binding ); return $docker_compose_yml; } From a6b2e9f97f7907b33def7616a3a4aea10f110890 Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 10 Sep 2018 19:26:36 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 405f3ca..df6eaf9 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# site-type-php \ No newline at end of file +# EasyEngine/site-type-php + +Adds `php` site type to [site command](https://github.com/EasyEngine/site-command/) + +## Usage + +```bash +ee site create example.com --type=php # Create simple php site (without db) +ee site create example.com --type=php --with-db # Create php site with db +ee site create example.com --type=php --cache # Create php site with redis cache +``` From 1c17c597e1676a79b7581448f2145d616c37dc4d Mon Sep 17 00:00:00 2001 From: Kirtan Gajjar Date: Mon, 10 Sep 2018 19:35:51 +0530 Subject: [PATCH 3/3] Add doc comments Signed-off-by: Kirtan Gajjar --- src/PHP.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/src/PHP.php b/src/PHP.php index feceeb1..3f8cdc2 100644 --- a/src/PHP.php +++ b/src/PHP.php @@ -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. @@ -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 ) { @@ -190,6 +208,12 @@ private function create_site_db_user( string $site_url ): string { * * [] * : Name of the website whose info is required. + * + * ## EXAMPLES + * + * # Display site info + * $ ee site info example.com + * */ public function info( $args, $assoc_args ) { @@ -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 = [] ) { @@ -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' ];