function writeLogRow($content) { $params = JComponentHelper::getParams('com_playjoom'); if ($params->get('logging_active') == 1) { //set path for log file $log_path = '..' . DS . $params->get('logging_path') . DS; $log_file = $log_path . 'playjoom0.log'; if (!is_writable($log_path)) { return null; } //set ip setting if ($params->get('logging_ip', 0) == 1) { $client = 'Client: ' . $_SERVER['REMOTE_ADDR'] . ', '; } else { $client = null; } $sessionid = PlayJoomHelper::getSessionID(); //get time $log_time = PlayJoomLogging::getLogTime(); /* * check log file site * arrSize 0 -> all * arrSize 1 -> numbers * arrSize 2 -> letters */ preg_match("/([0-9]+)([a-z]+)/i", $params->get('logging_filesize'), $arrSize); if (file_exists($log_file)) { if (filesize($log_file) >= $arrSize[1] * PlayJoomLogging::getFactor($arrSize[2])) { rename($log_file, $log_path . 'playjoom1.log'); } } //write log row file_put_contents($log_file, $log_time . ' - ' . $client . $sessionid . ' - ' . $content . "\r\n", FILE_APPEND); } return null; }