Skip to content

Commit

Permalink
git-svn-id: svn://cherokee-project.com/cherokee/trunk@3258 5dc97367-9…
Browse files Browse the repository at this point in the history
…7f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed May 25, 2009
1 parent 94c3f1c commit 6af69c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions admin/Wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ def run (self, uri, post):
self.show()
return self._run(uri, post)

def error (self, msg):
print "ERROR!! %s" % (msg)
def report_error (self, msg, desc=''):
content = '<h1>Wizard: %s</h1>' % (self.name)
content += '<div class="dialog-error">%s</div>' % (msg)
content += '<div class="indented">%s</div>'% (desc)

page = PageMenu ("wizard_error", self._cfg)
page.AddMacroContent ('title', "%s error"%(self.name))
page.AddMacroContent ('content', content)
return page.Render()

class WizardManager:
def __init__ (self, cfg, _type, pre):
Expand Down
9 changes: 5 additions & 4 deletions admin/Wizard_PHP.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Wizard_Rules_PHP (Wizard):
UNIX_SOCK = "/tmp/cherokee-php.socket"
DEFAULT_PATHS = ['/usr/bin', '/opt/php', '/usr/sfw/bin', '/usr/gnu/bin']
DEFAULT_BINS = ['php-cgi', 'php']
ICON = "php.jpg"
DESC = "Configures PHP in the current Virtual Server. It will add a new .php extension is not present."

Expand Down Expand Up @@ -43,12 +44,12 @@ def test_php_fcgi (path):

# Add a new Source, if needed
if not self.source:
php_path = path_find_binary (['php-cgi', 'php'],
php_path = path_find_binary (self.DEFAULT_BINS,
extra_dirs = self.DEFAULT_PATHS,
custom_test = test_php_fcgi)
if not php_path:
self.error ("Couldn't find a suitable PHP interpreter.")
return
desc = "<p>Looked for the binaries: %s.</p>" % (", ".join(self.DEFAULT_BINS))
return self.report_error ("Couldn't find a suitable PHP interpreter.", desc)

self.source = cfg_source_get_next (self._cfg)
self._cfg['%s!nick' % (self.source)] = 'PHP Interpreter'
Expand All @@ -63,7 +64,7 @@ def test_php_fcgi (path):
if not self.rule:
self.rule = cfg_vsrv_rule_get_next (self._cfg, self._pre)
if not self.rule:
self.error ("Couldn't add a new rule.")
return self.report_error ("Couldn't add a new rule.")

src_num = self.source.split('!')[-1]

Expand Down

0 comments on commit 6af69c5

Please sign in to comment.