<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */
 
  uses('io.File', 'io.FileUtil');

  /**
   * The storage daemon 
   *
   * 
   *
   * @see      xp://peer.server.ConnectionListener
   * @purpose  Connection Listener for the storage daemon
   */
  class StorageListener extends ConnectionListener {
  
    /**
     * Method to be triggered when a client connects
     *
     * @access  public
     * @param   &peer.server.ConnectionEvent event
     */
    function connected(&$event) {
    }
    
    /**<commit_msg>- Add documentation on the socket syntax<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */
 
  uses('io.File', 'io.FileUtil');

  /**
   * The storage daemon is a TCP/IP server that allows you to store
   * and retrieve data.
   *
   * Socket syntax (>>> is request, <<< is response, ### a comment):
   * <pre>
   *   ### Add an entry
   *   >>> ADD user a:2:{i:0;i:9;i:1;i:2;s:9:"thekid.de";}
   *   <<< +OK b:1;
   *
   *   ### Clear storage
   *   >>> CLEAR user
   *   <<< +OK b:1;
   *
   *   ### Get stored data
   *   >>> GET user
   *   <<< +OK a:1:{i:0;a:2:{i:0;i:9;i:1;i:2;s:9:"thekid.de";}}
   * </pre>
   *
   * Error messages are returned as following (example):
   * <pre>
   *   >>> GET nonexistant
   *   <<< -ERR Cannot get filesize for history.friebe"
   * </pre>
   *
   * All data is serialized using PHP's serialize() functionality
   *
   * @see      xp://peer.server.ConnectionListener
   * @purpose  Connection Listener for the storage daemon
   */
  class StorageListener extends ConnectionListener {
  
    /**
     * Method to be triggered when a client connects
     *
     * @access  public
     * @param   &peer.server.ConnectionEvent event
     */
    function connected(&$event) {
    }
    
    /**
{'fraction_non_alphanumeric': 0.14950166112956811, 'fraction_numerical': 0.008859357696566999, 'mean_word_length': 2.273550724637681, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5923', 'n_tokens_mistral': 622, 'n_tokens_neox': 599, 'n_words': 161}