mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -04:00
Add Safe PHP functions
This commit is contained in:
parent
04a956886a
commit
58cc098058
260 changed files with 49458 additions and 45 deletions
|
@ -1,10 +1,16 @@
|
|||
<?
|
||||
use function Safe\fopen;
|
||||
use function Safe\fwrite;
|
||||
use function Safe\fclose;
|
||||
use function Safe\error_log;
|
||||
|
||||
class Logger{
|
||||
public static function WriteGithubWebhookLogEntry(string $requestId, string $text){
|
||||
$fp = fopen(GITHUB_WEBHOOK_LOG_FILE_PATH, 'a+');
|
||||
|
||||
if($fp === false){
|
||||
self::WriteErrorLogEntry('Could not open log file: ' . GITHUB_WEBHOOK_LOG_FILE_PATH);
|
||||
try{
|
||||
$fp = fopen(GITHUB_WEBHOOK_LOG_FILE_PATH, 'a+');
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
self::WriteErrorLogEntry('Couldn\'t open log file: ' . GITHUB_WEBHOOK_LOG_FILE_PATH . '. Exception: ' . vds($ex));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue