Native PHP PDO vs. Phalcon PDO - php

Are there any advantages of using Phalcon's Framework PDO Adapter rather than the PHP's native PDO?
As there's seems to be a bit of advance functionality lacking in the Phalcon framework regarding PDO. Is it even worth it? Are there also dramatic performance differences that outweigh using PHP’s native PDO?

First of all, Databases adapters in Phalcon are created as a layer behind Phalcon\Mvc\Model. Thanks to this you have same interfaces for MySQL, Oracle or PosgreSQL Adapter.. Or for other adapter that you and me can create. That's why, as some kind of abstraction, Phalcon PDO is a little limited. It needs to share same logic with another types of RDBMS.
So if you don't want to use Models go with simple PHP PDO. But ask yourself where is the point of using MVC framework without Model layer :)
If you need more informations, follow this link: http://docs.phalconphp.com/pl/latest/reference/db.html

Related

Symfony Model abstraction (to SQL or NoSQL)

I am starting a new (and first) project with Symfony2, but I didn't choise Database engine yet. And it could be MySQL or NoSQL engines like MongoDB or others, or also it could be changed along the proyect cycle.
So, I would like to start working without limitation of choising Doctrine, Doctrine for Mongo or others. And allowing posibility of changing only model layer without big impact on controllers, and classes.
Recomendations? Comments? Best Practices?
Hope this tutorial will help you to get some knowledge. However try to learn the main concepts before doing any major development.

CakePHP, CodeIgniter and FuelPHP - which do you prefer and why?

I've been looking into learning a PHP framework lately and have spotted these three popular choices. They all seem to have similar approaches and methods, and I'm not sure where to begin. If you are or have been using either one I'd greatly appreciate any pros, cons or other info you might want to share about them.
I'm considering these frameworks with the following in mind:
- Which one has best multi-lingual support?
- Which is the easiest to implement / start out with?
- Which is the most future-proof and versatile (i.e. working with NoSQL databases such as MongoDB)?
I have been using all of the mentioned frameworks, but I really enjoy using the codeigniter framework, because it is very lightweight and does not interfere with my workflow in doing too much things I don't want.
The i18n and multi-lingual support is really simple, there is a helper and a class ready to use.
Codeigniter has also pretty much support for any database you may want to use. If you happen to use a database that isn't supported, you can easily write your own database driver, just take a look at one of the driver files.
It is also very easy to integrate other external libraries e.g. Doctrine, adodb into your project.

CodeIgniter support for AJAX, and ORM

I was searching for a good php framework for my next project, and I found that CodeIgniter is suitable, but I read this somewhere "codeIgniter has No ORM(Object Relational Mapping), No AJAX support", is that right?
"codeIgniter has No ORM(Object Relational Mapping)
TRUE. But it has a nice and handy custom Active Record class which acts as an ORM, supporting many database drivers; as of 2.0.3, supported databases are mysql, mysqli, postgre, odbc, mssql, sqlite, oci8.
And, if you want, you can just add your favourite ORM to the libraries or drivers and you can use that instead. There are many tutorials out there and answers on SO if you're stuck with this procedure, though it's pretty easy and the manual is really clear on how to create/use custom libraries.
No AJAX support
Whatever this means, it's not true. CI is a php framework for web development, so write your javascript ajax code inside views, call the right controller's method, and AJAX will work just fine.
If you mean there's no native support for that, i.e. using native classes to the task, then it's partly right. CI has the javascript class which is a loader/helper for jQuery; I never used it since I prefer loading that framework by myself and working directly on that, but you might give it a try.
Yes, CI has no built-in ORM. but it supports different libraires and classes which acts as ORM.
for example:
doctrine and data mapper
can be used along with codeigniter to fulfill your requirements.
as far as CI support for AJAX is concerned, AJAX works perfectly fine with codeigniter. Do keep in mind when developing using Ajax, that if someone turns off Javascript in their browser, what you develop will not work.
Hope this helps.

PHP ORM with NOSQL and RDBMS support

Are there any PHP ORM projects which supports MySQL and NoSQL databases such as MongoDB?
I am currently using RedBean to do MySQL ORM, however I woud like to introduce MongoDB to the applicatoin and perhaps even replace some of the MySQL with MongoDB in the future.
An ORM that can allow me to easily transition between both would be nice. However, I tend to not like ORM that requires too much configuration (i.e. YAML, XML etc). RedBean is very nice in that it allows one to easily get things working without too much configuration.
Yes, doctrine supports various RDBMS and NoSQL storages as well
Docrine 2 contains both an ORM and ODM for NoSQL databases (MongoDB and CouchDB are supported), and its theoretically possible to hook up Doctrine to anything else.
We're working on some adapter-based ORM called UniMapper in our company.
It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. You can even associate between entities from different storages. And it should be even faster than Doctrine. Try it give us some feedback :-).
MongoDB will be supported very soon, but you can write extension on your own, it's very easy.
However the quick start is not complete, you can ask me or somebody from our team.

What native mysql class should I port to from Zend_Db? ( No PDO or Mysqli )

I'm dealing with a client who has a legacy cPanel account where the php installation was not compiled with PDO nor Mysqli therefore my Zend_Db code is useless since it relies on either of those.
What library/class should I go with?
Depends what you're trying to achieve, it's possible to extend Zend Frameworks Zend_Db and add a mysql adapter. If this is too much trouble there are two library's that are probably worth looking at, the first depends on PEAR being installed and is MDB2 the other is ADOdb both offer OO DB abstraction and work with the mysql extension.
Meh - I just made my own class mimicking the exact methods and functionality of Zend_Db so I don't have to reprogram a lot of the code.
ezSQL (used by Wordpress)
Codeigniter database class

Categories