src/Log/Notifier.php
public static function push($notif, $status = self::STATUS_NOTICE)
  {
    static::checkStorage();
    if( is_string($notif) ) {
      $notif = array(array(
        'status'  => $status,
        'message' => $notif
      ));
    }
    $notifs = unserialize($_COOKIE[self::COOKIE_NAME]);
    foreach ($notif as $object) {
      if( !isset($object['message']) || !is_string($object['message']) ) {
        continue;
      }
      if( !isset($object['status']) || !in_array($object['status'], array(self::STATUS_NOTICE, self::STATUS_ERROR, self::STATUS_WARNING, self::STATUS_SUCCESS)) ) {
        $object['status'] = self::STATUS_NOTICE;
      }
      array_push($notifs, (object)$object);
    }
    setcookie(self::COOKIE_NAME, serialize($notifs), time()+180, "/");
  }
public static function push($notif, $status = self::STATUS_NOTICE)
  {
    static::checkStorage();
    if( is_string($notif) ) {
      $notif = array(array(
        'status'  => $status,
        'message' => $notif
      ));
    }
    $notifs = unserialize($_COOKIE[self::COOKIE_NAME]);
    foreach ($notif as $object) {
      if( !isset($object['message']) || !is_string($object['message']) ) {
        continue;
      }
      if( !isset($object['status']) || !in_array($object['status'], array(self::STATUS_NOTICE, self::STATUS_ERROR, self::STATUS_WARNING, self::STATUS_SUCCESS)) ) {
        $object['status'] = self::STATUS_NOTICE;
      }
      array_push($notifs, (object)$object);
    }
    setcookie(self::COOKIE_NAME, serialize($notifs), time()+180, "/");
  }
Ajoute une(des) notification(s) dans la pile

@param  mixed   $notif    Notification(s) à stocker
@param  string  $status   Statut de la notification (optionel, uniquement si on ajoute une seule notification)