Remove registry's GV_RootPath calls

This commit is contained in:
Romain Neutron
2013-06-19 19:21:49 +02:00
parent 98bb412575
commit 3f47cc248d
35 changed files with 79 additions and 81 deletions

View File

@@ -946,7 +946,7 @@ class Databox implements ControllerProviderInterface
$ret['xml_indexed'] = $datas['xml_indexed'];
$ret['thesaurus_indexed'] = $datas['thesaurus_indexed'];
if ($app['filesystem']->exists($app['phraseanet.registry']->get('GV_RootPath') . 'config/minilogos/logopdf_' . $databox_id . '.jpg')) {
if ($app['filesystem']->exists($app['root.path'] . '/config/minilogos/logopdf_' . $databox_id . '.jpg')) {
$ret['printLogoURL'] = '/custom/minilogos/logopdf_' . $databox_id . '.jpg';
}

View File

@@ -181,7 +181,7 @@ class Databoxes implements ControllerProviderInterface
$upgrader = new \Setup_Upgrade($app);
return $app['twig']->render('admin/databases.html.twig', array(
'files' => new \DirectoryIterator($app['phraseanet.registry']->get('GV_RootPath') . 'lib/conf.d/data_templates'),
'files' => new \DirectoryIterator($app['root.path'] . '/lib/conf.d/data_templates'),
'sbas' => $sbas,
'error_msg' => $errorMsg,
'recommendations' => $upgrader->getRecommendations(),
@@ -217,7 +217,7 @@ class Databoxes implements ControllerProviderInterface
$user = $connexion['user'];
$password = $connexion['password'];
$dataTemplate = new \SplFileInfo($app['phraseanet.registry']->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $dataTemplate . '.xml');
$dataTemplate = new \SplFileInfo($app['root.path'] . '/lib/conf.d/data_templates/' . $dataTemplate . '.xml');
try {
$connbas = new \connection_pdo('databox_creation', $hostname, $port, $user, $password, $dbName, array(), $app['debug']);
@@ -245,7 +245,7 @@ class Databoxes implements ControllerProviderInterface
&& (null !== $dataTemplate = $request->request->get('new_data_template'))) {
try {
$data_template = new \SplFileInfo($app['phraseanet.registry']->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $dataTemplate . '.xml');
$data_template = new \SplFileInfo($app['root.path'] . '/lib/conf.d/data_templates/' . $dataTemplate . '.xml');
$connbas = new \connection_pdo('databox_creation', $hostname, $port, $userDb, $passwordDb, $dbName, array(), $app['debug']);
try {
$base = \databox::create($app, $connbas, $data_template, $app['phraseanet.registry']);

View File

@@ -76,7 +76,7 @@ class TaskManager implements ControllerProviderInterface
})->bind('admin_tasks_scheduler_stop');
$controllers->get('/scheduler/log', function(Application $app, Request $request) {
$logdir = \p4string::addEndSlash($app['phraseanet.registry']->get('GV_RootPath') . 'logs');
$logdir = $app['root.path'] . '/logs/';
$rname = '/scheduler((\.log)|(-.*\.log))$/';
@@ -114,7 +114,7 @@ class TaskManager implements ControllerProviderInterface
})->bind('admin_tasks_scheduler_log');
$controllers->get('/task/{id}/log', function(Application $app, Request $request, $id) {
$logdir = \p4string::addEndSlash($app['phraseanet.registry']->get('GV_RootPath') . 'logs');
$logdir = $app['root.path'] . '/logs/';
$rname = '/task_' . $id . '((\.log)|(-.*\.log))$/';

View File

@@ -832,7 +832,7 @@ class Users implements ControllerProviderInterface
$controllers->get('/import/example/csv/', function(Application $app, Request $request) {
$file = new \SplFileInfo($app['phraseanet.registry']->get('GV_RootPath') . 'lib/Fixtures/exampleImportUsers.csv');
$file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/exampleImportUsers.csv');
if (!$file->isFile()) {
$app->abort(400);
@@ -851,7 +851,7 @@ class Users implements ControllerProviderInterface
$controllers->get('/import/example/rtf/', function(Application $app, Request $request) {
$file = new \SplFileInfo($app['phraseanet.registry']->get('GV_RootPath') . 'lib/Fixtures/Fields.rtf');
$file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/Fields.rtf');
if (!$file->isFile()) {
$app->abort(400);

View File

@@ -61,8 +61,8 @@ class Oauth2 implements ControllerProviderInterface
$template = "api/auth/end_user_authorization.html.twig";
$custom_template = sprintf(
"%sconfig/templates/web/api/auth/end_user_authorization/%s.html.twig"
, $app['phraseanet.registry']->get('GV_RootPath')
"%s/config/templates/web/api/auth/end_user_authorization/%s.html.twig"
, $app['root.path']
, $client->get_id()
);

View File

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

View File

@@ -218,7 +218,7 @@ class Lazaret implements ControllerProviderInterface
'base_id' => $lazaretFile->getBaseId(),
'created' => $lazaretFile->getCreated()->format(\DateTime::ATOM),
'updated' => $lazaretFile->getUpdated()->format(\DateTime::ATOM),
'pathname' => $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename(),
'pathname' => $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename(),
'sha256' => $lazaretFile->getSha256(),
'uuid' => $lazaretFile->getUuid(),
);
@@ -262,8 +262,8 @@ class Lazaret implements ControllerProviderInterface
return $app->json($ret);
}
$lazaretFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
try {
$borderFile = Border\File::buildFromPathfile(
@@ -382,8 +382,8 @@ class Lazaret implements ControllerProviderInterface
protected function denyLazaretFile(Application $app, LazaretFile $lazaretFile)
{
$lazaretFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
$app['EM']->remove($lazaretFile);
$app['EM']->flush();
@@ -474,8 +474,8 @@ class Lazaret implements ControllerProviderInterface
return $app->json($ret);
}
$lazaretFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
try {
$media = $app['mediavorus']->guess($lazaretFileName);
@@ -519,7 +519,7 @@ class Lazaret implements ControllerProviderInterface
return new Response(null, 404);
}
$lazaretThumbFileName = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
return \set_export::stream_file(
$app, $lazaretThumbFileName, $lazaretFile->getOriginalName(), 'image/jpeg', 'inline'

View File

@@ -46,7 +46,7 @@ class Root implements ControllerProviderInterface
return $app->redirectPath('logout');
}
$cssPath = $app['phraseanet.registry']->get('GV_RootPath') . 'www/skins/prod/';
$cssPath = $app['root.path'] . '/www/skins/prod/';
$css = array();
$cssfile = false;

View File

@@ -242,7 +242,7 @@ class Tools implements ControllerProviderInterface
$dataUri = DataURI\Parser::parse($request->request->get('image', ''));
$path = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp';
$path = $app['root.path'] . '/tmp';
$name = sprintf('extractor_thumb_%s', $record->get_serialize_key());

View File

@@ -238,7 +238,7 @@ class Account implements ControllerProviderInterface
*/
public function accountAccess(Application $app, Request $request)
{
require_once $app['phraseanet.registry']->get('GV_RootPath') . 'lib/classes/deprecated/inscript.api.php';
require_once $app['root.path'] . '/lib/classes/deprecated/inscript.api.php';
return $app['twig']->render('account/access.html.twig', array(
'inscriptions' => giveMeBases($app, $app['authentication']->getUser()->get_id())

View File

@@ -262,7 +262,7 @@ class Login implements ControllerProviderInterface
throw new FormProcessingException(_('Invalid captcha answer.'));
}
require_once($app['phraseanet.registry']->get('GV_RootPath') . 'lib/classes/deprecated/inscript.api.php');
require_once $app['root.path'] . '/lib/classes/deprecated/inscript.api.php';
$selected = isset($data['collections']) ? $data['collections'] : null;
$inscriptions = giveMeBases($app);
@@ -684,7 +684,7 @@ class Login implements ControllerProviderInterface
*/
public function login(PhraseaApplication $app, Request $request)
{
require_once($app['phraseanet.registry']->get('GV_RootPath') . 'lib/classes/deprecated/inscript.api.php');
require_once $app['root.path'] . '/lib/classes/deprecated/inscript.api.php';
try {
$app['phraseanet.appbox']->get_connection();

View File

@@ -441,9 +441,9 @@ class Thesaurus implements ControllerProviderInterface
} elseif ($request->get("ofm") == 'tofiles') {
$fname = 'topics_' . $lng . '.xml';
@rename($app['phraseanet.registry']->get('GV_RootPath') . 'config/topics/' . $fname, $app['phraseanet.registry']->get('GV_RootPath') . 'config/topics/topics_' . $lng . '_BKP_' . $now . '.xml');
@rename($app['root.path'] . '/config/topics/' . $fname, $app['root.path'] . '/config/topics/topics_' . $lng . '_BKP_' . $now . '.xml');
if ($dom->save($app['phraseanet.registry']->get('GV_RootPath') . 'config/topics/' . $fname)) {
if ($dom->save($app['root.path'] . '/config/topics/' . $fname)) {
$lngs[$lng] = \p4string::MakeString(sprintf(_('thesaurus:: fichier genere : %s'), $fname));
} else {
$lngs[$lng] = \p4string::MakeString(_('thesaurus:: erreur lors de l\'enregsitrement du fichier'));

View File

@@ -69,7 +69,7 @@ class PhraseaRegisterForm extends AbstractType
$builder->add('provider-id', 'hidden');
require_once($this->app['phraseanet.registry']->get('GV_RootPath') . 'lib/classes/deprecated/inscript.api.php');
require_once $this->app['root.path'] . '/lib/classes/deprecated/inscript.api.php';
$choices = array();
$baseIds = array();

View File

@@ -334,8 +334,7 @@ class PDF
$RIGHT_TEXT = "";
$RIGHT_IMG = NULL;
$LEFT__IMG = $this->app['phraseanet.registry']->get('GV_RootPath') . "config/minilogos/logopdf_"
. $rec->get_sbas_id() . "";
$LEFT__IMG = $this->app['root.path'] . "/config/minilogos/logopdf_" . $rec->get_sbas_id();
if (!is_file($LEFT__IMG)) {
$databox = $rec->get_databox();
@@ -356,7 +355,7 @@ class PDF
if ($vn == "" || $vn == "1") {
$RIGHT_TEXT = \phrasea::bas_labels($rec->get_base_id(), $this->app);
} elseif ($vn == "2") {
$RIGHT_IMG = $this->app['phraseanet.registry']->get('GV_RootPath') . "config/minilogos/" . $rec->get_base_id();
$RIGHT_IMG = $this->app['root.path'] . "/config/minilogos/" . $rec->get_base_id();
}
$xtmp = $this->pdf->GetX();

View File

@@ -133,8 +133,8 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
$url = '/skins/icons/rss32.gif';
$file = $this->app['phraseanet.registry']->get('GV_RootPath')
. 'www/custom/feed_' . $this->get_id() . '.jpg';
$file = $this->app['root.path']
. '/www/custom/feed_' . $this->get_id() . '.jpg';
if (file_exists($file)) {
$url = '/custom/feed_' . $this->get_id() . '.jpg';
@@ -156,8 +156,8 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
throw new \Alchemy\Phrasea\Exception\InvalidArgumentException('File does not exists');
}
$config_file = $this->app['phraseanet.registry']->get('GV_RootPath') . 'config/feed_' . $this->get_id() . '.jpg';
$www_file = $this->app['phraseanet.registry']->get('GV_RootPath') . 'www/custom/feed_' . $this->get_id() . '.jpg';
$config_file = $this->app['root.path'] . '/config/feed_' . $this->get_id() . '.jpg';
$www_file = $this->app['root.path'] . '/www/custom/feed_' . $this->get_id() . '.jpg';
copy($file, $config_file);
copy($file, $www_file);
@@ -185,10 +185,10 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
public function reset_icon()
{
$config_file = $this->app['phraseanet.registry']->get('GV_RootPath')
. 'config/feed_' . $this->get_id() . '.jpg';
$www_file = $this->app['phraseanet.registry']->get('GV_RootPath')
. 'www/custom/feed_' . $this->get_id() . '.jpg';
$config_file = $this->app['root.path']
. '/config/feed_' . $this->get_id() . '.jpg';
$www_file = $this->app['root.path']
. '/www/custom/feed_' . $this->get_id() . '.jpg';
if (is_file($config_file))
unlink($config_file);

View File

@@ -148,8 +148,8 @@ class appbox extends base
$collection->update_logo($pathfile);
}
$file = $this->app['phraseanet.registry']->get('GV_RootPath') . 'config/' . $pic_type . '/' . $collection->get_base_id();
$custom_path = $this->app['phraseanet.registry']->get('GV_RootPath') . 'www/custom/' . $pic_type . '/' . $collection->get_base_id();
$file = $this->app['root.path'] . '/config/' . $pic_type . '/' . $collection->get_base_id();
$custom_path = $this->app['root.path'] . '/www/custom/' . $pic_type . '/' . $collection->get_base_id();
foreach (array($file, $custom_path) as $target) {
@@ -206,8 +206,8 @@ class appbox extends base
}
}
$file = $this->app['phraseanet.registry']->get('GV_RootPath') . 'config/minilogos/' . $pic_type . '_' . $databox->get_sbas_id() . '.jpg';
$custom_path = $this->app['phraseanet.registry']->get('GV_RootPath') . 'www/custom/minilogos/' . $pic_type . '_' . $databox->get_sbas_id() . '.jpg';
$file = $this->app['root.path'] . '/config/minilogos/' . $pic_type . '_' . $databox->get_sbas_id() . '.jpg';
$custom_path = $this->app['root.path'] . '/www/custom/minilogos/' . $pic_type . '_' . $databox->get_sbas_id() . '.jpg';
foreach (array($file, $custom_path) as $target) {
@@ -329,8 +329,8 @@ class appbox extends base
$finder = new Finder();
$finder->in(array(
$this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/cache_minify/',
$this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/cache_twig/',
$this->app['root.path'] . '/tmp/cache_minify/',
$this->app['root.path'] . '/tmp/cache_twig/',
))
->depth(0)
->ignoreVCS(true)
@@ -354,7 +354,7 @@ class appbox extends base
'config/status/' => 'www/custom/status/',
'config/wm/' => 'www/custom/wm/',
) as $source => $target) {
$app['filesystem']->mirror($this->app['phraseanet.registry']->get('GV_RootPath') . $source, $this->app['phraseanet.registry']->get('GV_RootPath') . $target);
$app['filesystem']->mirror($this->app['root.path'] . '/' . $source, $this->app['root.path'] . '/' . $target);
}
$upgrader->add_steps_complete(1);

View File

@@ -765,7 +765,7 @@ abstract class base implements cache_cacheableInterface
$upgrader->add_steps(1)->set_current_message(_('Looking for patches'));
$iterator = new DirectoryIterator($this->app['phraseanet.registry']->get('GV_RootPath') . 'lib/classes/patch/');
$iterator = new DirectoryIterator($this->app['root.path'] . '/lib/classes/patch/');
foreach ($iterator as $fileinfo) {
if ( ! $fileinfo->isDot()) {

View File

@@ -648,7 +648,7 @@ class collection implements cache_cacheableInterface
if ( ! isset(self::$_logos[$base_id_key])) {
if (is_file($app['phraseanet.registry']->get('GV_RootPath') . 'config/minilogos/' . $base_id)) {
if (is_file($app['root.path'] . '/config/minilogos/' . $base_id)) {
$name = phrasea::bas_labels($base_id, $app);
self::$_logos[$base_id_key] = '<img title="' . $name
. '" src="' . $app['phraseanet.registry']->get('GV_STATIC_URL')

View File

@@ -1002,7 +1002,7 @@ class databox extends base
$base_ids[] = $base_id = $conn->lastInsertId();
if ( ! empty($row['logo'])) {
file_put_contents($this->app['phraseanet.registry']->get('GV_RootPath') . 'config/minilogos/' . $base_id, $row['logo']);
file_put_contents($this->app['root.path'] . '/config/minilogos/' . $base_id, $row['logo']);
}
} catch (Exception $e) {
unset($e);

View File

@@ -69,7 +69,7 @@ class databox_status
return;
}
$path = $this->path = $app['phraseanet.registry']->get('GV_RootPath') . "config/status/" . urlencode($sbas_params[$sbas_id]["host"]) . "-" . urlencode($sbas_params[$sbas_id]["port"]) . "-" . urlencode($sbas_params[$sbas_id]["dbname"]);
$path = $this->path = $app['root.path'] . "/config/status/" . urlencode($sbas_params[$sbas_id]["host"]) . "-" . urlencode($sbas_params[$sbas_id]["port"]) . "-" . urlencode($sbas_params[$sbas_id]["dbname"]);
$url = $this->url = "/custom/status/" . urlencode($sbas_params[$sbas_id]["host"]) . "-" . urlencode($sbas_params[$sbas_id]["port"]) . "-" . urlencode($sbas_params[$sbas_id]["dbname"]);
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
@@ -431,12 +431,12 @@ class databox_status
$name = "-stat_" . $bit . "_" . ($switch == 'on' ? '1' : '0') . ".gif";
try {
$file = $file->move($app['phraseanet.registry']->get('GV_RootPath') . "config/status/", $path.$name);
$file = $file->move($app['root.path'] . "/config/status/", $path.$name);
} catch (FileException $e) {
throw new Exception_Upload_CannotWriteFile();
}
$custom_path = $app['phraseanet.registry']->get('GV_RootPath') . 'www/custom/status/';
$custom_path = $app['root.path'] . '/www/custom/status/';
$app['filesystem']->mkdir($custom_path, 0750);

View File

@@ -278,7 +278,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->mime = 'image/png';
$this->width = 256;
$this->height = 256;
$this->path = $this->app['phraseanet.registry']->get('GV_RootPath') . 'www/skins/icons/substitution/';
$this->path = $this->app['root.path'] . '/www/skins/icons/substitution/';
$this->file = 'regroup_thumb.png';
$this->url = '/skins/icons/substitution/regroup_thumb.png';
} else {
@@ -288,7 +288,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->mime = 'image/png';
$this->width = 256;
$this->height = 256;
$this->path = $this->app['phraseanet.registry']->get('GV_RootPath') . 'www/skins/icons/substitution/';
$this->path = $this->app['root.path'] . '/www/skins/icons/substitution/';
$this->file = str_replace('+', '%20', $mime) . '.png';
$this->url = '/skins/icons/substitution/' . $this->file;
}
@@ -296,7 +296,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->is_physically_present = false;
if ( ! file_exists($this->path . $this->file)) {
$this->path = $this->app['phraseanet.registry']->get('GV_RootPath') . 'www/skins/icons/';
$this->path = $this->app['root.path'] . '/www/skins/icons/';
$this->file = 'substitution.png';
$this->url = '/skins/icons/' . $this->file;
}

View File

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

View File

@@ -87,7 +87,7 @@ class patch_370a7 implements patchInterface
try {
foreach ($rs as $row) {
$filePath = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $row['filepath'];
$filePath = $app['root.path'] . '/tmp/lazaret/' . $row['filepath'];
if (file_exists($filePath)) {
@@ -96,7 +96,7 @@ class patch_370a7 implements patchInterface
$spec->setResizeMode(ImageSpec::RESIZE_MODE_INBOUND_FIXEDRATIO);
$spec->setDimensions(375, 275);
$thumbPath = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
$thumbPath = $app['root.path'] . '/tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
try {
$app['media-alchemyst']

View File

@@ -102,7 +102,7 @@ class recordutils_image extends recordutils
$pathIn = $subdef->get_path() . $subdef->get_file();
$pathOut = $subdef->get_path() . 'stamp_' . $subdef->get_file();
$pathTmpStamp = $app['phraseanet.registry']->get('GV_RootPath') . 'tmp/' . time() . '-stamptmp_' . $subdef->get_file();
$pathTmpStamp = $app['root.path'] . '/tmp/' . time() . '-stamptmp_' . $subdef->get_file();
if ($xpprefs->query('/baseprefs/stamp')->length == 0) {
return $subdef->get_pathfile();
@@ -158,7 +158,7 @@ class recordutils_image extends recordutils
$text_xpos = 0;
$text_width = $image_width;
$logofile = $app['phraseanet.registry']->get('GV_RootPath') . 'config/stamp/' . $base_id;
$logofile = $app['root.path'] . '/config/stamp/' . $base_id;
$logopos = null;
$imlogo = null; // gd image
$logo_phywidth = $logo_phyheight = 0; // physical size
@@ -342,11 +342,11 @@ class recordutils_image extends recordutils
}
if ($app['phraseanet.registry']->get('composite_binary') &&
file_exists($app['phraseanet.registry']->get('GV_RootPath') . 'config/wm/' . $base_id)) {
file_exists($app['root.path'] . '/config/wm/' . $base_id)) {
$builder = ProcessBuilder::create(array(
$app['phraseanet.registry']->get('composite_binary'),
$app['phraseanet.registry']->get('GV_RootPath') . 'config/wm/' . $base_id,
$app['root.path'] . '/config/wm/' . $base_id,
$pathIn,
'-strip', '-watermark', '90%', '-gravity', 'center',
$pathOut

View File

@@ -46,7 +46,6 @@ class registry implements registryInterface
$this->app = $app;
$this->cache = new ArrayCache();
$this->cache->save('GV_RootPath', dirname(dirname(__DIR__)) . '/');
if ($app['phraseanet.configuration-tester']->isInstalled()) {
$this->cache->save('GV_ServerName', $app['phraseanet.configuration']['main']['servername']);
$this->cache->save('GV_debug', $app['debug']);

View File

@@ -640,7 +640,7 @@ class set_export extends set_abstract
$files[$id]["export_name"] = $tmp_name;
if (in_array('caption', $subdefs)) {
$caption_dir = $this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/desc_tmp/'
$caption_dir = $this->app['root.path'] . '/tmp/desc_tmp/'
. time() . $this->app['authentication']->getUser()->get_id() . '/';
$filesystem->mkdir($caption_dir, 0750);
@@ -662,7 +662,7 @@ class set_export extends set_abstract
}
if (in_array('caption-yaml', $subdefs)) {
$caption_dir = $this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/desc_tmp/'
$caption_dir = $this->app['root.path'] . '/tmp/desc_tmp/'
. time() . $this->app['authentication']->getUser()->get_id() . '/';
$filesystem->mkdir($caption_dir, 0750);
@@ -785,8 +785,8 @@ class set_export extends set_abstract
$file_xaccel = str_replace(
array(
$app['phraseanet.registry']->get('GV_X_Accel_Redirect'),
$app['phraseanet.registry']->get('GV_RootPath') . 'tmp/download/',
$app['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/'
$app['root.path'] . '/tmp/download/',
$app['root.path'] . '/tmp/lazaret/'
)
, array(
'/' . $app['phraseanet.registry']->get('GV_X_Accel_Redirect_mount_point') . '/',

View File

@@ -83,7 +83,7 @@ class task_Scheduler
$this->method = self::METHOD_FORK;
}
$lockdir = $this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'tmp/locks/';
$lockdir = $this->dependencyContainer['root.path'] . '/tmp/locks/';
for ($try = 1; true; $try ++) {
$lockfile = ($lockdir . 'scheduler.lock');
@@ -228,7 +228,7 @@ class task_Scheduler
"cmd" => $this->dependencyContainer['phraseanet.registry']->get('php_binary'),
"args" => array(
'-f',
$this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'bin/console',
$this->dependencyContainer['root.path'] . '/bin/console',
'--',
'-q',
'task:run',
@@ -339,7 +339,7 @@ class task_Scheduler
escapeshellarg($taskPoll[$tkey]["cmd"]) . ' ' . implode(' ', array_map('escapeshellarg', $taskPoll[$tkey]["args"]))
, $descriptors
, $taskPoll[$tkey]["pipes"]
, $this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . "bin/"
, $this->dependencyContainer['root.path'] . "/bin/"
, null
, array('bypass_shell' => true)
);

View File

@@ -574,7 +574,7 @@ abstract class task_abstract
*/
private function getLockfilePath()
{
$lockdir = $this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'tmp/locks/';
$lockdir = $this->dependencyContainer['root.path'] . '/tmp/locks/';
$lockfilePath = ($lockdir . 'task_' . $this->getID() . '.lock');
return $lockfilePath;

View File

@@ -128,7 +128,7 @@ class task_manager
{
$phpcli = $this->app['phraseanet.registry']->get('php_binary');
$cmd = $phpcli . ' -f ' . $this->app['phraseanet.registry']->get('GV_RootPath') . "bin/console scheduler:start";
$cmd = $phpcli . ' -f ' . $this->app['root.path'] . "/bin/console scheduler:start";
return new Process($cmd);
}
@@ -165,7 +165,7 @@ class task_manager
$pid = NULL;
$lockdir = $this->app['phraseanet.registry']->get('GV_RootPath') . 'tmp/locks/';
$lockdir = $this->app['root.path'] . '/tmp/locks/';
if (($schedlock = fopen($lockdir . 'scheduler.lock', 'a+')) != FALSE) {
if (flock($schedlock, LOCK_EX | LOCK_NB) === FALSE) {
// already locked : running !

View File

@@ -1426,7 +1426,7 @@ class task_period_archive extends task_abstract
if (!($rep = $node->getAttribute('grp_representation'))) {
try {
$this->dependencyContainer['filesystem']->copy(p4string::addEndSlash($this->dependencyContainer['phraseanet.registry']->get('GV_RootPath')) . 'www/skins/icons/substitution/regroup_doc.png', $genericdoc = ($path . '/group.jpg'), true);
$this->dependencyContainer['filesystem']->copy($this->dependencyContainer['root.path'] . '/www/skins/icons/substitution/regroup_doc.png', $genericdoc = ($path . '/group.jpg'), true);
} catch (IOException $e) {
$this->log($e->getMessage());
}

View File

@@ -442,7 +442,7 @@ class task_period_cindexer extends task_abstract
$args_nopwd[] = '--run';
}
$logdir = p4string::addEndSlash($this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'logs');
$logdir = $this->dependencyContainer['root.path'] . '/logs/';
$this->new_status = NULL; // new status to set at the end
$this->exception = NULL; // exception to throw at the end

View File

@@ -411,14 +411,14 @@ class task_period_ftp extends task_appboxAbstract
if ($subdef == 'caption') {
$desc = $record->get_caption()->serialize(\caption_record::SERIALIZE_XML, $ftp_export["businessfields"]);
$localfile = $this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'tmp/' . md5($desc . time() . mt_rand());
$localfile = $this->dependencyContainer['root.path'] . '/tmp/' . 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 = $record->get_caption()->serialize(\caption_record::SERIALIZE_YAML, $ftp_export["businessfields"]);
$localfile = $this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'tmp/' . md5($desc . time() . mt_rand());
$localfile = $this->dependencyContainer['root.path'] . '/tmp/' . md5($desc . time() . mt_rand());
if (file_put_contents($localfile, $desc) === false) {
throw new Exception('Impossible de creer un fichier temporaire');
}
@@ -507,7 +507,7 @@ class task_period_ftp extends task_appboxAbstract
$buffer .= $root . '/' . $folder . $filename . "\n";
}
$tmpfile = $this->dependencyContainer['phraseanet.registry']->get('GV_RootPath') . 'tmp/tmpftpbuffer' . $date->format('U') . '.txt';
$tmpfile = $this->dependencyContainer['root.path'] . '/tmp/tmpftpbuffer' . $date->format('U') . '.txt';
file_put_contents($tmpfile, $buffer);

View File

@@ -14,7 +14,7 @@
<div class="control-group">
<label class="control-label">Installation : </label>
<div class="controls">
<input type="text" class="input-xlarge" readonly="readonly" value="{{ app['phraseanet.registry'].get('GV_RootPath') }}" />
<input type="text" class="input-xlarge" readonly="readonly" value="{{ app['root.path'] }}" />
</div>
</div>
<div class="control-group">

View File

@@ -170,8 +170,8 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$lazaretFile = $this->getOneLazaretFile();
$lazaretFileName = self::$DI['app']['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = self::$DI['app']['phraseanet.registry']->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
$lazaretFileName = self::$DI['app']['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
$lazaretThumbFileName = self::$DI['app']['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
copy(__DIR__ . '/../../../../../files/cestlafete.jpg', $lazaretFileName);
copy(__DIR__ . '/../../../../../files/cestlafete.jpg', $lazaretThumbFileName);

View File

@@ -111,7 +111,7 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU
}
$databox = \databox::create(
self::$DI['app'], $conn, new \SplFileInfo(self::$DI['app']['phraseanet.registry']->get('GV_RootPath') . 'lib/conf.d/data_templates/fr-simple.xml'), self::$DI['app']['phraseanet.registry']
self::$DI['app'], $conn, new \SplFileInfo(self::$DI['app']['root.path'] . '/lib/conf.d/data_templates/fr-simple.xml'), self::$DI['app']['phraseanet.registry']
);
self::$createdDataboxes[] = $databox;