Controller/InstallController.php
public function configure()
    {
        $files_path = WWW_ROOT . 'files' . DS;
        if (!file_exists($files_path)) {
            mkdir($files_path, 0755);
        }
        $galleries_path = $files_path . 'gallery' . DS;
        if (!file_exists($galleries_path)) {
            mkdir($galleries_path, 0755);
        }

        $this->_configureDatabase();

        $this->Session->setFlash('Success! Gallery is now installed in your app.');

        $this->redirect(
            array(
                'controller' => 'gallery',
                'action' => 'index',
                'plugin' => 'gallery'
            )
        );

        $this->render(false, false);
    }
public function configure()
    {
        $files_path = WWW_ROOT . 'files' . DS;
        if (!file_exists($files_path)) {
            mkdir($files_path, 0755);
        }
        $galleries_path = $files_path . 'gallery' . DS;
        if (!file_exists($galleries_path)) {
            mkdir($galleries_path, 0755);
        }

        $this->_configureDatabase();

        $this->Session->setFlash('Success! Gallery is now installed in your app.');

        $this->redirect(
            array(
                'controller' => 'gallery',
                'action' => 'index',
                'plugin' => 'gallery'
            )
        );

        $this->render(false, false);
    }
Configure galleries and create mysql tables