Image upload storage strategies

Questions: When a user uploads an image to my site, the image goes through this process; user uploads pic store pic metadata in db, giving the image a unique id async image processing (thumbnail creation, cropping, etc) all images are stored in the same uploads folder So far the site is pretty small, and there… Read More »

How to call a closure that is a class variable?

Questions: class MyClass { var $lambda; function __construct() { $this->lambda = function() {echo ‘hello world’;}; // no errors here, so I assume that this is legal } } $myInstance = new MyClass(); $myInstance->lambda(); //Fatal error: Call to undefined method MyClass::lambda() So what is the correct syntax for reaching class variables ? Answers:

Could not open input file: artisan

Questions: When trying to create a new laravel project, The following error appears on the CLI: Could not open input file: artisan Script php artisan clear-compiled handling the post-install-cmd event returned with an error I am using the latest version of XAMPP v3.2.1 with PHP 5.5.15 and with mcrypt enabled (made sure of that by… Read More »

build a plugin system with php

Questions: I’m working on a custom CMS for my own use and was thinking about implementing a plugin system so I could extend the code a little easier. I’m having trouble conceptualizing the architecture and layout though. I know I could go through a few open source programs that implement similar features but this is… Read More »

CakePHP ACL Database Setup: ARO / ACO structure?

Questions: I’m struggling to implement ACL in CakePHP. After reading the documentation in the cake manual as well as several other tutorials, blog posts etc, I found Aran Johnson’s excellent tutorial which has helped fill in many of the gaps. His examples seem to conflict with others I’ve seen though in a few places –… Read More »

502 Gateway Errors under High Load (nginx/php-fpm)

Questions: I work for a rather busy internet site that is often gets very large spikes of traffic. During these spikes hundreds of pages per second are requested and this produces random 502 gateway errors. Now we run Nginx (1.0.10) and PHP-FPM on a machine with 4x SAS 15k drives (raid10) with a 16 core… Read More »

Cached, PHP generated Thumbnails load slowly

Questions: Question Part A ▉ (100 bountys, awarded) Main question was how to make this site, load faster. First we needed to read these waterfalls. Thanks all for your suggestions on the waterfall readout analysis. Evident from the various waterfall graphs shown here is the main bottleneck: the PHP-generated thumbnails. The protocol-less jquery loading from… Read More »