/** * Return array of locations where REST APIs can be located. * * These are directories that deployed API locations can be rooted at. * In other words, get these rest locations first, then under these directories, * you should be able to find deployed REST APIs in the subdirectories * specified by {@link getDeployedApiLocations()}. * * @return array of directory locations where REST APIs can be found */ public static function getRestLocations() { if (!empty(self::$restLocations)) { return self::$restLocations; } $_restLocations = array(); $_includePaths = explode(PATH_SEPARATOR, get_include_path()); foreach ($_includePaths as $_includePath) { $_includePath = realpath(rtrim($_includePath, '\\/')); if ($_includePath) { $_restLocations[] = $_includePath; } } self::$restLocations = array_unique($_restLocations); // if include_path has any dups, remove them return self::$restLocations; }