Merge pull request #1261 from bburnichon/feature/install-fixes

Fixup installation process
This commit is contained in:
Nicolas Le Goff
2015-03-04 19:35:57 +01:00
5 changed files with 40 additions and 58 deletions

View File

@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Model\Entities\ApiApplication;
use Silex\Application;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Process\Process;
class PhraseaInstallSubscriber implements EventSubscriberInterface
{
@@ -37,6 +38,7 @@ class PhraseaInstallSubscriber implements EventSubscriberInterface
{
$this->createNavigatorApplication();
$this->createOfficePluginApplication();
$this->generateProxies();
}
private function createNavigatorApplication()
@@ -74,4 +76,11 @@ class PhraseaInstallSubscriber implements EventSubscriberInterface
$this->app['manipulator.api-application']->update($application);
}
private function generateProxies()
{
$process = new Process('php ' . $this->app['root.path']. '/bin/developer orm:generate:proxies');
$process->setTimeout(300);
$process->run();
}
}

View File

@@ -11,6 +11,8 @@
namespace Alchemy\Phrasea\Helper;
use Doctrine\DBAL\Connection;
class DatabaseHelper extends Helper
{
public function checkConnection()
@@ -21,25 +23,9 @@ class DatabaseHelper extends Helper
$password = $this->request->query->get('password');
$db_name = $this->request->query->get('db_name');
$connection_ok = $db_ok = $is_databox = $is_appbox = $empty = false;
$is_databox = $is_appbox = $empty = false;
try {
$connection = $this->app['dbal.provider']([
'host' => $hostname,
'port' => $port,
'user' => $user,
'password' => $password
]);
$connection->connect();
$connection_ok = true;
$connection->close();
} catch (\Exception $e) {
}
unset($connection);
if (null !== $db_name && $connection_ok) {
try {
/** @var Connection $connection */
$connection = $this->app['dbal.provider']([
'host' => $hostname,
'port' => $port,
@@ -48,8 +34,7 @@ class DatabaseHelper extends Helper
'dbname' => $db_name,
]);
$db_ok = true;
if (false !== $dbOK = $connection->isConnected()) {
$sql = "SHOW TABLE STATUS";
$stmt = $connection->prepare($sql);
$stmt->execute();
@@ -68,19 +53,16 @@ class DatabaseHelper extends Helper
}
}
$connection->close();
} catch (\Exception $e) {
}
unset($connection);
}
$this->app['connection.pool.manager']->closeAll();
return [
'connection' => $connection_ok,
'connection' => $dbOK,
'innodb' => true,
'database' => $db_ok,
'database' => $dbOK,
'is_empty' => $empty,
'is_appbox' => $is_appbox,
'is_databox' => $is_databox

View File

@@ -1,4 +0,0 @@
{
"directory": "www/assets",
"interactive": false
}

View File

@@ -145,16 +145,12 @@ then
#copy configuration template
mv /var/www/phraseanet/lib/conf.d/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml.bkp
cp /vagrant/resources/vagrant/config/phraseanet/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml
mv /var/www/phraseanet/.bowerrc /var/www/phraseanet/.bowerrc.bkp
cp /vagrant/resources/vagrant/config/bower/.bowerrc /var/www/phraseanet/.bowerrc
cd /var/www/phraseanet
sudo -u vagrant composer install -n --prefer-source --dev
sudo -u vagrant npm install
sudo -u vagrant grunt install-assets
sudo -u vagrant bin/developer assets:compile-less
sudo -u vagrant rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
rm -f /var/www/phraseanet/.bowerrc
mv /www/phraseanet/.bowerrc.bkp /www/phraseanet/.bowerrc
mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml
fi
@@ -168,4 +164,3 @@ sudo service iptables-persistent stop
# reload bash
source ~/.bashrc

View File

@@ -654,7 +654,7 @@
<table class="main_content_table">
<tr>
<td><label>{{ 'Repertoire de stockage des fichiers' | trans }}</label></td>
<td><input class="path_to_test test_writeable required" type="text" name="datapath_noweb" value="" /></td>
<td><input class="path_to_test test_writeable required" type="text" name="datapath_noweb" value="{{ rootpath ~ '/datas' }}" /></td>
</tr>
</table>
</td>