[Deprecated] DMZ 1.6.2 (DataMapper OverZealous Edition) |
[eluser]NachoF[/eluser]
great.. then I guess youre welcome..... about code completion.. do you have any ideas on how to use it on notepad++ (Windows)??.... When I hit ctrl+space I just get a bunch of generic options that dont serve any purpose.
[eluser]OverZealous[/eluser]
@NachoF Sorry, I don't use Windows. Chances are very good, however, that Notepad++ doesn't support this style of code completion. The new stuff I've added requires a full IDE that can parse all of the files and build a database of options. NB 6.8 just added rudimentary support for PHPDocs, so the huge block of @param and @method items at the top give it hints into which magic methods and fields exist on the DataMapper object. I'm pretty sure I read that Eclipse with the new PHP plugin can do it, and ZendStudio may as well. Text-editor style programs almost never can do it, because they need to be able to see the entire project to provide information.
[eluser]OverZealous[/eluser]
This is interesting. I assumed (yeah, yeah, I know) that the new get_large_query method, sugessted by TheJim, would perform poorly for small result sets. Yet when I was testing, it actually improved performance, and reduced memory footprint for a 3 item query! This is limited testing, to be sure, and everyone's results will be a little different. However, I'm thinking of renaming it to something that suggests it should be used more often, and maybe recommending it for all results that are just going to be looped over. I don't have a good name for it yet, though. Any suggestions? My brainstorming list: • get_loop_only • get_for_looping • get_streamed / get_streaming (TheJim's original name) • get_iterated • get_list • get_as_list • get_serial / get_series Any and all suggestions will be welcome!
[eluser]NachoF[/eluser]
Well, I dont know what the method does but if its what it does get_loop_only is a good name
[eluser]Oblique[/eluser]
get_memory_sparing ? (although i suspect it sounds like indian speech in english, and not sure if it's the thing this method is about) and also get_for_loop sounds like best choice in terms of self-description
[eluser]TheJim[/eluser]
Well, as you might have guessed, I'm a little partial to get_streaming, but I think get_iterated and get_for_looping aren't bad either. As for it helping with smaller result sets as well, I believe it's mostly that the DataMapper constructor is a little heavy -- which makes perfect sense for the "magic" provided. I have a couple of ideas for further improving that, hopefully without complicating things too much, but it would probably be more involved than the enhancements I did suggest, and I haven't gotten around to writing the code and checking if my ideas will even work. Of course, even with a faster constructor, there would still be memory savings to the iterator/streaming approach, but less of a CPU savings. Anyway, I'm rambling. I need to check out 1.7 and see what other goodies you've managed to fit in. Thanks for the hard work, Phil.
[eluser]NachoF[/eluser]
I was just wondering... about code completion... do you get help with attributes that are on the database?? like $user->email? Im guessing not but I want to make sure... just downloaded Eclipse but Im not sure how to set it up to work with CI.
[eluser]OverZealous[/eluser]
@NachoF You don't get help automatically, but that's simply that they need to be defined in your model. It's very simple, and it looks something like this: Code: /** Alternatively you can define the actual variables inline, and that looks like this: Code: class User extends DataMapper { I prefer the former method, but it's purely a matter of taste. As far as setting up an IDE... Well, that always takes some effort. Eclipse might not be a good starting place, because you have to manually set up so much. I would have suggested Aptana (based on Eclipse) until they effectively dropped all PHP support in a recent upgrade. If you grab NetBeans with the PHP package, it's pretty full-featured out the gate. I've probably spent more time fiddling with the editor's fonts and colors than making it work ![]() My favorite feature is watching it auto-complete my complex Dojo Javascript libraries. I have not seen another IDE handle those without any additional plugins. But I have used NetBeans in various forms for (yikes!) almost a decade now, so I'm a bit biased. ![]()
[eluser]NachoF[/eluser]
You are talking about the 25MB package on that link, right??... downloading right now.
[eluser]OverZealous[/eluser]
@NachoF Maybe. I'm on a Mac, so mine says 23MB. ;-P It's the one that has PHP at the top of the column. :-) Edit: Should have added this link: http://netbeans.org/features/php/index.html |
Welcome Guest, Not a member yet? Register Sign In |