Compare commits

...
12 changed files with 0 additions and 448 deletions

No files matched your search

-2
View File
@@ -1,2 +0,0 @@
enchant
Pierre-Alain Joye, Ilia Alshanetsky
-36
View File
@@ -1,36 +0,0 @@
dnl
dnl $Id$
dnl
PHP_ARG_WITH(enchant,for ENCHANT support,
[ --with-enchant[=DIR] Include enchant support.
GNU Aspell version 1.1.3 or higher required.])
if test "$PHP_ENCHANT" != "no"; then
PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
if test "$PHP_ENCHANT" != "yes"; then
ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
else
ENCHANT_SEARCH_DIRS="/usr/local /usr"
fi
for i in $ENCHANT_SEARCH_DIRS; do
if test -f $i/include/enchant/enchant.h; then
ENCHANT_DIR=$i
ENCHANT_INCDIR=$i/include/enchant
elif test -f $i/include/enchant.h; then
ENCHANT_DIR=$i
ENCHANT_INCDIR=$i/include
fi
done
if test -z "$ENCHANT_DIR"; then
AC_MSG_ERROR(Cannot find enchant)
fi
ENCHANT_LIBDIR=$ENCHANT_DIR/lib
AC_DEFINE(HAVE_ENCHANT,1,[ ])
PHP_SUBST(ENCHANT_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
PHP_ADD_INCLUDE($ENCHANT_INCDIR)
fi
-25
View File
@@ -1,25 +0,0 @@
<?php
$tag = 'en_US';
$r = enchant_broker_init();
$bprovides = enchant_broker_describe($r);
echo "Current broker provides the following backend(s):\n";
print_r($bprovides);
if (enchant_broker_dict_exists($r,$tag)) {
$d = enchant_broker_request_dict($r, $tag);
$dprovides = enchant_dict_describe($d);
echo "dictionary $tag provides:\n";
$spellerrors = enchant_dict_check($d, "soong");
print_r($dprovides);
echo "found $spellerrors spell errors\n";
if ($spellerrors) {
$suggs = enchant_dict_suggest($d, "soong");
echo "Suggestions for 'soong':";
print_r($suggs);
}
enchant_broker_free_dict($d);
} else {
}
enchant_broker_free($r);
?>
-162
View File
@@ -1,162 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.4.8" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>enchant</name>
<channel>pecl.php.net</channel>
<summary>libenchant binder, support near all spelling tools</summary>
<description>Enchant is a binder for libenchant. Libenchant provides a common
API for many spell libraries:
- aspell/pspell (intended to replace ispell)
- hspell (hebrew)
- ispell
- myspell/hunspell (OpenOffice project, mozilla)
- uspell (primarily Yiddish, Hebrew, and Eastern European languages)
A plugin system allows to add custom spell support.
see www.abisource.com/enchant/
</description>
<lead>
<name>Pierre-Alain Joye</name>
<user>pajoye</user>
<email>paj@pearfr.org</email>
<active>yes</active>
</lead>
<lead>
<name>Ilia Alshanetsky</name>
<user>iliaa</user>
<email>ilia@php.net</email>
<active>yes</active>
</lead>
<date>2008-04-16</date>
<version>
<release>1.0.2</release>
<api>1.1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>- #13181, Leaving a context frees the dictionnary resources
- Fix protos descriptions in the sources
</notes>
<contents>
<dir name="/">
<dir name="docs">
<dir name="examples">
<file name="example1.php" role="doc"/>
</dir>
<!-- //docs/examples -->
</dir>
<!-- //docs -->
<file name="config.m4" role="src"/>
<file name="config.w32" role="src"/>
<file name="CREDITS" role="doc"/>
<file name="enchant.c" role="src"/>
<file name="php_enchant.h" role="src"/>
<dir name="tests">
<file name="broker_describe.phpt" role="test"/>
<file name="broker_free.phpt" role="test"/>
<file name="broker_init.phpt" role="test"/>
<file name="broker_request_dict.phpt" role="test"/>
<file name="hindi_correct.txt" role="test"/>
<file name="hindi_incorrect.txt" role="test"/>
<file name="bug13181.phpt" role="test"/>
</dir>
</dir>
<!-- / -->
</contents>
<dependencies>
<required>
<php>
<min>5</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
</pearinstaller>
</required>
</dependencies>
<providesextension>enchant</providesextension>
<extsrcrelease>
<configureoption default="shared" name="with-enchant" prompt="libenchant prefix?"/>
</extsrcrelease>
<changelog>
<release>
<date>2006-03-21</date>
<version>
<release>1.0.1</release>
<api>1.1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>- add enchant_broker_list_dicts to get a list of available dictionaries
- fix compilation warnings
- add examples
- add tests</notes>
</release>
<release>
<date>2004-08-11</date>
<version>
<release>1.0</release>
<api>1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>- Fixed leak inside MINFO function.
- Fixed crash inside enchant_dict_suggest() when there are no suggestions.
- Added missing safe_mode/open_basedir check inside enchant_broker_request_pwl_dict().
- Fixed various function prototypes.
- Fixed possible leak in suggestions result.
</notes>
</release>
<release>
<version>
<release>0.2.1</release>
<api>0.2.1</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2004-03-11</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>- Fix possible leak in suggestions result
- Move to beta status
</notes>
</release>
<release>
<version>
<release>0.2.0</release>
<api>0.2.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2006-03-21</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>- Add Ilia Alshanetsky as maintainer
- Cleanup sources codes (ilia)
- Add enchant_dict_quick_check (ilia)
</notes>
</release>
<release>
<version>
<release>0.1</release>
<api>0.1</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2003-03-08</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>Initial release
</notes>
</release>
</changelog>
</package>
-83
View File
@@ -1,83 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2003 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Pierre-Alain Joye <paj@pearfr.org> |
+----------------------------------------------------------------------+
$Id$
*/
#ifndef PHP_ENCHANT_H
#define PHP_ENCHANT_H
extern zend_module_entry enchant_module_entry;
#define phpext_enchant_ptr &enchant_module_entry
#define PHP_ENCHANT_VERSION "1.0.2-dev"
#ifdef PHP_WIN32
#define PHP_ENCHANT_API __declspec(dllexport)
#else
#define PHP_ENCHANT_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
PHP_MINIT_FUNCTION(enchant);
PHP_MSHUTDOWN_FUNCTION(enchant);
PHP_MINFO_FUNCTION(enchant);
PHP_FUNCTION(enchant_broker_init);
PHP_FUNCTION(enchant_broker_free);
PHP_FUNCTION(enchant_broker_get_error);
PHP_FUNCTION(enchant_broker_list_dicts);
PHP_FUNCTION(enchant_broker_request_dict);
PHP_FUNCTION(enchant_broker_request_pwl_dict);
PHP_FUNCTION(enchant_broker_free_dict);
PHP_FUNCTION(enchant_broker_dict_exists);
PHP_FUNCTION(enchant_broker_set_ordering);
PHP_FUNCTION(enchant_broker_describe);
PHP_FUNCTION(enchant_dict_check);
PHP_FUNCTION(enchant_dict_suggest);
PHP_FUNCTION(enchant_dict_add_to_personal);
PHP_FUNCTION(enchant_dict_add_to_session);
PHP_FUNCTION(enchant_dict_is_in_session);
PHP_FUNCTION(enchant_dict_store_replacement);
PHP_FUNCTION(enchant_dict_get_error);
PHP_FUNCTION(enchant_dict_describe);
PHP_FUNCTION(enchant_dict_quick_check);
#ifdef ZTS
#define ENCHANT_G(v) TSRMG(enchant_globals_id, zend_enchant_globals *, v)
#else
#define ENCHANT_G(v) (enchant_globals.v)
#endif
#endif /* PHP_ENCHANT_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
-28
View File
@@ -1,28 +0,0 @@
--TEST--
enchant_broker_describe() function
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
?>
--FILE--
<?php
$broker = enchant_broker_init();
if(!$broker) exit("failed, broker_init failure\n");
$provides = enchant_broker_describe($broker);
if (is_array($provides)) {
foreach ($provides as $backend) {
if (!(isset($backend['name']) && isset($backend['desc']) && isset($backend['file']))) {
exit("failed\n");
}
}
exit("OK\n");
} else {
echo "failed";
}
?>
--EXPECTF--
OK
-21
View File
@@ -1,21 +0,0 @@
--TEST--
enchant_broker_free() function
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
?>
--FILE--
<?php
$broker = enchant_broker_init();
if (is_resource($broker)) {
echo "OK\n";
enchant_broker_free($broker);
} else {
exit("init failed\n");
}
echo "OK\n";
?>
--EXPECT--
OK
OK
-15
View File
@@ -1,15 +0,0 @@
--TEST--
enchant_broker_init() function
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
?>
--FILE--
<?php
$broker = enchant_broker_init();
echo is_resource($broker) ? "OK" : "Failure";
echo "\n";
?>
--EXPECT--
OK
@@ -1,31 +0,0 @@
--TEST--
enchant_broker_request_dict() function
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
?>
--FILE--
<?php
$broker = enchant_broker_init();
if (!is_resource($broker)) {
exit("init failed\n");
}
$dicts = enchant_broker_list_dicts($broker);
if (is_array($dicts)) {
if (count($dicts)) {
$dict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']);
if (is_resource($dict)) {
echo "OK\n";
} else {
echo "fail to request " . $dicts[0]['lang_tag'];
}
}
} else {
exit("list dicts failed\n");
}
echo "OK\n";
?>
--EXPECT--
OK
OK
-43
View File
@@ -1,43 +0,0 @@
--TEST--
bug #13181, leaving a context frees the broker resources
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
?>
--FILE--
<?php
function get_dictionnary() {
$rBroker = enchant_broker_init();
$t = enchant_broker_request_dict($rBroker, 'en');
var_dump($t);
return $t;
}
$rDict = get_dictionnary();
var_dump($rDict);
enchant_dict_suggest($rDict, "soong");
function get_broker() {
$t = enchant_broker_init();
var_dump($t);
return $t;
}
$rbroker = get_broker();
var_dump($rbroker);
function get_dict($broker) {
$t = enchant_broker_request_dict($broker, 'en');
var_dump($t);
return $t;
}
$rDict = get_dict($rbroker);
var_dump($rDict);
?>
--EXPECTF--
resource(%d) of type (enchant_dict)
resource(%d) of type (enchant_dict)
resource(%d) of type (enchant_broker)
resource(%d) of type (enchant_broker)
resource(%d) of type (enchant_dict)
resource(%d) of type (enchant_dict)
-1
View File
@@ -1 +0,0 @@
इस पृष्ठ में एक लिंक बनाने के लिये इस प्रतीक को खीचें व छोड़ें
-1
View File
@@ -1 +0,0 @@
इस पृष्ठ में एक लिंक बनाने के लिये इस प्रतीक को खच व छड