Example #1
0
 public static function add_class_path($class_path)
 {
     $file = ZING_CONFIG_DIR . '/CLASS_PATHS';
     $contents = file_get_contents($file);
     if (substr($contents, -1) != "\n") {
         $contents .= "\n";
     }
     $contents .= \zing\FileUtils::relativize_path($class_path, ZING_ROOT);
     $contents .= "\n";
     file_put_contents($file, $contents);
 }
Example #2
0
 public function add_rule($path, $extensions = 'php')
 {
     if (\zing\FileUtils::is_absolute_path($path)) {
         if (!($path = \zing\FileUtils::relativize_path($path, $this->root))) {
             return;
         }
     }
     if (is_dir($path)) {
         $path = rtrim($path, '/') . '/';
     }
     $this->rules[] = array('path' => $path, 'extensions' => (array) $extensions);
 }