This commit is contained in:
franck
2013-09-17 16:38:49 +02:00
44 changed files with 10694 additions and 635 deletions

3
.gitignore vendored
View File

@@ -19,10 +19,9 @@ local/media/documents/*
local/media/images/*
web/assets/*
web/cache/*
web/.htaccess
phpdoc*.log
php-cs
xhprof/
phpunit.phar
.DS_Store
phpmyadmin
phpmyadmin

View File

@@ -40,6 +40,8 @@
</loops>
<forms>
<form name="thelia.install.step3" class="Thelia\Form\InstallStep3Form"/>
<form name="thelia.customer.creation" class="Thelia\Form\CustomerCreation"/>
<form name="thelia.customer.modification" class="Thelia\Form\CustomerModification"/>
<form name="thelia.customer.lostpassword" class="Thelia\Form\CustomerLostPasswordForm"/>

View File

@@ -56,17 +56,6 @@
<tag name="router.register" priority="0"/>
</service>
<service id="router.install" class="%router.class%">
<argument type="service" id="router.xmlLoader"/>
<argument>install.xml</argument>
<argument type="collection">
<argument key="cache_dir">%kernel.cache_dir%</argument>
<argument key="debug">%kernel.debug%</argument>
</argument>
<argument type="service" id="request.context"/>
<tag name="router.register" priority="-1"/>
</service>
<service id="router.front" class="%router.class%">
<argument type="service" id="router.xmlLoader"/>
<argument>front.xml</argument>

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="install.step1" path="/install" >
<default key="_controller">Thelia\Controller\Install\InstallController::index</default>
</route>
<route id="install.step2" path="/install/step/2" >
<default key="_controller">Thelia\Controller\Install\InstallController::checkPermission</default>
</route>
<route id="install.step3" path="/install/step/3" >
<default key="_controller">Thelia\Controller\Install\InstallController::databaseConnection</default>
</route>
<route id="install.step4" path="/install/step/4" >
<default key="_controller">Thelia\Controller\Install\InstallController::databaseSelection</default>
</route>
<route id="install.step5" path="/install/step/5" >
<default key="_controller">Thelia\Controller\Install\InstallController::generalInformation</default>
</route>
<route id="install.step6" path="/install/thanks" >
<default key="_controller">Thelia\Controller\Install\InstallController::thanks</default>
</route>
</routes>

View File

@@ -31,6 +31,7 @@ use Symfony\Component\Routing\Exception\MissingMandatoryParametersException;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Router;
use Thelia\Core\Security\SecurityContext;
use Thelia\Core\Translation\Translator;
use Thelia\Tools\URL;
use Thelia\Tools\Redirect;
use Thelia\Core\Template\ParserContext;
@@ -97,7 +98,7 @@ class BaseController extends ContainerAware
*
* return the Translator
*
* @return mixed \Thelia\Core\Translation\Translator
* @return Translator
*/
public function getTranslator()
{

View File

@@ -1,111 +0,0 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Controller\Install;
use Thelia\Install\CheckPermission;
/**
* Class InstallController
* @package Thelia\Controller\Install
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class InstallController extends BaseInstallController
{
public function index()
{
//$this->verifyStep(1);
$this->getSession()->set("step", 1);
return $this->render("index.html");
}
public function checkPermission()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 2);
return $this->render("step-2.html");
}
public function databaseConnection()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 3);
return $this->render("step-3.html");
}
public function databaseSelection()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 4);
return $this->render("step-4.html");
}
public function generalInformation()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 5);
return $this->render("step-5.html");
}
public function thanks()
{
//$this->verifyStep(2);
//$permission = new CheckPermission();
$this->getSession()->set("step", 6);
return $this->render("thanks.html");
}
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;
}
}
}

View File

@@ -86,6 +86,8 @@ class Thelia extends Kernel
$serviceContainer->setLogger('defaultLogger', \Thelia\Log\Tlog::getInstance());
$con->useDebug(true);
}
}
/**

View File

@@ -0,0 +1,111 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
use Symfony\Component\Validator\Constraints\NotBlank;
/**
* Created by JetBrains PhpStorm.
* Date: 8/29/13
* Time: 3:45 PM
*
* Allow to build a form Install Step 3 Database connection
*
* @package Coupon
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class InstallStep3Form extends BaseForm
{
/**
* Build Coupon form
*
* @return void
*/
protected function buildForm()
{
$this->formBuilder
->add(
'host',
'text',
array(
'constraints' => array(
new NotBlank()
)
)
)
->add(
'user',
'text',
array(
'constraints' => array(
new NotBlank()
)
)
)
->add(
'password',
'text',
array(
'constraints' => array(
new NotBlank()
)
)
)
->add(
'port',
'text',
array(
'constraints' => array(
new NotBlank(),
new GreaterThan(
array(
'value' => 0
)
)
)
)
)
->add(
'locale',
'hidden',
array(
'constraints' => array(
new NotBlank()
)
)
);
}
/**
* Get form name
*
* @return string
*/
public function getName()
{
return 'thelia_install_step3';
}
}

