Monthly Archives: March 2018

DDD and MVC: Difference between 'Model' and 'Entity'

Questions: I’m seriously confused about the concept of the ‘Model’ in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of ‘Fat Model Skinny Controller’ is lost as the Controller starts doing more and more logic. In… Read More »

Category: php

Python SimpleHTTPServer with PHP

Questions: I used python -m SimpleHTTPServer, but the PHP files don’t execute instead they just been downloaded. I heard about WPHP in an old post. But I don’t know how to use it. How I can work with it ? Answers:

Is there a point to minifying PHP?

Questions: I know you can minify PHP, but I’m wondering if there is any point. PHP is an interpreted language so will run a little slower than a compiled language. My question is: would clients see a visible speed improvement in page loads and such if I were to minify my PHP? Also, is there… Read More »

How would you code an anti plagiarism site?

Questions: First, please note, that I am interested in how something like this would work, and am not intending to build it for a client etc, as I’m sure there may already be open source implementations. How do the algorithms work which detect plagiarism in uploaded text? Does it use regex to send all words… Read More »

Category: php

Speeding up CakePHP

Questions: I’ve been a keen fan and user of CakePHP for about 2.5 years now, but the main bugbear that most fellow developers level at the framework is that it’s slow, and the dispatch cycle takes too long to make it a viable solution for production environments. I’m hoping that this question will inspire people… Read More »

Is this correct object oriented programming in php? [closed]

Questions: Could this be classified as correct OOP programming? class Greeting { public $greet = array(‘Hi’,’Hello’, ‘Howzit’, ‘Ola’, ‘Whats up’); function __construct($name) { $this->name = $name; shuffle($this->greet); } } $hi = new Greeting(‘INSERTNAMEHERE’); /*NAME OF PERSON GOES HERE*/ echo $hi->greet[1] .’ ‘. $hi->name; Answers:

How to execute PHP code from the command line?

Questions: I would like to execute a single php statement like if(function_exists(“my_func”)) echo ‘function exists’; directly with the command line without having to use a seperate php file. How is it possible ? Answers: