Alternc
latest
Alternc logiel libre pour l'hébergement
|
This class manage web-cron tasks. More...
Public Member Functions | |
schedule () | |
lst_cron () | |
List the crontab for the current user. More... | |
hook_menu () | |
Hook called by menu class to add menu to the left panel. More... | |
update ($arr) | |
update the crontab More... | |
delete_one ($id) | |
delete a crontab More... | |
valid_schedule ($s) | |
validate a crontab schedule More... | |
hook_quota_get () | |
hook for quota computation More... | |
execute_cron () | |
Execute the required crontab of AlternC users this function EXIT at the end. More... | |
cron_callback ($url, $content, $curl) | |
Callback function called by rolling_curl when a cron resulr has been received schedule it for next run and send the mail if needed. More... | |
rolling_curl ($urls, $callback, $custom_options=null) | |
Launch parallel (using MAX_SOCKETS sockets maximum) retrieval of URL using CURL. More... | |
Public Attributes | |
const | MAX_SOCKETS = 8 |
const | DEFAULT_CAFILE = "/etc/ssl/certs/ca-certificates.crt" |
Private Member Functions | |
_update_one ($url, $user, $password, $email, $schedule, $id=null) | |
update a crontab, More... | |
This class manage web-cron tasks.
Definition at line 26 of file m_cron.php.
|
private |
update a crontab,
Definition at line 119 of file m_cron.php.
References $cuid, $db, $id, $msg, $password, $q, $user, checkmail(), delete_one(), and valid_schedule().
Referenced by update().
m_cron::cron_callback | ( | $url, | |
$content, | |||
$curl | |||
) |
Callback function called by rolling_curl when a cron resulr has been received schedule it for next run and send the mail if needed.
Definition at line 253 of file m_cron.php.
m_cron::delete_one | ( | $id | ) |
delete a crontab
$id | the id of the crontab to delete |
Definition at line 108 of file m_cron.php.
References $cuid, $db, $id, and $msg.
Referenced by _update_one().
m_cron::execute_cron | ( | ) |
Execute the required crontab of AlternC users this function EXIT at the end.
Definition at line 208 of file m_cron.php.
References $db, $msg, exit, and rolling_curl().
m_cron::hook_menu | ( | ) |
Hook called by menu class to add menu to the left panel.
Definition at line 70 of file m_cron.php.
m_cron::hook_quota_get | ( | ) |
m_cron::lst_cron | ( | ) |
List the crontab for the current user.
Definition at line 48 of file m_cron.php.
m_cron::rolling_curl | ( | $urls, | |
$callback, | |||
$custom_options = null |
|||
) |
Launch parallel (using MAX_SOCKETS sockets maximum) retrieval of URL using CURL.
$urls | array of associative array, each having the following keys : url = url to get (of the form http[s]://login:password@host/path/file?querystring ) login & password = if set, tell the login and password to use as simple HTTP AUTH.
|
$callback | function called for each request when completing. First argument is the $url object, second is the content (output) third is the info structure from curl for the returned page. 200 for OK, 403 for AUTH FAILED, 0 for timeout, dump it to know it ;) this function should return as soon as possible to allow other curl calls to complete properly. |
$cursom_options | array of custom CURL options for all transfers |
Definition at line 287 of file m_cron.php.
References $i, $info, DEFAULT_CAFILE, and MAX_SOCKETS.
Referenced by execute_cron().
m_cron::schedule | ( | ) |
m_cron::update | ( | $arr | ) |
update the crontab
$arr | array the crontab information, including its ID |
Definition at line 86 of file m_cron.php.
References $ok, and _update_one().
m_cron::valid_schedule | ( | $s | ) |
validate a crontab schedule
$s | array schedule paramters |
Definition at line 174 of file m_cron.php.
References $r, and schedule().
Referenced by _update_one().
const m_cron::DEFAULT_CAFILE = "/etc/ssl/certs/ca-certificates.crt" |
Definition at line 29 of file m_cron.php.
Referenced by rolling_curl().
const m_cron::MAX_SOCKETS = 8 |
Definition at line 28 of file m_cron.php.
Referenced by rolling_curl().