public function run()
    {
        $this->returnCode = static::RETURN_SUCCESS;
        $this->lastError = null;
        $this->builtFile = null;

        if (!$this->backupComposer()) {
            $this->lastError = 'Could not backup composer directory';
            return $this->returnCode = static::RETURN_ERROR;
        }

        try {
            if ($this->flag & static::FLAG_OPTIMIZE) {
                $this->generateOptimizedClassmap();
            }

            $this->returnCode = $this->compile();
        } catch(\Exception $e) {
            $this->lastError = get_class($e) . ': ' . $e->getMessage();
            $this->returnCode = static::RETURN_ERROR;
        }

        if (!$this->restoreComposer()) {
            $this->lastError = 'Could not restore composer directory';
            return $this->returnCode = static::RETURN_ERROR;
        }

        return $this->returnCode;
    }