Commit 8f04d8e8 authored by Alain Takoudjou's avatar Alain Takoudjou

Any software can specify its own php.ini

parent 92af2456
...@@ -127,9 +127,11 @@ class BaseRecipe(BaseSlapRecipe): ...@@ -127,9 +127,11 @@ class BaseRecipe(BaseSlapRecipe):
self.substituteTemplate(pkg_resources.resource_filename(__name__, self.substituteTemplate(pkg_resources.resource_filename(__name__,
'template/apache.in'), apache_config)) 'template/apache.in'), apache_config))
self.path_list.append(config_file) self.path_list.append(config_file)
php_ini = pkg_resources.resource_filename(__name__, 'template/php.ini.in')
if self.options.has_key('php_ini'):
php_ini = os.path.join(self.options['php_ini'], 'php.ini.in')
self.path_list.append(self.createConfigurationFile('php.ini', self.path_list.append(self.createConfigurationFile('php.ini',
self.substituteTemplate(pkg_resources.resource_filename(__name__, self.substituteTemplate(php_ini, dict(tmp_directory=self.tmp_directory))))
'template/php.ini.in'), dict(tmp_directory=self.tmp_directory))))
self.path_list.extend(zc.buildout.easy_install.scripts([( self.path_list.extend(zc.buildout.easy_install.scripts([(
'httpd', 'httpd',
__name__ + '.apache', 'runApache')], self.ws, __name__ + '.apache', 'runApache')], self.ws,
...@@ -153,13 +155,13 @@ class BaseRecipe(BaseSlapRecipe): ...@@ -153,13 +155,13 @@ class BaseRecipe(BaseSlapRecipe):
destination = os.path.join(path, file) destination = os.path.join(path, file)
open(destination, 'w').write(open(template, 'r').read() % d) open(destination, 'w').write(open(template, 'r').read() % d)
def configureInstallation(self, document_root, mysql_conf, url): def configureInstallation(self, document_root, url, mysql_conf):
"""Start process which can launch python scripts, move or remove files or """Start process which can launch python scripts, move or remove files or
directories when installing software. directories when installing software.
""" """
if not self.options.has_key('delete') and not self.options.has_key('rename') and not\ if not self.options.has_key('delete') and not self.options.has_key('rename') and not\
self.options.has_key('chmod') and not self.options.has_key('script'): self.options.has_key('chmod') and not self.options.has_key('script'):
return return ""
delete = [] delete = []
chmod = [] chmod = []
data = [] data = []
...@@ -193,7 +195,7 @@ class BaseRecipe(BaseSlapRecipe): ...@@ -193,7 +195,7 @@ class BaseRecipe(BaseSlapRecipe):
if self.options.has_key('rename_chmod'): if self.options.has_key('rename_chmod'):
cmd += ["--chmod", self.options['rename_chmod'].strip()] cmd += ["--chmod", self.options['rename_chmod'].strip()]
rename.append(cmd + [fname[0].strip(), fname[1].strip()]) rename.append(cmd + [fname[0].strip(), fname[1].strip()])
rename_list += fname[0] + "=>" + fname[1] + " " rename_list += fname[0] + " to " + fname[1] + " "
if self.options.has_key('chmod'): if self.options.has_key('chmod'):
chmod = ["chmod", self.options['mode'].strip()] chmod = ["chmod", self.options['mode'].strip()]
for fname in self.options['chmod'].split(','): for fname in self.options['chmod'].split(','):
...@@ -225,12 +227,14 @@ class Simple(BaseRecipe): ...@@ -225,12 +227,14 @@ class Simple(BaseRecipe):
self.createHtdocs(self.options['source'].strip(), document_root) self.createHtdocs(self.options['source'].strip(), document_root)
mysql_conf = self.installMysqlServer() mysql_conf = self.installMysqlServer()
url = self.installApache(document_root) url = self.installApache(document_root)
renamed = self.configureInstallation(document_root, mysql_conf, url) renamed = self.configureInstallation(document_root, url, mysql_conf)
self.setConnectionDict(dict( connectionDict = dict(
url=url, url=url,
rename=renamed,
**mysql_conf **mysql_conf
)) )
if not renamed == "":
connectionDict['rename'] = renamed
self.setConnectionDict(connectionDict)
if self.options.has_key('template') and self.options.has_key('configuration'): if self.options.has_key('template') and self.options.has_key('configuration'):
self.createConfiguration(self.options['template'], document_root, self.createConfiguration(self.options['template'], document_root,
self.options['configuration'], mysql_conf) self.options['configuration'], mysql_conf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment