29 lines
775 B
PHP
29 lines
775 B
PHP
<?php
|
|
|
|
namespace KupShop\DevelopmentBundle\Resources\upgrades;
|
|
|
|
class CreateSharedDBUpgrade extends \UpgradeNew
|
|
{
|
|
protected $priority = -900;
|
|
|
|
public function check_dbExists()
|
|
{
|
|
return $this->checkDatabaseExists('kupshop_shared') || $this->checkTableExists('greeting_name', 'kupshop_shared');
|
|
}
|
|
|
|
/** Create shared kupshop database */
|
|
public function upgrade_dbExists()
|
|
{
|
|
global $cfg;
|
|
$command = sprintf(
|
|
'mysql -u %s -h %s -p%s %s < %s',
|
|
$cfg['Connection']['user'],
|
|
$cfg['Connection']['host'],
|
|
$cfg['Connection']['password'],
|
|
$cfg['Connection']['database'],
|
|
__DIR__.'/database_shared.sql'
|
|
);
|
|
exec($command, $output, $return);
|
|
}
|
|
}
|