Show
Ignore:
Timestamp:
11/11/07 00:51:13 (14 months ago)
Author:
jwage
Message:

Merged r3136:3137

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine.php

    r3127 r3138  
    442442     * Array of all the loaded models and the path to each one for autoloading 
    443443     * 
    444      * @var string 
     444     * @var array 
    445445     */ 
    446446    private static $_loadedModels = array(); 
     447     
     448    /** 
     449     * _validators 
     450     * 
     451     * Array of all the loaded validators 
     452     * @var array 
     453     */ 
     454    private static $_validators = array(); 
    447455 
    448456    /** 
     
    10711079    } 
    10721080     
    1073     function removeDirectories($folderPath) 
     1081    /** 
     1082     * removeDirectories 
     1083     * 
     1084     * @param string $folderPath  
     1085     * @return void 
     1086     */ 
     1087    public static function removeDirectories($folderPath) 
    10741088    { 
    10751089        if (is_dir($folderPath)) 
     
    10941108        } 
    10951109    } 
     1110     
     1111    /** 
     1112     * getValidators 
     1113     * 
     1114     * Get available doctrine validators 
     1115     * 
     1116     * @return array $validators 
     1117     */ 
     1118    public static function getValidators() 
     1119    { 
     1120        if (empty(self::$_validators)) { 
     1121            $dir = Doctrine::getPath() . DIRECTORY_SEPARATOR . 'Doctrine' . DIRECTORY_SEPARATOR . 'Validator'; 
     1122         
     1123            $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY); 
     1124            foreach ($files as $file) { 
     1125                $e = explode('.', $file->getFileName()); 
     1126                 
     1127                if (end($e) == 'php') { 
     1128                    $name = strtolower($e[0]); 
     1129                     
     1130                    self::$_validators[$name] = $name; 
     1131                } 
     1132            } 
     1133        } 
     1134         
     1135        return self::$_validators; 
     1136    } 
    10961137}