\AdmintoolsHelperDownload
Smart download helper. Automatically uses cURL or URL fopen() wrappers to fetch the package.
Synopsis
class AdmintoolsHelperDownload
{
- // methods
- public static bool download()
- public static mixed downloadAndReturn()
- private static bool hasCURL()
- private static bool|string getCURL()
- private static bool hasFOPEN()
- private static bool|string getFOPEN()
- private static array getAdapters()
- private static boolean chmod()
Methods
private
- chmod() — Change the permissions of a file, optionally using FTP
- getAdapters() — Detect and return available download "adapters" (not really adapters, as we don't follow the Adapter pattern, yet)
- getCURL() — Downloads the contents of a URL and writes them to disk (if $fp is not null) or returns them as a string (if $fp is null)
- getFOPEN() — Download from a URL using URL fopen() wrappers
- hasCURL() — Does the server support PHP's cURL extension?
- hasFOPEN() — Does the server support URL fopen() wrappers?
public
- download() — Downloads from a URL and saves the result as a local file
- downloadAndReturn() — Downloads from a URL and returns the result as a string