Giter Site home page Giter Site logo

sql-layer-adapter-doctrine-dbal's Introduction

DBAL driver for FDB SQL Layer

Prerequisites

  • The FoundationDB SQL Layer should be installed and running.

  • PHP and the pgsql PDO driver should be installed.

    • On Ubuntu, the latter is sudo apt-get install php5-pgsql.
  • To check that everything is okay, run this from the command line, adjusting the host name as needed.

<?php
$dbh = new PDO("pgsql:host=localhost port=15432 dbname=system");
$stmt = $dbh->prepare('SELECT version()');
$stmt->execute();
$row = $stmt->fetch();
echo $row[0] . "\n";
?>

Loading with Composer

Add a dependency with @beta stability.

    ...
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4",
        "doctrine/orm": "~2.2,>=2.2.3",
        "foundationdb/sql-layer-adapter-doctine-dbal": "~2.4@beta",
        ...

Configuring Symfony

Because this driver is not currently bundled with Doctrine, it is not available in the driver menu and a tiny bit of reconfiguration is needed.

  • Download Symfony standard without vendors.

  • Adjust composer.json as above and run composer update.

  • Configure most of the connection in app/config/parameters.yml.

parameters:
    database_driver: pdo_fdbsql
    database_host: localhost
    database_port: 15432
    database_name: symfony
    database_user: symfony
    database_password: secret
    ...
  • Add the driver class to app/config/config.yml and comment out the driver, which won't be recognized.
doctrine:
    dbal:
        driver_class: "FDB\\SQL\\DBAL\\PDOFoundationDBSQLDriver"
        # driver:   "%database_driver%"
        ...
  • php app/console doctrine:database:create should now run without error.

Contributing

We welcome pull requests to fix problems that you may encounter.

Running Tests

In order to run unit tests, some pieces of Doctrine itself are needed. Here are the steps we follow to set it up.

composer update
rm -rf vendor/doctrine
composer update --prefer-source
cd vendor/doctrine/dbal
composer update

Then to run tests

cp phpunit.xml.dist phpunit.xml
# (make any adjustments for database location)
phpunit

sql-layer-adapter-doctrine-dbal's People

Contributors

mmcm avatar rpeterson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.