<?php

namespace ForkCMS\Bundle\InstallerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class InstallerController extends Controller
{
    public function step1Action()
    {
        var_dump('1');exit;
    }

    public function step2Action()
    {
        var_dump('2');exit;
    }

    public function step3Action()
    {
        var_dump('3');exit;
    }

    public function step4Action()
    {
        var_dump('4');exit;
    }

    public function step5Action()
    {
        var_dump('5');exit;
    }

    public function step6Action()
    {
        var_dump('6');exit;
    }

    public function step7Action()
    {
        var_dump('7');exit;
    }

    public function noStepAction()
    {
        var_dump('no step');exit;
    }
}

<?php

namespace ForkCMS\Bundle\InstallerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Filesystem\Filesystem;

class InstallerController extends Controller
{
    public function step1Action()
    {
        $this->checkInstall();
        var_dump('1');exit;
    }

    public function step2Action()
    {
        $this->checkInstall();
        var_dump('2');exit;
    }

    public function step3Action()
    {
        $this->checkInstall();
        var_dump('3');exit;
    }

    public function step4Action()
    {
        $this->checkInstall();
        var_dump('4');exit;
    }

    public function step5Action()
    {
        $this->checkInstall();
        var_dump('5');exit;
    }

    public function step6Action()
    {
        $this->checkInstall();
        var_dump('6');exit;
    }

    public function step7Action()
    {
        $this->checkInstall();
        var_dump('7');exit;
    }

    public function noStepAction()
    {
        $this->checkInstall();
        var_dump('no step');exit;
    }

    protected function checkInstall()
    {
        $fs = new FileSystem();
        $installCacheDir = $this->container->getParameter('kernel.cache_dir');
        if ($fs->exists($installCacheDir . 'installed.txt')) {
            exit('This Fork has already been installed. To reinstall, delete
                 installed.txt from the ' . $installCacheDir . ' directory. To log in,
                 <a href="/private">click here</a>.');
        }
    }
}

Check if Fork has been installed before installing again.
Check if Fork has been installed before installing again.
