<commit_before><?php

require_once(realpath(dirname(__FILE__).'/dmOs.php'));

class dmServerCheck
{
  protected $checks;

  const WARNING = 1;
  const ERROR = 2;

  public function __construct()
  {
    $this->checks = $this->createChecks();
  }
  
  protected function createChecks()
  {
    // check graphviz
//    exec('dot -V', $output, $graphvizReturnCode);
    
    return array(
      'server' => array(
    new dmServerCheckUnit('unix', DIRECTORY_SEPARATOR == '/', true)
//    new dmServerCheckUnit('graphviz installed', 0 === $graphvizReturnCode, true)
    ),
       'symfony' => array(
    new dmServerCheckUnit('version', SYMFONY_VERSION, '1.3.0', self::ERROR)
    ),
      'php config' => array(
    new dmServerCheckUnit('version', phpversion(), '5.2.4', self::ERROR),
//    new dmServerCheckUnit('version != 5.2.9 (buggy)', version_compare(phpversion(), '5.2.9', '!='), true, self::ERROR),
    new dmServerCheckUnit('memory', ini_get('memory_limit'), '48M', self::ERROR),
    new dmServerCheckUnit('magic quote gpc', ini_get('magic_quotes_gpc'), false),
    new dmServerCheckUnit('upload max filesize', ini_get('upload_max_filesize'), '2M'),
    new dmServerCheckUnit('post max size', ini_get('post_max_size'), '2M'),
    new dmServerCheckUnit('register globals', ini_get('register_globals'), false),
    new dmServerCheckUnit('session auto_start', ini_get('session.auto_start'), false),
    new dmServerCheckUnit('mbstring', extension_loaded('mbstring'), true),
    new dmServerCheckUnit('utf8_decode()', function_exists('utf8_decode'), true)
    ),
       'php extensions' => array(
    new dmServerCheckUnit('pdo', extension_loaded('pdo'), true, self::ERROR),
    new dmServerCheckUnit('pdo_mysql', extension_loaded('pdo_mysql'), true),
    new dmServerCheckUnit('pdo_pgsql', extension_loaded('pdo_pgsql'), true),
    new dmServerCheckUnit('pdo_sqlite', extension_loaded('pdo_sqlite'), true),
    new dmServerCheckUnit('json', extension_loaded('json') ? phpversion('json') : false, '1.0', self::ERROR),
    new dmServerCheckUnit('gd', extension_loaded('gd'), true, self::ERROR),
//    new dmServerCheckUnit('date', extension_loaded('date'), true, self::ERROR),
    new dmServerCheckUnit('ctype', extension_loaded('ctype'), true, self::ERROR),
    new dmServerCheckUnit('dom', extension_loaded('dom'), true, self::ERROR),
    new dmServerCheckUnit('iconv', extension_loaded('iconv'), true, self::ERROR),
    new dmServerCheckUnit('pcre', extension_loaded('pcre'), true, self::ERROR),
    new dmServerCheckUnit('reflection', extension_loaded('Reflection'), true, self::ERROR),
//    new dmServerCheckUnit('session', extension_loaded('session'), true, self::ERROR),
    new dmServerCheckUnit('simplexml', extension_loaded('SimpleXML'), true, self::ERROR),
//    new dmServerCheckUnit('bitset', extension_loaded('bitset'), true),
    new dmServerCheckUnit('apc', function_exists('apc_store') ? phpversion('apc') : false, '3.0'),<commit_msg>added exec() in server checks<commit_after><?php

require_once(realpath(dirname(__FILE__).'/dmOs.php'));

class dmServerCheck
{
  protected $checks;

  const WARNING = 1;
  const ERROR = 2;

  public function __construct()
  {
    $this->checks = $this->createChecks();
  }
  
  protected function createChecks()
  {
    // check graphviz
//    exec('dot -V', $output, $graphvizReturnCode);
    
    return array(
      'server' => array(
    new dmServerCheckUnit('unix', DIRECTORY_SEPARATOR == '/', true)
//    new dmServerCheckUnit('graphviz installed', 0 === $graphvizReturnCode, true)
    ),
       'symfony' => array(
    new dmServerCheckUnit('version', SYMFONY_VERSION, '1.3.0', self::ERROR)
    ),
      'php config' => array(
    new dmServerCheckUnit('version', phpversion(), '5.2.4', self::ERROR),
//    new dmServerCheckUnit('version != 5.2.9 (buggy)', version_compare(phpversion(), '5.2.9', '!='), true, self::ERROR),
    new dmServerCheckUnit('memory', ini_get('memory_limit'), '48M', self::ERROR),
    new dmServerCheckUnit('magic quote gpc', ini_get('magic_quotes_gpc'), false),
    new dmServerCheckUnit('upload max filesize', ini_get('upload_max_filesize'), '2M'),
    new dmServerCheckUnit('post max size', ini_get('post_max_size'), '2M'),
    new dmServerCheckUnit('register globals', ini_get('register_globals'), false),
    new dmServerCheckUnit('session auto_start', ini_get('session.auto_start'), false),
    new dmServerCheckUnit('mbstring', extension_loaded('mbstring'), true),
    new dmServerCheckUnit('utf8_decode()', function_exists('utf8_decode'), true),
    new dmServerCheckUnit('exec()', function_exists('exec'), true)
    ),
       'php extensions' => array(
    new dmServerCheckUnit('pdo', extension_loaded('pdo'), true, self::ERROR),
    new dmServerCheckUnit('pdo_mysql', extension_loaded('pdo_mysql'), true),
    new dmServerCheckUnit('pdo_pgsql', extension_loaded('pdo_pgsql'), true),
    new dmServerCheckUnit('pdo_sqlite', extension_loaded('pdo_sqlite'), true),
    new dmServerCheckUnit('json', extension_loaded('json') ? phpversion('json') : false, '1.0', self::ERROR),
    new dmServerCheckUnit('gd', extension_loaded('gd'), true, self::ERROR),
//    new dmServerCheckUnit('date', extension_loaded('date'), true, self::ERROR),
    new dmServerCheckUnit('ctype', extension_loaded('ctype'), true, self::ERROR),
    new dmServerCheckUnit('dom', extension_loaded('dom'), true, self::ERROR),
    new dmServerCheckUnit('iconv', extension_loaded('iconv'), true, self::ERROR),
    new dmServerCheckUnit('pcre', extension_loaded('pcre'), true, self::ERROR),
    new dmServerCheckUnit('reflection', extension_loaded('Reflection'), true, self::ERROR),
//    new dmServerCheckUnit('session', extension_loaded('session'), true, self::ERROR),
    new dmServerCheckUnit('simplexml', extension_loaded('SimpleXML'), true, self::ERROR),
//    new dmServerCheckUnit('bitset', extension_loaded('bitset'), true),
    new dmServerCheckUnit('apc', function_exists('apc_store') ? phpversion('apc') : false, '3.0'),
{'fraction_non_alphanumeric': 0.1687813021702838, 'fraction_numerical': 0.008347245409015025, 'mean_word_length': 5.723905723905724, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '394231', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1860, 'n_words': 379}