Update directory structure & allow to configure paths (tmp, log, cache)

This commit is contained in:
Nicolas Le Goff
2014-09-05 11:28:25 +02:00
parent 69fd50906f
commit de7988689e
2201 changed files with 850 additions and 13650 deletions

72
.gitignore vendored
View File

@@ -1,20 +1,62 @@
# Exclude common IDE project files
/nbproject
/config/custom_files
/config/templates
/config/topics
/config/wm
/config/minilogos
/config/status
/config/stamp
/config/configuration.yml
/vendor
/plugins
/node_modules
composer.phar
behat.yml
/datas
/.idea
# Exclude javascript dependencies folder
/www/assets
/tmp-assets
# Exclude node.js dependencies folder
/node_modules
# Exclude compiled LESS folder
/www/skins/build
/www/crossdomain.xml
# Exclude compiled javascript test fixture folder
/www/scripts/tests/fixtures
# Exclude configuration folder exception the configuration sample file
/config
!/config/configuration.sample.yml
# Exclude generated proxies from doctrine2
/resources/proxies
# Exclude temporaries resources (zip files, quarantine documents etc ..) folder
/tmp
# Exclude cache folder
/cache
# Exclude log folder
/logs
# Exclude plugin folder
/plugins
# Excluse assets plugin folder
/www/plugins
# Exclude folder for storing documents (images, videos, PDF) and their sub-definitions
/datas
# Exclude dependencies folder
/vendor
# Exclude package's binaries folder except the Phraseanet's ones
/bin
!/bin/console
!/bin/developer
!/bin/setup
# Exclude composer
composer.phar
# Exclude behat configuration file
behat.yml
# Exclude vagrant configuration file
.vagrant
# Exclude crossdomain.xml file it's generated
/www/crossdomain.xml

View File

@@ -61,7 +61,7 @@ script:
bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y -v;
bin/developer ini:setup-tests-dbs -v;
fi"
- php hudson/cleanupSubdefs.php
- php resources/hudson/cleanupSubdefs.php
#sqlite db generation should occur once Phraseanet is up to date :
- bin/developer phraseanet:regenerate-sqlite
- ./node_modules/.bin/grunt test

View File

