Indefero

Indefero Commit Details


Date:2008-08-04 14:24:07 (16 years 4 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, svn
Commit:6ad7ee8c71dc89fd074ac0129bc9d7f286de229d
Parents: da1ddc41791747b4463a460899a36792de21b1b5
Message:Added integration with git-daemon.

In the configuration it is possible to give a git daemon url to have it
displayed in the source view.
Changes:

File differences

src/IDF/Project.php
287287
288288
289289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
290322
}
return $tags;
}
/**
* Get the path to the git repository.
*
* @return string Path to the git repository
*/
public function getGitRepository()
{
$gitrep = Pluf::f('git_repository');
if (substr($gitrep, -4) == '.git') {
return $gitrep;
}
// here we consider that the git_repository is a folder
// containing a series of git repositories
return $gitrep.'/'.$this->shortname.'.git';
}
/**
* Get the url to the repository through git daemon.
*
* @return string Path to the git daemon.
*/
public function getGitDaemonUrl()
{
$gitrep = Pluf::f('git_daemon_url');
if (substr($gitrep, -4) == '.git') {
return $gitrep;
}
// here we consider that the git_repository is a folder
// containing a series of git repositories
return $gitrep.'/'.$this->shortname.'.git';
}
}
src/IDF/Views/Source.php
3434
3535
3636
37
37
3838
3939
4040
......
5252
5353
5454
55
55
5656
5757
5858
......
8181
8282
8383
84
84
8585
8686
8787
......
148148
149149
150150
151
151
152152
153153
154154
......
182182
183183
184184
185
185
186186
187187
188188
public function changeLog($request, $match)
{
$title = sprintf('%s Git Change Log', (string) $request->project);
$git = new IDF_Git(Pluf::f('git_repository'));
$git = new IDF_Git($request->project->getGitRepository());
$branches = $git->getBranches();
$commit = $match[2];
$res = $git->getChangeLog($commit, 50);
public function treeBase($request, $match)
{
$title = sprintf('%s Git Source Tree', (string) $request->project);
$git = new IDF_Git(Pluf::f('git_repository'));
$git = new IDF_Git($request->project->getGitRepository());
$commit = $match[2];
$branches = $git->getBranches();
if ('commit' != $git->testHash($commit)) {
public function tree($request, $match)
{
$title = sprintf('%s Git Source Tree', (string) $request->project);
$git = new IDF_Git(Pluf::f('git_repository'));
$git = new IDF_Git($request->project->getGitRepository());
$branches = $git->getBranches();
$commit = $match[2];
if ('commit' != $git->testHash($commit)) {
public function commit($request, $match)
{
$git = new IDF_Git(Pluf::f('git_repository'));
$git = new IDF_Git($request->project->getGitRepository());
$commit = $match[2];
$branches = $git->getBranches();
if ('commit' != $git->testHash($commit)) {
public function download($request, $match)
{
$commit = trim($match[2]);
$git = new IDF_Git(Pluf::f('git_repository'));
$git = new IDF_Git($request->project->getGitRepository());
$branches = $git->getBranches();
if ('commit' != $git->testHash($commit)) {
// Redirect to the first branch
src/IDF/conf/idf.php-dist
2323
2424
2525
26
2627
27
28
28
29
30
31
32
33
34
35
2936
30
31
32
33
34
3537
36
38
39
40
41
3742
43
44
3845
39
40
4146
4247
4348
49
4450
4551
4652
4753
4854
4955
50
56
5157
5258
5359
......
5965
6066
6167
62
63
68
69
70
71
72
73
6474
65
6675
6776
6877
69
70
71
7278
7379
7480
7581
7682
83
7784
7885
7986
8087
8188
82
83
84
85
86
87
88
89
90
91
9289
9390
9491
......
9996
10097
10198
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
102117
103
$cfg = array();
// to start with, it can be practical.
$cfg['debug'] = false;
$cfg['installed_apps'] = array('Pluf', 'IDF');
$cfg['pluf_use_rowpermission'] = true;
// if you have a single git repository, just put the full path to it
// without trailing slash.
// If within a folder you have a series of git repository, just put
// the folder without a trailing slash.
// InDefero will automatically append a slash, the project shortname
// and .git to create the name of the repository.
// $cfg['git_repository'] = '/home/git/repositories';
$cfg['git_repository'] = '/home/git/repositories/indefero.git';
$cfg['middleware_classes'] = array(
'IDF_Middleware',
'Pluf_Middleware_Session',
'Pluf_Middleware_Translation',
);
$cfg['template_context_processors'] = array('IDF_Middleware_ContextPreProcessor');
// As for the 'git_repository' case, you can either have it ending
// with .git in the case of a single repository or let it append
// '/'.$project_shortname.'.git' to make the path.
$cfg['git_daemon_url'] = 'git://projects.ceondo.com/indefero.git';
// admins will get an email in case of errors in the system in non
// debug mode.
$cfg['admins'] = array(
// admins will get an email in case of errors
// in the system in non debug mode.
array('Admin', 'you@example.com'),
);
// Email configuration
$cfg['send_emails'] = true;
$cfg['mail_backend'] = 'smtp';
$cfg['mail_host'] = 'localhost';
$cfg['mail_port'] = 25;
$cfg['pear_path'] = '/usr/share/php';
// Paths/Url configuration
$cfg['idf_base'] = ''; // put '/whatever/index.php if you are not
// using mod_rewrite and installing in a
// subfolder.
$cfg['login_success_url'] = '/';
$cfg['after_logout_page'] = '/';
$cfg['secret_key'] = ''; // write here a long random string unique for
// this installation.
// write here a long random string unique for this installation. This
// is critical to put a long string.
$cfg['secret_key'] = '';
// the sender of all the emails.
$cfg['from_email'] = 'sender@example.com';
$cfg['from_email'] = 'sender@example.com'; // the sender of all the emails.
// Email address for the bounced messages.
$cfg['bounce_email'] = 'no-reply@example.com';
$cfg['idf_views'] = dirname(__FILE__).'/views.php';
// Temporary folder where the script is writing the compiled templates,
// cached data and other temporary resources.
// It must be writeable by your webserver instance.
// It is mandatory if you are using the template system.
$cfg['tmp_folder'] = '/tmp';
// The folder in which the templates of the application are located.
$cfg['template_folders'] = array(
dirname(__FILE__).'/../templates',
);
$cfg['template_tags'] = array(
'hotkey' => 'IDF_Template_HotKey',
'issuetext' => 'IDF_Template_IssueComment',
);
$cfg['template_modifiers'] = array(
'size' => 'IDF_Views_Source_PrettySize',
'markdown' => 'IDF_Template_Markdown_filter',
);
// Database configuration
// For testing we are using in memory SQLite database.
$cfg['db_login'] = 'www';
$cfg['db_engine'] = 'PostgreSQL'; // SQLite is also well tested or MySQL
$cfg['db_database'] = 'website';
// From this point you should not need to update anything.
$cfg['installed_apps'] = array('Pluf', 'IDF');
$cfg['pluf_use_rowpermission'] = true;
$cfg['middleware_classes'] = array(
'IDF_Middleware',
'Pluf_Middleware_Session',
'Pluf_Middleware_Translation',
);
$cfg['template_context_processors'] = array('IDF_Middleware_ContextPreProcessor');
$cfg['idf_views'] = dirname(__FILE__).'/views.php';
$cfg['template_tags'] = array(
'hotkey' => 'IDF_Template_HotKey',
'issuetext' => 'IDF_Template_IssueComment',
);
$cfg['template_modifiers'] = array(
'size' => 'IDF_Views_Source_PrettySize',
'markdown' => 'IDF_Template_Markdown_filter',
);
return $cfg;
src/IDF/templates/source/tree.html
4444
4545
4646
47
4748
4849
4950
</table>
{aurl 'url', 'IDF_Views_Source::download', array($project.shortname, $commit)}
<p class="right"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this version'}</a></p>
<p class="right"><kbd>git clone {$project.getGitDaemonUrl()}</kbd></p>
{/block}
{block context}

Archive Download the corresponding diff file

Page rendered in 0.10478s using 13 queries.