public static function purgeOpcache($messageBag = array()) {
        // This only clears the Opcache on CLI,
        // which is often separate from the HTTP Opcache.
        if (function_exists('opcache_reset')) {
            opcache_reset();
            $messageBag[] = 'OPCache: purged on the CLI';
        }

        if (function_exists('apc_clear_cache')) {
            apc_clear_cache();
            $messageBag[] = 'APC: purged on the CLI';
        }

        // Next, trigger the Opcache clear calls through HTTP.
        $deployConfig = new Garp_Deploy_Config;
        if (!$deployConfig->isConfigured(APPLICATION_ENV)) {
            return $messageBag;
        }

        $hostName = Zend_Registry::get('config')->app->domain;
        foreach (self::_getServerNames() as $serverName) {
            $opcacheResetWithServerName = self::_resetOpcacheHttp($serverName, $hostName);
            if ($opcacheResetWithServerName) {
                $messageBag[] = "OPCache: http purged on `{$serverName}`";
            }
            if (!$opcacheResetWithServerName) {
                $opcacheResetWithHostName = self::_resetOpcacheHttp($hostName, $hostName);
                $messageBag[] = $opcacheResetWithHostName
                    ? "OPCache: http purged on `{$hostName}`"
                    : "OPCache: failed purging OPCache in http context on `{$hostName}`";
            }
        }
        return $messageBag;
    }