<commit_before>// Configuration check routine
var fs = require('fs');
const Configstore = require('configstore');
const pkg = require('./package.json');
const conf = new Configstore(pkg.name)

var unix_paths = ["/usr/bin/php", "/usr/sbin/php", "/etc/php", "/usr/lib/php", "/usr/share/php"]

$(function() {

  // Check OS
  checkWrite("Detecting system... ",0);
  var os;

  if (process.platform == "win32") {
    os = "win";
    checkWrite("Windows",1);
  }
  else if (process.platform == 'darwin') {
    os = "osx";
    checkWrite("Mac OSX",1);
  }
  else {
    os = "linux";
    checkWrite("Linux",1);
  }

  // Searching for PHP binary
  checkWrite("Trying to find PHP binary... ",0);
  switch (os) {
    case "osx":
    case "linux":
      checkPhpPath(unix_paths, 0);
      // @TODO Implement Windows
  }

});

function checkPhpPath(list, index) {
  if (list[index] == null) {
    phpNotFound();
  } else {
    fs.exists(list[index], function(exists) {
      if (exists) {
        phpFound(list[index]);
      } else {
        checkPhpPath(list, ++index);
      }
    });
  }
}

function phpFound(path) {
  checkWrite("Found! ("+path+")", 1);
  checkWrite("Storing data...", 0);
  conf.set("php_path", path);
  checkWrite("Done!",1);
  checkWrite("Starting app...");
  // Wait for 1.5 second, just in the first run
  setTimeout('window.location = "index.html"', 1500);
}

function phpNotFound() {
  // @TODO Implement
}<commit_msg>Added a message when it's not possible to find PHP binary<commit_after>// Configuration check routine
var fs = require('fs');
const Configstore = require('configstore');
const pkg = require('./package.json');
const conf = new Configstore(pkg.name)

var unix_paths = ["/usr/bin/php", "/usr/sbin/php", "/etc/php", "/usr/lib/php", "/usr/share/php"]

$(function() {

  // Check OS
  checkWrite("Detecting system... ",0);
  var os;

  if (process.platform == "win32") {
    os = "win";
    checkWrite("Windows",1);
  }
  else if (process.platform == 'darwin') {
    os = "osx";
    checkWrite("Mac OSX",1);
  }
  else {
    os = "linux";
    checkWrite("Linux",1);
  }

  // Searching for PHP binary
  checkWrite("Trying to find PHP binary... ",0);
  switch (os) {
    case "osx":
    case "linux":
      checkPhpPath(unix_paths, 0);
      // @TODO Implement Windows
  }

});

function checkPhpPath(list, index) {
  if (list[index] == null) {
    phpNotFound();
  } else {
    fs.exists(list[index], function(exists) {
      if (exists) {
        phpFound(list[index]);
      } else {
        checkPhpPath(list, ++index);
      }
    });
  }
}

function phpFound(path) {
  checkWrite("Found! ("+path+")", 1);
  checkWrite("Storing data...", 0);
  conf.set("php_path", path);
  checkWrite("Done!",1);
  checkWrite("Starting app...");
  // Wait for 1.5 second, just in the first run
  setTimeout('window.location = "index.html"', 1500);
}

function phpNotFound() {
  // @TODO Implement instructions and possibility to search for PHP binary
  checkWrite("Not found. Install PHP and try again.");
}
{'fraction_non_alphanumeric': 0.18446280991735536, 'fraction_numerical': 0.011239669421487603, 'mean_word_length': 3.100271002710027, 'pattern_counts': {'":': 4, '<': 3, '<?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': '1006227', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1028, 'n_words': 257}