function freeze()
    {
        $this->frozen = array();
        $this->frozenRoutes = array();

        $this->application->boot();
        $this->application->flush();

        $this->application['debug'] = true;
        $this->application['exception_handler']->disable();

        $output = $this->application['freezer.destination'];

        if (!is_dir($output)) {
            mkdir($output, 0755, true);
        }

        $routes = array();

        foreach ($this->generators as $g) {
            foreach ($g() as $route) {
                $routes[] = $route;
            }
        }

        $route = null;

        foreach ($routes as $route) {
            if (is_array($route)) {
                $routeName = $route[0];
                $params = @$route[1] ?: array();

                $this->freezeRoute($routeName, $params);
            } else {
                $this->freezeUrl((string) $route);
            }
        }
    }