Search found 83 matches

by kyberfabrikken
Fri Dec 14, 2007 4:41 am
Forum: PHP - Theory and Design
Topic: configuration variables passed to objects
Replies: 42
Views: 7281

well yeah.. <?php class test { public function c($var1, $var2, $var4, $var5, $var8, $var9, $var11, $var13) { print_r(get_defined_vars()); } } ?> If you have a function with that many parameters, it's probably ripe for refactoring. Good candidates could be to combine related parameters into paramete...
by kyberfabrikken
Thu Dec 13, 2007 2:39 pm
Forum: PHP - Theory and Design
Topic: configuration variables passed to objects
Replies: 42
Views: 7281

nathanr wrote: makes my life a lot easier I tell you.. and i have a pet hate for the word "global" in php!
Wow -- You managed introduce global variables into PHP. That's really scary ...
by kyberfabrikken
Thu Dec 13, 2007 2:34 pm
Forum: PHP - Theory and Design
Topic: Injecting an object into an object
Replies: 16
Views: 3254

There's also the option of passing the connection in method calls. This is more fine grained than the other suggestions, but it gives a high degree of decoupling. The problem with passing a connection in the constructor is, that you make the connection a property on the object, which uses it. Proper...
by kyberfabrikken
Wed Nov 28, 2007 7:39 am
Forum: PHP - Theory and Design
Topic: Should I use a framework?
Replies: 7
Views: 2058

As for which framework to choose, it doesn't really matter. I'd say it matters a lot. Problem is, that it's hard to give advice on. Most of the available frameworks are excellent, but they are so in different ways. What fits you depends on the application, you're building and on who you are. Oh, an...
by kyberfabrikken
Sat Nov 17, 2007 12:43 pm
Forum: PHP - Theory and Design
Topic: Securing against XSS type 1 & 2
Replies: 11
Views: 2018

Maugrim_The_Reaper wrote:If you only send scalar data to the View, there's the possibility of automating escaping to some degree so it's less a manual burden.
You can do this with objects too. Just create a proxy around it, which returns scalars escaped and objects as wrapped in (new) proxies.
by kyberfabrikken
Wed Oct 03, 2007 3:12 pm
Forum: PHP - Theory and Design
Topic: Zend_View - layout like django
Replies: 8
Views: 2633

Syntactically different, but take a look at: http://www.tagarga.com/blok/makrell
by kyberfabrikken
Mon Sep 17, 2007 8:35 am
Forum: PHP - Theory and Design
Topic: Dynamically convert procedural PHP to object-based
Replies: 16
Views: 4611

Not sure how much it relates to your problem, but see this post:
http://mikenaberezny.com/archives/76
by kyberfabrikken
Sun Sep 09, 2007 4:37 am
Forum: PHP - Theory and Design
Topic: Creating a Reusuable Framework (With Updates)
Replies: 2
Views: 830

Re: Creating a Reusuable Framework (With Updates)

I figure the best way would to use SVN and just check out the framework in each website directory and then just "update" them using svn. What do you think about this? Sounds like the right thing to do. You might want to separate framework (reusable code) from application, in separate repo...
by kyberfabrikken
Mon Aug 13, 2007 3:41 pm
Forum: PHP - Theory and Design
Topic: Thinking MVC
Replies: 18
Views: 3507

Then there the subject of building hierarchies. Generally there are hierarchies of controllers and hierarchies of Views. I tend to prefer the latter because I don't find many problems that actually require full Controller hierarchies, and the complexity of getting a good hierarchical Controllers is...
by kyberfabrikken
Wed Aug 08, 2007 2:42 am
Forum: PHP - Theory and Design
Topic: Thinking aloud: Assets/Class Management?
Replies: 4
Views: 1101

yea if you've used version control for anything else before than that would be a good way to go I think version control systems tend to seem mystical to those who haven't used them before, but it's really not much different from using an FTP-client. You update files, you check them in. If you add a...
by kyberfabrikken
Fri Aug 03, 2007 7:36 am
Forum: PHP - Theory and Design
Topic: Thinking aloud: Assets/Class Management?
Replies: 4
Views: 1101

A version control system is probably a better solution to this.
by kyberfabrikken
Fri Aug 03, 2007 7:35 am
Forum: PHP - Theory and Design
Topic: Real Time PHP script for ngrep
Replies: 2
Views: 1286

Remember to be paranoid when routing something from a HTTP request to your shell.
by kyberfabrikken
Tue Jul 31, 2007 2:50 am
Forum: PHP - Theory and Design
Topic: Tracking memory usage
Replies: 15
Views: 13771

Ambush Commander wrote:Played around with XDebug's traces, they have lots of info, but I can't see any way to practically apply it yet. It looks like I'm going to have to build a trace parser or something.
Try Xdebug + WinCacheGrind (As sike suggested).
by kyberfabrikken
Wed Jul 25, 2007 5:50 am
Forum: PHP - Theory and Design
Topic: MVC and PHP
Replies: 11
Views: 3824

How then is the View supposed to be aware of which data to use? You program it that way. In my code though I don't tell the view which model to use or anything like that. Instead the controller takes the input, like maybe an ID, then passes it to the model. The model uses that ID to look up some da...
by kyberfabrikken
Tue Jul 24, 2007 5:11 pm
Forum: PHP - Theory and Design
Topic: MVC and PHP
Replies: 11
Views: 3824

The controller (...) gets data from the model based on the input, passes data to a view, then sends the view to the client to see. In MVC, the controller shouldn't tell the view, which model to use. The controller isn't a mediator between model and view. Think of controller as write-interface to mo...