Indefero

Indefero Commit Details


Date:2009-01-29 13:29:45 (15 years 10 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:6153cd0b133cd7713ebc124f7bf890d109926d37
Parents: 672423861647d5e27f46924bf83bdd0a0b27face
Message:Fixed issue 119, no environment for the shell_exec and exec calls.

For each call exec or shell_exec, I have added the ability to prepend a
string. For example '/usr/bin/env -i '.
Changes:

File differences

src/IDF/Plugin/SyncGit/Serve.php
191191
192192
193193
194
194
195
195196
196197
197198
public function initRepository($fullpath)
{
mkdir($fullpath, 0750, true);
exec(sprintf('git --git-dir=%s init', escapeshellarg($fullpath)),
exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'git --git-dir=%s init', escapeshellarg($fullpath)),
$out, $res);
if ($res != 0) {
throw new Exception(sprintf('Init repository error, exit status %d.', $res));
src/IDF/Plugin/SyncMercurial.php
7979
8080
8181
82
8283
8384
8485
$output = array();
$cmd = sprintf('hg init %s',
escapeshellarg($mercurial_path.'/'.$shortname));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$ll = exec($cmd, $output, $return);
return ($return == 0);
}
src/IDF/Plugin/SyncSvn.php
7979
8080
8181
82
8283
8384
8485
$output = array();
$cmd = sprintf('svnadmin create %s',
escapeshellarg($svn_path.'/'.$shortname));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$ll = exec($cmd, $output, $return);
return ($return == 0);
}
src/IDF/Scm.php
5252
5353
5454
55
5556
5657
5758
......
7475
7576
7677
78
7779
7880
7981
*/
public static function exec($command, &$output=array(), &$return=0)
{
$command = Pluf::f('idf_exec_cmd_prefix', '').$command;
$key = md5($command);
$cache = Pluf_Cache::factory();
if (null === ($res=$cache->get($key))) {
*/
public static function shell_exec($command)
{
$command = Pluf::f('idf_exec_cmd_prefix', '').$command;
$key = md5($command);
$cache = Pluf_Cache::factory();
if (null === ($res=$cache->get($key))) {
src/IDF/Scm/Git.php
235235
236236
237237
238
238
239
239240
240241
241242
......
410411
411412
412413
413
414
415
414416
415417
416418
*/
public function getBlob($request_file_info, $dummy=null)
{
return shell_exec(sprintf('GIT_DIR=%s git cat-file blob %s',
return shell_exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'GIT_DIR=%s git cat-file blob %s',
escapeshellarg($this->repo),
escapeshellarg($request_file_info->hash)));
}
*/
public function getArchiveCommand($commit, $prefix='git-repo-dump/')
{
return sprintf('GIT_DIR=%s git archive --format=zip --prefix=%s %s',
return sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'GIT_DIR=%s git archive --format=zip --prefix=%s %s',
escapeshellarg($this->repo),
escapeshellarg($prefix),
escapeshellarg($commit));
src/IDF/Scm/Mercurial.php
398398
399399
400400
401
401
402
402403
403404
404405
*/
public function getArchiveCommand($commit, $prefix='')
{
return sprintf('hg archive --type=zip -R %s -r %s -',
return sprintf(Pluf::f('idf_exec_cmd_prefix', '').
'hg archive --type=zip -R %s -r %s -',
escapeshellarg($this->repo),
escapeshellarg($commit));
}
src/IDF/Scm/Svn.php
369369
370370
371371
372
372
373373
374374
375375
*/
public function getArchiveCommand($commit, $prefix='git-repo-dump/')
{
throw new Exception(('Unsupported feature.'));
throw new Exception('Unsupported feature.');
}
src/IDF/conf/idf.php-dist
201201
202202
203203
204
205
206
207
208
209
210
204211
# Extra text files when displaying source
# $cfg['idf_extra_text_ext'] = 'ext1 ext2 ext3';
# If you can execute the shell commands executed to get info
# from the scm with the user of your PHP process but it is
# not working from within PHP, this can be due to the environment
# variables not being set correctly. Note the trailing space.
# $cfg['idf_exec_cmd_prefix'] = '/usr/bin/env -i ';
return $cfg;

Archive Download the corresponding diff file

Page rendered in 0.10976s using 14 queries.