OPiQuotations
v.03.00.00 — April 5, 2019
|
Classes | |
class | Db |
class | OPiQuotation |
Class quotation (text, author…) or maxim (text, nation…). More... | |
class | OPiQuotations |
Class to get OPiQuotation and informations from the databse. More... | |
class | Selection |
Class selection. More... | |
Functions | |
error_handler ($errno, $errstr, $errfile, $errline, $errcontext) | |
Error handler function. More... | |
hide_password ($s) | |
If $s contains an element '[password] => ...' then hides the password value. More... | |
to_log ($message) | |
Append $message in LOG_FILE. More... | |
html_text_cut ($html_text, $max_length, $hellip='…', $reduce=true) | |
If length of $html_text <= $max_length characters then return $html_text, else return $html_text cutted added of $hellip to not be longer than $max_length characters. More... | |
text_cut ($text, $max_length, $hellip='…', $reduce=true) | |
If length of $text <= $max_length characters then return $text, else return $text cutted added of $hellip to be length of $max_length characters. More... | |
Variables | |
return | true |
const | LOG_FILE = 'logs/log.txt' |
Filename of errors log file. More... | |
return | TRUE |
OPiQuotations\error_handler | ( | $errno, | |
$errstr, | |||
$errfile, | |||
$errline, | |||
$errcontext | |||
) |
Error handler function.
Get all errors specified by error_reporting() and write message with to_log() function.
If error is an E_USER_ERROR then exit, else continue.
This handler must be activated by set_error_handler('\OPiQuotations\error_handler').
See http://www.php.net/manual/en/function.set-error-handler.php
int | $errno | |
string | $errstr | |
string | $errfile | |
int | $errline | |
array | $errcontext |
Definition at line 49 of file log.inc.
References to_log().
OPiQuotations\hide_password | ( | $s | ) |
OPiQuotations\html_text_cut | ( | $html_text, | |
$max_length, | |||
$hellip = '…' , |
|||
$reduce = true |
|||
) |
If length of $html_text <= $max_length characters then return $html_text, else return $html_text cutted added of $hellip to not be longer than $max_length characters.
If a cutting is required and $reduce then reduce contiguous whitespaces.
If the cutting cut a HTML entity then remove it.
string | $html_text | |
int | $max_length | (must be >= length of $hellip) |
string | $hellip,; | (must not containt the & character) |
bool | $reduce |
Definition at line 109 of file OPiQuotations.inc.
References $i, $max_length, and text_cut().
OPiQuotations\text_cut | ( | $text, | |
$max_length, | |||
$hellip = '…' , |
|||
$reduce = true |
|||
) |
If length of $text <= $max_length characters then return $text, else return $text cutted added of $hellip to be length of $max_length characters.
If a cutting is required and $reduce then reduce contiguous whitespaces.
string | $text | |
int | $max_length | (must be >= length of $hellip) |
string | $hellip,; | |
bool | $reduce |
Definition at line 147 of file OPiQuotations.inc.
References $max_length, and $text.
Referenced by html_text_cut(), and OPiQuotations\OPiQuotation\to_text_twitter().
OPiQuotations\to_log | ( | $message | ) |
Append $message in LOG_FILE.
If the specified mail in '.private/log_email.inc' is not empty then send also the message to this mail.
If $message is not a string then a warning is added to the message and $message is converted to a string.
mixed | $message |
Definition at line 104 of file log.inc.
References hide_password().
Referenced by OPiQuotations\Db\__construct(), error_handler(), OPiQuotations\Db\list_to_assoc(), OPiQuotations\Db\nb(), OPiQuotations\Db\query_insert(), OPiQuotations\Db\query_quotations(), and OPiQuotations\Db\query_quotations_nb().
const OPiQuotations\LOG_FILE = 'logs/log.txt' |
return OPiQuotations::TRUE |
Definition at line 1116 of file OPiQuotation.inc.