Skip to content

Commit 375b96f

Browse files
committed
PostgresQL to mod_dbd completed
1 parent 1729e9d commit 375b96f

File tree

13 files changed

+101
-404
lines changed

13 files changed

+101
-404
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
*~
2+
*.o
3+
*.lo
4+
*.la
5+
*.log
6+
*.status
7+
config.h
8+
stamp-h1
9+
Makefile
10+
.deps
11+
.libs
212
aclocal.m4
313
config.guess
414
config.h.in
515
config.sub
616
depcomp
717
install-sh
818
ltmain.sh
19+
libtool
920
missing
1021
autom4te.cache/
1122
m4/libtool.m4

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
2010-06-19 Take Vos <take.vos@vosgames.nl>
3+
4+
* Replaced postgresql with mod_dbd
5+
6+
* Replaced regex with mod_rewrite
7+
8+

Makefile.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ subdir = .
3737
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
3838
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
3939
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
40-
config.guess config.sub depcomp install-sh ltmain.sh missing
40+
TODO config.guess config.sub depcomp install-sh ltmain.sh \
41+
missing
4142
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
4243
am__aclocal_m4_deps = $(top_srcdir)/m4/ap_check_apache.m4 \
43-
$(top_srcdir)/m4/ax_lib_postgresql.m4 \
4444
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
4545
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
4646
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
@@ -175,10 +175,6 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
175175
PACKAGE_URL = @PACKAGE_URL@
176176
PACKAGE_VERSION = @PACKAGE_VERSION@
177177
PATH_SEPARATOR = @PATH_SEPARATOR@
178-
PG_CONFIG = @PG_CONFIG@
179-
POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
180-
POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
181-
POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
182178
RANLIB = @RANLIB@
183179
SED = @SED@
184180
SET_MAKE = @SET_MAKE@

README

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,37 @@ Example apache config
3838
---------------------
3939
Below is part of an apache configuration file. The first part loads
4040
the module.
41-
The Location directive makes the /tautoru url under control of the okioki module.
42-
- The OkiokiConnectionInfo shows a postgresql connect string.
43-
- The OkiokiCommand gives http method, a regex url (under /tautoru) and optionally decoded argument names.
44-
- The OkiokiSQL sets the SQL statement to execute when the command matches, it also optionally
45-
allows for named SQL parameters (which are decoded from the url, query string, post parameter and cookies).
46-
- The OkiokiCSV sets the names (which matches the names in the select clause) of the columns to display.
41+
42+
- Use of DBD commands to prepare the sql statements and use a resource pool
43+
- Use of the Rewrite engine to convert RESTful URLs to simple urls.
44+
- The OkiokiCommand has assigned to it:
45+
* a http method,
46+
* an url (under /tautoru),
47+
* That the result should be returned in CSV form,
48+
* the prepared statement to use,
49+
* and the parameters from a GET/POST form, to be used with the prepared statement
4750

4851
<IfModule !mod_okioki.c>
4952
LoadModule okioki_module modules/mod_okioki.so
5053
</IfModule>
5154

52-
<Location /tautoru>
53-
SetHandler okioki-handler
54-
OkiokiConnectionInfo "host=localhost dbname=tautoru user=tautoru password=foobarbaz"
55+
<VirtualHost *:80>
56+
DBDriver pgsql
57+
DBDParams "host=localhost dbname=tautoru user=tautoru password=xxxxxx"
58+
59+
DBDPrepareSQL "select id, name from otp_algorithm;" sql_test
60+
DBDPrepareSQL "select name from otp_algorithm where id = %hhd;" sql_test_id
61+
62+
#RewriteLog "/var/log/apache2/rewrite.log"
63+
#RewriteLogLevel 9
5564

56-
OkiokiCommand GET ^/test$
57-
OkiokiSQL "select id, name from otp_algorithm"
58-
OkiokiCSV id name
65+
RewriteEngine on
66+
RewriteRule ^/tautoru/test/(.*) /tautoru/test_id?id=$1
5967

60-
OkiokiCommand GET ^/test/([0-9]+)$ id
61-
OkiokiSQL "select name from otp_algorithm where id = $1" id
62-
OkiokiCSV name
63-
</Location>
68+
<Location /tautoru>
69+
SetHandler okioki-handler
70+
OkiokiCommand GET /test CSV sql_test
71+
OkiokiCommand GET /test_id CSV sql_test_id id
72+
</Location>
73+
</VirtualHost>
6474

0 commit comments

Comments
 (0)