Jump to content

trq

Staff Alumni
  • Content Count

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. trq

    how to make my website fast ?

    The simplest way to gain request-start to request-end speed is to cache using something like akamai.
  2. trq

    namespace autoloader for custom api

    Composer ships with an autoloader, just stick to one of the standards and use that.
  3. trq

    PHP developer section

    like wtf?
  4. trq

    getting $_GET in a framework

    The point I'm trying to make is why have the rewrite at all if you're just going to use normal querystring parameters? I understand you want to force everything through a front controller, but why stop there? But yeah, you could just use the QSA flag to have apache append existing parameters. RewriteRule ^(.*)$ index.php?uri=$1 [PT,L,QSA]
  5. trq

    getting $_GET in a framework

    That rewrite rule removes the need for typical GET parameters by making your urls "pretty". So instead of this: users/activate-account?email_address=test&token=test You would use something more like: users/activate-account/test/test Of course then you need some sort of "router" to parse and handle these parameters for you. If this is your own framework you need to decide how your urls are going to be formed.
  6. trq

    Alternatives to $_GLOBALS

    Why? The only reason to do this is laziness. It is making your code tightly coupled to whatever this "god" object is. A controller has no interest in your connection settings for instance. Objects should be passed their dependencies (and only their dependencies) at construction time. Most frameworks handle this in an easy to manage manor by providing a configurable dependency injection container which allows you to configure how objects are to be created.
  7. trq

    Rookie needs help - filtering path?

    You don't need a regex unless you actually need to match a pattern.. <?php if (substr_count($path, '/') > 2) { echo "Directories too deep"; }
  8. trq

    Cronjob and insert content in site

    Why would you edit the index.php file? PHP is a programming language, you can use it to dynamically display data from different data sources. Having cron dynamically alter the PHP "script" is ridiculous. Instead, have your cron job put the data somewhere PHP can easily access it (like a database) and then write some logic into your php script to retrieve this data and display it.
  9. trq

    Where is anti-formatting performed?

    There should be zero business logic in controllers. They are nothing but a very thin layer between http and your domain.
  10. trq

    Storing articles on GitHub

    Yes they will be indexed by google.
  11. trq

    Does anyone know about this error?

    That is not a standard php error. Both CDbException & CDbCommand are part of your code base.
  12. trq

    Mods4u

    What?
  13. trq

    Detecting Mobile Handset Script

    Why would you care what mobile a client is using?
  14. There is no need to restart the machine, just the http server. sudo /etc/init.d/nginx restart
  15. Then you're doing it wrong.
  16. trq

    php multi pages function

    Helpful.
  17. trq

    codeigniter, how to store into view

    Why are people still using code ignitor?
  18. trq

    php multi pages function

    Where exactly are you stuck?
  19. trq

    class conversion number to word

    The error is self explanatory, your are trying to concatenate a value onto an inexistent variable $str. Simply declare $str somewhere before you use it.
  20. This sort of thing is done using the curl extension, or better still a wrapper like Guzzle. Where exactly are you stuck?
  21. How many dots are within the path to a file makes no difference.
  22. trq

    Want to start with Cake-PHP

    The official site will have the best most up to date documentation, not that it's a very popular framework IMO.
  23. trq

    Help working out how to process data

    Do you have a question?
×

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.