public static function sendErrorToDevelopers($title, $msg, $flag_file = '')
    {
        $cfg_email = Configuration::getInstance()->get('site')['email'];

        if (!$flag_file) {
            $flag_file = md5($msg);
        }

        FileSystem::mkDir(DIR_CACHE . 'errors/');
        $file = DIR_CACHE . 'errors/' . $flag_file;

        if (!file_exists($file) || filemtime($file) + 3600 < NOW) {
            touch($file);
            file_put_contents($file, $msg);

            /** @noinspection PhpUsageOfSilenceOperatorInspection */
            /** @noinspection UsageOfSilenceOperatorInspection */
            @mail(CMS_SUPPORT_EMAIL, $title, $msg . "\n\nAuto Error Report " . Constants::ADMIN_CMS_NAME . ".\n\nVisitor:\nIP: " . $_SERVER['REMOTE_ADDR'] . "\nBrowser agent: " . $_SERVER['HTTP_USER_AGENT'] . "\nURL: " . $_SERVER['REQUEST_URI'] . "\nReferer: " . $_SERVER['HTTP_REFERER'] . "\n" . date('d.m.Y H:i:s'), 'From: ' . $cfg_email, '-f ' . $cfg_email);
        }
    }
public static function sendErrorToDevelopers($title, $msg, $flag_file = '')
    {
        $cfg_email = Configuration::getInstance()->get('site')['email'];

        if (!$flag_file) {
            $flag_file = md5($msg);
        }

        FileSystem::mkDir(DIR_CACHE . 'errors/');
        $file = DIR_CACHE . 'errors/' . $flag_file;

        if (!file_exists($file) || filemtime($file) + 3600 < NOW) {
            touch($file);
            file_put_contents($file, $msg);

            /** @noinspection PhpUsageOfSilenceOperatorInspection */
            /** @noinspection UsageOfSilenceOperatorInspection */
            @mail(CMS_SUPPORT_EMAIL, $title, $msg . "\n\nAuto Error Report " . Constants::ADMIN_CMS_NAME . ".\n\nVisitor:\nIP: " . $_SERVER['REMOTE_ADDR'] . "\nBrowser agent: " . $_SERVER['HTTP_USER_AGENT'] . "\nURL: " . $_SERVER['REQUEST_URI'] . "\nReferer: " . $_SERVER['HTTP_REFERER'] . "\n" . date('d.m.Y H:i:s'), 'From: ' . $cfg_email, '-f ' . $cfg_email);
        }
    }
public static function sendErrorToDevelopers ( $ title , $ msg , $ flag_file = '' ) { $ cfg_email = Configuration :: getInstance ( ) -> get ( 'site' ) [ 'email' ] ; if ( ! $ flag_file ) { $ flag_file = md5 ( $ msg ) ; } FileSystem :: mkDir ( DIR_CACHE . 'errors/' ) ; $ file = DIR_CACHE . 'errors/' . $ flag_file ; if ( ! file_exists ( $ file ) || filemtime ( $ file ) + 3600 < NOW ) { touch ( $ file ) ; file_put_contents ( $ file , $ msg ) ; /** @noinspection PhpUsageOfSilenceOperatorInspection */ /** @noinspection UsageOfSilenceOperatorInspection */ @ mail ( CMS_SUPPORT_EMAIL , $ title , $ msg . "\n\nAuto Error Report " . Constants :: ADMIN_CMS_NAME . ".\n\nVisitor:\nIP: " . $ _SERVER [ 'REMOTE_ADDR' ] . "\nBrowser agent: " . $ _SERVER [ 'HTTP_USER_AGENT' ] . "\nURL: " . $ _SERVER [ 'REQUEST_URI' ] . "\nReferer: " . $ _SERVER [ 'HTTP_REFERER' ] . "\n" . date ( 'd.m.Y H:i:s' ) , 'From: ' . $ cfg_email , '-f ' . $ cfg_email ) ; } }
Sends error report to developers when error occurs

@param string $title
@param string $msg
@param string $flag_file
Sends error report to developers when error occurs