Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 1308 | Rev 1311 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1308 Rev 1310
Line 21... Line 21...
21
 
21
 
22
 
22
 
23
/* restore_error_handler();
23
/* restore_error_handler();
24
   error_reporting(E_ALL); */
24
   error_reporting(E_ALL); */
25
class Textes {
25
class Textes {
Line 26... Line 26...
26
    private $plantuseurl = 'https://uses.plantnet-project.org/f/api.php?action=parse&format=json
26
    private $plantuseurl = 'https://uses.plantnet-project.org/f/api.php?section=0&action=parse&format=json
27
        &section=0&prop=wikitext&disabletoc=1&disableeditsection=1&disablelimitreport=1&page=';
27
        &prop=wikitext&disabletoc=1&disableeditsection=1&disablelimitreport=1&page=';
28
    
28
    
Line 77... Line 77...
77
        }
77
        }
78
        $masqueEntete = rtrim($masqueEntete,',');
78
        $masqueEntete = rtrim($masqueEntete,',');
79
        return $masqueEntete;
79
        return $masqueEntete;
80
    }
80
    }
Line -... Line 81...
-
 
81
    
-
 
82
    private function definirValeurParDefautDesParametres() {
-
 
83
        if (isset($this->parametres['retour']) == false) {
-
 
84
            $this->parametres['retour'] = self::MIME_JSON;
-
 
85
        }
-
 
86
        if (isset($this->parametres['retour.format']) == false) {
-
 
87
            $this->parametres['retour.format'] = 'min';
-
 
88
        }
-
 
89
        if (isset($this->parametres['navigation.depart']) == false) {
-
 
90
            $this->parametres['navigation.depart'] = 0;
-
 
91
        }
-
 
92
        if (isset($this->parametres['navigation.limite']) == false) {
-
 
93
            $this->parametres['navigation.limite'] = 100;
-
 
94
        }
-
 
95
    }
81
    
96
    
82
    private function obtenirTextes() {
97
    private function obtenirTextes() {
83
        $retour = "";
98
        $retour = "";
84
        $json = file_gets_content($this->plantuseurl.$this->parametres['retour.format']);
99
        $json = file_gets_content($this->plantuseurl.$this->parametres['masque']);
85
        if ($json != false) {
100
        if ($json != false) {
86
            $tableau = json_decode($json);
101
            $tableau = json_decode($json);
87
            if (isset($tableau['parse']['wikitext']['*'])) {
102
            if (isset($tableau['parse']['wikitext']['*'])) {
88
                $texte = $tableau['parse']['wikitext']['*'];
103
                $texte = $tableau['parse']['wikitext']['*'];