View File

@@ -25,19 +25,33 @@ use Thelia\Install\Exception\AlreadyInstallException;
/**
* Class BaseInstall
*
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
abstract class BaseInstall
{
/** @var bool If Installation wizard is launched by CLI */
protected $isConsoleMode = true;
/**
* Verify if an installation already exists
* Constructor
*
* @param bool $verifyInstall Verify if an installation already exists
*
* @throws Exception\AlreadyInstallException
*/
public function __construct($verifyInstall = true)
{
/* TODO : activate this part
// Check if install wizard is launched via CLI
if (php_sapi_name() == 'cli') {
$this->isConsoleMode = true;
} else {
$this->isConsoleMode = false;
}
if (file_exists(THELIA_ROOT . '/local/config/database.yml') && $verifyInstall) {
throw new AlreadyInstallException("Thelia is already installed");
}*/
}
$this->exec();

View File

@@ -0,0 +1,122 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Install;
use PDO;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use Symfony\Component\Translation\TranslatorInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Install\Exception\InstallException;
/**
* Class CheckDatabaseConnection
*
* Take care of integration tests (database connection)
*
* @package Thelia\Install
* @author Manuel Raynaud <mraynaud@openstudio.fr>
* @author Guillaume MOREL <gmorel@openstudio.fr>
*/
class CheckDatabaseConnection extends BaseInstall
{
protected $validationMessages = array();
/** @var bool If permissions are OK */
protected $isValid = true;
/** @var TranslatorInterface Translator Service */
protected $translator = null;
/** @var string Database host information */
protected $host = null;
/** @var string Database user information */
protected $user = null;
/** @var string Database password information */
protected $password = null;
/** @var int Database port information */
protected $port = null;
/**
* @var \PDO instance
*/
protected $connection = null;
/**
* Constructor
*
* @param string $host Database host information
* @param string $user Database user information
* @param string $password Database password information
* @param int $port Database port information
* @param bool $verifyInstall If verify install
* @param Translator $translator Translator Service
* necessary for install wizard
*/
public function __construct($host, $user, $password, $port, $verifyInstall = true, Translator $translator = null)
{
$this->host = $host;
$this->user = $user;
$this->password = $password;
$this->port = $port;
parent::__construct($verifyInstall);
}
/**
* Perform database connection check
*
* @return bool
*/
public function exec()
{
$dsn = "mysql:host=%s;port=%s";
try {
$this->connection = new \PDO(
sprintf($dsn, $this->host, $this->port),
$this->user,
$this->password
);
} catch (\PDOException $e) {
$this->validationMessages = 'Wrong connection information';
$this->isValid = false;
}
return $this->isValid;
}
public function getConnection()
{
return $this->connection;
}
}

View File

