j'ai enleve les fichiers inutiles
[bazdig.git] / lib / localresource.php
blob96751fc023a5d059a9fb61ae57ad4af3787efb09
1 <?php
2 class LocalResource
4 var $url;
5 var $file;
7 function __construct($url, $file)
9 $this->url = $url;
10 $this->file = $file;
13 function LocalResource($url, $file)
15 $this->__construct($url, $file);
18 function get($path)
20 $u = absolutize($this->url .'/'. $path);
21 $f = absolutize($this->file .'/'. $path);
22 $r = new LocalResource($u, $f);
23 return $r;
26 function get_file()
28 return $this->file;
31 function get_url()
33 return $this->url;
37 function absolutize($path)
39 $path = ereg_replace('/\./', '/', $path);
40 while (ereg('/[^/.]+/\.\./', $path)) {
41 $path = ereg_replace('/[^/.]+/\.\./', '/', $path);
44 return $path;