migrate phpinterface-classes to PDO database class, refs #1287

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-06 09:11:26 +01:00
parent 388156b7b8
commit 849da2a423
9 changed files with 222 additions and 289 deletions

View File

@@ -234,7 +234,7 @@ class apache
'loginname' => 'froxlor.panel',
'documentroot' => $mypath
);
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$phpconfig = $php->getPhpConfig($this->settings['system']['mod_fcgid_defaultini_ownvhost']);
$starter_filename = makeCorrectFile($configdir . '/php-fcgi-starter');
@@ -273,7 +273,7 @@ class apache
'documentroot' => $mypath,
);
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$phpconfig = $php->getPhpConfig($this->settings['phpfpm']['vhost_defaultini']);
$srvName = substr(md5($ipport),0,4).'.fpm.external';
if ($row_ipsandports['ssl']) {

View File

@@ -32,7 +32,7 @@ class apache_fcgid extends apache
if($domain['phpenabled'] == '1')
{
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
if((int)$this->settings['phpfpm']['enabled'] == 1)
@@ -93,8 +93,8 @@ class apache_fcgid extends apache
// create starter-file | config-file
$php->getInterface()->createConfig($phpconfig);
// create php.ini
// @TODO make php-fpm support this
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
else
@@ -143,7 +143,7 @@ class apache_fcgid extends apache
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
// get php.ini for our own vhost
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
// get php-config
if ($this->settings['phpfpm']['enabled'] == '1') {
@@ -157,8 +157,8 @@ class apache_fcgid extends apache
// create starter-file | config-file
$php->getInterface()->createConfig($phpconfig);
// create php.ini
// @TODO make php-fpm support this
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
}

View File

@@ -151,7 +151,7 @@ class lighttpd
'documentroot' => $mypath
);
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$this->lighttpd_data[$vhost_filename].= ' fastcgi.server = ( '."\n";
$this->lighttpd_data[$vhost_filename].= "\t".'".php" => ('."\n";

View File

@@ -15,10 +15,6 @@
*
*/
/*
* This script creates the php.ini's used by mod_suPHP+php-cgi
*/
if(@php_sapi_name() != 'cli'
&& @php_sapi_name() != 'cgi'
&& @php_sapi_name() != 'cgi-fcgi')
@@ -34,7 +30,7 @@ class lighttpd_fcgid extends lighttpd
if($domain['phpenabled'] == '1')
{
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
// vhost data for php-fpm
@@ -105,8 +101,8 @@ class lighttpd_fcgid extends lighttpd
// create starter-file | config-file
$php->getInterface()->createConfig($phpconfig);
// create php.ini
// @TODO make php-fpm support this
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
else
@@ -145,7 +141,7 @@ class lighttpd_fcgid extends lighttpd
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
// get php.ini for our own vhost
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
// get php-config
if ($this->settings['phpfpm']['enabled'] == '1') {
@@ -159,8 +155,8 @@ class lighttpd_fcgid extends lighttpd
// create starter-file | config-file
$php->getInterface()->createConfig($phpconfig);
// create php.ini
// @TODO make php-fpm support this
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
}

View File

@@ -242,7 +242,7 @@ class nginx
'documentroot' => $mypath,
);
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$this->nginx_data[$vhost_filename] .= "\t\t".'fastcgi_pass unix:' . $php->getInterface()->getSocketFile() . ';' . "\n";
} else {
$this->nginx_data[$vhost_filename] .= "\t\t".'fastcgi_pass ' . $this->settings['system']['nginx_php_backend'] . ';' . "\n";

View File

@@ -15,10 +15,6 @@
*
*/
/*
* This script creates the php.ini's used by mod_suPHP+php-cgi
*/
if(@php_sapi_name() != 'cli'
&& @php_sapi_name() != 'cgi'
&& @php_sapi_name() != 'cgi-fcgi')
@@ -34,7 +30,7 @@ class nginx_phpfpm extends nginx
if($domain['phpenabled'] == '1')
{
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
$php_options_text = "\t".'location ~ \.php$ {'."\n";
@@ -52,8 +48,8 @@ class nginx_phpfpm extends nginx
// create starter-file | config-file
$php->getInterface()->createConfig($phpconfig);
// create php.ini
// @TODO make php-fpm support this
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
else
@@ -92,7 +88,7 @@ class nginx_phpfpm extends nginx
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
// get php.ini for our own vhost
$php = new phpinterface($this->getDB(), $this->settings, $domain);
$php = new phpinterface($this->settings, $domain);
// get php-config
if ($this->settings['phpfpm']['enabled'] == '1') {
@@ -106,8 +102,8 @@ class nginx_phpfpm extends nginx
// create starter-file | config-file
$php->getInterface()->createConfig($phpconfig);
// create php.ini
// @TODO make php-fpm support this
// create php.ini (fpm does nothing here, as it
// defines ini-settings in its pool config)
$php->getInterface()->createIniFile($phpconfig);
}
}