<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses(
    'lang.Process', 
    'lang.Runnable', 
    'lang.RuntimeError', 
    'lang.RuntimeOptions', 
    'lang.ElementNotFoundException'
  );

  /**
   * Represents the runtime - that is, the PHP binary executing the
   * current process.
   *
   * @test     xp://net.xp_framework.unittest.core.SystemExitTest
   * @test     xp://net.xp_framework.unittest.core.RuntimeTest
   * @purpose  Access to PHP runtime
   */
  class Runtime extends Object {
    protected static 
      $instance   = NULL;
      
    protected
      $executable = NULL,
      $startup    = NULL;
    
    static function __static() {
      self::$instance= new self();
      
      // PHP versions < 5.2.1 only have these memory functions if
      // compiled with --enable-memory-limit.
      if (!function_exists('memory_get_usage')) { 
        function memory_get_usage() { return -1; } 
        function memory_get_peak_usage() { return -1; } 
      }
    }
    
    /**
     * Retrieve the runtime instance
     *
     * @return  lang.Runtime
     */<commit_msg>- 5.3.0+: Remove check on existance of memory_get_usage()<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses(
    'lang.Process', 
    'lang.Runnable', 
    'lang.RuntimeError', 
    'lang.RuntimeOptions', 
    'lang.ElementNotFoundException'
  );

  /**
   * Represents the runtime - that is, the PHP binary executing the
   * current process.
   *
   * @test     xp://net.xp_framework.unittest.core.SystemExitTest
   * @test     xp://net.xp_framework.unittest.core.RuntimeTest
   * @purpose  Access to PHP runtime
   */
  class Runtime extends Object {
    protected static 
      $instance   = NULL;
      
    protected
      $executable = NULL,
      $startup    = NULL;
    
    static function __static() {
      self::$instance= new self();
    }
    
    /**
     * Retrieve the runtime instance
     *
     * @return  lang.Runtime
     */
{'fraction_non_alphanumeric': 0.11659192825112108, 'fraction_numerical': 0.003986048829098156, 'mean_word_length': 2.1326053042121687, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '7235907', 'n_tokens_mistral': 635, 'n_tokens_neox': 603, 'n_words': 153}