<nephtali>

A simple, flexible, fast, and security-focused PHP framework
Nephtali documentation

API documentation

n\curl

Function wrappers for CURL operations such as getting contents of files, uploading via FTP, etc.

Functions

  • void ftp_upload(string $local_file_path, string $file_name, string $ftp_domain, string $ftp_username, string $ftp_password)

    FTP's a file to a server via curl.

  • void save_upload(string $post_key, string $file_name, string $ftp_domain, string $ftp_username, string $ftp_password)

    Save a file upload using CURL to ftp to the site and upload the file.

    This is useful on shared hosts where one does not have permissions to save files with PHP. In this case, you can set up an FTP account to an uploads directory, and then use this function to upload the file to the directory.

  • string get_contents(string $url, array $post_data, int $connect_timeout, int $transaction_timeout, array $opts)

    Retrieves the contents of a url via CURL.

    Unlike file_get_contents(), this function is useful because you can set a timeout on the request, which is useful in situations where you don't want an entire page to error out just because of one section of the page.

  • array get_contents_parallel(array $requests)

    Retrieves the contents of a multiple urls in parallel via CURL.

    In situations where some tasks take a significant amount of time relative to others, processing the tasks in parallel can buy you an overall improvement in performance, as the total time now equals the time for the longest task as opposed to the total time for each of the indivual tasks.

Nephtali namespaces