Php 如何测试pspell?
这很好,然后我和戈达迪换了一个电话。如果我用我的php信息运行一个测试,它会说pspell已启用。有人知道测试错误的方法吗,甚至可能知道修复方法吗Php 如何测试pspell?,php,.htaccess,aspell,pspell,Php,.htaccess,Aspell,Pspell,这很好,然后我和戈达迪换了一个电话。如果我用我的php信息运行一个测试,它会说pspell已启用。有人知道测试错误的方法吗,甚至可能知道修复方法吗 $pspell_config = pspell_config_create("en"); pspell_config_personal($pspell_config, "/home/user/public_html/custom.pws"); pspell_config_repl($pspell_config, "/home/user/public_
$pspell_config = pspell_config_create("en");
pspell_config_personal($pspell_config, "/home/user/public_html/custom.pws");
pspell_config_repl($pspell_config, "/home/user/public_html/custom.repl");
$pspell_link = pspell_new_config($pspell_config);
我正在用下面的代码测试我的代码。。这让我知道它是否有效,但不会抛出错误
$pspell_link = pspell_new("en");
$word = "color";
if (pspell_check($pspell_link, $word)) {
echo "Found a fix.";
} else {
echo "Sorry we are working on our search engines, please bare with us!";
}
我找到了这个代码来完成这个任务
error_reporting(E_ALL);
@ini_set('display_errors', 1);
// Call it once first because of a bug in Windows' Aspell.
pspell_new('en');
$test = pspell_new('en');
echo '
Testing pspell.... ', pspell_check($test, 'thisisnotawordandyouknowit') ? 'failure' : 'pass', '.<br />
If no error messages were displayed, Aspell is installed and working properly.';
错误报告(E_ALL);
@ini设置(“显示错误”,1);
//首先调用它一次,因为Windows的Aspell中有一个bug。
pspell_new(“en”);
$test=pspell_new('en');
回声'
测试pspell…',pspell_check($test,'这不是单词,你知道它')?'失败“:”通过“,”。
如果未显示任何错误消息,则说明Aspell已安装且工作正常。“;
这将显示pspell的错误,而不需要通过php.ini运行错误检查。我发现这段代码可以实现这一点
error_reporting(E_ALL);
@ini_set('display_errors', 1);
// Call it once first because of a bug in Windows' Aspell.
pspell_new('en');
$test = pspell_new('en');
echo '
Testing pspell.... ', pspell_check($test, 'thisisnotawordandyouknowit') ? 'failure' : 'pass', '.<br />
If no error messages were displayed, Aspell is installed and working properly.';
错误报告(E_ALL);
@ini设置(“显示错误”,1);
//首先调用它一次,因为Windows的Aspell中有一个bug。
pspell_new(“en”);
$test=pspell_new('en');
回声'
测试pspell…',pspell_check($test,'这不是单词,你知道它')?'失败“:”通过“,”。
如果未显示任何错误消息,则说明Aspell已安装且工作正常。“;
这将显示pspell的错误,而无需通过php.ini运行错误检查