Welcome Guest, Not a member yet? Register   Sign In
Reactor Engineers
#61

[eluser]InsiteFX[/eluser]
Correct me if I am wrong, but I thought the whole idea of the Reactor was to bring CodeIgniter up to the PHP 5 level of coding!

But:
1) almost all libraries are still using var which is depreciated!
2) Where are namespaces? Namespaces would solve a lot of problems.
3) Auth, why because other frameworks have it? This should be an addon library not in the core.
4) There is still a lot of PHP 4 code in the framework.

Keep the CI core simple and fast like it always has been.

Get it PHP 5, then add all the bell's, and what others think should be in the core.
In other words get the core stable first.

In my opinion the focus should be on getting CI up to the PHP 5 level.

Just my two cents.

InsiteFX
#62

[eluser]WanWizard[/eluser]
The problem with that is that you're likely to break the existing functionality, which is clearly an option that's not on the table.
But it's something that has to happen sooner or later, but you can forget utilizing PHP5+ goodies if you don't want to...
#63

[eluser]Dan Horrigan[/eluser]
InsightFX,

Uhg, where to start. Reactor was not created purely to upgrade the framework to PHP 5. It is to better the framework.

PHP 4 support was dropped yes, but there is a LOT of code to change to bring it up into full PHP 5 goodness.

Let me go down your list:

1) They are working on it...not an easy thing to do.
2) Namespaces are 5.3 only, CI is 5.1.6 compat. Not to mention adding namespaces would raise the entry barrier so high that all the noobs would leave.
3) Well, everyone hs different opinions about this.
4) Again, give them time.
#64

[eluser]Basketcasesoftware[/eluser]
You are right about the namespace compatibility issue. But the point that InsightFX made about the usage of 'var' is on point. Additionally I would suggest using the type hinting feature that's existed since PHP 5.0.
It's not just for classes, but it's for arrays to. If a function or method is needing an array as an argument it's a trivial step to prepend an 'array' before the argument variable. i.e. function foo($fi, array $fum=array()) I've seen code in the loader that simply checks to make sure an argument is an array, and if it's not, just silently converts the argument to a NULL. This trait is undocumented in the User Guide. There isn't even a hint via code comment why this is even done. I only found it by actually looking at the library load code (which revealed other undocumented features). In fact I saw unreachable legacy code there from the previous edition of CI. Yes, I could do a rewrite and a pull. Smile (And contribute to the documentation since I'm complaining about it).

I'll post a code suggestion in an appropriate location if someone can tell me where.
#65

[eluser]Phil Sturgeon[/eluser]
Basketcasesoftware: Actually type hinting for parameters has never truly existed in PHP. It looked like we were going to get it for a while, but it has been ripped out of PHP 5.4 and is not going to happen nicely but in some weird misguided fashion. Either way foo($fi, array $fum=array()) says "I want a object which is an instance of "array". It also cannot take default values other than null.

As for the var vrs public/protected/private thing, sure they need to start being moved over but I really dont see this being a priority. Firstly, this will do nothing other than break a great deal of code. This is down to the fact that lots of these "private" methods in CI - which use _ as a start of the method - are currently not private. They are not all treated like their are private, either by the core or by applications using CI.

If we run around making them all public/private, etc right now then things will just break. As we move forward, developing in this way will be important.

Main point right now? This makes no difference. There is no speed difference, security improvements or negative effect on the framework whatsoever by leaving them in place. They will go, in time.
#66

[eluser]Basketcasesoftware[/eluser]
Hmm. I used the example I gave in my own code successfully (you'll notice the default is not NULL). But I'm using PHP 5.3+, that might make a difference. Thanks for the info on the change in type hinting. That's the first I've heard of it. That rather sucks actually. No wonder there is code going "is this an array?" in CI.

I see where you are at with the legacy stuff and the lack of code normalization. Is new code being written with view access in mind?

What? No comment on the library load issue I made mention of? Should I go ahead on that? I actually did some work on it in a different thread but I was looking at the wrong code initially. I'll go ahead and do the re-write then. Should I just start a new thread in this forum for it?
#67

[eluser]Phil Sturgeon[/eluser]
I'll try to find the article that explains it all, it's only a fuzzy memory at this point (and yes, I am using PHP 5.2 which acts differently on this to 5.3).

New code is being written in full PHP 5 style.

As for the loader, I'm not sure. Some people want to change the loader to let it allow anything to be sent to the constructor. I'd be all for that change instead of just documenting the rather odd behavior that exists at the moment.
#68

[eluser]Basketcasesoftware[/eluser]
Ok. Currently the 2.0 code has a simple quick patch that makes some of the legacy code unreachable as I pointed out in my previous post. I'll try to find my posting in the Ignited Code forum where I developed a fix around the 1.7 code (mistakenly - teaches me to just copy the 2.0 code into the 1.7 directory. %-P) I'll start a separate thread here in this forum with the suggested change and enjoy being on the receiving end of some flames. ;-P
#69

[eluser]Basketcasesoftware[/eluser]
Ok. The code is posted in its own thread. Damn comments filled the thing out so much that I couldn't just put it all in a code block. Too big. Upload. Right now the level of reaction seems to be like wetting yourself in a dark pair of pants. Gives you a warm feeling, but nobody notices. :-S
#70

[eluser]JasonS[/eluser]
[quote author="Dan Horrigan" date="1297806633"]
2) Namespaces are 5.3 only, CI is 5.1.6 compat. Not to mention adding namespaces would raise the entry barrier so high that all the noobs would leave.[/quote]

Seriously, I hope this isn't the reason for ignoring PHP5.3.

The whole problem with codeigniter of late has been its reluctance to get up to date. It has supported PHP4 longer than PHP have supported PHP4. If PHP5.3 is being ignored because a subset of users are not yet competent with the features then once again we will be stuck with an old version of PHP for years.

If using 5.3 can lower the CI footprint and improve performance then this is what should be used. Any decent host can support this either by default, an option in the control panel or adding a single line to a .htaccess file...

At the end of the day CI is made for developers to make their life easier, it isn't made for muppets or end users. Thinking that developers are not up to using a version of PHP which has been out for a quite a while now is wrong. I am fairly certain that developers who do not know PHP5.3 would soon get up to date and as usual the community would provide support when needed.

Finally, supporting the lowest common denominator will mean that CI will always be a year or two out of date...




Theme © iAndrew 2016 - Forum software by © MyBB