From 79e508524d659123205ac7bd076578f2b1226fa0 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 17 Sep 2013 16:30:15 +0200 Subject: [PATCH] remove isntall routing and template --- core/lib/Thelia/Config/Resources/routing.xml | 11 - .../Config/Resources/routing/install.xml | 31 -- .../Install/BaseInstallController.php | 59 ---- .../Controller/Install/InstallController.php | 270 ------------------ templates/install/index.html | 46 --- templates/install/layout.tpl | 65 ----- templates/install/step-2.html | 50 ---- templates/install/step-3.html | 86 ------ templates/install/step-4.html | 77 ----- templates/install/step-5.html | 72 ----- templates/install/thanks.html | 42 --- 11 files changed, 809 deletions(-) delete mode 100644 core/lib/Thelia/Config/Resources/routing/install.xml delete mode 100644 core/lib/Thelia/Controller/Install/BaseInstallController.php delete mode 100644 core/lib/Thelia/Controller/Install/InstallController.php delete mode 100644 templates/install/index.html delete mode 100644 templates/install/layout.tpl delete mode 100644 templates/install/step-2.html delete mode 100644 templates/install/step-3.html delete mode 100644 templates/install/step-4.html delete mode 100644 templates/install/step-5.html delete mode 100644 templates/install/thanks.html diff --git a/core/lib/Thelia/Config/Resources/routing.xml b/core/lib/Thelia/Config/Resources/routing.xml index a8ad18abf..efeea61e8 100755 --- a/core/lib/Thelia/Config/Resources/routing.xml +++ b/core/lib/Thelia/Config/Resources/routing.xml @@ -56,17 +56,6 @@ - - - install.xml - - %kernel.cache_dir% - %kernel.debug% - - - - - front.xml diff --git a/core/lib/Thelia/Config/Resources/routing/install.xml b/core/lib/Thelia/Config/Resources/routing/install.xml deleted file mode 100644 index 720761b40..000000000 --- a/core/lib/Thelia/Config/Resources/routing/install.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Thelia\Controller\Install\InstallController::indexAction - - - - Thelia\Controller\Install\InstallController::checkPermissionAction - - - - Thelia\Controller\Install\InstallController::databaseConnectionAction - - - - Thelia\Controller\Install\InstallController::databaseSelectionAction - - - - Thelia\Controller\Install\InstallController::generalInformationAction - - - - Thelia\Controller\Install\InstallController::thanksAction - - - diff --git a/core/lib/Thelia/Controller/Install/BaseInstallController.php b/core/lib/Thelia/Controller/Install/BaseInstallController.php deleted file mode 100644 index bac7a4f19..000000000 --- a/core/lib/Thelia/Controller/Install/BaseInstallController.php +++ /dev/null @@ -1,59 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ - -namespace Thelia\Controller\Install; -use Symfony\Component\HttpFoundation\Response; -use Thelia\Controller\BaseController; - -/** - * Class BaseInstallController - * @package Thelia\Controller\Install - * @author Manuel Raynaud - */ -class BaseInstallController extends BaseController -{ - /** - * @return a ParserInterface instance parser - */ - protected function getParser() - { - $parser = $this->container->get("thelia.parser"); - - // Define the template that shoud be used - $parser->setTemplate("install"); - - return $parser; - } - - public function render($templateName, $args = array()) - { - return new Response($this->renderRaw($templateName, $args)); - } - - public function renderRaw($templateName, $args = array()) - { - $data = $this->getParser()->render($templateName, $args); - - return $data; - } -} diff --git a/core/lib/Thelia/Controller/Install/InstallController.php b/core/lib/Thelia/Controller/Install/InstallController.php deleted file mode 100644 index a6b0d975d..000000000 --- a/core/lib/Thelia/Controller/Install/InstallController.php +++ /dev/null @@ -1,270 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ - -namespace Thelia\Controller\Install; -use Thelia\Form\Exception\FormValidationException; -use Thelia\Form\InstallStep3Form; -use Thelia\Install\CheckDatabaseConnection; -use Thelia\Install\CheckPermission; -use Thelia\Install\Exception\AlreadyInstallException; -use Thelia\Install\Exception\InstallException; - -/** - * Class InstallController - * - * @package Thelia\Controller\Install - * @author Manuel Raynaud - * @author Guillaume MOREL - */ -class InstallController extends BaseInstallController -{ - public function indexAction() - { - $args = array(); - try { - //$this->verifyStep(1); // @todo implement - $this->getSession()->set("step", 1); - } catch (AlreadyInstallException $e) { - $args['isAlreadyInstalled'] = true; - } - - - return $this->render("index.html"); - } - - /** - * Integration tests - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function checkPermissionAction() - { - try { - //$this->verifyStep(2); // @todo implement - $checkPermission = new CheckPermission(true, $this->getTranslator()); - $args['isValid'] = $isValid = $checkPermission->exec(); - $args['validationMessages'] = $checkPermission->getValidationMessages(); - - $this->getSession()->set("step", 2); - } catch (AlreadyInstallException $e) { - $args['isAlreadyInstalled'] = true; - } - $args = array(); - - - return $this->render("step-2.html", $args); - } - - /** - * Database connexion tests - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function databaseConnectionAction() - { - $args = array(); - - try { - //$this->verifyStep(2); // @todo implement - - if ($this->getRequest()->isMethod('POST')) { - // Create the form from the request - $step3Form = new InstallStep3Form($this->getRequest()); - - $message = false; - try { - // Check the form against constraints violations - $form = $this->validateForm($step3Form, 'POST'); - - // Get the form field values - $data = $form->getData(); - var_dump('data', $data); - - // @todo implement tests - try { - new CheckDatabaseConnection( - $data['host'], - $data['user'], - $data['password'], - $data['port'], - true, - $this->getTranslator() - ); - - $this->getSession()->set('install', array( - 'host' =>$data['host'], - 'user' => $data['user'], - 'password' => $data['password'], - 'port' => $data['port'] - ) - ); - } catch (InstallException $e) { - $message = $this->getTranslator()->trans( - 'Can\'t connect with these credentials to this server', - array(), - 'install-wizard' - ); - } - - // $this->redirect( - // str_replace( - // '{id}', - // $couponEvent->getCoupon()->getId(), - // $creationForm->getSuccessUrl() - // ) - // ); - } catch (FormValidationException $e) { - // Invalid data entered - $message = $this->getTranslator()->trans( - 'Please check your input:', - array(), - 'install-wizard' - ); - - } catch (\Exception $e) { - // Any other error - $message = $this->getTranslator()->trans( - 'Sorry, an error occurred:', - array(), - 'install-wizard' - ); - } - - if ($message !== false) { - // Mark the form as with error - $step3Form->setErrorMessage($message); - - // Send the form and the error to the parser - $this->getParserContext() - ->addForm($step3Form) - ->setGeneralError($message); - } - } - - $this->getSession()->set("step", 3); - - $args['edit_language_locale'] = $this->getSession()->getLang()->getLocale(); - $args['formAction'] = 'install/step/3'; - - } catch (AlreadyInstallException $e) { - $args['isAlreadyInstalled'] = true; - } - - return $this->render('step-3.html', $args); - } - - /** - * Database selection - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function databaseSelectionAction() - { - $args = array(); - try { - - } catch (AlreadyInstallException $e) { - $args['isAlreadyInstalled'] = true; - } - - //$this->verifyStep(2); // @todo implement - - //$permission = new CheckPermission(); - - $this->getSession()->set("step", 4); - - return $this->render("step-4.html"); - } - - /** - * Set general information - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function generalInformationAction() - { - $args = array(); - try { - - } catch (AlreadyInstallException $e) { - $args['isAlreadyInstalled'] = true; - } - //$this->verifyStep(2); // @todo implement - - //$permission = new CheckPermission(); - - $this->getSession()->set("step", 5); - - return $this->render("step-5.html"); - } - - /** - * Display Thanks page - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function thanksAction() - { - $args = array(); - try { - - } catch (AlreadyInstallException $e) { - $args['isAlreadyInstalled'] = true; - } - //$this->verifyStep(2); // @todo implement - - //$permission = new CheckPermission(); - - $this->getSession()->set("step", 6); - - return $this->render("thanks.html"); - } - - /** - * Verify each steps and redirect if one step has already been passed - * - * @param int $step Step number - * - * @return bool - */ - protected function verifyStep($step) - { - $session = $this->getSession(); - - if ($session->has("step")) { - $sessionStep = $session->get("step"); - } else { - return true; - } - - switch ($step) { - case "1" : - if ($sessionStep > 1) { - $this->redirect("/install/step/2"); - } - break; - } - - return true; - } -} diff --git a/templates/install/index.html b/templates/install/index.html deleted file mode 100644 index b7843d528..000000000 --- a/templates/install/index.html +++ /dev/null @@ -1,46 +0,0 @@ -{extends file="layout.tpl"} - -{block name="page-title"}{intl l='Installation'}{/block} - -{block name="main-content"} -
-
- -
-
-
- -

{intl l="Thelia installation wizard"}

- -
-
    -
  • 1{intl l="Welcome"}
  • -
  • 2{intl l="Checking permissions"}
  • -
  • 3{intl l="Database connection"}
  • -
  • 4{intl l="Database selection"}
  • -
  • 5{intl l="General information"}
  • -
  • 6{intl l="Thanks"}
  • -
-
- -
-

- {intl l="Welcome in the Thelia installation wizard."} -

-

- {intl l="We will guide you throughout this process to install any application on your system."} -

- -
- - - -
-
-
- -
-
-{/block} \ No newline at end of file diff --git a/templates/install/layout.tpl b/templates/install/layout.tpl deleted file mode 100644 index 1497d7ea5..000000000 --- a/templates/install/layout.tpl +++ /dev/null @@ -1,65 +0,0 @@ - - - - {block name="page-title"}Thelia Install{/block} - - {images file='../admin/default/assets/img/favicon.ico'}{/images} - - - - {stylesheets file='../admin/default/assets/less/*' filters='less,cssembed'} - - {/stylesheets} - - - -
-
- -
-
-
{intl l='Version %ver' ver="{$THELIA_VERSION}"}
-
-
- -
-
- - {* -- Main page content section ----------------------------------------- *} - {if $isAlreadyInstalled} -
{intl l='Thelia is already installed'}
- {else} - {block name="main-content"}Put here the content of the template{/block} - {/if} - - - {* -- Footer section ---------------------------------------------------- *} - -
- - - {* -- Javascript section ------------------------------------------------ *} - - - - {block name="after-javascript-include"}{/block} - - {javascripts file='../admin/default/assets/js/bootstrap/bootstrap.js'} - - {/javascripts} - - {block name="javascript-initialization"}{/block} - - - \ No newline at end of file diff --git a/templates/install/step-2.html b/templates/install/step-2.html deleted file mode 100644 index fbd34ddb5..000000000 --- a/templates/install/step-2.html +++ /dev/null @@ -1,50 +0,0 @@ -{extends file="layout.tpl"} - -{block name="page-title"}{intl l='Installation step 2'}{/block} - -{block name="main-content"} -
-
- -
-
-
- -

{intl l="Thelia installation wizard"}

- -
-
    -
  • 1{intl l="Welcome"}
  • -
  • 2{intl l="Checking permissions"}
  • -
  • 3{intl l="Database connection"}
  • -
  • 4{intl l="Database selection"}
  • -
  • 5{intl l="General information"}
  • -
  • 6{intl l="Thanks"}
  • -
-
- -
-

{intl l="Checking directory permissions ..."}

-
    - {foreach from=$validationMessages item=validationMessage} -
  • - {$validationMessage.text nofilter} - {if !$validationMessage.status} - {$validationMessage.hint nofilter}{/if} -
  • - {/foreach} -
- -
- - - -
-
-
- -
-
-{/block} \ No newline at end of file diff --git a/templates/install/step-3.html b/templates/install/step-3.html deleted file mode 100644 index f93b0182b..000000000 --- a/templates/install/step-3.html +++ /dev/null @@ -1,86 +0,0 @@ -{extends file="layout.tpl"} - -{block name="page-title"}{intl l='Installation step 3'}{/block} - -{block name="main-content"} -
-
- -
-
-
- -

{intl l="Thelia installation wizard"}

- -
- -
- - {form name="thelia.install.step3"} -
- {if ! empty($general_error) } -
{$general_error}
- {/if} - - {form_hidden_fields form=$form} - - {form_field form=$form field='locale'} - - {/form_field} - -
- {form_field form=$form field='host'} -
- - - {if $error}{$message}{/if} -
- {/form_field} - - {form_field form=$form field='user'} -
- - - {if $error}{$message}{/if} -
- {/form_field} - - {form_field form=$form field='password'} -
- - - {if $error}{$message}{/if} -
- {/form_field} - - {form_field form=$form field='port'} -
- - - {if $error}{$message}{/if} -
- {/form_field} -
-
-
-
- -
-
-{/block} \ No newline at end of file diff --git a/templates/install/step-4.html b/templates/install/step-4.html deleted file mode 100644 index 981be34bb..000000000 --- a/templates/install/step-4.html +++ /dev/null @@ -1,77 +0,0 @@ -{extends file="layout.tpl"} - -{block name="page-title"}{intl l='Installation step 4'}{/block} - -{block name="main-content"} -
-
- -
-
-
- -

{intl l="Thelia installation wizard"}

- -
- -
- -
-
-
- {intl l="Choose your database"} -

- The SQL server contains multiple databases.
- Select below the one you want to use. -

- -
- -
-
- -
- -

- {intl l="or"} -

- -
- -
- -
- -
-
-
-
- - - -
-
-
- -
-
-{/block} \ No newline at end of file diff --git a/templates/install/step-5.html b/templates/install/step-5.html deleted file mode 100644 index 611a86a20..000000000 --- a/templates/install/step-5.html +++ /dev/null @@ -1,72 +0,0 @@ -{extends file="layout.tpl"} - -{block name="page-title"}{intl l='Installation step 4'}{/block} - -{block name="main-content"} -
-
- -
-
-
- -

{intl l="Thelia installation wizard"}

- - - -
-
- -

- The system will now you create a custom site access. -

- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
-
- - - -
-
-
- -
-
-{/block} \ No newline at end of file diff --git a/templates/install/thanks.html b/templates/install/thanks.html deleted file mode 100644 index b6ed27065..000000000 --- a/templates/install/thanks.html +++ /dev/null @@ -1,42 +0,0 @@ -{extends file="layout.tpl"} - -{block name="page-title"}{intl l='Thanks'}{/block} - -{block name="main-content"} -
-
- -
-
-
- -

{intl l="Thelia installation wizard"}

- - - -
-

- {intl l="Thank you have installed Thelia"}. -

-

- {intl l="You will be redirected to your personal space in order to manage your store now."} -

- -
- -
-
-
- -
-
-{/block} \ No newline at end of file