|
Posted by gosha bine on 05/08/07 07:13
Gilles Ganault wrote:
> Hi
>
> If possible, I'd like to use a file-based, simpler alternative to
> MySQL such as BerkeleyDB to manage a two-column database (phone number
> -> name), but I'm not sure my hoster supports this kind of thing:
>
> ---------------
> Configure Command ./configure --with-mysql=/usr/local/mysql
> --with-config-file-path=/opt3/local/apache/conf --with-gd
> --enable-gd-native-ttf --enable-gd-imgstrttf
> --with-jpeg-dir=/usr/local --with-ttf=/usr
> --with-freetype-dir=/usr/local --with-zlib-dir=/usr/local
> --with-zlib=/usr/local --with-imap=/usr/local/imap-2006g
> --with-imap-ssl=/usr/local/ssl --without-kerberos
> --with-dom=/usr/local --with-sablot=/usr/local --enable-xslt
> --with-xslt-sablot --with-png-dir=/usr/local --with-pdflib=/usr/local
> --with-curl=/usr/local/ --with-mcrypt=/usr/local
> --with-ming=/usr/local --with-gettext=/usr/local
> --with-apxs=/opt3/local/apache/bin/apxs --enable-track-vars
> --with-regex=system --with-pear --enable-ftp --enable-bcmath
> --enable-mbstring --enable-exif --enable-calendar
> --enable-memory-limit --enable-trans-sid --enable-libgcc
> --enable-inline-optimization --disable-debug
>
> Apache
> Loaded Modules mod_php4, mod_setenvif, mod_so, mod_headers,
> mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias,
> mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
> mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation,
> mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core
> ---------------
>
> If not, is there some PHP source file that I can include in my script?
>
> Thank you.
How big is your DB? If it is small enough to fit into memory, you can
simply store it in a php file:
file db.php
<? $DB=array('Bob'=>'bobs phone','Tom'=>'toms phone' etc);
file main.php:
include 'db.php';
// manipulate $DB array
.....
// save
file_put_contents('db.php', '<?$DB=' . var_export($DB,1));
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Navigation:
[Reply to this message]
|