Filesystem::exists PHP Method

exists() public static method

public static exists ( $file )
    public static function exists($file)
    {
        return file_exists(self::path($file));
    }

Usage Example

Example #1
0
 /**
  * Method for parsing ini files
  *
  * @param		string	$filename Path and name of the ini file to parse
  *
  * @return	array		Array of strings found in the file, the array indices will be the keys. On failure an empty array will be returned
  *
  * @since		2.5
  */
 public static function parseFile($filename)
 {
     if (!Filesystem::exists($filename)) {
         return array();
     }
     // Capture hidden PHP errors from the parsing
     $version = phpversion();
     $php_errormsg = null;
     $track_errors = ini_get('track_errors');
     ini_set('track_errors', true);
     if ($version >= '5.3.1') {
         $contents = file_get_contents($filename);
         $contents = str_replace('_QQ_', '"\\""', $contents);
         $strings = @parse_ini_string($contents);
         if ($strings === false) {
             return array();
         }
     } else {
         $strings = @parse_ini_file($filename);
         if ($strings === false) {
             return array();
         }
         if ($version == '5.3.0' && is_array($strings)) {
             foreach ($strings as $key => $string) {
                 $strings[$key] = str_replace('_QQ_', '"', $string);
             }
         }
     }
     return $strings;
 }
All Usage Examples Of Filesystem::exists