Bonjour tous,
Pour faire suite au topic : http://forum.thelia.net/viewtopic.php?id=11055, je repart sur une base propre.
Nous savons déjà que la V1.5.4.3, ne passe même pas sur du php5.6, voir : http://forum.thelia.net/viewtopic.php?id=12052
Donc, nous allons essayer de faire quelque chose pour ce passage pour php7, c'est tout pour le moment et cela va ravir beaucoup d'utilisateurs de thelia qui ne veulent ou ne peuvent pas techniquement, mais voir l'autre topic.
J'ai donc installé la V1.5.4.3 sur wampserver (en rusant) et choisi php 7.1.9
J'ai installé le plugin "insertionproduit", la mini-boutique mise à dispo par thelia et vais suivre depuis le début pour ceux qui arrivent.
J'ouvre le site :
Warning: Declaration of Variable::charger($nom) should be compatible with Requete::charger() in D:\wamp\www\thelia1543\classes\Variable.class.php on line 25
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\wamp\www\thelia1543\classes\Cnx.class.php:32 Stack trace: #0 D:\wamp\www\thelia1543\classes\Cnx.class.php(59): StaticConnection::getHandle() #1 D:\wamp\www\thelia1543\classes\Requete.class.php(33): Cnx->__construct() #2 D:\wamp\www\thelia1543\classes\Baseobj.class.php(34): Requete->__construct() #3 D:\wamp\www\thelia1543\classes\Variable.class.php(40): Baseobj->__construct() #4 D:\wamp\www\thelia1543\classes\Variable.class.php(61): Variable->__construct('utilisercachepl...') #5 D:\wamp\www\thelia1543\classes\actions\ActionsModules.class.php(26): Variable::lire('utilisercachepl...') #6 D:\wamp\www\thelia1543\classes\actions\ActionsModules.class.php(30): ActionsModules->__construct() #7 D:\wamp\www\thelia1543\fonctions\moteur.php(29): ActionsModules::instance() #8 D:\wamp\www\thelia1543\index.php(28): require('D:\\wamp\\www\\the...') #9 {main} thrown in D:\wamp\www\thelia1543\classes\Cnx.class.php on line 32
Normal, mais yoan a donné un script, dans classes/Cnx.class.php tu ajoutes juste après require_once(__DIR__."/../client/config_thelia.php"); le code suivant :
if(! function_exists('mysql_query')){
function mysql_query($query, $link = null) {
return mysqli_query($link, $query);
}
function mysql_fetch_object($resul) {
return mysqli_fetch_object($resul);
}
function mysql_result($res,$row=0,$col=0){
return mysqli_result($res,$row=0,$col=0);
}
function mysql_num_rows($res){
return mysqli_num_rows($res);
}
}
Je relance le site :
Warning: Declaration of Variable::charger($nom) should be compatible with Requete::charger() in D:\wamp\www\thelia1543\classes\Variable.class.php on line 25
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\wamp\www\thelia1543\classes\Cnx.class.php:50 Stack trace: #0 D:\wamp\www\thelia1543\classes\Cnx.class.php(77): StaticConnection::getHandle() #1 D:\wamp\www\thelia1543\classes\Requete.class.php(33): Cnx->__construct() #2 D:\wamp\www\thelia1543\classes\Baseobj.class.php(34): Requete->__construct() #3 D:\wamp\www\thelia1543\classes\Variable.class.php(40): Baseobj->__construct() #4 D:\wamp\www\thelia1543\classes\Variable.class.php(61): Variable->__construct('utilisercachepl...') #5 D:\wamp\www\thelia1543\classes\actions\ActionsModules.class.php(26): Variable::lire('utilisercachepl...') #6 D:\wamp\www\thelia1543\classes\actions\ActionsModules.class.php(30): ActionsModules->__construct() #7 D:\wamp\www\thelia1543\fonctions\moteur.php(29): ActionsModules::instance() #8 D:\wamp\www\thelia1543\index.php(28): require('D:\\wamp\\www\\the...') #9 {main} thrown in D:\wamp\www\thelia1543\classes\Cnx.class.php on line 50
yoan intervient de nouveau et propose directement le fichier Cnx.class.php
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : thelia@openstudio.fr */
/* web : http://www.openstudio.fr */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* Â Â along with this program. Â If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
require_once(__DIR__."/../client/config_thelia.php");
if(! function_exists('mysql_query')){
function mysql_query($query, $link = null) {
return mysqli_query($link, $query);
}
function mysql_fetch_object($resul) {
return mysqli_fetch_object($resul);
}
function mysql_result($res,$row=0,$col=0){
return mysqli_result($res,$row=0,$col=0);
}
function mysql_num_rows($res){
return mysqli_num_rows($res);
}
}
function mysqli_result($res,$row=0,$col=0){
$numrows = mysqli_num_rows($res);
if ($numrows && $row <= ($numrows-1) && $row >=0){
mysqli_data_seek($res,$row);
$resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
if (isset($resrow[$col])){
return $resrow[$col];
}
}
return false;
}
class StaticConnection {
public static $db_handle = -1;
public static function getHandle() {
if (self::$db_handle == -1) {
self::$db_handle = @mysqli_connect(
THELIA_BD_HOST,
THELIA_BD_LOGIN,
THELIA_BD_PASSWORD) or die('Le serveur de base de données n\'est pas accessible.');
mysqli_query(self::$db_handle, "SET NAMES UTF8");
if (! self::$db_handle && $_REQUEST['erreur'] != 1) {
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
die("Connexion à la base de données impossible");
}
mysqli_select_db(self::$db_handle, THELIA_BD_NOM) or die('Echec de selection de la base de données.');
}
return self::$db_handle;
}
}
Je relance le site ....... c'est mieux :
Fatal error: Class 'Cnx' not found in D:\wamp\www\thelia1543\classes\Requete.class.php on line 28

Bon, on avance, attendons les réponses.