41 lines
1.5 KiB
PHP
41 lines
1.5 KiB
PHP
<?php
|
|
/*************************************************************************************/
|
|
/* This file is part of the Thelia package. */
|
|
/* */
|
|
/* Copyright (c) OpenStudio */
|
|
/* email : dev@thelia.net */
|
|
/* web : http://www.thelia.net */
|
|
/* */
|
|
/* For the full copyright and license information, please view the LICENSE.txt */
|
|
/* file that was distributed with this source code. */
|
|
/*************************************************************************************/
|
|
|
|
namespace Slide;
|
|
|
|
use Propel\Runtime\Connection\ConnectionInterface;
|
|
use Slide\Model\SlideItemQuery;
|
|
use Thelia\Install\Database;
|
|
use Thelia\Module\BaseModule;
|
|
|
|
class Slide extends BaseModule
|
|
{
|
|
public function preActivation(ConnectionInterface $con = null)
|
|
{
|
|
$injectSql = false;
|
|
|
|
try {
|
|
$item = SlideItemQuery::create()->findOne();
|
|
} catch (\Exception $ex) {
|
|
// the table doest not exist
|
|
$injectSql = true;
|
|
}
|
|
|
|
if (true === $injectSql) {
|
|
$database = new Database($con);
|
|
$database->insertSql(null, array(__DIR__ . '/Config/thelia.sql'));
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|