dolibarr-bugtrack
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-bugtrack] [Bug #819] new install crash


From: Doliforge
Subject: [Dolibarr-bugtrack] [Bug #819] new install crash
Date: Wed, 17 Apr 2013 17:12:27 +0200

Doliforge
Ce message ne s'affiche pas correctement?
mettez à jour vos préférences utilisateur.

new install crash

Dernières modifications

17/04/2013 17:12 (Europe/Paris)
Complete alorithm is
preg_match('/^(.*)\.class\.php$/i',$file,$reg);
$type=$reg[1];
$class='DoliDB'.ucfirst($type);

May be PHP-FPM have another way to interpret regexp or ucfirst, with only file in standard dolibarr (mssql.class.php,mysql.class.php,mysqli.class.php,pgsql.class.php,sqlite.calss.php) you cannot have the calling of getStaticMember function with this value :'DoliDB._pgsql'

Répondre

État

 Détails
Submitted by:  Nicolas LESCURE (solariane) Submitted on:  13/04/2013 15:47
Last Modified On:  17/04/2013 17:07 Dolibarr version:  3.3.1
PHP version:  5.3 Database type and version:  
OS Type/Version:  Debian / Squeeze Category:  Other
Severity:  5 - Major 
Summary:  new install crash
Description:  Doing a source install of dolibarr on a debian server with NGINX as web front, I kept getting a broken page on the second step of the install.

looking at the log I've got :


PHP message: PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class DoliDB._pgsql does not exist' in /var/www/dev/dolibarr/htdocs/core/lib/functions.lib.php:51
Stack trace:
#0 /var/www/dev/dolibarr/htdocs/core/lib/functions.lib.php(51): ReflectionClass->__construct('DoliDB._pgsql')
#1 /var/www/dev/dolibarr/htdocs/install/fileconf.php(311): getStaticMember('DoliDB._pgsql', 'versionmin')
#2 {main}
thrown in /var/www/dev/dolibarr/htdocs/core/lib/functions.lib.php on line 51

I've look neither @the rule of coding / pushing a patch nor @the impact it might have elsewhere => I've done a quick an dirty patch as follow

Old Code -
$classObj = new ReflectionClass($class);
$result = null;

New Code -
$result = null;
try {
$classObj = new ReflectionClass($class);
} catch (Exception $e) {
return $result;
}


Step to reproduce bug:  try a new install :-)
 Etat
Resolution:  Aucun Assigned to:  HENRY Florian (fhenry)
Status:  Need more info 

Commentaires

HENRY Florian 17/04/2013 17:12
Complete alorithm is
preg_match('/^(.*)\.class\.php$/i',$file,$reg);
$type=$reg[1];
$class='DoliDB'.ucfirst($type);

May be PHP-FPM have another way to interpret regexp or ucfirst, with only file in standard dolibarr (mssql.class.php,mysql.class.php,mysqli.class.php,pgsql.class.php,sqlite.calss.php) you cannot have the calling of getStaticMember function with this value :'DoliDB._pgsql'
HENRY Florian 17/04/2013 17:07
I can't reproduce on my platform. Unbuntu 12.04/mysql or pgsql.
The problem is more here : /var/www/dev/dolibarr/htdocs/install/fileconf.php(311): getStaticMember('DoliDB._pgsql', 'versionmin')
the correct way should be getStaticMember('DoliDBPgsql', 'versionmin');
the 'DoliDBPgsql' sould be constrcut by $class='DoliDB'.ucfirst($type); and $type come from the file name into htdocs/core/db/
So it's really strange you get this error, except if you have renamed files inside this directory.
Nicolas LESCURE 17/04/2013 16:47
at first only MySQL, without driver for pgSQL ( no php5-pgsql module )

then installed php5-pgsql module ( but not the postgreSQL server itself )

in both case it crashed


the patch make it work.


[ a small addition : I'm using PHP-FPM ]
HENRY Florian 17/04/2013 16:39
Could you specified your database engine (Mysql/pgSQL) ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]