PHP C C++ CMake
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
include_extras/VC9
tests-performance
tests
.gitignore
.travis.yml
CMakeLists.txt
CREDITS
INSTALL.txt
INSTALL_LINUX.txt
INSTALL_WINDOWS.txt
LICENSE
README.md
config.m4
config.w32
config_cmake.h
create_user_cloud.sql
example.php
nuodb_driver.c
nuodb_statement.c
pdo_nuodb.c
pdo_nuodb.cbp
pdo_nuodb.dsp
pdo_nuodb.layout
pdo_nuodb.php
php_pdo_nuodb.h
php_pdo_nuodb_c_cpp_common.h
php_pdo_nuodb_cpp_int.cpp
php_pdo_nuodb_cpp_int.h
php_pdo_nuodb_int.h
run-test.php

README.md

NuoDB PHP PDO Native Driver

Build Status

This is the official NuoDB PHP PDO driver. It is actively supported by NuoDB, updated and tested with each new release of NuoDB and upon major releases of PHP.

Installing Necessary Dependencies

In order to build the driver you must have PHP plus developer tools installed. This may be done from source or using package managers.

Windows: PHP version 5.3 and 5.4 is required
Linux: PHP version 5.3, 5.4, or 5.5 is required

NuoDB installed

Build & Install on Unix

phpize --clean
phpize
configure --with-pdo-nuodb=/opt/nuodb
make clean
make
sudo make install

Build on Windows

phpize --clean
phpize
configure --with-pdo-nuodb="C:\Program Files\NuoDB"
nmake clean
nmake

Windows Install Example with PHP installed in C:\php

php -i | findstr extension_dir
del /S /Q C:\php\php_pdo_nuodb.*
copy Release_TS\php_pdo_nuodb.* C:\php

Linux Driver Configuration

After the NuoDB PHP PDO Driver is installed, you must configure PHP to automatically load it. The NuoDB PHP PDO Driver is a PHP extension library. The NuoDB PHP PDO Driver extension library depends on the PHP PDO extension library, and must be loaded after it. Otherwise you will get an error message when PHP attempts to load.

If your PHP installation has a configuration that exists entirely in a single PHP initization file (php.ini), then add the following to that php.ini, after the PHP PDO extension library is loaded:

extension=pdo_nuodb.so

Your PHP installation may have a configuration that does not exist entirely in a single PHP initalization file (php.ini). Some PHP installations are set to scan an additional directory for initialization files. For example, on Ubuntu 14.04, the command line version of PHP is coded to scan the /etc/php5/cli/conf.d directory for initalization files. In those cases, you should create your own initialziation file (e.g. pdo_nuodb.ini) file which loads the NuoDB PHP PDO Extension library:

extension=pdo_nuodb.so

and make sure that pdo_nuodb.ini loaded after the PHP PDO extension library (pdo.so).

RUNNING TESTS

Prerequisites for running the unit tests include having a running database at test@localhost. The privileged credentials must be the username/password: "dba/dba". The non-privileged credentials must be username/password: "cloud/user". The database can be started using these commands on Unix:

java -jar /opt/nuodb/jar/nuoagent.jar --broker --domain test --password bird --bin-dir /opt/nuodb/bin &
nuodbmgr --broker localhost --password bird --command "start process sm host localhost database test archive /tmp/nuodb_test_data waitForRunning true initialize true"
nuodbmgr --broker localhost --password bird --command "start process te host localhost database test options '--dba-user dba --dba-password dba'"
echo "create user cloud password 'user';" | /opt/nuodb/bin/nuosql test@localhost --user dba --password dba

Run the following commands to run the tests:

pear run-tests tests/*.phpt

LOGGING

You can optionally enable and control logging with the following PHP configuration variables: Add the following to your loaded php.ini

pdo_nuodb.enable_log
pdo_nuodb.log_level
pdo_nuodb.logfile_path

pdo_nuodb.enable_log defaults to 0. To enable logging, set pdo_nuodb.enable_log=1.

pdo_nuodb.log_level defaults to 1. You can use levels 1-5. The higher level numbers have more detail. The higher level numbers include lesser levels:

1 - errors/exceptions only
2 - SQL statements
3 - API
4 - Functions
5 - Everything

pdo_nuodb.logfile_path defaults to /tmp/nuodb_pdo.log. You can override that default by specifying your own path.

License

NuoDB License