Welcome Guest, Not a member yet? Register   Sign In
CI Session Library + CI Active Record + Doctrine => No joy
#1

[eluser]Spockz[/eluser]
In my project to integrate Doctrine with CI (readme: WC, SVN) I found two disturbing things.

First is the fact that the Session class totally depends on the Active Record class being enabled and that the availability of the class is not even checked. I think that even if the next point isn't fixed the availability of the AR should at least be checked and the dependency noted in the documentation and class file.

The second point is that the use of the database is hard coded into the class. And thus it's not pluggable. It might be a nice idea to implement a modular data storage for the session class to make it less dependable on the CI AR. This would be particularly nice to get rid of the CI database layer at all to use only Doctrine.

What is your opinion about this?
#2

[eluser]Nick Husher[/eluser]
What does removing Active Record buy you, really? Perhaps a degree of sanity knowing that your database calls are all going through a single path, but a really bad future developer could always just use the built-in PHP SQL functions, so I don't see that argument as particularly weighty.

A few months ago, I whipped up a Doctrine plugin than operates alongside Active Record. You can use any of the built-in CI libraries and can upgrade your CI version without breaking anything, while still gaining all the power of Doctrine.

If you're looking for a framework with a built-in ORM, that's also a lot like CodeIgniter, check out Kohana.

[Drop-in PHP Doctrine plugin]
#3

[eluser]Spockz[/eluser]
Why? It eliminates the necessity of loading a heavyweight to do just do a plain thing. I write software to be correct, and maintain a reasonably high standard. Just loading an extra heavy library because the developers of a framework didn't think of making things modular opposes me.
The argument that a bad future developer could always use the built-in php sql functions is a no-brainer, and bad developers don't get in my team. So I don't worry about those.

It looks that your plugin does the same as my hook and cli file combined.

I know about Kohana, but I like(d) to bring something good to CodeIgniter. Why should I suddenly change software?
#4

[eluser]GSV Sleeper Service[/eluser]
just install the native sessions library (I seem to be saying this a lot lately!) find it on the wiki.
I really don't like the way the default CI sessions work.




Theme © iAndrew 2016 - Forum software by © MyBB