Merge branch 'master' of https://github.com/alchemy-fr/Phraseanet into PHRAS-2122-subview-setup-default-path

This commit is contained in:
aina-esokia
2018-07-20 17:44:58 +04:00
15 changed files with 2127 additions and 1954 deletions

View File

@@ -12,6 +12,7 @@ namespace Alchemy\Phrasea\Controller;
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Configuration\StructureTemplate;
use Alchemy\Phrasea\SearchEngine\Elastic\ElasticsearchOptions;
use Alchemy\Phrasea\Setup\RequirementCollectionInterface;
use Alchemy\Phrasea\Setup\Requirements\BinariesRequirements;
use Alchemy\Phrasea\Setup\Requirements\FilesystemRequirements;
@@ -82,6 +83,7 @@ class SetupController extends Controller
'locale' => $this->app['locale'],
'available_locales' => Application::getAvailableLanguages(),
'available_templates' => $st->getNames(),
'elasticOptions' => ElasticsearchOptions::fromArray([]),
'warnings' => $warnings,
'error' => $request->query->get('error'),
'current_servername' => $request->getScheme() . '://' . $request->getHttpHost() . '/',
@@ -106,6 +108,20 @@ class SetupController extends Controller
$appbox_name = $request->request->get('ab_name');
$databox_name = $request->request->get('db_name');
$elastic_settings = $request->request->get('elasticsearch_settings');
$elastic_settings = [
'host' => (string) $elastic_settings['host'],
'port' => (int) $elastic_settings['port'],
'index' => (string) (isset($elastic_settings['index_name']) ? $elastic_settings['index_name'] : ''),
'shards' => (int) $elastic_settings['shards'],
'replicas' => (int) $elastic_settings['replicas'],
'minScore' => (int) $elastic_settings['min_score'],
'highlight' => (bool) (isset($elastic_settings['highlight']) ? $elastic_settings['highlight'] : false)
];
$elastic_settings = ElasticsearchOptions::fromArray($elastic_settings);
try {
$abInfo = [
'host' => $database_host,
@@ -181,6 +197,12 @@ class SetupController extends Controller
$this->app->getAuthenticator()->openAccount($user);
if(empty($elastic_settings->getHost())){
$elastic_settings = ElasticsearchOptions::fromArray([]);
}
$this->app['conf']->set(['main', 'search-engine', 'options'], $elastic_settings->toArray());
return $this->app->redirectPath('admin', [
'section' => 'taskmanager',
'notice' => 'install_success',

View File

@@ -23,7 +23,7 @@ use Silex\ServiceProviderInterface;
class V1 extends Api implements ControllerProviderInterface, ServiceProviderInterface
{
const VERSION = '1.5.0';
const VERSION = '2.0.0';
public static $extendedContentTypes = [
'json' => ['application/vnd.phraseanet.record-extended+json'],

View File

@@ -94,8 +94,8 @@ class FtpPullJob extends AbstractJob
}
$ftp = $app['phraseanet.ftp.client']($host, $port, 90, $ssl, $proxy, $proxyport);
$ftp->passive($passive);
$ftp->login($user, $password);
$ftp->passive($passive);
$ftp->chdir($ftpPath);
$list_1 = $ftp->list_directory(true);

View File

@@ -401,6 +401,10 @@ class ftpclient
$current_dir = $this->pwd();
$contents = ftp_rawlist($this->connexion, $current_dir, ! ! $recursive);
if($contents === false){
throw new Exception('Vérifier les paramètres ftp ou mettre en mode passive');
}
$list = [];
foreach ($contents as $content) {