-/**
- * Define the command used to spellcheck the document.
- */
-$sqspell_command=$SQSPELL_APP[$sqspell_use_app];
-/**
- * If you have php >= 4.3.0, we can use proc_open and safe mode
- * and not mess w/ temp files. Otherwise we will do it the old
- * way, (minus the uneeded call to cat that messes up Wintel
- * boxen.)
- * Thanks Ray Ferguson for providing this patch.
- */
-if( check_php_version ( 4, 3 ) ) {
- $descriptorspec = array(
- 0 => array('pipe', 'r'), // stdin is a pipe that the child will read from
- 1 => array('pipe', 'w'), // stdout is a pipe that the child will write to
- 2 => array('pipe', 'w'), // stderr is a pipe that the child will write to
- );
- $spell_proc=proc_open($sqspell_command, $descriptorspec, $pipes);
- fwrite($pipes[0], $sqspell_new_text);
- fclose($pipes[0]);
- $sqspell_output = array();
- for($i=1; $i<=2; $i++){
- while(!feof($pipes[$i]))
- array_push($sqspell_output, rtrim(fgetss($pipes[$i],999),"\n"));
- fclose($pipes[$i]);
- }
- $sqspell_exitcode=proc_close($spell_proc);
+include_once(SM_PATH . 'plugins/squirrelspell/class/common.php');
+
+$aParams = array();
+$aParams['words'] = sqspell_getLang($sqspell_use_app);
+
+if ($SQSPELL_SPELLCHECKER===1) {
+ include_once(SM_PATH . 'plugins/squirrelspell/class/php_pspell.php');
+ $aParams['dictionary'] = $SQSPELL_APP[$sqspell_use_app];
+ $aParams['charset'] = $default_charset;
+ $check = new php_pspell($aParams);