Jump to content

keeB

Staff Alumni
  • Posts

    1,075
  • Joined

  • Last visited

Everything posted by keeB

  1. Daniel, I was speaking mostly of something like symphony, I honestly have no idea about Zend.
  2. I don't think he said.. 'Hey, please tell me OOP makes my life confusing' The argument will go on until the end of time. People like to code the way they like to code. As for an answer to pagination, moving to OOP should be really simple. All pagination is is a double-linked list (search it on wikipedia) that instead retrieves <x> instead of just next(). The general method of implementing it is the following: 1. Retrieve data in to cache 2. Pull first <x> from cache. $x = $list->getNext(); ($index is 0), $list->getPrev() returns null 3. Pull next <x> from cache. $x = $list->getNext(); The helper methods you would want to provide are things like: ->getCurrentPageNum(); ->getTotalPages();
  3. So you want to implement a plugin system with callbacks. Doesn't really change the idea very much.
  4. <?php interface PluginInterface { function execute(); //each plugin must have a execute() method. } class PluginLoader() { public static function loadPlugIn($plugin) { // return the plugin object } public function register($plugin) { // registers a plugin in registry } } class MyPluginImpl implements PluginInterface { function execute() { print "lol"; // mylolplugin } } ?> Seems pretty straight forward to me using objects.
  5. Hmmmmmm.. I am pretty sure you can look up Java JNI to come up with a solution if you needed to, but generally if you want to hook 2 apps up you're going to need to provide some sort of way to interface. If you wanted to have a chatroom written in Java that a PHP script could work with, most likely what you'd do is set up (prototype): TcpIpConnection.java ChatRoomServer.java (And you'd have ChatRoom.java + friends for servicing the normal chatroom) ChatRoomServer would initiate a TcpIp Listen on port <x> and broadcast any events that happened in the chat room. Beyond doing some sort of integration like that, remember, any function provided by PHP is actually implemented in C/C++. You could write your own extension (like GD) that interfaces with your chat program, so that in PHP all you would have to do is like: chat_start(); #in some sort of ajax script print chat_poll(); Hope this makes sense.
  6. And I'm telling you this section of the message board has to do with installation of PHP, not Third Party Applications (hint)
  7. Agree with above. You're most likely updating the wrong httpd.conf
  8. And that has to do with PHP Installation..... how?
  9. Not the wrong forum but, when asking questions that are this unordinary, you really need to provide details so we can help. Normal questions -- we can usually discern what the intention is. This one, I cannot.
  10. onClick="lolform.submit()" ?
  11. I'm going to say what everyone reading this article is thinking... What the hell are you on and where can I get some? Can you please calm down and reform your thoughts in to something more coherent?
  12. Well, no. If you consider what you learned, then it should make sense that it should not break the barrier of what 'private' is. You basically proved: $x->foo('bar'); is the same as $x->__call("foo", "bar"); So, by that logic, if foo is declared private, why provide a means of accessing it?
  13. I think it would be awesome if you could write a little article on how learning CakePHP is going, jesirose. I think it would give some people good insight on what an experience developer can accomplish.
  14. Semantics aside, I think it's valuable for everyone to know the information you provided about __call() and how you use it. I am generally not a fan of these magic methods provided by PHP. __call() __get() and __set() seem very counter intuitive (to me) but I can certainly understand why people would use them.
  15. That's a really interesting idea and a different perspective on the situation. Tell me, though. From an outsiders perspective, what would you think if I said the following: "Every method requires similar parameters and the response should be the same" I think you would say -- "Sounds like theres a bit more abstraction to be done." Or am I offbase?
  16. You're talking about unit testing from a method perspective. You don't unit test methods. That's silly. You unit test the services your object/module provides, which, tests the overall functionality. The one that breaks encapsulation/requires knowledge of how your classes are implemented.
  17. I think those frameworks are a bit heavy for a basic portfolio. Honestly, you should have a prototype up in less than 5 hours. I think everyone has their weak point. I could have a solid back end but, ask me to write the UI and I could spend years perfecting it and it'd still look like a 5 year old took a shit on a piece of paper and handed it in as a drawing.
  18. This is what a debugger is for. Copy and paste means a maintenance nightmare, you were right to do something about it! Disagree. I think this exposes a fundamental flaw in your design process. I think your ideas on how to unit test have been clouded. Unit testing doesn't need to be complicated. Generally if you have a module or service, the proper way to unit test it is to provide a stub. Using this stub you ensure the core of the service/module works as expected. I don't see anywhere where I would require to know the input and the parameters that are being passed. I already know! I am passing them! I hope this doesn't come off as being harsh, it's definitely not my intention.
  19. OOP is slower? That's new to me! In fact, I think it'd be faster, considering you have less code bloat. How would you rate yourself, on a scale from 1-10, in PHP knowledge? I think people the people you see design so quickly are playing to their strengths, and not worrying about little details. Set realistic goals. Make a deliverable to yourself every X amount of time, and ensure there's measures in place to make up for any miscomings. I think that will go a long way in to helping you code quickly and efficiently. Everything else is a matter of taste/style.
  20. you should provide a guest login cause i aint registering.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.