Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Use google maps. And simply place Maker's on the map. It's also possible to get the directions between two Maker's.
  2. Yes. Pretty much the entire point of this thread.
  3. Indeed. You talk about poor OOP practices and you mention procedural code. That's like writing an article about Italy and then go on describing the country-side in Australia. How call_user_func and if/switch fit into the poor OOP practices is also lost on me.
  4. There is no typical term. You can make this up. Some use pro account, others use premium account. If you have multiple levels in your premium accounts, you can use gold, silver, copper as differentiators.
  5. A dependency is when one thing requires another to work. For example: class A implements FrameworkSpecificInterface class A extends FrameworkClassB class A { public function setFoo(FrameworkSpecificInterface $i) } class A { const B = FrameworkFoo::B; }These are hard depencies on an interface, a class, a constant, and a soft depency on the framework it's from (if these were framework things). These are hard depencies since your code won't run if it can't find the class/interface/constant. Dependency injection/IoC does not remove these dependencies, they merely help you to bind these dependencies dynamically. It also allows you to decouple any using code from having to know how to construct the object. That said, IoC is not a new concept, in fact there are many patterns you may already know that provide IoC: a Factory, a Facade, a Builder. These all share the same thing they hide the construction of an object from the code that uses it, though less dynamically then a dependency injection container. http://en.wikipedia.org/wiki/Inversion_of_control
  6. Portfolio. Is sufficient to have your foot in the door. Most employers will also use a technical test to ascertain quality offered. For example we use multiple empirical technical tests which basically acts as a grading system. Candidates that passed are contacted for a conversation.
  7. http://forums.phpfreaks.com/topic/281633-generate-a-registration-id-and-display-it-after-successful-registration/?do=findComment&comment=1447128
  8. Our first hindu in the Guru rank.
  9. Your MVC implementation is wrong. class Controller { private $view; private $model; } class Model { } class View { private $model; }Your controller connects your Model and View. Not your View.
  10. I think it's great to see two people decide to repeat what I said.
  11. table (.., version) table_versions (.., version)In table version is default 1 when you update the row you copy it to the *_versions table. You update the table, and increment the version on the 'table' table. You might wanna lock the row/table before doing this to avoid multiple people overriding each others changes.
  12. If you use Doctrine you can create your database schema in code. Schema updates can then be performed through code.
  13. Double post http://forums.phpfreaks.com/topic/281490-systemportal-to-manage-logins-authenticate-other-systems-basic-functions/?do=findComment&comment=1446430
  14. Encrypting your source code is slow. An hacker is still able to retrieve the decrypted code or able to generate a license key or re-use an existing key multiple times. Encrypting your source code also has other issues, like how will you provide support when they need it, unless you have some extreme logging in your code this will be hard to do, and you can't install an decrypted version on their system. Developing new features has the same problem. It's ok if everything runs smooth, but if something fails, you lose a customer. So in essence encrypting your software makes you lose business instead of gaining. Therefor it is up to you as a businessmen to think of a way that will provide you repeat business and happy customers without having to resort to techniques that are threats to your business. Like for example provide a lightweight version of your product for free. Customers wishing additional features, can buy these from your website, you can even allow 3rd party developers participate, and let them sell these through your website, taking a percentage on each sale. Aggressive methods will make your customers run away from you instead of towards you. If you are developing this for a customer, and my arguments don't stick. Then you are gonna have to clearly define what the software will do when an invalid/expired license key is entered. If you lock down your system like the above mentioned script does, none of your customers is gonna like this (and probably either sue you or leave), that they can't access THEIR data and their website is offline because the license key expired at 2am... (they are gonna raise their middle finger to the screen while they press [del] in their ftp client). So at the very basic level you'll need a working lightweight version of your software, that allows exporting data, and some basic admin stuff (fix typos etc.. while they wai for the new license key), and ability to enter/purchase a new license key. Just imagine your OS would lockdown when you dont have a valid license key, and they encrypted your hard-drives, so without the license key you cant get your photos, your music, .., I think you would be really pissed off and you would most likely run linux from that point onwards, if not already Treating your customers like friends is better then to treat them like enemies, because they'll treat you the same way!
  15. Your website is flagged by my antivirus as harmful. http://browsingprotection.f-secure.com/swp/result?url=http%3A%2F%2Fuqload.com%2F
  16. The result you return is passed to the success function. success: function(data) { var el = document.getElementById('subcategory_id'); $(el).empty(); // remove all HTML inside <select/> $.each(data, function(i, option) { // add each <option/> from data $('<option value="' + option.id + '">' + option.name + '</option>').appendTo(el); }); }
  17. Dupe: http://forums.phpfreaks.com/topic/281199-php-assigne/
  18. It's easier to install phpunit and zendframework through composer. Download composer.phar and put it inside your project directory. Then using the commandline type: $ composer.phar require phpunit/phpunit zendframework/zendframework
  19. No. It was the answer to your second question. A front controller is the single point of entry to boot your application, in Java this is your main method. In C++ this is main(). In PHP this is index.php (or whatever you set as default). Since files can easily be served by Apache you don't need a front controller as Apache does all your front controller needs. However where your system consists of functions or objects it's not so easy to route a request to an object which is why you use a front controller to do this for you. Thus translating /foo/bar to (new Foo)->bar() or to foo_bar().
  20. If all your controllers are named: index.php, start.php, .. then you don't need a front controller as Apache already does all what your front controller would do. The reason there is a front controller in some systems is because something has to translate /foo/bar to (new Foo)->bar(); or foo_bar(); when your controllers however are files, then your front controller is obsolete. Using includes you would center the logic required to redirect the user to the correct page, like when he is not logged in.
  21. You understood me wrong in your controller you can use this however you want, but not inside your update_save function. You can pass these like so: update_save($_POST['foo'], $_POST['bar']);If you need a redirect you just add it: update_save(..); header('Location: ..'); exit;
  22. Yes. It separates the 3 responsibilities. Though a controller should not execute queries as only your model should be capable to do this. Also your update_save function should receive it's data from the controller and not use $_POST or $_GET internally since only your controller knows about $_POST and $_GET. The controller should be a firewall of some sort, between the client and your controller HTTP exists, but the model should be agnostic of HTTP. HTTP CALLS { client }<---->{ controller}---->{ model } The advantage here is that you can change HTTP to for example CLI or SOAP or whatever without having to change the underlying model. Since $_POST, $_GET, $_COOKIE, $_SESSION are part of HTTP it's therefor that your model should be agnostic of these variables. A model should not issue redirects since redirect's are the responsibility of the controller.
  23. A template and a view are the same thing. In MVC the View is the part of the application that displays the results of a user's action and the application's processing. How you make up that View is entirely up to you. MVC is an idea and thus not bound to any technical implementation's, the same applies to views. For example: // the file is the controller (binds model and view) if ($_POST) { // mail is part of our model mail('foo@bar.bat', $_POST['subject'], $_POST['message']); // thank-you.html is part of our views include 'thank-you.html'; exit; } // contact.html is part of our views include 'contact.html'; // all concerns have been separatedThis is an MVC implementation.
  24. When posting code, mind that this is a public forum. And any sensitive data is for the world to see. I removed your db credentials, but I advice you to change them.
  25. MUAHAHA! MORE MINIONS! MORE MINIONS!!! uhm.. I meant congrats on the promotion.
×
×
  • 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.