Subversion Repositories Applications.wikini

Rev

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

Rev Author Line No. Line
46 jpm 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 setPageCourante($page) {
27
		$this->page = $page;
28
	}
29
 
30
	public function __call($methodeNom, $arguments) {
31
		if ($this->wikiObjet == null) {
32
			$this->initialiser();
33
		}
34
 
35
		chdir($this->cheminWiki);
36
		$retour = call_user_func_array(array($this->wikiObjet, $methodeNom), $arguments);
37
		chdir($this->cheminApi);
38
		return $retour;
39
	}
40
}
30 aurelien 41
?>