+ /**
+ * Determine if a path is absolute.
+ *
+ * @return bool
+ * TRUE if absolute. FALSE if relative.
+ */
+ public static function isAbsolute($path) {
+ if (substr($path, 0, 1) === DIRECTORY_SEPARATOR) {
+ return TRUE;
+ }
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+ if (preg_match('!^[a-zA-Z]:[/\\\\]!', $path)) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+