PHP Conference Japan 2024

enchant_broker_describe

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL enchant >= 0.1.0)

enchant_broker_describe列舉 Enchant 提供者

說明

enchant_broker_describe(EnchantBroker $broker): 陣列

列舉 Enchant 提供者,並提供關於它們的一些基本資訊。 phpinfo() 也會提供相同的資訊。

參數

broker

enchant_broker_init() 返回的 Enchant 代理。

回傳值

傳回一個包含可用 Enchant 提供器及其詳細資訊的 陣列

更新日誌

版本 說明
8.0.0 broker 現在需要一個 EnchantBroker 實例;先前需要的是一個 資源
8.0.0 在此版本之前,函式在失敗時會傳回 false

範例

範例 #1 列出指定 broker 提供的後端

<?php
$r
= enchant_broker_init();
$bprovides = enchant_broker_describe($r);
echo
"目前 broker 提供下列後端:\n";
print_r($bprovides);

?>

上述範例將輸出類似以下的內容:

Current broker provides the following backend(s):
Array
(
    [0] => Array
        (
            [name] => aspell
            [desc] => Aspell Provider
            [file] => /usr/lib/enchant/libenchant_aspell.so
        )

    [1] => Array
        (
            [name] => hspell
            [desc] => Hspell Provider
            [file] => /usr/lib/enchant/libenchant_hspell.so
        )

    [2] => Array
        (
            [name] => ispell
            [desc] => Ispell Provider
            [file] => /usr/lib/enchant/libenchant_ispell.so
        )

    [3] => Array
        (
            [name] => myspell
            [desc] => Myspell Provider
            [file] => /usr/lib/enchant/libenchant_myspell.so
        )

)

新增註解

使用者貢獻的註解

此頁面沒有使用者貢獻的註解。
To Top