\apex\app\sysNetwork

Handles various general repository communication such as retrieving a list of packages and themes, checking for available upgrades, and so on.

Summary

Methods
Properties
Constants
check_valid_repo()
list_packages()
check_package()
search()
check_upgrades()
send_repo_request()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

check_valid_repo()

check_valid_repo(string  $host, integer  $is_ssl = 1) : boolean

Check whether or not a repository is valid.

Parameters

string $host

The hostname to check

integer $is_ssl

A 1/0, whether or not to check via SSL

Returns

boolean —

WHether or not ti's a valid repo.

list_packages()

list_packages(string  $type = 'package') : array

List all available packages on a repo

Parameters

string $type

The type to list -- 'package' or 'theme'.

Returns

array —

An array of arrays, with each element being an array containing details on one page that is available.

check_package()

check_package(string  $pkg_alias, string  $type = 'package') : array

Checks to see whether or not a package alias exists in any of the repositories configured on this system.

Parameters

string $pkg_alias

The package alias to search for.

string $type

The type -- 'package' or 'theme'

Returns

array —

An array of all repos that contain the package.

search()

search(string  $term) : string

Search all repositories

Searches all repos configured on this system for a given term, for any packages that match. Unlike the 'check_package' method, this does not have to be the exact alias, and will search the alias, name and description of all packages for given term.

Parameters

string $term

The term to search for.

Returns

string —

A message containg all packages and repos that match the term.

check_upgrades()

check_upgrades(array  $packages = array()) 

Check for upgrades

Parameters

array $packages

An array of packages to check for upgrades. If none specified, all packages installed in the system will be checked.

send_repo_request()

send_repo_request(integer  $repo_id, string  $alias, string  $action, array  $request = array(), boolean  $noerror = false, string  $zip_file = '') : mixed

Send HTTP request to repository

Parameters

integer $repo_id

The ID# of the repository to send the request to

string $alias

The alias of the package /theme the request is for

string $action

The action being performed

array $request

The contents of the POST request

boolean $noerror

If true, will return false instead of triggering an error

string $zip_file

Optional zip file to upload with the package / theme / upgrade.

Returns

mixed —

Array of the JSON response, or false if failed