Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. I've not used this myself, just remember reading about it: http://go.aopphp.com Looks interesting yet scary.
  2. Actually, there is a library that might be able to help you, just can't think of the name of it off the top of my head. Give me a second.
  3. Yeah, if you can't change that function, that isn't going to happen.
  4. return will work as expected. <?php function a() { include 'file.php'; echo 'work'; } file.php <?php echo 'play'; return; echo 'this will not be reached';
  5. I wouldn't. I much prefer to go the template route. A *very* simple example: <?php function renderTemplate($template, array $data = []) { extract($data); include $template; } template.html.php <table width="100%" cellpadding="12" cellspacing="0" border="0"> <tr bgcolor ="black"> <td align ="left"><img src = "logo.gif" /></td> <td> <h1><?= $heading; ?></h1> </td> <td align ="right"><img src = "logo.gif" /></td> </tr> </table> <?php renderTemplate('template.html.php', ['heading' => 'TLA Consulting Pty Ltd']);
  6. No interface do not include implementation.
  7. I don't think so. Unsetting a variable is like it was never initialized at all.
  8. By your definition it does not support function overloading.
  9. That is indeed what your looking for. It's not cheap, no. If you can find a freelance devops guy you could go down that route (hint hint). We have a freelance board, but I'm not sure where else you might search or how much activity you might get.
  10. This is one of php's little quirks, there is no way to fix it now without breaking BC. Live with it.
  11. Who cares?
  12. You "try before it goes live" by installing a local http server to use when developing. You won't get any php working without one.
  13. Do you have some relevant code?
  14. No, the code you're have in your form is fine. Judging from your error, you don't have a server setup. PHP requires a http server configured to execute PHP. You then need to access your site via urls, not file paths. eg; http://localhost/index.html, not file:///C:/ etc
  15. No you don't need to "link" them, the form just needs to submit to your php script (by setting it as the action).
  16. Your closing theEnd needs to be at the start of the line.
  17. If this script is being executed by requested it via a web server then the script executes as that web server. eg; On a typical Debian machine, Apache Http for instance will be running as the www-data user.
  18. What the hell are these classes? I mean, why does an Action extend a View in the first place? The two seem unrelated.
  19. It's pretty hard to write SOLID code without interfaces.
  20. People still use things like Wampserver? I thought we'd all moved to reproducible development environments via Vagrant?
  21. That assumes Google_Service_Calendar_Acl_Resource is a function which it is not.
  22. It shouldn't. spl_autoload_register adds autoloaders onto a stack of autoloaders. So, unless Joomla is doing something funky with its autoloading, your implementation looks fine. Another option to consider would be to simply use Composer. All you need to do then is include composer's autoloader into your project somewhere.
  23. That code is in some serious need of being thrown out. The session_is_registered function is deprecated. The mysql_* extension is deprecated Short tags have long been disabled by default. And in general it's just poor code. Moving forward, you might want the code maintained.
  24. Don't put it within your http server's document root. There is no reason it needs to be executed via http.
  25. We are not here to fix code for people. If you have a specific question, ask it.
×
×
  • 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.