$entries Bisherige Eintraege (neueste zuerst). * @param string $type Art der Aktion, z. B. 'autoload_off'. * @param array $data Einzelheiten; wird erst bei der Anzeige in Text umgesetzt. * @param int $time Zeitpunkt. * @param int $max Hoechstzahl der Eintraege. * @return array */ public static function push( array $entries, $type, array $data, $time, $max = self::MAX_ENTRIES ) { array_unshift( $entries, array( 'time' => (int) $time, 'type' => (string) $type, 'data' => $data, ) ); return array_slice( $entries, 0, $max ); } /** * Haelt eine Aktion im Verlauf fest. Autoload aus: Der Verlauf wird nur auf * der eigenen Seite gelesen und soll nicht bei jedem Aufruf in den Speicher. * * @param string $type Art der Aktion. * @param array $data Einzelheiten. */ public static function add( $type, array $data ) { update_option( self::OPTION_KEY, self::push( self::all(), $type, $data, time() ), false ); } /** @return array */ public static function all() { $entries = get_option( self::OPTION_KEY, array() ); return is_array( $entries ) ? $entries : array(); } }