diff --git a/VERSION_HOTLINE/54626 b/VERSION_HOTLINE/54626 new file mode 100644 index 0000000000000000000000000000000000000000..1c9113683b540440c727b5e4496a6f68ed5623bb --- /dev/null +++ b/VERSION_HOTLINE/54626 @@ -0,0 +1 @@ +- ticket #54626 : compatibilité PHP 7.1 \ No newline at end of file diff --git a/cosmogramme/php/classes/classe_parseur.php b/cosmogramme/php/classes/classe_parseur.php index 8535816c8eba44642af81074b67d564cecc142ba..2170150c6630c6eb6dccceb47a545bfd783f5219 100644 --- a/cosmogramme/php/classes/classe_parseur.php +++ b/cosmogramme/php/classes/classe_parseur.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class parseur { @@ -38,7 +38,7 @@ class parseur { protected $_fileSystem; - public function open($fic, $format, $pointeur_reprise, $id_profil=0) { + public function open($fic, $format, $pointeur_reprise = 0, $id_profil=0) { $this->formatFichier = $format; $fileSystem = $this->getFileSystem(); $this->hFic = @$fileSystem->fopen($fic, 'rb'); @@ -64,10 +64,10 @@ class parseur { } return true; } - + public function close() { - if($this->hFic) + if($this->hFic) $this->getFileSystem()->fclose($this->hFic); unset($this->hFic); } @@ -78,7 +78,7 @@ class parseur { $fileSystem = $this->getFileSystem(); switch($this->formatFichier) { case self::FORMAT_UNIMARC: - $ret = $this->nextUnimarc($this->hFic); + $ret = $this->nextUnimarc($this->hFic); $this->pointeur_reprise += strlen($ret['data']); break; case self::FORMAT_ASCII_TAB: @@ -88,7 +88,7 @@ class parseur { } break; case self::FORMAT_ASCII_COMMA: - $ret = $this->nextAscii($this->hFic, ';'); + $ret = $this->nextAscii($this->hFic, ';'); $this->pointeur_reprise = $fileSystem->ftell($this->hFic); break; case self::FORMAT_ASCII_PIPE: @@ -104,7 +104,7 @@ class parseur { $this->pointeur_reprise = $fileSystem->ftell($this->hFic); break; case self::FORMAT_MARC21: - $ret = $this->nextUnimarc($this->hFic); + $ret = $this->nextUnimarc($this->hFic); $this->pointeur_reprise += strlen($ret['data']); break; } @@ -119,7 +119,7 @@ class parseur { public function getEnreg($adresse) { - if(!$this->hFic) + if(!$this->hFic) afficherErreur('Il faut d\'abord ouvrir le fichier'); $this->pointeur_reprise = $adresse; $this->buffer = ''; @@ -169,7 +169,7 @@ class parseur { private function nextAscii($hFic, $separateur) { $fileSystem = $this->getFileSystem(); $data = trim($fileSystem->fgets($hFic)); - if ($separateur != chr(9)) + if ($separateur != chr(9)) $data = str_replace($separateur, chr(9), $data); return ['data' => $data, @@ -187,7 +187,7 @@ class parseur { // trouvé un enreg if(!$pos_debut) { $pos_debut=stripos($data,$debut_enreg); - if($pos_debut !== false ) + if($pos_debut !== false ) $data=substr($data,$pos_debut); } if($pos_debut !== false) { @@ -202,14 +202,14 @@ class parseur { // lecture buffer $enreg = $fileSystem->fread($hFic, $long); if ($fileSystem->feof($hFic)) { - if($enreg == false) { - $ret["statut"] = "eof"; - return $ret; + if($enreg == false) { + $ret["statut"] = "eof"; + return $ret; } } $data .= $enreg; } - + // Retour ok $ret["statut"] = "ok"; $ret["data"] = $data; diff --git a/cosmogramme/php/classes/classe_unimarc.php b/cosmogramme/php/classes/classe_unimarc.php index 5dcc647418c1d5248f9ac207bb5cf2578776d6cf..69ce9a40d46685950136c81b735a3290257eeca9 100644 --- a/cosmogramme/php/classes/classe_unimarc.php +++ b/cosmogramme/php/classes/classe_unimarc.php @@ -765,7 +765,7 @@ class notice_unimarc extends iso2709_record { $ex = $this->withExemplaireDo( $exemplaire, function($champ, &$ex) use ($ret, $codes_barres, $cotes) { - return $this->getPMBExemplaire($champ,$ex,$code_barres,$cotes); + return $this->getPMBExemplaire($champ,$ex, $ret, $code_barres,$cotes); }); if ($ex["code_barres"]>"") { diff --git a/library/Class/NoticeUnimarc.php b/library/Class/NoticeUnimarc.php index 1dca7c4aea4b9cd1fc31140be390ef11f8381884..bec73dccbd3151994263037bab6a7c034462daf7 100644 --- a/library/Class/NoticeUnimarc.php +++ b/library/Class/NoticeUnimarc.php @@ -208,7 +208,7 @@ class Class_NoticeUnimarc { $this->full_record = ''; $this->guide = ''; $this->directory = ''; - $this->errors = ''; + $this->errors = []; $this->inner_guide = ''; $this->inner_directory = []; $this->inner_data = [];