<commit_before><?php
if(!defined('LIMB_PROJECT_DIR'))
  define('LIMB_PROJECT_DIR', lmb_cli_ask_for_option('Project directory', lmb_cli_find_project_dir(getcwd())));

if(!defined('LIMB_FW_DIR'))
  define('LIMB_FW_DIR', lmb_cli_ask_for_option('Limb directory', lmb_cli_find_limb_dir(LIMB_PROJECT_DIR)));

if(!lmb_cli_init_tasks(LIMB_FW_DIR))
  die("ERROR: Limb not found".PHP_EOL);

lmb_require('limb/taskman/taskman.inc.php');

taskman_propset('PROJECT_DIR', LIMB_PROJECT_DIR);
taskman_propset('LIMB_DIR', LIMB_FW_DIR);
taskman_run();

function lmb_cli_ask_for_option($option_name, $default_value = '')
{
  if($default_value)<commit_msg>-- Added project and limb directories initialisation from PHP config<commit_after><?php
if(!$project_dir = get_cfg_var('limb.project_dir'))
  $project_dir = lmb_cli_ask_for_option('Project directory', lmb_cli_find_project_dir(getcwd()));
else
  echo "Project directory loaded from PHP config: {$project_dir}\n";

if(!$limb_dir = get_cfg_var('limb.dir'))
  $limb_dir = lmb_cli_ask_for_option('Limb directory', lmb_cli_find_limb_dir($project_dir));
else
  echo "Limb directory loaded from PHP config: {$limb_dir}\n";

if(!lmb_cli_init_tasks($limb_dir))
  die("ERROR: Limb not found".PHP_EOL);

lmb_require('limb/taskman/taskman.inc.php');

taskman_propset('PROJECT_DIR', $project_dir);
taskman_propset('LIMB_DIR', $limb_dir);
taskman_run();

function lmb_cli_ask_for_option($option_name, $default_value = '')
{
  if($default_value)
{'fraction_non_alphanumeric': 0.1447098976109215, 'fraction_numerical': 0.0, 'mean_word_length': 9.779411764705882, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5724195', 'n_tokens_mistral': 581, 'n_tokens_neox': 568, 'n_words': 80}