<?php

# Get the debug configuration
$production = !LOCALHOST && !Configure::read('debug');

# Define the existence of the method based on the debug value
$method = $production
	? 'public function appError($error) { ClassRegistry::init("Admin")->clearCache(null, true); $this->handleAppErrorInProduction($error); }'
	: null;

# Define the class
$class = "
	class ErrorHandlingController extends Controller {

		{$method}

		public function handleAppErrorInProduction(\$error) {}

	}";

# Load the class
eval($class);
