Projet

Général

Profil

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

root / class / RefPoint.class.php @ e68abb6a

1
<?php
2
require_once(dirname(__FILE__).'/../constants.inc.php');
3

    
4
//
5
class RefPoint {
6
  static $all_ref_points_cache;
7

    
8
  public static function load_if_needed() {
9
    if (!isset(self::$all_ref_points_cache)) {
10
      $ref_points_filename = '../ref_points.local.php';
11
          if (file_exists($ref_points_filename)) {
12
            require($ref_points_filename);
13
        self::$all_ref_points_cache = $ref_points;
14
            return $ref_points;
15
          } else {
16
            return array();
17
      }
18
    }
19
   return self::$all_ref_points_cache;
20
  }
21

    
22
  public static function get($name) {
23
    self::load_if_needed();
24
    return self::$all_ref_points_cache[$name];
25
  }
26

    
27
}
28
?>