Changeset 112756 in spip-zone


Ignore:
Timestamp:
Dec 12, 2018, 10:50:03 PM (2 months ago)
Author:
root
Message:

php7 compatible

  • nouvelle version de la librairie et adaptation aux nouvelles méthodes
  • appel correct de constructeur de classe
  • appel correct de constante
  • passage correct de string
  • appel correct des fonctions de callback sur preg_replace
Location:
_plugins_/article_pdf/branches/php7
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/article_pdf/branches/php7/article_pdf_options.php

    r104928 r112756  
    1313
    1414if (!defined('_DIR_LIB')) define('_DIR_LIB', _DIR_RACINE . 'lib/');
    15 if (!defined('_DIR_FPDF_LIB')) define('_DIR_FPDF_LIB', _DIR_LIB . 'h5c1accba-fpdf17/');
     15if (!defined('_DIR_FPDF_LIB')) define('_DIR_FPDF_LIB', _DIR_LIB . 'h5c1accba-fpdf181/');
    1616
    1717function balise_ARTICLE_PDF_dist($p) {
  • _plugins_/article_pdf/branches/php7/paquet.xml

    r112755 r112756  
    2020
    2121        <lib nom="h5c1accba-fpdf181" lien="http://www.fpdf.org/fr/download/fpdf181.zip" />
    22 
    2322        <necessite nom="PHP" compatibilite="[7;]" />
    2423</paquet>
  • _plugins_/article_pdf/branches/php7/pdf/lib_pdf_global.php

    r112754 r112756  
    88
    99 //  Fichier de dump pour debug
    10 define (DUMP_FILE_FULL_PATH_NAME,"Dump.txt");
     10define ('DUMP_FILE_FULL_PATH_NAME',"Dump.txt");
    1111
    1212class PDF extends FPDF
     
    4848function Build($OutputFileFullPathName)
    4949{
    50         $this->Open();
    51 
    5250        $this->BuildDocument() ;
    5351
    54         $this->Output($OutputFileFullPathName);
    55 
     52        $this->Output('F', $OutputFileFullPathName);
    5653        $this->Close();
    5754}
     
    7471{
    7572        //Appel au constructeur parent
    76         $this->FPDF($orientation, $unit, $format);
     73        $this->__construct($orientation, $unit, $format);
    7774        $this->SetCompression(1);
    7875
     
    8784        $trans_tbl = array_flip ($trans_tbl);
    8885        $ret = strtr ($string, $trans_tbl);
    89         return preg_replace('/&#(\d+);/me', "chr('\\1')",$ret);
     86        return preg_replace_callback('/&#(\d+);/m', chr($matches[1]),$ret);
    9087}
    9188
  • _plugins_/article_pdf/branches/php7/pdf/lib_pdf_spip.php

    r112754 r112756  
    1818
    1919        // bas
    20         $this->SetAutoPageBreak(auto, $BottomMargin*3/2);
     20        $this->SetAutoPageBreak('auto', $BottomMargin*3/2);
    2121}
    2222
Note: See TracChangeset for help on using the changeset viewer.