This project has moved. For the latest updates, please go here.
Basic Setup
  • Check if the php_lsa extension is loaded (in a web based environment):
$module = "lsa";

if(!extension_loaded($module)) {
  echo "Lsa Module not Loaded";
  exit;
}
  • Load the php_lsa extension is loaded (in a command-line environment):
$module = "lsa";

//true for commandline execution, false for web based execution.
$standalone = true;

if ($standalone) {
  //The following path needs to be adjusted
  $module = "c:\program Files\EasyPHP 2.0b1\php5\ext\php_lsa";  
  dl($module);
} else {
  if(!extension_loaded($module)) {
    echo "Lsa Module not Loaded";
    exit;
  }
}
  • Create a php_lsa object:
$module = "lsa";

if(!extension_loaded($module)) {
  echo "Lsa Module not Loaded";
  exit;
}

$lsa = new php_lsa();
  • Increase the PHP execution time (Lsa tends to take long):
ini_set ("max_execution_time","1800");
$maxtime = ini_get('max_execution_time');
  • Import files from disk (Note: the $base directory is of great importance for the clean method as it deletes files recursivly):
$base = "F:\\Work\\Lsi\\07-Garcia2";
$lsa->disk($base, "*.txt", false);
  • Some constants:
//Engine names
$engine1 = 'SVDLIBC';  //Needs svd.exe in the php's ext directory
$engine2 = 'WINGTP';  //Needs wingtp.exe in the php's ext directory
$engine3 = 'ALGLIB';      //Built-in engine.

//Temporary File Extensions used.
$MMExt = ".mm";
$HBExt = ".hb";
$NSext = ".ns";
$SLext = ".ls";
$CSext = ".csv";

Last edited Jan 19, 2010 at 10:27 AM by wvd_vegt, version 1

Comments

No comments yet.