public function setupServiceManager($configPath)
    {
        try {
            $this->getServiceManager();
        } catch (InvalidServiceManagerException $e) {
            if (! \helpers_File::emptyDirectory($configPath, true)) {
                throw new \common_exception_Error('Unable to empty ' . $configPath . ' folder.');
            }
            $driver = new ServiceConfigDriver();
            $configService = $driver->connect('config', array(
                'dir' => $configPath,
                'humanReadable' => true
            ));

            $this->setServiceManager(new ServiceManager($configService));
        }

        return $this->getServiceManager();
    }