Tweeks of new Log System
This commit is contained in:
		@@ -51,7 +51,7 @@ class ErrorHandler {
 | 
				
			|||||||
			'message' => $exception->getMessage(),
 | 
								'message' => $exception->getMessage(),
 | 
				
			||||||
			'file' => $exception->getFile(),
 | 
								'file' => $exception->getFile(),
 | 
				
			||||||
			'line' => $exception->getLine(),
 | 
								'line' => $exception->getLine(),
 | 
				
			||||||
			'trace' => $exception->getTraceAsString(),
 | 
								'trace' => $exception->getTrace(),
 | 
				
			||||||
		];
 | 
							];
 | 
				
			||||||
		echo json_encode($message);
 | 
							echo json_encode($message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@ class LogManager
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public function setLevel($type = LogRecordTypess::WARNING){
 | 
						public function setLevel($type = LogRecordTypess::WARNING){
 | 
				
			||||||
		$logLevel = $type['level'];
 | 
							$this->logLevel = $type['level'];
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public function write($value, $type = LogRecordTypess::ERROR){
 | 
						public function write($value, $type = LogRecordTypess::ERROR){
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,8 @@
 | 
				
			|||||||
//TODO: Working timestamp to $title
 | 
					//TODO: Working timestamp to $title
 | 
				
			||||||
class NotificationManager
 | 
					class NotificationManager
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	public static function addSubscriber($userID = '', $token = ''){
 | 
						public static function addSubscriber($userID, $token){
 | 
				
			||||||
 | 
							if (!empty($userID) && !empty($token)) {
 | 
				
			||||||
			$notificationSubscriber = $subDeviceId = Db::loadOne('SELECT id FROM notifications WHERE token = ?;', array($token));
 | 
								$notificationSubscriber = $subDeviceId = Db::loadOne('SELECT id FROM notifications WHERE token = ?;', array($token));
 | 
				
			||||||
			if ($notificationSubscriber == ''){
 | 
								if ($notificationSubscriber == ''){
 | 
				
			||||||
				$notification = array (
 | 
									$notification = array (
 | 
				
			||||||
@@ -15,6 +16,7 @@ class NotificationManager
 | 
				
			|||||||
				Db::add ('notifications', $notification);
 | 
									Db::add ('notifications', $notification);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static function getSubscription () {
 | 
						public static function getSubscription () {
 | 
				
			||||||
		return Db::loadAll ("SELECT * FROM notifications");
 | 
							return Db::loadAll ("SELECT * FROM notifications");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user