I had a job interview recently and I was asked to do FizzBuzz. The code is very simple to write, however I wanted to see if I could make it…
Php
WordPress, concrete5, ZF2, PHP, mysql database dump
Here is a very simple script that once uploaded locks onto various architectures and extracts the database using the captured details. For example, wordpress and concrete5 have been detected here:…
Zend framework 2 DomPdf No block-level parent found. Not good. error message
This error can be caused by many things, but the most notable is when attempting to reuse DomPdf to render more than one PDF. This is to do with the…
ZF2 different layouts in modules
To enable a different layout in a module, to your module.php for the module define a new layout like so public function init(ModuleManager $mm) { $mm->getEventManager()->getSharedManager()->attach(__NAMESPACE__, ‘dispatch’, function($e) { $e->getTarget()->layout(‘admin/layout’);…
adding password authentication for a zend cms or controller
This is a very quick way to add password protection to a controller such as a cms controller. This code intercepts the login within the init() method of your chosen…
session_start hangs when it used to work
I had a problem with my zend application hanging with a white screen for no reason. I narrowed it down to when $adminSession = new Zend_Session_Namespace(‘Admin’); was executed, this is…
ckeditor to upload images
A few posts on how to do this, and a lot of frustrated people so here is how: Download both ckeditor and ckfinder. Decompress them into the root directory. Include…
database class php
Updated the database class Usage: // min instantiation $dataBase = new DB(‘hostname’,’username’,’password’,’database’); // max instantiation $dataBase = new DB(‘hostname’,’username’,’password’,’database’,DEBUG_LEVEL,array(‘admin@domain.com’,’admin@domain2.com)); Class: class DB{ /* * DESCRIPTION: Object class, Handles all database…