3.5.2.12. Redirection
File: classes/Redirection.php
The Preferences class provides support for preferences. Preferences are organized by
site, name, item, and index. Name is alphanumeric while item and index are numeric.
3.5.2.12.1. add_redirection
Format: result = add_redirection(site,root,type,path)
where "site" is the site,
"root" is the path to redirect from, "name" is the the preference name, "type" is the redirection type,
and "path" is the path to redirect to.
Example: $result = $redir->add_redirection($site,$root,$type,$path);
This method adds a redirection for the specified site. The type is one of the following:
- 1: File. The root path is redirected to the specified path. Neither the root nor the path may be null. This is the standard redirection that can be done with the web server software.
- 2: File system. The root path is the path that is redirected to the user file system. The file used with the root is the file id in the user file system. See User File Systems.
- 3: Download. The root path is the path that is redirected to download files. The file used with the root is the download id in the download table. See downloads.
3.5.2.12.2. delete
Format: result = delete(id)
where "id" is the redirection ID to delete.
Example: $result = $redir->delete($id);
This method deletes the specified redirection entry.
3.5.2.12.3. get_redirections
Format: result = get_redirections(site)
where "site" is the site whose redirections to return.
Example: $result = $redir->get_redirections($site);
This method returns an array of redirections for the given site.
3.5.2.12.4. resolve_redirection($site,$root)
Format: result = resolve_redirection(site,root)
where "site" is the site whose redirections to return.
Example: $result = $redir->resolve_redirection($site,$root);
This method returns an array of redirections for the given site.