Bontiv-Sourceer source code viewer
Root | Help
./nk-auto-install-googlecode/class/remotedir.php
<?php
require_once 'dir.php';

class
RemoteDir extends Dir
{
    protected
$base_url;
   
    public function
__construct($server, $tag = 'tip')
    {
       
$this->base_url = $server . '/' . $tag;
       
parent::__construct();
    }
   
    public function
list_dir ()
    {
       
$data = file_get_contents ($this->base_url
           
. $this->getPath('.')
            );
       
preg_match_all('`<li><a href=".*">(.*)</a></li>`', $data, $matches);
        return
$matches[1];
    }
   
    public function
get_content ($file)
    {
        return
file_get_contents ($this->base_url
           
. $this->getPath($file)
            );
    }
}
Presented with Bontiv-Sourceer