Obtain database data into fixture files - php

does anyone know if there is anyway to obtain the data from an oracle database into fixtures files? Even using any symfony2 method or bundle?
PD: I'm working with the latest stable symfony2 version.

You can use: https://github.com/symfony/DoctrineFixturesBundle and implement ContainerAwareFixture, then you should have access to your Oracle connection.

Related

Laravel (Main Website) + Node (Scraper) + DB

I am creating a website using the Laravel framework that requires the utilization of some data. This data is being collected by a scraper implemented with Node.js. My approach is to collect the data and store it on a database (MongoDB) and read it with Laravel.
I came across this solution, should I work with it?
Is there another way to push data from Node.js into MongoDB and then read the same MongoDB in Laravel?
Your Node.js app should save data into your MongoDB database, and your Laravel app should read that data only when needed - your solution is clearly not the way to go.
There is a library that allows using a MongoDB just like a standard database using the same Eloquent methods : laravel-mongodb, you should definitely check it out and use it (or find an equivalent).

Laravel with DB2 Database

Hi guys I'm new with Laravel and I want to use it to build a REST API and the routing is just great my only problem now is the database , I read that Laravel only supports just four database systems http://laravel.com/docs/database#configuration and I need to use IBM DB2 , so is there any alternative to this? I mean like another library and if is possible to integrate with this framework. (I'm not using ODBC)
You can swap out Eloquent and use Doctrine which supports DB2.
Doctrine is on composer so can be easily loaded.

Using MySQL and Cassandra in Codeigniter

I am using Codeigniter to develop my application. I am using MySQL database and I need to integrate Cassandra db in my site. So i need to use both of them in my framework.
I get the code from the following link for using Codeigniter with Cassandra, but I need to use both cassandra and mysql. Is it possible to use both? Half of the project is completed i am using MySQL.
I only need to integrate Cassandra, but the files downloaded from github the code is intergrated with cassandra. I can't find the steps or separate plugin cassandra files to integrate with Codeignitor.
yes its possible. cassandraci is a library whose function you can access with
$this->db->query()->insert('key', array());
$r1 = $this->db->query()->get('key');
only if you autoload that db class. Read more

What php frameworks have database migration support?

I'm looking for a good php framework with support for handling database migrations. Ideally I would like to be able to run a command that generates a migration script, one that updates the database with changes and can handle rolling back those changes. Is there anything out there that does this?
The Doctrine project supports migrations - http://www.doctrine-project.org/projects/migrations/2.0/docs/reference/introduction/en
Hmm, that documentation is a bit lacking, at least in the introduction. Hopefully it gets better as it goes on.
Whilst most popular in Symfony, this can easily be integrated into other frameworks or even used on its own.
Promising, but not yet have a stable version : https://github.com/fuel/fuel
There is a new php framework called Laravel and it has migrations the same way as ruby on rails. It seems so pretty!
You can find it at http://laravel.com/
Migrations Docs
In addition, the framework introduces the idea of bundles, what can give to your project a great modular view.
If you try it, tell us your experience! :)
symfony - http://www.symfony-project.org/
In symfony you can write database schema using ORM like Propel, it is independant from database driver. If you have a database already, you want to migrate to a different db, I think you can dump the db, change the db config, and re-import it to the new db. (though I have not tried it myself.)
There are much php framework over there that can use any database. For example Zend, Ci, Cake and many others. One thing you should do is change database type that's usually stored in configuration file. And then migrate your database manually. No framework that can generate migration script automatically. U can also use ESF for database migration

Data import and migrate using Doctrine

I need to load data from an old DB into a migrated schema of this DB using Doctrine migration system.
I guess Doctrine might help me in this process.
I tried and lost a few hours using ETL scripts programs, without success.
From my point of view I need to :
Create a DB with the V0 schema
Load the data from the old DB (schema are identical)
Migrate DB to latest version using Doctrine migration
Extract data
Load it in the new DB
WHat do you think of this process?
Do you think it is feasable using Doctrine?
I tried a few searches on Google without success.
I am currently reviewed the features of Doctrine_Core class.
Thanks for your help
Yes, it is possible to migrate data from one database to another using Doctrine.
It sounds like you're trying to do a one-time database revision and migration and that your applications are not currently written using Doctrine. In that scenario, database abstraction has little or no benefit, unless you're also rewriting the applications to use it.
If you have no prior experience using Doctrine then I seriously doubt that writing custom migration classes in it will be easier than doing it with whatever database API you are already experienced using. It makes sense to use the migration classes (some times) if you are already using Doctrine for your development. Otherwise it's another layer and API you don't need.
I'm using Doctrine 1.2, which has some nice features for migrations but also a number of bugs and omissions of expected functionality. Reportedly version 2 improves on this but I haven't used it yet.

Categories