This commit is contained in:
Manuel Raynaud
2014-01-10 11:41:55 +01:00
parent ab0fbb6e27
commit 9d0121f321
54 changed files with 220 additions and 290 deletions

View File

@@ -53,9 +53,8 @@ abstract class BaseInstall
throw new AlreadyInstallException("Thelia is already installed");
}
$this->exec();
}
abstract public function exec();
}
}

View File

@@ -24,12 +24,8 @@
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

View File

@@ -28,7 +28,6 @@ use RecursiveIteratorIterator;
use Symfony\Component\Translation\TranslatorInterface;
use Thelia\Core\Translation\Translator;
/**
* Class CheckPermission
*
@@ -164,9 +163,6 @@ class CheckPermission extends BaseInstall
}
}
return $this->isValid;
}
@@ -200,7 +196,6 @@ class CheckPermission extends BaseInstall
return (is_writable(THELIA_ROOT . $directory) === true);
}
/**
* Get Translated text about the directory state
*
@@ -269,7 +264,6 @@ class CheckPermission extends BaseInstall
return $translatedText;
}
/**
* Get Translated text about the directory state
* Not usable with CLI
@@ -382,7 +376,7 @@ class CheckPermission extends BaseInstall
{
$serverValueInBytes = $this->returnBytes(ini_get($key));
if($serverValueInBytes == -1) {
if ($serverValueInBytes == -1) {
return true;
}
@@ -400,7 +394,7 @@ class CheckPermission extends BaseInstall
{
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
switch ($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;

View File

@@ -23,7 +23,6 @@
namespace Thelia\Install;
/**
* Class Database
* @package Thelia\Install
@@ -112,4 +111,4 @@ class Database
)
);
}
}
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Install\Exception;
/**
* Class AlreadyInstallException
* @package Thelia\Install\Exception
@@ -32,4 +31,4 @@ namespace Thelia\Install\Exception;
class AlreadyInstallException extends InstallException
{
}
}

View File

@@ -29,4 +29,4 @@ namespace Thelia\Install\Exception;
class InstallException extends \RuntimeException
{
}
}

View File

@@ -23,7 +23,6 @@
namespace Thelia\Install\Exception;
/**
* Class UpToDateException
* @package Thelia\Install\Exception
@@ -32,4 +31,4 @@ namespace Thelia\Install\Exception;
class UpToDateException extends InstallException
{
}
}

View File

@@ -29,13 +29,12 @@ use Thelia\Log\Tlog;
use Thelia\Model\ConfigQuery;
use Thelia\Model\Map\ProductTableMap;
/**
* Class Update
* @package Thelia\Install
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class Update
class Update
{
protected static $version = array(
'0' => '2.0.0-beta1',
@@ -61,7 +60,7 @@ class Update
$currentVersion = ConfigQuery::read('thelia_version');
$logger->debug("start update process");
if(true === $this->isLatestVersion($currentVersion)) {
if (true === $this->isLatestVersion($currentVersion)) {
$logger->debug("You already have the latest version. No update available");
throw new UpToDateException('You already have the latest version. No update available');
}
@@ -78,7 +77,7 @@ class Update
}
$con->commit();
$logger->debug('update successfully');
} catch(PropelException $e) {
} catch (PropelException $e) {
$con->rollBack();
$logger->error(sprintf('error during update process with message : %s', $e->getMessage()));
throw $e;
@@ -99,4 +98,4 @@ class Update
ConfigQuery::write('thelia_version', $version);
}
}
}