Browse Source

ee site create command started

bugfixes
harshadyeola 10 years ago
parent
commit
f10f2de968
  1. 8
      config/plugins.d/site.conf
  2. 72
      ee/cli/plugins/site.py
  3. 2
      ee/cli/templates/virtualconf.mustache

8
config/plugins.d/site.conf

@ -0,0 +1,8 @@
### Example Plugin Configuration for EasyEngine
[site]
### If enabled, load a plugin named `example` either from the Python module
### `ee.cli.plugins.example` or from the file path
### `/var/lib/ee/plugins/example.py`
enable_plugin = true

72
ee/cli/plugins/site.py

@ -1,6 +1,7 @@
"""EasyEngine site controller."""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
import sys
def ee_site_hook(app):
@ -93,15 +94,72 @@ class EESiteCreateController(CementBaseController):
dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'],
dict(help="wpsubdomain site", action='store_true')),
(['--w3tc'],
dict(help="w3tc", action='store_true')),
(['--wpfc'],
dict(help="wpfc", action='store_true')),
(['--wpsc'],
dict(help="wpsc", action='store_true')),
]
@expose(hide=True)
def default(self):
# TODO Default action for ee site command
data = dict(foo='EESiteCreateController.default().')
self.app.render((data), 'default.mustache')
# print("Inside EESiteCreateController.default().")
# data = dict(foo='EESiteCreateController.default().')
# self.app.render((data), 'default.mustache')
if self.app.pargs.html:
data = dict(site_name=self.app.pargs.site_name,
static=True, basic=False, wp=False, w3tc=False,
wpfc=False, wpsc=False, multisite=False,
wpsubdir=False)
if self.app.pargs.php:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=True, wp=False, w3tc=False,
wpfc=False, wpsc=False, multisite=False,
wpsubdir=False)
if self.app.pargs.mysql:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=True, wp=False, w3tc=False,
wpfc=False, wpsc=False, multisite=False,
wpsubdir=False)
if (self.app.pargs.wp or self.app.pargs.w3tc or self.app.pargs.wpfc
or self.app.pargs.wpsc):
if self.app.pargs.wp:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=True, wp=True, w3tc=False,
wpfc=False, wpsc=False, multisite=False,
wpsubdir=False)
if self.app.pargs.w3tc:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=False, wp=True, w3tc=True,
wpfc=False, wpsc=False, multisite=False,
wpsubdir=False)
if self.app.pargs.wpfc:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=False, wp=True, w3tc=False,
wpfc=True, wpsc=False, multisite=False,
wpsubdir=False)
if self.app.pargs.wpsc:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=False, wp=True, w3tc=False,
wpfc=False, wpsc=True, multisite=False,
wpsubdir=False)
if self.app.pargs.wpsubdir:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=True, wp=True, w3tc=False,
wpfc=False, wpsc=False, multisite=True,
wpsubdir=True)
if self.app.pargs.wpsubdomain:
data = dict(site_name=self.app.pargs.site_name,
static=False, basic=True, wp=True, w3tc=False,
wpfc=False, wpsc=False, multisite=True,
wpsubdir=False)
self.app.render((data), 'virtualconf.mustache')
class EESiteUpdateController(CementBaseController):
@ -126,6 +184,12 @@ class EESiteUpdateController(CementBaseController):
dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'],
dict(help="wpsubdomain site", action='store_true')),
(['--w3tc'],
dict(help="w3tc", action='store_true')),
(['--wpfc'],
dict(help="wpfc", action='store_true')),
(['--wpsc'],
dict(help="wpsc", action='store_true')),
]
@expose(help="update example.com")

2
ee/cli/templates/virtualconf.mustache

@ -25,7 +25,7 @@ try_files $uri $uri/ /index.html;
}
{{/static}}
include {{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}
{{^static}}include{{/static}} {{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}}
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}
{{#wp}}include common/wpcommon.conf;{{/wp}}
include common/locations.conf;

Loading…
Cancel
Save