Subversion Repositories Applications.wikini

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
30 aurelien 1
<?php
2
class WikiApi {
3
 
4
	private $page = null;
5
	private $wikiObjet = null;
6
	private $cheminWiki = null;
7
	private $cheminApi = null;
8
 
9
	public function __construct($cheminWiki, $cheminApi) {
10
		$this->cheminWiki = $cheminWiki;
11
		$this->cheminApi = $cheminApi;
12
	}
13
 
14
	private function initialiser() {
15
		if ($this->page != null) {
16
        	$_REQUEST['wiki'] = $this->page;
17
        }
18
 
19
		ini_set('include_path',ini_get('include_path').':'.$this->cheminWiki.':');
20
		chdir($this->cheminWiki);
21
        include 'api.php';
22
        $this->wikiObjet = $wiki;
23
        chdir($this->cheminApi);
24
	}
25
 
26
	public function setPageCourrante($page) {
27
		$this->page = $page;
28
	}
29
 
30
	public function __call($methodeNom, $arguments) {
31
        //echo $methodeNom."/";
32
        if ($this->wikiObjet == null) {
33
        	$this->initialiser();
34
        }
35
 
36
        chdir($this->cheminWiki);
37
        $retour = call_user_func_array(array($this->wikiObjet, $methodeNom), $arguments);
38
        chdir($this->cheminApi);
39
        return $retour;
40
    }
41
}
42
?>