Skip to content

Commit c2689fe

Browse files
committed
- Initial commit
1 parent 1950bdd commit c2689fe

File tree

6 files changed

+914
-0
lines changed

6 files changed

+914
-0
lines changed

Diff for: ext/enchant/config.m4

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
dnl
2+
dnl $Id$
3+
dnl
4+
5+
PHP_ARG_WITH(enchant,for ENCHANT support,
6+
[ --with-enchant[=DIR] Include enchant support.
7+
GNU Aspell version 1.1.3 or higher required.])
8+
9+
if test "$PHP_ENCHANT" != "no"; then
10+
PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
11+
if test "$PHP_ENCHANT" != "yes"; then
12+
ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
13+
else
14+
ENCHANT_SEARCH_DIRS="/usr/local /usr"
15+
fi
16+
for i in $ENCHANT_SEARCH_DIRS; do
17+
if test -f $i/include/enchant/enchant.h; then
18+
ENCHANT_DIR=$i
19+
ENCHANT_INCDIR=$i/include/enchant
20+
elif test -f $i/include/enchant.h; then
21+
ENCHANT_DIR=$i
22+
ENCHANT_INCDIR=$i/include
23+
fi
24+
done
25+
26+
if test -z "$ENCHANT_DIR"; then
27+
AC_MSG_ERROR(Cannot find enchant)
28+
fi
29+
30+
ENCHANT_LIBDIR=$ENCHANT_DIR/lib
31+
32+
AC_DEFINE(HAVE_ENCHANT,1,[ ])
33+
PHP_SUBST(ENCHANT_SHARED_LIBADD)
34+
PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
35+
PHP_ADD_INCLUDE($ENCHANT_INCDIR)
36+
fi

Diff for: ext/enchant/config.w32

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// $Id$
2+
// vim:ft=javascript
3+
4+
ARG_ENABLE("enchant", "Enchant Support", "no");
5+
6+
if (PHP_ENCHANT == "yes") {
7+
EXTENSION("enchant", "enchant.c");
8+
AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
9+
}

Diff for: ext/enchant/docs/examples/example1.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
$tag = 'en_US';
3+
$r = enchant_broker_init();
4+
$bprovides = enchant_broker_describe($r);
5+
echo "Current broker provides the following backend(s):\n";
6+
print_r($bprovides);
7+
8+
9+
if (enchant_broker_dict_exists($r,$tag)) {
10+
$d = enchant_broker_request_dict($r, $tag);
11+
$dprovides = enchant_dict_describe($d);
12+
echo "dictionary $tag provides:\n";
13+
$spellerrors = enchant_dict_check($d, "soong");
14+
print_r($dprovides);
15+
echo "found $spellerrors spell errors\n";
16+
if ($spellerrors) {
17+
$suggs = enchant_dict_suggest($d, "soong");
18+
echo "Suggestions for 'soong':";
19+
print_r($suggs);
20+
}
21+
enchant_broker_free_dict($d);
22+
} else {
23+
}
24+
enchant_broker_free($r);
25+
?>

0 commit comments

Comments
 (0)