@@ -23,56 +23,364 @@
namespace Thelia\Install;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use Symfony\Component\Translation\TranslatorInterface;
use Thelia\Core\Translation\Translator;
/**
* Class CheckPermission
*
* Take care of integration tests (files permissions)
*
* @package Thelia\Install
* @author Manuel Raynaud <mraynaud@openstudio.fr>
* @author Manuel Raynaud <mraynaud@openstudio.fr>
* @author Guillaume MOREL <gmorel@openstudio.fr>
*/
class CheckPermission extends BaseInstall
{
const CONF = "const";
const LOG = "log";
const CACHE = "cache";
private $directories = array();
private $validation = array();
private $valid = true;
const DIR_CONF = 'local/config';
const DIR_LOG = 'log';
const DIR_CACHE = 'cache';
public function __construct($verifyInstall = true)
/** @var array Directory needed to be writable */
protected $directoriesToBeWritable = array(
self::DIR_CONF,
self::DIR_LOG,
self::DIR_CACHE,
);
/** @var array Minimum server configuration necessary */
protected $minServerConfigurationNecessary = array(
'memory_limit' => 134217728,
'post_max_size' => 20971520,
'upload_max_filesize' => 2097152
);
protected $validationMessages = array();
/** @var bool If permissions are OK */
protected $isValid = true;
/** @var TranslatorInterface Translator Service */
protected $translator = null;
/**
* Constructor
*
* @param bool $verifyInstall If verify install
* @param Translator $translator Translator Service
* necessary for install wizard
*/
public function __construct($verifyInstall = true, Translator $translator = null)
{
$this->translator = $translator;
$this->directories = array(
self::CONF => THELIA_ROOT . "local/config",
self::LOG => THELIA_ROOT . "log",
self::CACHE => THELIA_ROOT . "cache"
$this->validationMessages['php_version'] = array(
'text' => $this->getI18nPhpVersionText('5.4', phpversion(), true),
'hint' => $this->getI18nPhpVersionHint(),
'status' => true
);
$this->validation = array(
self::CONF => array(
"text" => sprintf("config directory(%s)...", $this->directories[self::CONF]),
"status" => true
),
self::LOG => array(
"text" => sprintf("cache directory(%s)...", $this->directories[self::LOG]),
"status" => true
),
self::CACHE => array(
"text" => sprintf("log directory(%s)...", $this->directories[self::CACHE]),
"status" => true
)
);
foreach ($this->directoriesToBeWritable as $directory) {
$this->validationMessages[$directory] = array(
'text' => '',
'hint' => '',
'status' => true
);
}
foreach ($this->minServerConfigurationNecessary as $key => $value) {
$this->validationMessages[$key] = array(
'text' => '',
'hint' => $this->getI18nConfigHint(),
'status' => true
);
}
parent::__construct($verifyInstall);
}
/**
* Perform file permission check
*
* @return bool
*/
public function exec()
{
foreach ($this->directories as $key => $directory) {
if(is_writable($directory) === false) {
$this->valid = false;
$this->validation[$key]["status"] = false;
if (version_compare(phpversion(), '5.4', '<')) {
$this->validationMessages['php_version'] = $this->getI18nPhpVersionText('5.4', phpversion(), false);
}
foreach ($this->directoriesToBeWritable as $directory) {
$fullDirectory = THELIA_ROOT . $directory;
$this->validationMessages[$directory]['text'] = $this->getI18nDirectoryText($fullDirectory, true);
if (is_writable($fullDirectory) === false) {
if (!$this->makeDirectoryWritable($fullDirectory)) {
$this->isValid = false;
$this->validationMessages[$directory]['status'] = false;
$this->validationMessages[$directory]['text'] = $this->getI18nDirectoryText($fullDirectory, false);
$this->validationMessages[$directory]['hint'] = $this->getI18nDirectoryHint($fullDirectory);
}
}
}
foreach ($this->minServerConfigurationNecessary as $key => $value) {
$this->validationMessages[$key]['text'] = $this->getI18nConfigText($key, $this->formatBytes($value), ini_get($key), true);
if (!$this->verifyServerMemoryValues($key, $value)) {
$this->isValid = false;
$this->validationMessages[$key]['status'] = false;
$this->validationMessages[$key]['text'] = $this->getI18nConfigText($key, $this->formatBytes($value), ini_get($key), false);;
}
}
return $this->isValid;
}
}
/**
* Get validation messages
*
* @return array
*/
public function getValidationMessages()
{
return $this->validationMessages;
}
/**
* Make a directory writable (recursively)
*
* @param string $directory path to directory
*
* @return bool
*/
protected function makeDirectoryWritable($directory)
{
chmod($directory, 0777);
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($directory)
);
foreach ($iterator as $item) {
chmod($item, 0777);
}
return (is_writable(THELIA_ROOT . $directory) === true);
}
/**
* Get Translated text about the directory state
*
* @param string $directory Directory being checked
* @param bool $isValid If directory permission is valid
*
* @return string
*/
protected function getI18nDirectoryText($directory, $isValid)
{
if ($this->translator !== null) {
if ($isValid) {
$sentence = 'Your directory <strong>%directory%</strong> is writable';
} else {
$sentence = 'Your directory <strong>%directory%</strong> is not writable';
}
$translatedText = $this->translator->trans(
$sentence,
array(
'%directory%' => $directory
),
'install-wizard'
);
} else {
$translatedText = sprintf('Your directory %s needs to be writable', $directory);
}
return $translatedText;
}
/**
* Get Translated hint about the directory state
*
* @param string $directory Directory being checked
*
* @return string
*/
protected function getI18nDirectoryHint($directory)
{
if ($this->translator !== null) {
$sentence = '<span class="label label-primary">chmod 777 %directory%</span> on your server with admin rights could help';
$translatedText = $this->translator->trans(
$sentence,
array(
'%directory%' => $directory
),
'install-wizard'
);
} else {
$translatedText = sprintf('chmod 777 %s on your server with admin rights could help', $directory);
}
return $translatedText;
}
/**
* Get Translated text about the directory state
* Not usable with CLI
*
* @param string $key .ini file key
* @param string $expectedValue Expected server value
* @param string $currentValue Actual server value
* @param bool $isValid If server configuration is valid
*
* @return string
*/
protected function getI18nConfigText($key, $expectedValue, $currentValue, $isValid)
{
if ($isValid) {
$sentence = 'Your <span class="label label-primary">%key%</span> server configuration (currently %currentValue%) is well enough to run Thelia2 (%expectedValue% needed)';
} else {
$sentence = 'Your <span class="label label-primary">%key%</span> server configuration (currently %currentValue%) is not sufficient enough in order to run Thelia2 (%expectedValue% needed)';
}
$translatedText = $this->translator->trans(
$sentence,
array(
'%key%' => $key,
'%expectedValue%' => $expectedValue,
'%currentValue%' => $currentValue,
),
'install-wizard'
);
return $translatedText;
}
/**
* Get Translated hint about the config requirement issue
*
* @return string
*/
protected function getI18nConfigHint()
{
$sentence = 'Modifying this value on your server <span class="label label-primary">php.ini</span> file with admin rights could help';
$translatedText = $this->translator->trans(
$sentence,
array(),
'install-wizard'
);
return $translatedText;
}
/**
* Get Translated hint about the PHP version requirement issue
*
* @param string $expectedValue
* @param string $currentValue
* @param bool $isValid
*
* @return string
*/
protected function getI18nPhpVersionText($expectedValue, $currentValue, $isValid)
{
if ($this->translator !== null) {
if ($isValid) {
$sentence = 'Your PHP version <span class="label label-primary">%currentValue%</span> is well enough to run Thelia2 (%expectedValue% needed)';
} else {
$sentence = 'Your PHP version <span class="label label-primary">%currentValue%</span> is not sufficient enough to run Thelia2 (%expectedValue% needed)';
}
$translatedText = $this->translator->trans(
$sentence,
array(
'%expectedValue%' => $expectedValue,
'%currentValue%' => $currentValue,
),
'install-wizard'
);
} else {
$translatedText = sprintf('Thelia needs at least PHP %s (%s currently)', $expectedValue, $currentValue);
}
return $translatedText;
}
/**
* Get Translated hint about the config requirement issue
*
* @return string
*/
protected function getI18nPhpVersionHint()
{
$sentence = 'Upgrading your version of PHP with admin rights could help';
$translatedText = $this->translator->trans(
$sentence,
array(),
'install-wizard'
);
return $translatedText;
}
/**
* Check if a server memory value is met or not
*
* @param string $key .ini file key
* @param int $necessaryValueInBytes Expected value in bytes
*
* @return bool
*/
protected function verifyServerMemoryValues($key, $necessaryValueInBytes)
{
$serverValueInBytes = $this->returnBytes(ini_get($key));
return ($serverValueInBytes >= $necessaryValueInBytes);
}
/**
* Return bytes from memory .ini value
*
* @param string $val .ini value
*
* @return int
*/
protected function returnBytes($val)
{
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}
/**
* Convert bytes to readable string
*
* @param int $bytes bytes
* @param int $precision conversion precision
*
* @return string
*/
protected function formatBytes($bytes, $precision = 2)
{
$base = log($bytes) / log(1024);
$suffixes = array('', 'k', 'M', 'G', 'T');
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
}
}

View File

@@ -93,7 +93,7 @@ class Database
*/
public function createDatabase($dbName)
{
$this->connection->query(
$this->connection->exec(
sprintf(
"CREATE DATABASE IF NOT EXISTS %s CHARACTER SET utf8",
$dbName

View File

@@ -34,8 +34,6 @@ class Admin extends BaseAdmin implements UserInterface
public function setPassword($password)
{
\Thelia\Log\Tlog::getInstance()->debug($password);
if ($this->isNew() && ($password === null || trim($password) == "")) {
throw new \InvalidArgumentException("customer password is mandatory on creation");
}

0
local/modules/Colissimo/Colissimo.php Normal file → Executable file
View File

0
local/modules/Colissimo/Config/config.xml Normal file → Executable file
View File

0
local/modules/Colissimo/Config/plugin.xml Normal file → Executable file
View File

0
local/modules/Colissimo/Config/schema.xml Normal file → Executable file
View File

0
local/modules/DebugBar/Config/config.xml Normal file → Executable file
View File

0
local/modules/DebugBar/Config/plugin.xml Normal file → Executable file
View File

0
local/modules/DebugBar/Config/schema.xml Normal file → Executable file
View File

View File

0
local/modules/DebugBar/DebugBar.php Normal file → Executable file
View File

0
local/modules/DebugBar/Listeners/DebugBarListeners.php Normal file → Executable file
View File

0
local/modules/DebugBar/Smarty/Plugin/DebugBar.php Normal file → Executable file
View File

View File

@@ -1,46 +0,0 @@
{extends file="layout.tpl"}
{block name="page-title"}{intl l='Installation'}{/block}
{block name="main-content"}
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
<div class="wizard">
<ul>
<li class="active"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></li>
<li><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></li>
<li><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></li>
<li><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
</ul>
</div>
<div class="well">
<p class="lead text-center">
{intl l="Welcome in the Thelia installation wizard."}
</p>
<p class="text-center">
{intl l="We will guide you throughout this process to install any application on your system."}
</p>
</div>
<div class="clearfix">
<a href="install/step/2" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}

View File

@@ -1,62 +0,0 @@
<!DOCTYPE html>
<html lang="{$lang_code}">
<head>
<title>{block name="page-title"}Thelia Install{/block}</title>
{images file='../admin/default/assets/img/favicon.ico'}<link rel="shortcut icon" href="{$asset_url}" />{/images}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{stylesheets file='../admin/default/assets/less/*' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
</head>
<body>
<div class="topbar">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
</div>
</div>
</div>
</div>
{* -- Main page content section ----------------------------------------- *}
{block name="main-content"}Put here the content of the template{/block}
{* -- Footer section ---------------------------------------------------- *}
<hr />
<footer class="footer">
<div class="container">
<p>{intl l='&copy; Thelia 2013'}
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Édité par OpenStudio'}</a>
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Forum Thelia'}</a>
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Contributions Thelia'}</a>
<span class="pull-right">{intl l='interface par <a target="_blank" href="http://www.steaw-webdesign.com/">Steaw-Webdesign</a>'}</span>
</p>
{module_include location='in_footer'}
</div>
</footer>
{* -- Javascript section ------------------------------------------------ *}
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
{block name="after-javascript-include"}{/block}
{javascripts file='../admin/default/assets/js/bootstrap/bootstrap.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{block name="javascript-initialization"}{/block}
</body>
</html>

View File

@@ -1,51 +0,0 @@
{extends file="layout.tpl"}
{block name="page-title"}{intl l='Installation step 2'}{/block}
{block name="main-content"}
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
<div class="wizard">
<ul>
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
<li class="active"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></li>
<li><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></li>
<li><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
</ul>
</div>
<div class="well">
<p>We will check some rights to files and directories...</p>
<ul class="list-unstyled list-group">
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
<li class="list-group-item text-danger">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
<li class="list-group-item text-danger">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
<li class="list-group-item text-danger">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
</ul>
</div>
<div class="clearfix">
<a href="install" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
<a href="install/step/3" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}

View File

@@ -1,56 +0,0 @@
{extends file="layout.tpl"}
{block name="page-title"}{intl l='Installation step 3'}{/block}
{block name="main-content"}
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
<div class="wizard">
<ul>
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
<li class="active"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></li>
<li><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
</ul>
</div>
<div class="well">
<form action="">
<div class="form-group">
<label for="">{intl l="Host"} :</label>
<input id="" type="text" class="form-control">
</div>
<div class="form-group">
<label for="">{intl l="Login"} :</label>
<input id="" type="text" class="form-control">
</div>
<div class="form-group">
<label for="">{intl l="Password"} :</label>
<input id="" type="password" class="form-control">
</div>
</form>
</div>
<div class="clearfix">
<a href="install/step/2" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
<a href="install/step/4" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}

View File

@@ -1,77 +0,0 @@
{extends file="layout.tpl"}
{block name="page-title"}{intl l='Installation step 4'}{/block}
{block name="main-content"}
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
<div class="wizard">
<ul>
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></a></li>
<li class="active"><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
</ul>
</div>
<div class="well">
<form action="">
<fieldset>
<legend>{intl l="Choose your database"}</legend>
<p>
The SQL server contains multiple databases.<br/>
Select below the one you want to use.
</p>
<div class="radio">
<label>
<input type="radio" name="" id="" value="">
Database 1
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="" id="" value="">
Database 2
</label>
</div>
<p>
{intl l="or"}
</p>
<div class="radio">
<label>
<input type="radio" name="" id="" value="" checked>
Create an other database
</label>
</div>
<div class="form-group">
<input type="text" class="form-control">
</div>
</fieldset>
</form>
</div>
<div class="clearfix">
<a href="install/step/2" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
<a href="install/step/4" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}

View File

@@ -1,72 +0,0 @@
{extends file="layout.tpl"}
{block name="page-title"}{intl l='Installation step 4'}{/block}
{block name="main-content"}
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
<div class="wizard">
<ul>
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></a></li>
<li class="active"><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
</ul>
</div>
<div class="well">
<form action="">
<p>
The system will now you create a custom site access.
</p>
<div class="form-group">
<label for="">{intl l="Login"} :</label>
<input id="" type="text" class="form-control">
</div>
<div class="form-group">
<label for="">{intl l="Password"} :</label>
<input id="" type="password" class="form-control">
</div>
<div class="form-group">
<label for="">{intl l="Password confirmation"} :</label>
<input id="" type="password" class="form-control">
</div>
<div class="form-group">
<label for="">{intl l="Email address"} :</label>
<input id="" type="email" class="form-control">
</div>
<div class="form-group">
<label for="">{intl l="Email address confirmation"} :</label>
<input id="" type="email" class="form-control">
</div>
</form>
</div>
<div class="clearfix">
<a href="install/step/2" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
<a href="install/step/4" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}

View File

@@ -1,42 +0,0 @@
{extends file="layout.tpl"}
{block name="page-title"}{intl l='Thanks'}{/block}
{block name="main-content"}
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
<div class="wizard">
<ul>
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></a></li>
<li class="complete"><a href="#"><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></a></li>
<li class="active"><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
</ul>
</div>
<div class="well">
<p class="lead text-center">
{intl l="Thank you have installed Thelia"}.
</p>
<p class="text-center">
{intl l="You will be redirected to your personal space in order to manage your store now."}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}

12
web/.htaccess Normal file
View File

@@ -0,0 +1,12 @@
Options +FollowSymlinks -Indexes
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

119
web/install/bdd.php Normal file
View File

@@ -0,0 +1,119 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
$step=4;
include("header.php");
if (isset($_POST['host']) && isset($_POST['username']) && isset($_POST['password']) && isset($_POST['port'])){
$_SESSION['install']['host'] = $_POST['host'];
$_SESSION['install']['username'] = $_POST['username'];
$_SESSION['install']['password'] = $_POST['password'];
$_SESSION['install']['port'] = $_POST['port'];
$checkConnection = new \Thelia\Install\CheckDatabaseConnection($_POST['host'], $_POST['username'], $_POST['password'], $_POST['port']);
if(! $checkConnection->exec() || $checkConnection->getConnection()->query('show databases') === false){
header('location: connection.php?err=1');
exit;
}
}
elseif($_SESSION['install']['step'] >=3) {
$checkConnection = new \Thelia\Install\CheckDatabaseConnection($_SESSION['install']['host'], $_SESSION['install']['username'], $_SESSION['install']['password'], $_SESSION['install']['port']);
}
else {
header('location: connection.php?err=1');
exit;
}
$_SESSION['install']['step'] = 4;
$connection = $checkConnection->getConnection();
$databases = $connection->query('show databases');
?>
<div class="well">
<form action="config.php" method="post">
<fieldset>
<legend>Choose your database</legend>
<p>
The SQL server contains multiple databases.<br/>
Select below the one you want to use.
</p>
<?php foreach($databases as $database): ?>
<?php if ($database['Database'] == 'information_schema') continue; ?>
<?php
$connection->exec(sprintf('use %s', $database['Database']));
$tables = $connection->query('SHOW TABLES');
$found = false;
foreach($tables as $table) {
if($table[0] == 'cart_item') {
$found = true;
break;
}
}
?>
<div class="radio">
<label for="database_<?php echo $database['Database']; ?>">
<input type="radio" name="database" id="database_<?php echo $database['Database']; ?>" value="<?php echo $database['Database']; ?>" <?php if($found){ echo "disabled"; } ?>>
<?php echo $database['Database']; ?>
</label>
</div>
<?php endforeach; ?>
<?php
$connection->exec('use information_schema');
$permissions = $connection->query("SELECT COUNT( * ) FROM `USER_PRIVILEGES`
WHERE PRIVILEGE_TYPE = 'CREATE'
AND GRANTEE LIKE '%".$_SESSION['install']['username']."%'
AND IS_GRANTABLE = 'YES';");
$writePermission = false;
if($permissions->fetchColumn(0) > 0) {
?>
<p>
or
</p>
<div class="radio">
<label>
Create an other database
</label>
</div>
<div class="form-group">
<input type="text" name="database_create" class="form-control">
</div>
<?php } ?>
</fieldset>
<div class="clearfix">
<div class="control-btn">
<button type="submit" class="pull-right btn btn-default btn-primary">Continue</button>
</div>
</div>
</form>
</div>
<?php include 'footer.php'; ?>

View File

@@ -21,39 +21,7 @@
/* */
/*************************************************************************************/
namespace Thelia\Controller\Install;
use Symfony\Component\HttpFoundation\Response;
use Thelia\Controller\BaseController;
include __DIR__ . "/../../core/bootstrap.php";
/**
* Class BaseInstallController
* @package Thelia\Controller\Install
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
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;
}
}
$thelia = new \Thelia\Core\Thelia("install", false);
$thelia->boot();

110
web/install/config.php Normal file
View File

@@ -0,0 +1,110 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
$step = 5;
include("header.php");
global $thelia;
$err = isset($_GET['err']) && $_GET['err'];
if (!$err && $_SESSION['install']['step'] != $step) {
$checkConnection = new \Thelia\Install\CheckDatabaseConnection($_SESSION['install']['host'], $_SESSION['install']['username'], $_SESSION['install']['password'], $_SESSION['install']['port']);
$connection = $checkConnection->getConnection();
$connection->exec("SET NAMES UTF8");
$database = new \Thelia\Install\Database($connection);
if (isset($_POST['database'])) {
$_SESSION['install']['database'] = $_POST['database'];
}
if (isset($_POST['database_create']) && $_POST['database_create'] != "") {
$_SESSION['install']['database'] = $_POST['database_create'];
$database->createDatabase($_SESSION['install']['database']);
}
$database->insertSql($_SESSION['install']['database']);
if(!file_exists(THELIA_ROOT . "/local/config/database.yml")) {
$fs = new \Symfony\Component\Filesystem\Filesystem();
$sampleConfigFile = THELIA_ROOT . "/local/config/database.yml.sample";
$configFile = THELIA_ROOT . "/local/config/database.yml";
$fs->copy($sampleConfigFile, $configFile, true);
$configContent = file_get_contents($configFile);
$configContent = str_replace("%DRIVER%", "mysql", $configContent);
$configContent = str_replace("%USERNAME%", $_SESSION['install']['username'], $configContent);
$configContent = str_replace("%PASSWORD%", $_SESSION['install']['password'], $configContent);
$configContent = str_replace(
"%DSN%",
sprintf("mysql:host=%s;dbname=%s;port=%s", $_SESSION['install']['host'], $_SESSION['install']['database'], $_SESSION['install']['port']),
$configContent
);
file_put_contents($configFile, $configContent);
// FA - no, as no further install will be possible
// $fs->remove($sampleConfigFile);
$fs->remove($thelia->getContainer()->getParameter("kernel.cache_dir"));
}
}
$_SESSION['install']['step'] = $step;
?>
<form action="end.php" method="POST" >
<div class="well">
<div class="form-group">
<label for="admin_login">Administrator login :</label>
<input id="admin_login" class="form-control" type="text" name="admin_login" placeholder="admin" value="" required>
</div>
<div class="form-group">
<label for="admin_password">Administrator password :</label>
<input id="admin_password" class="form-control" type="password" name="admin_password" value="" required>
</div>
<div class="form-group">
<label for="admin_password_verif">Administrator password verification :</label>
<input id="admin_password_verif" class="form-control" type="password" name="admin_password_verif" value="" required>
</div>
<div class="form-group">
<label for="email_contact">Contact email :</label>
<input id="email_contact" class="form-control" type="text" name="email_contact" placeholder="foo@bar.com" value="" required>
</div>
<div class="form-group">
<label for="site_name">Site name :</label>
<input id="site_name" class="form-control" type="text" name="site_name" placeholder="" value="" required>
</div>
<div class="clearfix">
<div class="control-btn">
<button type="submit" class="pull-right btn btn-default btn-primary">Continue</button>
</div>
</div>
</div>
</form>
<?php include('footer.php'); ?>

View File

@@ -0,0 +1,67 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
$step = 3;
include("header.php");
if(!$_SESSION['install']['continue'] && $_SESSION['install']['step'] == 2) {
header(sprintf('location: %s', $_SESSION['install']['return_step']));
}
$_SESSION['install']['step'] = 3;
?>
<form action="bdd.php" method="POST" >
<?php if(isset($_GET['err']) && $_GET['err'] == 1){ ?>
<div class="alert alert-danger">Wrong connection information</div>
<?php } ?>
<div class="well">
<div class="form-group">
<label for="host">Host :</label>
<input id="host" class="form-control" type="text" name="host" placeholder="localhost" value="<?php if(isset($_SESSION['install']['host'])){ echo $_SESSION['install']['host']; } ?>">
</div>
<div class="form-group">
<label for="user">Username :</label>
<input id="user" type="text" class="form-control" name="username" placeholder="john" value="<?php if(isset($_SESSION['install']['username'])){ echo $_SESSION['install']['username']; } ?>">
</div>
<div class="form-group">
<label for="password">Password :</label>
<input id="password" type="password" class="form-control" name="password" placeholder="l33t 5p34k" >
</div>
<div class="form-group">
<label for="port">Port :</label>
<input id="port" type="text" class="form-control" name="port" value="<?php if(isset($_SESSION['install']['port'])){ echo $_SESSION['install']['port']; } else { echo '3306'; } ?>">
</div>
</div>
<div class="clearfix">
<div class="control-btn">
<button type="submit" class="pull-right btn btn-default btn-primary">Continue</button>
</div>
</div>
</form>
<?php include("footer.php"); ?>

57
web/install/end.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
$step=6;
include "header.php";
if($_SESSION['install']['step'] != $step && (empty($_POST['admin_login']) || empty($_POST['admin_password']) || ($_POST['admin_password'] != $_POST['admin_password_verif']))) {
header('location: config.php?err=1');
}
if($_SESSION['install']['step'] == 5) {
$admin = new \Thelia\Model\Admin();
$admin->setLogin($_POST['admin_login'])
->setPassword($_POST['admin_password'])
->setFirstname('admin')
->setLastname('admin')
->save();
$config = new \Thelia\Model\Config();
$config->setName('contact_email')
->setValue($_POST['email_contact'])
->save();
;
}
$_SESSION['install']['step'] = $step;
?>
<div class="well">
<p class="lead text-center">
Thank you have installed Thelia
</p>
<p class="lead text-center">
Don't forget to delete the web/install directory.
</p>
</div>
<?php include "footer.php"; ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

41
web/install/footer.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
?>
</div>
</div>
</div>
</div>
</div>
<hr />
<footer class="footer">
<div class="container">
<p>&copy; Thelia 2013
- <a href="http://www.openstudio.fr/" target="_blank">Édité par OpenStudio</a>
- <a href="http://forum.thelia.net/" target="_blank">Forum Thelia</a>
- <a href="http://contrib.thelia.net/" target="_blank">Contributions Thelia</a>
</p>
</div>
</footer>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
</body>
</html>

59
web/install/header.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
session_start();
include 'bootstrap.php';
?>
<!DOCTYPE html>
<html lang="">
<head>
<title>Installation</title>
<link rel="shortcut icon" href="fd33fd0-6fda040.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="topbar">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="version-info">Version undefined</div>
</div>
</div>
</div>
</div>
<div class="install">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<h3 class="title title-without-tabs">Thelia installation wizard</h3>
<div class="wizard">
<ul>
<li class="<?php if($step == 1){ echo 'active'; } elseif ($step > 1) { echo 'complete'; }?>"><span class="badge">1</span>Welcome<span class="chevron"></span></li>
<li class="<?php if($step == 2){ echo 'active'; } elseif ($step > 2) { echo 'complete'; }?>"><span class="badge">2</span>Checking permissions<span class="chevron"></span></li>
<li class="<?php if($step == 3){ echo 'active'; } elseif ($step > 3) { echo 'complete'; }?>"><span class="badge">3</span>Database connection<span class="chevron"></span></li>
<li class="<?php if($step == 4){ echo 'active'; } elseif ($step > 4) { echo 'complete'; }?>"><span class="badge">4</span>Database selection<span class="chevron"></span></li>
<li class="<?php if($step == 5){ echo 'active'; } elseif ($step > 5) { echo 'complete'; }?>"><span class="badge">5</span>General information<span class="chevron"></span></li>
<li class="<?php if($step == 6){ echo 'active'; } elseif ($step > 6) { echo 'complete'; }?>"><span class="badge">6</span>Thanks<span class="chevron"></span></li>
</ul>
</div>

39
web/install/index.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
?>
<?php
$step = 1;
include("header.php");
?>
<div class="well">
<p class="lead text-center">
Welcome in the Thelia installation wizard.
</p>
<p class="text-center">
We will guide you throughout this process to install any application on your system.
</p>
</div>
<div class="clearfix">
<a href="permission.php" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> Continue</a>
</div>
<?php include("footer.php"); ?>

View File

@@ -0,0 +1,56 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
?>
<?php
$step = 2;
include("header.php");
global $thelia;
$checkPermission = new \Thelia\Install\CheckPermission(true, $thelia->getContainer()->get('thelia.translator'));
$isValid = $checkPermission->exec();
$validationMessage = $checkPermission->getValidationMessages();
$_SESSION['install']['return_step'] = 'permission.php';
$_SESSION['install']['continue'] = $isValid;
$_SESSION['install']['current_step'] = 'permission.php';
$_SESSION['install']['step'] = 2;
?>
<div class="well">
<p>Checking permissions</p>
<ul class="list-unstyled list-group">
<?php foreach($validationMessage as $item => $data): ?>
<li class="list-group-item <?php if ($data['status']) {echo 'text-success';} else { echo 'text-danger';} ?>">
<?php echo $data['text']; ?>
<?php if (!$data['status']) { echo $data['hint']; } ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="clearfix">
<?php if($isValid){ ?>
<a href="connection.php" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> Continue</a>
<?php } else { ?>
<a href="permission.php" class="pull-right btn btn-default btn-danger"><span class="glyphicon glyphicon-refresh"></span> refresh</a>
<?php } ?>
</div>
<?php include("footer.php"); ?>

1999
web/install/script.js Normal file

File diff suppressed because it is too large Load Diff

7534
web/install/styles.css Normal file

File diff suppressed because one or more lines are too long