/** * Allows to manually set an error * @param int|string $error the Error code */ public static function setError($error) { self::$error = $error; }
/** * Validates if the given path is a Grav Instance * * @param string $target The local path to the Grav Instance * * @return boolean True if is a Grav Instance. False otherwise */ public static function isGravInstance($target) { self::$error = 0; self::$target = $target; if (!file_exists($target . DS . 'index.php') || !file_exists($target . DS . 'bin') || !file_exists($target . DS . 'user') || !file_exists($target . DS . 'system' . DS . 'config' . DS . 'system.yaml')) { self::$error = self::NOT_GRAV_ROOT; } return !self::$error; }