Projet

Général

Profil

Paste
Télécharger (582 octets) Statistiques
| Branche: | Révision:

root / class / sites_dir.class.php @ 7f9aab46

1
<?php
2
class sites_dir {
3
  private $base_dir;
4

    
5
  public function __construct($dir) {
6
    $this->base_dir = $dir;
7
    }
8
  
9
  public function get_sites() {
10
        try
11
        {
12
            $dir_fd = opendir($this->base_dir);
13
        }
14
        catch(Exception $e)
15
        {
16
                die('Erreur : '.$e->getMessage());
17
        }
18
             
19
 
20
    $point_list = array();
21
    while (false !== ($point_dir = readdir($dir_fd))) {
22
      $pt = new site_point($this->base_dir.'/'.$point_dir);
23
      if ($pt->get_prefix() !== false) $point_list[] = $pt;
24
    }
25
    return $point_list;
26
  }
27
  
28
  public function get_dir() {
29
          return $this->base_dir;
30
  }
31

    
32
}