CodeIgniter Forums
Should I use version 2? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Should I use version 2? (/thread-36687.html)



Should I use version 2? - El Forum - 12-11-2010

[eluser]peredurabefrog[/eluser]
Hi,

I'm a fairly experienced PHP developer (PHP5) currently involved with a project (Wales Legislation Online) that would---or at least the backend admin pages would---in my opinion, benefit from the use of a framework. I've looked at a number of frameworks and I think that CodeIgniter is the one I'd feel happiest with.

Looking through the forums I see that sometimes it is advised to use CI 2.0 for new projects. Is that the general opinion? There is obviously one advantage in that using CI 2.0 now will avoid a potential upgrade nightmare in the future - since the changes are quite radical. A disadvantage would be the fact that the documentation is all for 1.7.x and therefore PHP4-ish: however, I think I could cope with that---personally---because my background is PHP5 anyway.

It comes down, therefore, to stability and bugginess. Is CI 2.0 ready for use in new projects? Or should I follow the golden rule and never use a dev version for a live project?

Many thanks


Peredur


Should I use version 2? - El Forum - 12-11-2010

[eluser]michalsn[/eluser]
I would chose CI 2. If you download CI 2 from bitbucket you will find user guide (up to date).
MojoMotor and ExpressionEngine are built with CI2 - so CI 2 is ready to use.


Should I use version 2? - El Forum - 12-11-2010

[eluser]peredurabefrog[/eluser]
[quote author="michalsn" date="1292090720"]I would chose CI 2. If you download CI 2 from bitbucket you will find user guide (up to date).
MojoMotor and ExpressionEngine are built with CI2 - so CI 2 is ready to use.[/quote]

Many thanks for that.

I downloaded 2.0 and have started looking at the docs. One thing that strikes me is this:

Quote:In some cases you may want certain functions hidden from public access. To make a function private, simply add an underscore as the name prefix and it will not be served via a URL request. For example, if you were to have a function like this...

So we're not using access specifiers here? Is it not possible to use these PHP5 features? Or am I misreading it? Obviously I've not spent a lot of time looking at it, but this sort of stood out for me.

Cheers


Peredur.


Should I use version 2? - El Forum - 12-11-2010

[eluser]michalsn[/eluser]
Underscore for private functions is just an old convention from times when PHP4 was full supported. You can have private function (without underscore) and it will be hidden from public access. I use both Wink
Code:
private function _top_secret()



Should I use version 2? - El Forum - 12-11-2010

[eluser]Phil Sturgeon[/eluser]
peredurabefrog: CI is just PHP, so you can use any PHP 5 features you like. Autoload your libraries, have static libraries, use callbacks and closures in your controllers, etc.

As for whether you should use 1.x or 2.x, do it. If you write 1.7.x code now you'll only have to change it later. Besides, every bug found in the 1.7.x branch is fixed in the 2.x branch. Thanks to that I find this branch to be much more stable, even if it is labeled as "in development". I wrote up my opinions in an article which explains things a bit more.

http://philsturgeon.co.uk/news/2010/10/codeigniter-2.0-is-stable


Should I use version 2? - El Forum - 12-11-2010

[eluser]peredurabefrog[/eluser]
[quote author="Phil Sturgeon" date="1292099415"]peredurabefrog: CI is just PHP, so you can use any PHP 5 features you like. Autoload your libraries, have static libraries, use callbacks and closures in your controllers, etc.

As for whether you should use 1.x or 2.x, do it. If you write 1.7.x code now you'll only have to change it later. Besides, every bug found in the 1.7.x branch is fixed in the 2.x branch. Thanks to that I find this branch to be much more stable, even if it is labeled as "in development". I wrote up my opinions in an article which explains things a bit more.

http://philsturgeon.co.uk/news/2010/10/codeigniter-2.0-is-stable[/quote]

Hi,

Thanks to you and Michalsn for your kind replies. I'm reassured.

Cheers


Peredur