@@ -20,7 +20,8 @@ module.exports = function(grunt) {
all: ['www/include/js/tests/*.html']
},
clean: {
"assets": ["<%= path.bower %>", "<%= path.asset %>"]
"assets": ["<%= path.asset %>"],
"bower": ["<%= path.bower %>"]
},
bower: {
install: {
@@ -253,6 +254,32 @@ module.exports = function(grunt) {
"dest": "<%= path.asset %>/normalize-css/",
"flatten": true
},
"sinon-chai": {
"expand": true,
"src": [
"<%= path.bower %>/sinon-chai/lib/sinon-chai.js",
"<%= path.bower %>/sinon-chai/LICENCE.txt",
],
"dest": "<%= path.asset %>/sinon-chai/",
"flatten": true
},
"sinonjs": {
"expand": true,
"src": [
"<%= path.bower %>/sinonjs/sinon.js"
],
"dest": "<%= path.asset %>/sinonjs/",
"flatten": true
},
"squire": {
"expand": true,
"src": [
"<%= path.bower %>/squire/src/Squire.js",
"<%= path.bower %>/squire/LICENCE"
],
"dest": "<%= path.asset %>/squire/",
"flatten": true
},
"qunit": {
"expand": true,
"src": [
@@ -390,6 +417,7 @@ module.exports = function(grunt) {
"copy:blueimp",
"copy:bootstrap",
"copy:bootstrap-multiselect",
"copy:chai",
"copy:font-awesome",
"copy:geonames-server-jquery-plugin",
"copy:humane-js",
@@ -402,9 +430,16 @@ module.exports = function(grunt) {
"copy:jquery-ui",
"copy:jquery.treeview",
"copy:json2",
"copy:js-fixtures",
"copy:modernizr",
"copy:normalize",
"copy:normalize",
"copy:qunit",
"copy:mocha",
"copy:requirejs",
"copy:sinon-chai",
"copy:sinonjs",
"copy:squire",
"copy:swfobject",
"copy:tinymce",
"copy:underscore",
@@ -416,7 +451,8 @@ module.exports = function(grunt) {
"bower",
"copy-deps",
"bower_postinst",
"copy-assets"
"copy-assets",
"clean:bower"
]);
grunt.registerTask('test', ["shell:generate_js_fixtures", "qunit", "mocha_phantomjs"]);
};

12
Vagrantfile vendored
View File

@@ -1,11 +1,15 @@
require 'yaml'
unless Vagrant.has_plugin?("vagrant-hostsupdater")
raise 'vagrant-hostmanager is not installed! please run "vagrant plugin install vagrant-hostsupdater'
end
root = File.dirname(File.expand_path(__FILE__))
Vagrant.configure("2") do |config|
Dir.glob(root+"/vagrant/vms/**/puphpet/config.yaml").each do|f|
dir = File.dirname(File.expand_path(f)+"/..")
base_path = dir[0..-21]
Dir.glob(root+"/resources/vagrant/vms/**/puphpet/config.yaml").each do|f|
dir = File.dirname(File.expand_path(f+"/.."))
base_path = dir
configValues = YAML.load_file(f)
data = configValues['vagrantfile-local']
@@ -167,7 +171,7 @@ Vagrant.configure("2") do |config|
node.vm.provision "shell" do |s|
s.path = "#{base_path}/puphpet/shell/initial-setup.sh"
s.args = "/vagrant/vagrant/vms/#{data['name']}/puphpet"
s.args = "/vagrant/resources/vagrant/vms/#{data['name']}/puphpet"
end
node.vm.provision "shell" do |kg|

View File

@@ -79,8 +79,12 @@ main:
host: 127.0.0.1
port: 6700
storage:
subdefs:
default-dir: null
subdefs:null
cache: null
log : null
download: null
lazaret: null
caption: null
bridge:
youtube:
enabled: false

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

View File

@@ -1,2 +0,0 @@
*
!.gitignore

0
config/topics/.gitkeep Normal file
View File

View File

@@ -1,2 +0,0 @@
*
!.gitignore

0
config/wm/.gitkeep Normal file
View File

0
datas/.gitkeep Normal file
View File

View File

@@ -1,4 +0,0 @@
dailymotion:
public_key:
secret_key:
dev_token:

View File

@@ -1,74 +0,0 @@
<?php
require_once __DIR__ . '/../../vendor/autoload.php';
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Yaml;
$console = new Application('Functionnal tests for dailymotion API');
$console
->register('upload:dailymotion')
->setDescription('Test upload on dailymotion API')
->setCode(function (InputInterface $input, OutputInterface $output) use ($core) {
try {
$configuration = Yaml::parse(__DIR__. '/config/keys.conf.yml');
} catch(\Exception $e) {
$output->writeln('<error>could not parse configuration file</error>');
return;
}
$appbox = \appbox::get_instance($core);
$found = false;
foreach ($appbox->get_databoxes() as $databox) {
/* @var $databox \databox */
$sql = 'SELECT record_id FROM record WHERE type="video" AND (
mime="video/mp4" OR mime="video/quicktime" OR mime="video/x-msvideo" OR mime="video/x-msvideo"
) LIMIT 1';
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute();
$rows = $stmt->fetch(\PDO::FETCH_ASSOC);
if(1 === count($rows)) {
$found = true;
$record = $databox->get_record($rows['record_id']);
break;
}
unset($stmt);
}
if (!$found) {
$output->writeln('<error>No video found, </error>');
return;
}
$bridge = new \Bridge_Api_Dailymotion($core['Registry'], new \Bridge_Api_Auth_OAuth2());
$bridge->set_oauth_token($configuration['dailymotion']['dev_token']);
$options = [];
$samples = [
'title' => $record->get_title(),
'description' => 'Upload functionnal test',
'tags' => 'phraseanet upload test dm api',
'private' => true,
];
foreach($bridge->get_fields() as $field) {
$options[$field['name']] = isset($samples[$field['name']]) ? $samples[$field['name']] : uniqid('test_upload');
}
try {
$idVideo = $bridge->upload($record, $options);
$output->writeln(sprintf('<info>video id is %s</info>', $idVideo));
} catch(\Bridge_Exception_ActionAuthNeedReconnect $e) {
$output->writeln(sprintf('<error>Invalid token %s</error>', $configuration['dailymotion']['dev_token']));
} catch(\Exception $e) {
$output->writeln(sprintf('<error>%s : %s -> %s</error>',get_class($e), $e->getMessage(), $e->getTraceAsString()));
}
});
$console->run();

View File

@@ -188,25 +188,25 @@ class Application extends SilexApplication
error_reporting(-1);
$this['root.path'] = realpath(__DIR__ . '/../../..');
$this->environment = $environment;
mb_internal_encoding("UTF-8");
$this->setupApplicationPaths($this);
$this['charset'] = 'UTF-8';
mb_internal_encoding($this['charset']);
!defined('JETON_MAKE_SUBDEF') ? define('JETON_MAKE_SUBDEF', 0x01) : '';
!defined('JETON_WRITE_META_DOC') ? define('JETON_WRITE_META_DOC', 0x02) : '';
!defined('JETON_WRITE_META_SUBDEF') ? define('JETON_WRITE_META_SUBDEF', 0x04) : '';
!defined('JETON_WRITE_META') ? define('JETON_WRITE_META', 0x06) : '';
$this['charset'] = 'UTF-8';
$this['debug'] = $this->share(function (Application $app) {
return Application::ENV_PROD !== $app->getEnvironment();
});
if ($this['debug'] === true) {
ini_set('log_errors', 'on');
ini_set('error_log', $this['root.path'] . '/logs/php_error.log');
ini_set('error_log', $this['root.path'].'/logs/php_error.log');
}
$this->register(new BasketMiddlewareProvider());
@@ -218,6 +218,7 @@ class Application extends SilexApplication
$this->register(new AuthenticationManagerServiceProvider());
$this->register(new BorderManagerServiceProvider());
$this->register(new BrowserServiceProvider());
$this->register(new FilesystemServiceProvider());
$this->register(new ConfigurationServiceProvider());
$this->register(new ConfigurationTesterServiceProvider);
$this->register(new ConvertersServiceProvider());
@@ -229,7 +230,6 @@ class Application extends SilexApplication
$this->register(new JMSSerializerServiceProvider());
$this->register(new FFMpegServiceProvider());
$this->register(new FeedServiceProvider());
$this->register(new FilesystemServiceProvider());
$this->register(new FtpServiceProvider());
$this->register(new GeonamesServiceProvider());
$this['geonames.server-uri'] = $this->share(function (Application $app) {
@@ -333,7 +333,7 @@ class Application extends SilexApplication
$this->register(new TokensServiceProvider());
$this->register(new TwigServiceProvider(), [
'twig.options' => [
'cache' => $this['root.path'].'/tmp/cache_twig/',
'cache' => $this->share(function($app) {return $app['cache.path'].'/twig';}),
],
]);
@@ -341,7 +341,7 @@ class Application extends SilexApplication
'locale_fallbacks' => ['fr'],
'translator.cache-options' => [
'debug' => $this['debug'],
'cache_dir' => $this['root.path'].'/tmp/translations'
'cache_dir' => $this->share(function($app) {return $app['cache.path'].'/translations';}),
],
]);
@@ -589,6 +589,8 @@ class Application extends SilexApplication
{
$this['twig'] = $this->share(
$this->extend('twig', function ($twig, $app) {
$twig->setCache($app['cache.path'].'/twig');
$paths = require $app['plugins.directory'] . '/twig-paths.php';
if ($app['browser']->isTablet() || $app['browser']->isMobile()) {
@@ -899,4 +901,92 @@ class Application extends SilexApplication
{
return static::$flashTypes;
}
private function setupApplicationPaths(Application $app)
{
// app root path
$this['root.path'] = realpath(__DIR__ . '/../../..');
// temporary resources default path such as download zip, quarantined documents etc ..
$this['tmp.path'] = $this['root.path'].'/tmp';
// cache path for dev env
$this['cache.dev.path'] = $app->share(function() use ($app) {
$path = sys_get_temp_dir().'/'.md5($app['root.path']);
// ensure path is created
$app['filesystem']->mkdir($path);
return $path;
});
// cache path (twig, minify, translations, configuration, doctrine metas serializer metas, profiler etc ...)
$this['cache.path'] = $app->share(function() use ($app) {
// if ($app->getEnvironment() !== Application::ENV_PROD) {
// return $this['cache.dev.path'];
// }
$path = $this['root.path'].'/cache';
if ($app['phraseanet.configuration']->isSetup()) {
$path = $app['conf']->get(['main', 'storage', 'cache'], $path);
}
// ensure path is created
$app['filesystem']->mkdir($path);
return $path;
});
$app['cache.paths'] = $app->share(function() use ($app) {
return array(
self::ENV_DEV => $this['cache.path'],
self::ENV_TEST => $this['cache.path'],
self::ENV_PROD => $this['cache.path']
);
});
// log path
$this['log.path'] = $app->share(function() use ($app) {
$path = $this['root.path'].'/logs';
if ($app['phraseanet.configuration']->isSetup()) {
return $app['conf']->get(['main', 'storage', 'log'], $path);
}
// ensure path is created
$app['filesystem']->mkdir($path);
return $path;
});
// temporary download file path (zip file)
$this['tmp.download.path'] = $app->share(function() use ($app) {
$path = $this['tmp.path'].'/download';
if ($app['phraseanet.configuration']->isSetup()) {
return $app['conf']->get(['main', 'storage', 'download'], $path);
}
// ensure path is created
$app['filesystem']->mkdir($path);
return $path;
});
// quarantined file path
$this['tmp.lazaret.path'] = $app->share(function() use ($app) {
$path = $this['tmp.path'].'/lazaret';
if ($app['phraseanet.configuration']->isSetup()) {
return $app['conf']->get(['main', 'storage', 'quarantine'], $path);
}
// ensure path is created
$app['filesystem']->mkdir($path);
return $path;
});
// document caption file path
$this['tmp.caption.path'] = $app->share(function() use ($app) {
$path = $this['tmp.path'].'/caption';
if ($app['phraseanet.configuration']->isSetup()) {
return $app['conf']->get(['main', 'storage', 'caption'], $path);
}
// ensure path is created
$app['filesystem']->mkdir($path);
return $path;
});
}
}

View File

@@ -61,7 +61,7 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
if (PhraseaApplication::ENV_DEV === $app->getEnvironment()) {
$app->register($p = new WebProfilerServiceProvider(), [
'profiler.cache_dir' => $app['root.path'].'/tmp/cache/profiler',
'profiler.cache_dir' => $app['cache.path'].'/profiler',
]);
$app->mount('/_profiler', $p);

View File

@@ -196,11 +196,11 @@ class Manager
*/
protected function bookLazaretPathfile($filename, $suffix = '')
{
$output = $this->app['root.path'] . '/tmp/lazaret/lzrt_' . substr($filename, 0, 3) . '_' . $suffix . '.' . pathinfo($filename, PATHINFO_EXTENSION);
$output = $this->app['tmp.path'].'/lazaret/lzrt_' . substr($filename, 0, 3) . '_' . $suffix . '.' . pathinfo($filename, PATHINFO_EXTENSION);
$infos = pathinfo($output);
$n = 0;
$this->app['filesystem']->mkdir($this->app['root.path'] . '/tmp/lazaret');
$this->app['filesystem']->mkdir($this->app['tmp.lazaret.path']);
while (true) {
$output = sprintf('%s/%s-%d%s', $infos['dirname'], $infos['filename'], ++ $n, (isset($infos['extension']) ? '.' . $infos['extension'] : ''));

View File

@@ -100,12 +100,12 @@ class IniReset extends Command
// inject v3.1 fixtures
if ($input->getOption('v3.1')) {
$this->container['filesystem']->copy($this->container['root.path'].'/hudson/connexion.inc', $this->container['root.path'].'/config/connexion.inc');
$this->container['filesystem']->copy($this->container['root.path'].'/hudson/_GV.php', $this->container['root.path'].'/config/_GV.php');
$this->container['filesystem']->copy($this->container['root.path'].'/resources/hudson/connexion.inc', $this->container['root.path'].'/config/connexion.inc');
$this->container['filesystem']->copy($this->container['root.path'].'/resources//hudson/_GV.php', $this->container['root.path'].'/config/_GV.php');
$command = $this->getApplication()->find('dbal:import');
$content = file_get_contents($this->container['root.path'] . '/hudson/fixtures.sql');
$content = file_get_contents($this->container['root.path'] . '/resources//hudson/fixtures.sql');
$content = str_replace('ab_test', $dbs['ab'], $content);
$content = str_replace('db_test', $dbName, $content);

View File

@@ -30,12 +30,12 @@ class JsFixtures extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$dbRefPath = __DIR__ . '/../../../../../tests/db-ref.sqlite';
$dbRefPath = sys_get_temp_dir() . '/db-ref.sqlite';
if (!file_exists($dbRefPath)) {
throw new RuntimeException('You must generate sqlite db first, run "bin/console phraseanet:regenerate-sqlite" command.');
}
copy($dbRefPath, '/tmp/db.sqlite');
copy($dbRefPath, sys_get_temp_dir().'/db.sqlite');
$sbasId = current($this->container['phraseanet.appbox']->get_databoxes())->get_sbas_id();
$this->writeResponse($output, 'GET', '/login/', '/home/login/index.html');

View File

@@ -54,16 +54,16 @@ class RegenerateSqliteDb extends Command
{
parent::__construct('phraseanet:regenerate-sqlite');
$this->setDescription("Updates the sqlite 'tests/db-ref.sqlite' database with current database definition.");
$this->setDescription("Updates the sqlite 'db-ref.sqlite' database with current database definition.");
}
public function doExecute(InputInterface $input, OutputInterface $output)
{
$fs = new Filesystem();
$source = __DIR__ . '/../../../../../tests/db-ref.sqlite';
$target = __DIR__ . '/../../../../../tests/db-ref.sqlite.bkp';
$json = __DIR__ . '/../../../../../tests/fixtures.json';
$source = sys_get_temp_dir().'/db-ref.sqlite';
$target = sys_get_temp_dir().'/db-ref.sqlite.bkp';
$json = sys_get_temp_dir().'/fixtures.json';
$renamed = false;
if (is_file($source)) {

View File

@@ -37,7 +37,7 @@ class SetupTestsDbs extends Command
));
}
$settings = Yaml::parse(file_get_contents(__DIR__ . '/../../../../../hudson/InstallDBs.yml'));
$settings = Yaml::parse(file_get_contents(__DIR__ . '/../../../../../resources/hudson/InstallDBs.yml'));
$dbs = array();

View File

@@ -33,7 +33,6 @@ class Uninstaller extends Command
$root = $this->container['root.path'];
foreach ([
$root.'/tmp/configuration-compiled.php',
$root.'/config/configuration.yml',
$root.'/config/services.yml',
$root.'/config/connexions.yml',
@@ -42,27 +41,48 @@ class Uninstaller extends Command
$root.'/config/connexion.inc',
$root.'/config/_GV.php',
$root.'/config/_GV.php.old',
$root.'/tmp/cache_registry.php',
$root.'/tmp/cache_registry.yml',
$root.'/config/configuration-compiled.php',
] as $file) {
if (is_file($file)) {
if ($this->container['filesystem']->exists($file)) {
unlink($file);
}
}
foreach ([
$root.'/tmp/serializer',
$root.'/tmp/cache_twig',
$root.'/tmp/translations',
$root.'/tmp/cache_minify',
$root.'/tmp/download',
$root.'/tmp/locks',
$root.'/tmp/cache',
] as $dir) {
if (is_dir($dir)) {
$this->container['tmp.download.path'],
$this->container['tmp.lazaret.path'],
$this->container['tmp.caption.path'],
$this->container['tmp.path'].'/sessions',
$this->container['tmp.path'].'/locks',
] as $resource) {
if (is_dir($resource)) {
$finder = new Finder();
foreach ($finder->files()->in($dir) as $file) {
unlink($file);
foreach ($finder->files()->in($resource) as $file) {
$this->container['filesystem']->remove($file);
}
} elseif (is_file($resource)) {
$this->container['filesystem']->remove($resource);
}
}
foreach ($this->container['cache.paths'] as $path) {
foreach ([
$path.'/cache_registry.php',
$path.'/cache_registry.yml',
$path.'/serializer',
$path.'/doctrine',
$path.'/twig',
$path.'/translations',
$path.'/minify',
$path.'/profiler',
] as $resource) {
if (is_dir($resource)) {
$finder = new Finder();
foreach ($finder->files()->in($resource) as $file) {
$this->container['filesystem']->remove($file);
}
} elseif (is_file($resource)) {
$this->container['filesystem']->remove($resource);
}
}
}

View File

@@ -72,8 +72,8 @@ class XSendFileMappingGenerator extends Command
private function computeMapping($paths)
{
return array_merge([
['mount-point' => 'protected_lazaret', 'directory' => $this->container['root.path'] . '/tmp/lazaret'],
['mount-point' => 'protected_download', 'directory' => $this->container['root.path'] . '/tmp/download'],
['mount-point' => 'protected_lazaret', 'directory' => $this->container['tmp.lazaret.path']],
['mount-point' => 'protected_download', 'directory' => $this->container['tmp.download.path']],
], array_map([$this, 'pathsToConf'], array_unique($paths)));
}

View File

@@ -52,7 +52,7 @@ class SchedulerRun extends Command
}
$this->container['signal-handler']->register([SIGINT, SIGTERM], [$this, 'signalHandler']);
$this->container['task-manager']->addSubscriber(new LockFileSubscriber($this->container['task-manager.logger'], $this->container['root.path'].'/tmp/locks'));
$this->container['task-manager']->addSubscriber(new LockFileSubscriber($this->container['task-manager.logger'], $this->container['tmp.path'].'/locks'));
$this->container['task-manager']->start();
}
}

View File

@@ -61,7 +61,7 @@ class TaskRun extends Command
$logger->pushHandler(new RotatingFileHandler($file->getPath(), $this->container['task-manager.logger.configuration']['max-files'], $this->container['task-manager.logger.configuration']['level']));
}
$job->addSubscriber(new LockFileSubscriber('task-'.$task->getId(), $logger, $this->container['root.path'].'/tmp/locks'));
$job->addSubscriber(new LockFileSubscriber('task-'.$task->getId(), $logger, $this->container['tmp.path'].'/locks'));
$job->addSubscriber(new StopSignalSubscriber($this->container['signal-handler'], $logger));
if ($input->getOption('listen-signal')) {

View File

@@ -795,7 +795,7 @@ class Users implements ControllerProviderInterface
$controllers->get('/import/example/csv/', function (Application $app) {
$file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/exampleImportUsers.csv');
$file = new \SplFileInfo($app['root.path'] . '/resources/examples/example_import_users.csv');
if (!$file->isFile()) {
$app->abort(400);
@@ -814,7 +814,7 @@ class Users implements ControllerProviderInterface
$controllers->get('/import/example/rtf/', function (Application $app) {
$file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/Fields.rtf');
$file = new \SplFileInfo($app['root.path'] . '/resources/examples/fields.rtf');
if (!$file->isFile()) {
$app->abort(400);

View File

@@ -519,8 +519,8 @@ class V1 implements ControllerProviderInterface
'report' => [
'anonymous' => $app['conf']->get(['registry', 'modules', 'anonymous-report']),
],
'filesystem' => [
'noWeb' => $app['conf']->get(['main', 'storage', 'subdefs', 'default-dir']),
'storage' => [
'documents' => $app['conf']->get(['main', 'storage', 'subdefs']),
],
'searchEngine' => [
'configuration' => [

View File

@@ -26,9 +26,10 @@ class Minifier implements ControllerProviderInterface
$controllers = $app['controllers_factory'];
$controllers->get('/', function (Application $app, Request $request) {
// cache directory path
$min_cachePath = $app['root.path'] . '/tmp/cache_minify';
$min_cachePath = $app['cache.path'].'/minify';
// ensure path is created
$app['filesystem']->mkdir($min_cachePath);
/**
* Cache file locking. Set to false if filesystem is NFS. On at least one

View File

@@ -136,7 +136,7 @@ class DoDownload implements ControllerProviderInterface
$mime = $subdef['mime'];
$list['complete'] = true;
} else {
$exportFile = $app['root.path'] . '/tmp/download/' . $token->getValue() . '.zip';
$exportFile = $app['tmp.download.path'].'/'.$token->getValue() . '.zip';
$mime = 'application/zip';
}
@@ -184,7 +184,7 @@ class DoDownload implements ControllerProviderInterface
$app,
$token,
$list,
sprintf($app['root.path'] . '/tmp/download/%s.zip', $token->getValue()) // Dest file
sprintf($app['tmp.download.path'].'/%s.zip', $token->getValue()) // Dest file
);
return $app->json([

View File

@@ -223,7 +223,7 @@ class Export implements ControllerProviderInterface
$app,
$token,
$list,
$app['root.path'] . '/tmp/download/' . $token->getValue() . '.zip'
$app['tmp.download.path'].'/'. $token->getValue() . '.zip'
);
$remaingEmails = $destMails;

View File

@@ -126,7 +126,7 @@ class Lazaret implements ControllerProviderInterface
'base_id' => $lazaretFile->getBaseId(),
'created' => $lazaretFile->getCreated()->format(\DateTime::ATOM),
'updated' => $lazaretFile->getUpdated()->format(\DateTime::ATOM),
'pathname' => $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename(),
'pathname' => $app['tmp.lazaret.path'].'/'.$lazaretFile->getFilename(),
'sha256' => $lazaretFile->getSha256(),
'uuid' => $lazaretFile->getUuid(),
];
@@ -174,8 +174,8 @@ class Lazaret implements ControllerProviderInterface
return $app->json($ret);
}
$lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getFilename();
$lazaretThumbFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getThumbFilename();
try {
$borderFile = Border\File::buildFromPathfile(
@@ -294,8 +294,8 @@ class Lazaret implements ControllerProviderInterface
protected function denyLazaretFile(Application $app, LazaretFile $lazaretFile)
{
$lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getFilename();
$lazaretThumbFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getThumbFilename();
$app['EM']->remove($lazaretFile);
$app['EM']->flush();
@@ -386,8 +386,8 @@ class Lazaret implements ControllerProviderInterface
return $app->json($ret);
}
$lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getFilename();
$lazaretThumbFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getThumbFilename();
try {
$media = $app['mediavorus']->guess($lazaretFileName);
@@ -437,7 +437,7 @@ class Lazaret implements ControllerProviderInterface
return new Response(null, 404);
}
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretThumbFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getThumbFilename();
return $app['phraseanet.file-serve']->deliverFile($lazaretThumbFileName, $lazaretFile->getOriginalName(), DeliverDataInterface::DISPOSITION_INLINE, 'image/jpeg', 3600);
}

View File

@@ -252,11 +252,9 @@ class Tools implements ControllerProviderInterface
$dataUri = DataURI\Parser::parse($request->request->get('image', ''));
$path = $app['root.path'] . '/tmp';
$name = sprintf('extractor_thumb_%s', $record->get_serialize_key());
$fileName = sprintf('%s/%s.png', $path, $name);
$fileName = sprintf('%s/%s.png', sys_get_temp_dir(), $name);
file_put_contents($fileName, $dataUri->getData());

View File

@@ -22,12 +22,10 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHa
class SessionHandlerFactory
{
private $connectionFactory;
private $root;
public function __construct(ConnectionFactory $connectionFactory, $root = null)
public function __construct(ConnectionFactory $connectionFactory)
{
$this->connectionFactory = $connectionFactory;
$this->root = __DIR__ . '/../../../../..';
}
/**
@@ -62,7 +60,7 @@ class SessionHandlerFactory
)
);
case 'file':
return new NativeFileSessionHandler($this->root.'/tmp/sessions');
return new NativeFileSessionHandler(isset($options['save-path']) ? $options['save-path'] : null);
case 'redis':
return new WriteCheckSessionHandler(
new RedisSessionHandler(

View File

@@ -21,7 +21,9 @@ class CacheServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
$app['phraseanet.cache-registry'] = $app['root.path'] . '/tmp/cache_registry.php';
$app['phraseanet.cache-registry'] = $app->share(function () use ($app) {
return $app['cache.path'].'/cache_registry.php';
});
$app['phraseanet.cache-compiler'] = $app->share(function () {
return new Compiler();

View File

@@ -34,8 +34,8 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
$app['phraseanet.configuration.compiler'] = $app->share(function (SilexApplication $app) {
return new Compiler();
});
$app['phraseanet.configuration.config-path'] = $app['root.path'] . '/config/configuration.yml';
$app['phraseanet.configuration.config-compiled-path'] = $app['root.path'] . '/tmp/configuration-compiled.php';
$app['phraseanet.configuration.config-path'] = $app['root.path'].'/config/configuration.yml';
$app['phraseanet.configuration.config-compiled-path'] = $app['root.path'].'/config/configuration-compiled.php';
$app['configuration.store'] = $app->share(function (SilexApplication $app) {
return new HostConfiguration(new Configuration(

View File

@@ -21,7 +21,10 @@ class JMSSerializerServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
$app['serializer.cache-directory'] = $app['root.path'] . '/tmp/serializer/';
$app['serializer.cache-directory'] = $app->share(function () use ($app) {
return $app['cache.path'].'/serializer/';
});
$app['serializer.src_directory'] = $app['root.path'] . '/vendor/jms/serializer/src/';
$app['serializer.metadata.annotation_reader'] = $app->share(function () use ($app) {

View File

@@ -37,7 +37,9 @@ class ORMServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
$app['EM.sql-logger.file'] = $app['root.path'] . '/logs/doctrine-log.log';
$app['EM.sql-logger.file'] = $app->share(function (Application $app) {
return $app['log.path'].'/doctrine-log.log';
});
$app['EM.sql-logger.max-files'] = 5;
$app['EM.sql-logger'] = $app->share(function (Application $app) {
@@ -55,7 +57,7 @@ class ORMServiceProvider implements ServiceProviderInterface
$annotationReader = new AnnotationReader();
$fileCacheReader = new FileCacheReader(
$annotationReader,
$app['root.path']."/tmp/doctrine",
$app['cache.path'].'/doctrine',
$app['debug']
);
@@ -97,7 +99,7 @@ class ORMServiceProvider implements ServiceProviderInterface
$config->setMetadataDriverImpl($app['EM.driver']);
$config->setProxyDir($app['root.path'] . '/tmp/doctrine-proxies');
$config->setProxyDir($app['root.path'].'/resources/proxies');
$config->setProxyNamespace('Alchemy\Phrasea\Model\Proxies');
$config->setAutoGenerateProxyClasses($app['debug']);
$config->addEntityNamespace('Phraseanet', 'Alchemy\Phrasea\Model\Entities');

View File

@@ -23,7 +23,7 @@ class SessionHandlerServiceProvider implements ServiceProviderInterface
public function register(Application $app)
{
$app['session.storage.handler.factory'] = $app->share(function (Application $app) {
return new SessionHandlerFactory($app['cache.connection-factory'], $app['root.path']);
return new SessionHandlerFactory($app['cache.connection-factory']);
});
}

View File

@@ -58,7 +58,7 @@ class TasksServiceProvider implements ServiceProviderInterface
});
$app['task-manager.log-file.root'] = $app->share(function (Application $app) {
return $app['root.path'].'/logs';
return $app['log.path'];
});
$app['task-manager.log-file.factory'] = $app->share(function (Application $app) {

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core;
class Version
{
protected static $number = '3.9.0-alpha.18';
protected static $number = '3.9.0-alpha.19';
protected static $name = 'Gorgosaurus';
public static function getNumber()

View File

@@ -205,7 +205,7 @@ class TokenManipulator implements ManipulatorInterface
switch ($token->getType()) {
case 'download':
case 'email':
$file = $this->app['root.path'] . '/tmp/download/' . $token->getValue() . '.zip';
$file = $this->app['tmp.download.path'].'/' . $token->getValue() . '.zip';
if (is_file($file)) {
unlink($file);
}

View File

@@ -59,13 +59,16 @@ class Installer
private function populateRegistryData($serverName, $dataPath)
{
if (null === realpath($dataPath)) {
if (null === $dataPath = realpath($dataPath)) {
throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $dataPath));
}
$dataPath = realpath($dataPath) . DIRECTORY_SEPARATOR;
$this->app['conf']->set(['main', 'storage', 'subdefs', 'default-dir'], $dataPath);
$this->app['conf']->set(['main', 'storage', 'subdefs'], $dataPath);
$this->app['conf']->set(['main', 'storage', 'cache'], realpath(__DIR__ . '/../../../../cache'));
$this->app['conf']->set(['main', 'storage', 'log'], realpath(__DIR__ . '/../../../../logs'));
$this->app['conf']->set(['main', 'storage', 'download'], realpath(__DIR__ . '/../../../../tmp/download'));
$this->app['conf']->set(['main', 'storage', 'lazaret'], realpath(__DIR__ . '/../../../../tmp/lazaret'));
$this->app['conf']->set(['main', 'storage', 'caption'], realpath(__DIR__ . '/../../../../tmp/caption'));
$this->app['conf']->set('servername', $serverName);
$this->app['conf']->set('registry', $this->app['registry.manipulator']->getRegistryData());
}

View File

@@ -35,8 +35,8 @@ class FilesystemProbe extends FilesystemRequirements implements ProbeInterface
);
}
if ($conf->has(['main', 'storage', 'subdefs', 'default-dir'])) {
$paths[] = $conf->get(['main', 'storage', 'subdefs', 'default-dir']);
if ($conf->has(['main', 'storage', 'subdefs'])) {
$paths[] = $conf->get(['main', 'storage', 'subdefs']);
}
foreach ($paths as $path) {

View File

@@ -31,16 +31,12 @@ class FilesystemRequirements extends RequirementCollection implements Requiremen
$baseDir . '/config/wm',
$baseDir . '/logs',
$baseDir . '/tmp',
$baseDir . '/www/custom',
$baseDir . '/tmp/locks',
$baseDir . '/tmp/cache_twig',
$baseDir . '/tmp/serializer',
$baseDir . '/tmp/doctrine',
$baseDir . '/tmp/cache_minify',
$baseDir . '/tmp/caption',
$baseDir . '/tmp/lazaret',
$baseDir . '/tmp/desc_tmp',
$baseDir . '/tmp/download',
$baseDir . '/tmp/batches'
$baseDir . '/cache',
$baseDir . '/www/custom',
];
foreach ($paths as $path) {

View File

@@ -190,14 +190,14 @@ class FtpJob extends AbstractJob
if ($subdef == 'caption') {
$desc = $app['serializer.caption']->serialize($record->get_caption(), CaptionSerializer::SERIALIZE_XML, $exportElement->isBusinessfields());
$localfile = $app['root.path'] . '/tmp/' . md5($desc . time() . mt_rand());
$localfile = sys_get_temp_dir().'/' . md5($desc . time() . mt_rand());
if (file_put_contents($localfile, $desc) === false) {
throw new \Exception('Impossible de creer un fichier temporaire');
}
} elseif ($subdef == 'caption-yaml') {
$desc = $app['serializer.caption']->serialize($record->get_caption(), CaptionSerializer::SERIALIZE_YAML, $exportElement->isBusinessfields());
$localfile = $app['root.path'] . '/tmp/' . md5($desc . time() . mt_rand());
$localfile = sys_get_temp_dir().'/' . md5($desc . time() . mt_rand());
if (file_put_contents($localfile, $desc) === false) {
throw new \Exception('Impossible de creer un fichier temporaire');
}
@@ -272,7 +272,7 @@ class FtpJob extends AbstractJob
$buffer .= $root . '/' . $folder . $filename . "\n";
}
$tmpfile = $app['root.path'] . '/tmp/tmpftpbuffer' . $date->format('U') . '.txt';
$tmpfile = sys_get_temp_dir().'/tmpftpbuffer' . $date->format('U') . '.txt';
file_put_contents($tmpfile, $buffer);

View File

@@ -45,11 +45,17 @@ class CachedTranslator extends Translator
return;
}
if (null === $this->options['cache_dir']) {
if (is_callable($this->options['cache_dir'])) {
$cache_dir = call_user_func($this->options['cache_dir'], $this->app);
} else {
$cache_dir = $this->options['cache_dir'];
}
if (null === $cache_dir) {
return parent::loadCatalogue($locale);
}
$cache = new ConfigCache($this->options['cache_dir'].'/catalogue.'.$locale.'.php', $this->options['debug']);
$cache = new ConfigCache($cache_dir.'/catalogue.'.$locale.'.php', $this->options['debug']);
if (!$cache->isFresh()) {
parent::loadCatalogue($locale);

View File

@@ -17,9 +17,9 @@ class Setup_Upgrade
{
/**
*
* @var appbox
* @var Applications
*/
private $appbox;
private $app;
/**
*
@@ -30,16 +30,16 @@ class Setup_Upgrade
public function __construct(Application $app, $force = false)
{
if ($force) {
self::remove_lock_file();
$this->remove_lock_file();
}
if (self::lock_exists()) {
if ($this->lock_exists()) {
throw new Exception_Setup_UpgradeAlreadyStarted('The upgrade is already started');
}
$this->appbox = $app['phraseanet.appbox'];
$this->app = $app;
if (version_compare($this->appbox->get_version(), '3.9', '<')
if (version_compare($this->app['phraseanet.appbox']->get_version(), '3.9', '<')
&& count(MailChecker::getWrongEmailUsers($app)) > 0) {
throw new \Exception_Setup_FixBadEmailAddresses('Please fix the database before starting');
}
@@ -55,7 +55,7 @@ class Setup_Upgrade
*/
public function __destruct()
{
self::remove_lock_file();
$this->remove_lock_file();
return;
}
@@ -93,9 +93,9 @@ class Setup_Upgrade
'last_update' => $date_obj->format(DATE_ATOM),
], 1);
if (!file_put_contents(self::get_lock_file(), $datas))
if (!file_put_contents($this->get_lock_file(), $datas))
throw new Exception_Setup_CannotWriteLockFile(
sprintf('Cannot write lock file to %s', self::get_lock_file())
sprintf('Cannot write lock file to %s', $this->get_lock_file())
);
return $this;
@@ -106,11 +106,11 @@ class Setup_Upgrade
*
* @return boolean
*/
private static function lock_exists()
private function lock_exists()
{
clearstatcache();
return file_exists(self::get_lock_file());
return file_exists($this->get_lock_file());
}
/**
@@ -118,19 +118,19 @@ class Setup_Upgrade
*
* @return string
*/
private static function get_lock_file()
private function get_lock_file()
{
return __DIR__ . '/../../../tmp/upgrade.lock';
return $this->app['tmp.path'].'/locks/upgrade.lock';
}
/**
*
* @return Void
*/
private static function remove_lock_file()
private function remove_lock_file()
{
if (self::lock_exists()) {
unlink(self::get_lock_file());
if ($this->lock_exists()) {
unlink($this->get_lock_file());
}
return;

View File

@@ -288,21 +288,24 @@ class appbox extends base
$app['phraseanet.pre-schema-upgrader']->apply($app);
$finder = new Finder();
$finder->in([
$this->app['root.path'] . '/tmp/cache_minify/',
$this->app['root.path'] . '/tmp/cache_twig/',
$this->app['root.path'] . '/tmp/translations/',
$this->app['root.path'] . '/tmp/cache/profiler/',
$this->app['root.path'] . '/tmp/doctrine/',
$this->app['root.path'] . '/tmp/serializer/',
])
$in = [];
foreach ($app['cache.paths'] as $path) {
$in[] = $path.'/minify/';
$in[] = $path.'/twig/';
$in[] = $path.'/translations/';
$in[] = $path.'/profiler/';
$in[] = $path.'/doctrine/';
$in[] = $path.'/serializer/';
};
$finder->in(array_filter($in, function($path) {
return is_dir($path);
}))
->depth(0)
->ignoreVCS(true)
->ignoreDotFiles(true);
foreach ($finder as $file) {
$app['filesystem']->remove($file);
}
$app['filesystem']->remove($finder);
foreach ([
'config/custom_files/' => 'www/custom/',
@@ -311,7 +314,7 @@ class appbox extends base
'config/status/' => 'www/custom/status/',
'config/wm/' => 'www/custom/wm/',
] as $source => $target) {
$app['filesystem']->mirror($this->app['root.path'] . '/' . $source, $this->app['root.path'] . '/' . $target);
$app['filesystem']->mirror($this->app['root.path'] . '/' . $source, $this->app['root.path'] . '/' . $target, null, array('override' => true));
}
$advices = $this->upgradeDB(true, $app);

View File

@@ -594,7 +594,7 @@ class databox extends base
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$databox->insert_datas();
$databox->setNewStructure(
$data_template, $app['conf']->get(['main', 'storage', 'subdefs', 'default-dir'])
$data_template, $app['conf']->get(['main', 'storage', 'subdefs'])
);
return $databox;
@@ -934,7 +934,7 @@ class databox extends base
$contents = str_replace(
["{{basename}}", "{{datapathnoweb}}"]
, [$this->dbname, $path_doc]
, [$this->dbname, rtrim($path_doc, '/').'/']
, $contents
);

View File

@@ -42,7 +42,7 @@ class module_console_sphinxGenerateSuggestion extends Command
)
));
$tmp_file = $this->container['root.path'] . '/tmp/dict' . $index . '.txt';
$tmp_file = sys_get_temp_dir().'/dict' . $index . '.txt';
$databox = $this->getService('phraseanet.appbox')->get_databox($sbas_id);

View File

@@ -31,21 +31,16 @@ class module_console_systemClearCache extends Command
{
$finder = new Finder();
$in = [];
foreach ($this->container['cache.paths'] as $path) {
$in[] = $path;
};
$finder
->exclude('.git')
->exclude('.svn')
->in([
$this->container['root.path'] . '/tmp/cache_minify/',
$this->container['root.path'] . '/tmp/cache_twig/',
$this->container['root.path'] . '/tmp/translations/',
$this->container['root.path'] . '/tmp/cache/profiler/',
$this->container['root.path'] . '/tmp/doctrine/',
$this->container['root.path'] . '/tmp/serializer/',
]);
->in($in);
$filesystem = new Filesystem();
$filesystem->remove($finder);
$this->container['filesystem']->remove($finder);
if ($this->container['phraseanet.configuration-tester']->isInstalled()) {
$this->getService('phraseanet.cache-service')->flushAll();

View File

@@ -89,7 +89,7 @@ class patch_370alpha7a extends patchAbstract
$i = 0;
foreach ($rs as $row) {
$filePath = $app['root.path'] . '/tmp/lazaret/' . $row['filepath'];
$filePath = $app['tmp.lazaret.path'].'/'.$row['filepath'];
if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
continue;
}
@@ -100,7 +100,7 @@ class patch_370alpha7a extends patchAbstract
$spec->setResizeMode(ImageSpec::RESIZE_MODE_INBOUND_FIXEDRATIO);
$spec->setDimensions(375, 275);
$thumbPath = $app['root.path'] . '/tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
$thumbPath = $app['tmp.lazaret.path'].'/'.sprintf("thumb_%s", $row['filepath']);
try {
$app['media-alchemyst']->turnInto($filePath, $thumbPath, $spec);

View File

@@ -63,11 +63,11 @@ class patch_380alpha16a extends patchAbstract
}
$xsendfile['mapping'][] = [
'directory' => $app['root.path'] . '/tmp/lazaret/',
'directory' => $app['tmp.lazaret.path'],
'mount-point' => '/lazaret/',
];
$xsendfile['mapping'][] = [
'directory' => $app['root.path'] . '/tmp/download/',
'directory' => $app['tmp.download.path'],
'mount-point' => '/download/',
];

View File

@@ -0,0 +1,100 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_390alpha19a extends patchAbstract
{
/** @var string */
private $release = '3.9.0-alpha.19';
/** @var array */
private $concern = [base::APPLICATION_BOX];
/**
* {@inheritdoc}
*/
public function get_release()
{
return $this->release;
}
/**
* {@inheritdoc}
*/
public function require_all_upgrades()
{
return false;
}
/**
* {@inheritdoc}
*/
public function concern()
{
return $this->concern;
}
/**
* {@inheritdoc}
*/
public function getDoctrineMigrations()
{
return [];
}
/**
* {@inheritdoc}
*/
public function apply(base $appbox, Application $app)
{
$storage = $app['conf']->get(['main', 'storage']);
$storage['cache'] = $app['root.path'].'/cache';
$storage['log'] = $app['root.path'].'/logs';
$storage['download'] = $app['root.path'].'/tmp/download';
$storage['lazaret'] = $app['root.path'].'/tmp/lazaret';
$storage['caption'] = $app['root.path'].'/tmp/caption';
$app['conf']->set(['main', 'storage'], $storage);
// update file structure
$this->removeDirectory($app, $app['root.path'].'/tmp/cache_twig');
$this->removeDirectory($app, $app['root.path'].'/tmp/doctrine');
$this->removeDirectory($app, $app['root.path'].'/tmp/profiler');
$this->removeDirectory($app, $app['root.path'].'/tmp/serializer');
$this->removeDirectory($app, $app['root.path'].'/tmp/translations');
$this->removeDirectory($app, $app['root.path'].'/tmp/cache_minify');
$this->removeDirectory($app, $app['root.path'].'/features');
$this->removeDirectory($app, $app['root.path'].'/hudson');
$this->removeDirectory($app, $app['root.path'].'/locales');
$this->removeDirectory($app, $app['root.path'].'/vagrant');
$this->removeDirectory($app, $app['root.path'].'/tmp/doctrine-proxies');
$this->copyFile($app, $app['root.path'].'/tmp/cache_registry.php', $app['cache.path'].'/cache_registry.php');
$this->copyFile($app, $app['root.path'].'/tmp/configuration-compiled.php', $app['root.path'].'/config/configuration-compiled.php');
return true;
}
private function removeDirectory(Application $app, $originDir)
{
if (is_dir($originDir)) {
$app['filesystem']->remove($originDir);
}
}
private function copyFile(Application $app, $originFile, $targetFile)
{
if ($app['filesystem']->exists($originFile)) {
$app['filesystem']->copy($originFile, $targetFile);
}
}
}

View File

@@ -165,7 +165,7 @@ class patch_390alpha9b extends patchAbstract
'GV_smtp_secure' => ['registry', 'email', 'smtp-secure-mode'],
'GV_smtp_user' => ['registry', 'email', 'smtp-user'],
'GV_smtp_password' => ['registry', 'email', 'smtp-password'],
'GV_base_datapath_noweb' => ['main', 'storage', 'subdefs', 'default-dir'],
'GV_base_datapath_noweb' => ['main', 'storage', 'subdefs'],
'GV_youtube_api' => ['main', 'bridge', 'youtube', 'enabled'],
'GV_youtube_client_id' => ['main', 'bridge', 'youtube', 'client_id'],
'GV_youtube_client_secret' => ['main', 'bridge', 'youtube', 'client_secret'],

View File

@@ -41,7 +41,7 @@ class random
switch ($row['type']) {
case 'download':
case 'email':
$file = $this->app['root.path'] . '/tmp/download/' . $row['value'] . '.zip';
$file = $this->app['tmp.download.path'].'/'.$row['value'].'.zip';
if (is_file($file))
unlink($file);
break;

View File

@@ -631,8 +631,7 @@ class set_export extends set_abstract
$files[$id]["export_name"] = $tmp_name;
if (in_array('caption', $subdefs)) {
$caption_dir = $this->app['root.path'] . '/tmp/desc_tmp/'
. time() . $this->app['authentication']->getUser()->getId() . '/';
$caption_dir = $this->app['tmp.caption.path'].'/'.time().$this->app['authentication']->getUser()->getId().'/';
$filesystem->mkdir($caption_dir, 0750);
@@ -653,8 +652,7 @@ class set_export extends set_abstract
}
if (in_array('caption-yaml', $subdefs)) {
$caption_dir = $this->app['root.path'] . '/tmp/desc_tmp/'
. time() . $this->app['authentication']->getUser()->getId() . '/';
$caption_dir = $this->app['tmp.caption.path'].'/'.time().$this->app['authentication']->getUser()->getId().'/';
$filesystem->mkdir($caption_dir, 0750);

View File

@@ -72,8 +72,12 @@ main:
swftools_timeout: 60
unoconv_timeout: 60
storage:
subdefs:
default-dir: null
subdefs: null
cache: null
log : null
download: null
lazaret: null
caption: null
bridge:
youtube:
enabled: false

2
logs/.gitignore vendored
View File

@@ -1,2 +0,0 @@
*
!.gitignore

0
logs/.gitkeep Normal file
View File

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="BuildSourceHudson" default="Main" basedir=".">
<project name="BuildSourceHudson" default="Main" basedir="">
<property file="build.properties"/>
<target name="Main">
<delete includeemptydirs="true" verbose="false" failonerror="false">

View File

@@ -1,8 +1,8 @@
<?php
require __DIR__ . '/../lib/autoload.php';
require __DIR__ . '/../../lib/autoload.php';
$app = require __DIR__ . '/../lib/Alchemy/Phrasea/Application/Root.php';
$app = require __DIR__ . '/../../lib/Alchemy/Phrasea/Application/Root.php';
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
$structure = $databox->get_subdef_structure();

View File

View File

@@ -0,0 +1,210 @@
servername: 'http://local.phrasea/'
languages:
available: []
default: 'fr'
main:
maintenance: false
key: ''
database:
host: 'sql-host'
port: 3306
user: 'sql-user'
password: 'sql-password'
dbname: ab_phraseanet
driver: pdo_mysql
charset: UTF8
database-test:
driver: pdo_sqlite
path: '/tmp/db.sqlite'
charset: UTF8
cache:
type: ArrayCache
options: []
opcodecache:
type: ArrayCache
options: []
search-engine:
type: Alchemy\Phrasea\SearchEngine\Phrasea\PhraseaEngine
options: []
task-manager:
status: started
enabled: true
logger:
max-files: 10
enabled: true
level: INFO
listener:
protocol: tcp
host: 127.0.0.1
port: 6660
linger: 500
websocket-server:
host: local.phrasea
port: 9090
ip: 0.0.0.0
subscriber:
protocol: tcp
host: 127.0.0.1
port: 13598
session:
type: 'redis'
options:
host: localhost
port: 6379
ttl: 86400
binaries:
ghostscript_binary: null
php_binary: null
swf_extract_binary: null
pdf2swf_binary: null
swf_render_binary: null
unoconv_binary: null
ffmpeg_binary: null
ffprobe_binary: null
mp4box_binary: null
pdftotext_binary: null
recess_binary: null
phraseanet_indexer: null
ffmpeg_timeout: 3600
ffprobe_timeout: 60
gs_timeout: 60
mp4box_timeout: 60
swftools_timeout: 60
unoconv_timeout: 60
storage:
subdefs: null
cache: /tmp/phraseanet/cache
log : /tmp/phraseanet/log
download: /var/www/phraseanet/tmp/download
lazaret: /var/www/phraseanet/tmp/lazaret
caption: /var/www/phraseanet/tmp/caption
bridge:
youtube:
enabled: false
client_id: null
client_secret: null
developer_key: null
flickr:
enabled: false
client_id: null
client_secret: null
dailymotion:
enabled: false
client_id: null
client_secret: null
trusted-proxies: ['127.0.0.1']
debugger:
allowed-ips: ['192.168.56.1']
border-manager:
enabled: true
extension-mapping: { }
checkers:
-
type: Checker\Sha256
enabled: true
-
type: Checker\UUID
enabled: true
-
type: Checker\Colorspace
enabled: false
options:
colorspaces: [cmyk, grayscale, rgb]
-
type: Checker\Dimension
enabled: false
options:
width: 80
height: 160
-
type: Checker\Extension
enabled: false
options:
extensions: [jpg, jpeg, bmp, tif, gif, png, pdf, doc, odt, mpg, mpeg, mov, avi, xls, flv, mp3, mp2]
-
type: Checker\Filename
enabled: false
options:
sensitive: true
-
type: Checker\MediaType
enabled: false
options:
mediatypes: [Audio, Document, Flash, Image, Video]
authentication:
auto-create:
templates: { }
captcha:
enabled: true
trials-before-display: 9
providers:
facebook:
enabled: false
options:
app-id: ''
secret: ''
twitter:
enabled: false
options:
consumer-key: ''
consumer-secret: ''
google-plus:
enabled: false
options:
client-id: ''
client-secret: ''
github:
enabled: false
options:
client-id: ''
client-secret: ''
viadeo:
enabled: false
options:
client-id: ''
client-secret: ''
linkedin:
enabled: false
options:
client-id: ''
client-secret: ''
registration-fields:
-
name: company
required: true
-
name: lastname
required: true
-
name: firstname
required: true
-
name: geonameid
required: true
xsendfile:
enabled: false
type: nginx
mapping: []
h264-pseudo-streaming:
enabled: false
type: nginx
mapping: []
plugins: []
api_cors:
enabled: false
allow_credentials: false
allow_origin: []
allow_headers: []
allow_methods: []
expose_headers: []
max_age: 0
hosts: []
session:
idle: 0
# 1 week
lifetime: 604800
crossdomain:
allow-access-from:
-
domain: '*.cooliris.com'
secure: 'false'

View File

@@ -26,12 +26,12 @@ vagrantfile-local:
cpus: 1
provision:
puppet:
manifests_path: vagrant/vms/phraseanet-php54-nginx/puphpet/puppet
manifests_path: resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet
manifest_file: manifest.pp
module_path: vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules
module_path: resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/modules
options:
- '--verbose'
- '--hiera_config /vagrant/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/hiera.yaml'
- '--hiera_config /vagrant/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/puppet/hiera.yaml'
- '--parser future'
synced_folder:
KaPfJ4CzfgFk:
@@ -150,12 +150,11 @@ nginx:
proxy_buffers: '4 256k'
vhosts:
issDOx17O4bn:
server_name: nginx.phraseanet
server_name: phraseanet-php54-nginx
server_aliases:
- nginx.phrasea.net
- nginx.alchemyasp.com
- nginx.phraseanet.php54
www_root: /var/www/phraseanet/www
listen_port: '8080'
listen_port: '80'
index_files:
- index.html
- index.htm

Some files were not shown because too many files have changed in this diff Show More