mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
add more options during install
This commit is contained in:
@@ -111,7 +111,7 @@ main:
|
|||||||
download: null
|
download: null
|
||||||
lazaret: null
|
lazaret: null
|
||||||
caption: null
|
caption: null
|
||||||
tmp_files: null
|
worker_tmp_files: null
|
||||||
border-manager:
|
border-manager:
|
||||||
enabled: true
|
enabled: true
|
||||||
extension-mapping:
|
extension-mapping:
|
||||||
|
@@ -55,6 +55,11 @@ class Install extends Command
|
|||||||
->addOption('es-host', null, InputOption::VALUE_OPTIONAL, 'ElasticSearch server HTTP host', 'localhost')
|
->addOption('es-host', null, InputOption::VALUE_OPTIONAL, 'ElasticSearch server HTTP host', 'localhost')
|
||||||
->addOption('es-port', null, InputOption::VALUE_OPTIONAL, 'ElasticSearch server HTTP port', 9200)
|
->addOption('es-port', null, InputOption::VALUE_OPTIONAL, 'ElasticSearch server HTTP port', 9200)
|
||||||
->addOption('es-index', null, InputOption::VALUE_OPTIONAL, 'ElasticSearch index name', null)
|
->addOption('es-index', null, InputOption::VALUE_OPTIONAL, 'ElasticSearch index name', null)
|
||||||
|
->addOption('download-path', null, InputOption::VALUE_OPTIONAL, 'Path to download repository', '/var/alchemy/Phraseanet/tmp/download')
|
||||||
|
->addOption('lazaret-path', null, InputOption::VALUE_OPTIONAL, 'Path to lazaret repository', '/var/alchemy/Phraseanet/tmp/lazaret')
|
||||||
|
->addOption('caption-path', null, InputOption::VALUE_OPTIONAL, 'Path to caption repository', '/var/alchemy/Phraseanet/tmp/caption')
|
||||||
|
->addOption('scheduler-locks-path', null, InputOption::VALUE_OPTIONAL, 'Path to scheduler-locks repository', '/var/alchemy/Phraseanet/tmp/locks')
|
||||||
|
->addOption('worker-tmp-files', null, InputOption::VALUE_OPTIONAL, 'Path to worker-tmp-files repository', '/var/alchemy/Phraseanet/tmp')
|
||||||
->addOption('yes', 'y', InputOption::VALUE_NONE, 'Answer yes to all questions');
|
->addOption('yes', 'y', InputOption::VALUE_NONE, 'Answer yes to all questions');
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@@ -151,6 +156,7 @@ class Install extends Command
|
|||||||
|
|
||||||
$this->container['phraseanet.installer']->install($email, $password, $abConn, $serverName, $dataPath, $dbConn, $templateName, $this->detectBinaries());
|
$this->container['phraseanet.installer']->install($email, $password, $abConn, $serverName, $dataPath, $dbConn, $templateName, $this->detectBinaries());
|
||||||
$this->container['conf']->set(['main', 'search-engine', 'options'], $esOptions->toArray());
|
$this->container['conf']->set(['main', 'search-engine', 'options'], $esOptions->toArray());
|
||||||
|
$this->defineStorageTmpPath($input);
|
||||||
|
|
||||||
if (null !== $this->getApplication()) {
|
if (null !== $this->getApplication()) {
|
||||||
$command = $this->getApplication()->find('crossdomain:generate');
|
$command = $this->getApplication()->find('crossdomain:generate');
|
||||||
@@ -387,6 +393,53 @@ class Install extends Command
|
|||||||
return $index;
|
return $index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function defineStorageTmpPath(InputInterface $input)
|
||||||
|
{
|
||||||
|
$downloadPath = $input->getOption('download-path');
|
||||||
|
|
||||||
|
if (!is_dir($downloadPath)) {
|
||||||
|
mkdir($downloadPath, 0755, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$lazaretPath = $input->getOption('lazaret-path');
|
||||||
|
|
||||||
|
if (!is_dir($lazaretPath)) {
|
||||||
|
mkdir($lazaretPath, 0755, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$captionPath = $input->getOption('caption-path');
|
||||||
|
|
||||||
|
if (!is_dir($captionPath)) {
|
||||||
|
mkdir($captionPath, 0755, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$workerTmpFiles = $input->getOption('worker-tmp-files');
|
||||||
|
|
||||||
|
if (!is_dir($workerTmpFiles)) {
|
||||||
|
mkdir($workerTmpFiles, 0755, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$schedulerLocksPath = $input->getOption('scheduler-locks-path');
|
||||||
|
|
||||||
|
if (!is_dir($schedulerLocksPath)) {
|
||||||
|
mkdir($schedulerLocksPath, 0755, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($schedulerLocksPath = realpath($schedulerLocksPath)) === FALSE) {
|
||||||
|
throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $schedulerLocksPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
$config = $this->container['configuration.store']->initialize()->getConfig();
|
||||||
|
|
||||||
|
$config['main']['storage']['download'] = realpath($downloadPath);
|
||||||
|
$config['main']['storage']['lazaret'] = realpath($lazaretPath);
|
||||||
|
$config['main']['storage']['caption'] = realpath($captionPath);
|
||||||
|
$config['main']['storage']['worker_tmp_files'] = realpath($workerTmpFiles);
|
||||||
|
|
||||||
|
$this->container['configuration.store']->setConfig($config);
|
||||||
|
}
|
||||||
|
|
||||||
private function detectBinaries()
|
private function detectBinaries()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -181,8 +181,8 @@ class UploadController extends Controller
|
|||||||
$uploadedFilename = $file->getRealPath();
|
$uploadedFilename = $file->getRealPath();
|
||||||
$renamedFilename = null;
|
$renamedFilename = null;
|
||||||
|
|
||||||
if(!empty($this->app['conf']->get(['main', 'storage', 'tmp_files']))) {
|
if(!empty($this->app['conf']->get(['main', 'storage', 'worker_tmp_files']))) {
|
||||||
$tmpStorage = \p4string::addEndSlash($this->app['conf']->get(['main', 'storage', 'tmp_files'])).'upload/';
|
$tmpStorage = \p4string::addEndSlash($this->app['conf']->get(['main', 'storage', 'worker_tmp_files'])).'upload/';
|
||||||
|
|
||||||
if(!is_dir($tmpStorage)){
|
if(!is_dir($tmpStorage)){
|
||||||
$this->getFilesystem()->mkdir($tmpStorage);
|
$this->getFilesystem()->mkdir($tmpStorage);
|
||||||
|
@@ -57,7 +57,7 @@ class SubdefGenerator
|
|||||||
$this->filesystem = $filesystem;
|
$this->filesystem = $filesystem;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->mediavorus = $mediavorus;
|
$this->mediavorus = $mediavorus;
|
||||||
$this->tmpDirectory = $this->app['conf']->get(['main', 'storage', 'tmp_files']);;
|
$this->tmpDirectory = $this->app['conf']->get(['main', 'storage', 'worker_tmp_files']);;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateSubdefs(\record_adapter $record, array $wanted_subdefs = null)
|
public function generateSubdefs(\record_adapter $record, array $wanted_subdefs = null)
|
||||||
|
@@ -211,9 +211,6 @@ class Installer
|
|||||||
|
|
||||||
$config['main']['storage']['cache'] = realpath(__DIR__ . '/../../../../cache');
|
$config['main']['storage']['cache'] = realpath(__DIR__ . '/../../../../cache');
|
||||||
$config['main']['storage']['log'] = realpath(__DIR__ . '/../../../../logs');
|
$config['main']['storage']['log'] = realpath(__DIR__ . '/../../../../logs');
|
||||||
$config['main']['storage']['download'] = realpath(__DIR__ . '/../../../../tmp/download');
|
|
||||||
$config['main']['storage']['lazaret'] = realpath(__DIR__ . '/../../../../tmp/lazaret');
|
|
||||||
$config['main']['storage']['caption'] = realpath(__DIR__ . '/../../../../tmp/caption');
|
|
||||||
|
|
||||||
$config['registry'] = $this->app['registry.manipulator']->getRegistryData();
|
$config['registry'] = $this->app['registry.manipulator']->getRegistryData();
|
||||||
|
|
||||||
|
@@ -111,7 +111,7 @@ main:
|
|||||||
download: null
|
download: null
|
||||||
lazaret: null
|
lazaret: null
|
||||||
caption: null
|
caption: null
|
||||||
tmp_files: null
|
worker_tmp_files: null
|
||||||
|
|
||||||
trusted-proxies: []
|
trusted-proxies: []
|
||||||
debugger:
|
debugger:
|
||||||
|
Reference in New Issue
Block a user