PHP.mk документација

pspell_new_config

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

function.pspell-new-config.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека function.pspell-new-config.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
pspell_new_config

Референца за `function.pspell-new-config.php` со подобрена типографија и навигација.

function.pspell-new-config.php

pspell_new_config

(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)

pspell_new_configВчитај нов речник со поставки базирани на дадена конфигурација

= NULL

pspell_new_config(PSpell\Config $config): PSpell\Dictionary|false

pspell_new_config() отвора нов речник со поставки наведени во config, создаден со pspell_config_create() и изменет со pspell_config_*() функции. Овој метод ви обезбедува најголема флексибилност и ги има сите функционалности обезбедени од pspell_new() and pspell_new_personal().

Параметри

config

На config параметарот е оној што е вратен од pspell_config_create() кога е креирана конфигурацијата.

Вратени вредности

Враќа PSpell\Dictionary инстанца при успех, или false Враќа ресурс од покажувач на датотека при успех, или

Дневник на промени

Верзија = NULL
8.1.0 На config параметарот очекува PSpell\Config инстанца сега; претходно, а resource се очекуваше.
8.1.0 Враќа PSpell\Dictionary инстанца сега; претходно, а resource .

Примери

Пример #1 pspell_new_config()

<?php
$pspell_config
= pspell_config_create("en");
pspell_config_personal($pspell_config, "/var/dictionaries/custom.pws");
pspell_config_repl($pspell_config, "/var/dictionaries/custom.repl");
$pspell = pspell_new_config($pspell_config);
?>

Белешки од корисници 1 белешка

soapergem на gmail точка com
пред 17 години
Today I ran into an interesting problem that I thought I'd share here to save the next developer that ends up in the same situation a whole lot of trouble. I have been running PHP5 as a FastCGI module on a Windows IIS server, and I recently installed the Aspell library and enabled the pspell extension in my php.ini file. I also installed the English Aspell dictionary. But when I went to use pspell, I was getting ambiguous errors that would terminate script execution without warning.

So I started to break things down, and came to the conclusion that the following code successfully executed its first line, but broke on the last line with the call to pspell_new_config:

<?php

$pspell_config = pspell_config_create('en');
$pspell_link = pspell_new_config($pspell_config);

?>

This returned a FastCGI error in the browser, with error number -2147467259 (0x80004005). By luck, I happened to think to try the same script via the command line, which gave a much more descriptive error. What happened was that the dictionary installer created the *.dat files in the Aspell\data directory using the Windows standard CRLF "\r\n" instead of the UNIX standard "\n" for line feeds. By changing these all back to the UNIX standard, everything worked. It's apparently very touchy about these line feeds, so if you're wracking your brain over why pspell_new_config is breaking your scripts and you're using a Windows server, start by ensuring that there aren't any extraneous "\r" characters in your dictionary files.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.