Browse code

Tried to remove lots of code that shows email addresses.

And changed perms to make it possible to put the GitList source code
in a multifile in GNU Emacs.

Apollia authored on 06/21/2018 12:28:15
Showing 1 changed files
1 1
old mode 100755
2 2
new mode 100644
Browse code

Changed the location of config.ini.

Apollia authored on 06/21/2018 05:37:55
Showing 1 changed files
... ...
@@ -20,7 +20,7 @@ if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) {
20 20
 require 'vendor/autoload.php';
21 21
 
22 22
 
23
-$Filepath____Config_Ini=$_SERVER['DOCUMENT_ROOT'] . "/../apconfig/GitList/config.ini";
23
+$Filepath____Config_Ini=$_SERVER['DOCUMENT_ROOT'] . "/../apconfig/GitList/Default-Version/config.ini";
24 24
 		
25 25
 $config = GitList\Config::fromFile($Filepath____Config_Ini);
26 26
 
Browse code

Made it so config.ini has to be at this new location, outside of the web-viewable "gitlist" folder:

$_SERVER['DOCUMENT_ROOT']/../apconfig/GitList/config.ini

Apollia authored on 06/11/2018 22:01:00
Showing 1 changed files
1 1
old mode 100644
2 2
new mode 100755
... ...
@@ -19,7 +19,10 @@ if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) {
19 19
 
20 20
 require 'vendor/autoload.php';
21 21
 
22
-$config = GitList\Config::fromFile('config.ini');
22
+
23
+$Filepath____Config_Ini=$_SERVER['DOCUMENT_ROOT'] . "/../apconfig/GitList/config.ini";
24
+		
25
+$config = GitList\Config::fromFile($Filepath____Config_Ini);
23 26
 
24 27
 if ($config->get('date', 'timezone')) {
25 28
     date_default_timezone_set($config->get('date', 'timezone'));
Browse code

Proper config namespace

Klaus Silveira authored on 05/17/2014 12:32:28
Showing 1 changed files
... ...
@@ -1,11 +1,10 @@
1 1
 <?php
2 2
 
3 3
 /**
4
- * GitList 0.4
5
- * https://github.com/klaussilveira/gitlist
4
+ * GitList: an elegant and modern git repository viewer
5
+ * http://gitlist.org
6 6
  */
7 7
 
8
-// Set the default timezone for systems without date.timezone set in php.ini
9 8
 if (!ini_get('date.timezone')) {
10 9
     date_default_timezone_set('UTC');
11 10
 }
... ...
@@ -22,8 +21,8 @@ require 'vendor/autoload.php';
22 21
 
23 22
 $config = GitList\Config::fromFile('config.ini');
24 23
 
25
-if ($config->get('Date', 'timezone')) {
26
-    date_default_timezone_set($config->get('Date', 'timezone'));
24
+if ($config->get('date', 'timezone')) {
25
+    date_default_timezone_set($config->get('date', 'timezone'));
27 26
 }
28 27
 
29 28
 $app = require 'boot.php';
Browse code

Merge pull request #336 from plicease/timezone_option

add an option for setting the timezone in the local config.ini

Klaus Silveira authored on 09/12/2013 19:32:06
Showing 0 changed files
Browse code

version catch-up

Gábor Tóth authored on 07/01/2013 12:52:03
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 /**
4
- * GitList 0.3
4
+ * GitList 0.4
5 5
  * https://github.com/klaussilveira/gitlist
6 6
  */
7 7
 
Browse code

add an option for setting the timezone in the local config.ini

Graham Ollis authored on 06/21/2013 18:44:38
Showing 1 changed files
... ...
@@ -21,6 +21,11 @@ if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) {
21 21
 require 'vendor/autoload.php';
22 22
 
23 23
 $config = GitList\Config::fromFile('config.ini');
24
+
25
+if ($config->get('Date', 'timezone')) {
26
+    date_default_timezone_set($config->get('Date', 'timezone'));
27
+}
28
+
24 29
 $app = require 'boot.php';
25 30
 $app->run();
26 31
 
Browse code

Major refactoring of the codebase, specially in the directory scanning parts.

I have removed the directory management features from Gitter and ported them to GitList,
since they are application-specific logic. I was unhappy with the way directories and multiple
directories were handled, so i altered almost everything.

The tests are OK, but the coverage is not good. This means that i'll need som help from all
GitList users that are actively testing the development version with multiple directories.

I have removed the directory caching feature for now, it will be re-implemented soon.

Klaus Silveira authored on 06/01/2013 15:51:25
Showing 1 changed files
... ...
@@ -14,12 +14,13 @@ if (php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'
14 14
     return false;
15 15
 }
16 16
 
17
+if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) {
18
+    die(sprintf('The "%s" folder must be writable for GitList to run.', __DIR__ . DIRECTORY_SEPARATOR . 'cache'));
19
+}
20
+
17 21
 require 'vendor/autoload.php';
18 22
 
19
-// Load configuration
20 23
 $config = GitList\Config::fromFile('config.ini');
21
-
22 24
 $app = require 'boot.php';
23
-
24 25
 $app->run();
25 26
 
Browse code

Gitlist php code compliant with PSR-1 and PSR-2.

Wim Rijnders authored on 02/05/2013 10:27:10
Showing 1 changed files
... ...
@@ -1,4 +1,5 @@
1 1
 <?php
2
+
2 3
 /**
3 4
  * GitList 0.3
4 5
  * https://github.com/klaussilveira/gitlist
... ...
@@ -9,7 +10,7 @@ if (!ini_get('date.timezone')) {
9 10
     date_default_timezone_set('UTC');
10 11
 }
11 12
 
12
-if(php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'], 1))) {
13
+if (php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'], 1))) {
13 14
     return false;
14 15
 }
15 16
 
... ...
@@ -21,3 +22,4 @@ $config = GitList\Config::fromFile('config.ini');
21 22
 $app = require 'boot.php';
22 23
 
23 24
 $app->run();
25
+
Browse code

gitlist passes units tests.

Wim Rijnders authored on 01/27/2013 21:06:10
Showing 1 changed files
... ...
@@ -1,5 +1,4 @@
1 1
 <?php
2
-
3 2
 /**
4 3
  * GitList 0.3
5 4
  * https://github.com/klaussilveira/gitlist
Browse code

Merged with master main repo.

Wim Rijnders authored on 01/19/2013 08:06:31
Showing 0 changed files
Browse code

multiple dir's fully tested.

Wim Rijnders authored on 12/20/2012 19:56:10
Showing 1 changed files
... ...
@@ -1,8 +1,5 @@
1 1
 <?php
2 2
 
3
-#WRI DEBUG
4
-echo "<pre>";
5
-
6 3
 /**
7 4
  * GitList 0.3
8 5
  * https://github.com/klaussilveira/gitlist
... ...
@@ -20,7 +17,4 @@ $config = GitList\Config::fromFile('config.ini');
20 17
 
21 18
 $app = require 'boot.php';
22 19
 
23
-#WRI DEBUG
24
-echo "</pre>";
25
-
26 20
 $app->run();
Browse code

Merge pull request #201 from zauguin/master

PHP Built-In Web Server

Klaus Silveira authored on 12/19/2012 18:43:21
Showing 0 changed files
Browse code

Renamed getRepository() in gitter Client, to avoid method name collision; some code cleanup.

Wim Rijnders authored on 12/04/2012 05:29:10
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 <?php
2 2
 
3
+#WRI DEBUG
3 4
 echo "<pre>";
4 5
 
5 6
 /**
... ...
@@ -19,6 +20,7 @@ $config = GitList\Config::fromFile('config.ini');
19 20
 
20 21
 $app = require 'boot.php';
21 22
 
23
+#WRI DEBUG
22 24
 echo "</pre>";
23 25
 
24 26
 $app->run();
Browse code

Multiple root dir's recursion. Works fine, using them per repo needs to be figured out.

Wim Rijnders authored on 12/02/2012 19:42:21
Showing 1 changed files
... ...
@@ -1,5 +1,7 @@
1 1
 <?php
2 2
 
3
+echo "<pre>";
4
+
3 5
 /**
4 6
  * GitList 0.3
5 7
  * https://github.com/klaussilveira/gitlist
... ...
@@ -16,4 +18,7 @@ require 'vendor/autoload.php';
16 18
 $config = GitList\Config::fromFile('config.ini');
17 19
 
18 20
 $app = require 'boot.php';
21
+
22
+echo "</pre>";
23
+
19 24
 $app->run();
Browse code

Added support for PHP built-in Web server

zauguin authored on 11/01/2012 17:43:17
Showing 1 changed files
... ...
@@ -10,6 +10,10 @@ if (!ini_get('date.timezone')) {
10 10
     date_default_timezone_set('UTC');
11 11
 }
12 12
 
13
+if(php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'], 1))) {
14
+    return false;
15
+}
16
+
13 17
 require 'vendor/autoload.php';
14 18
 $app = require 'boot.php';
15 19
 $app->run();
16 20
\ No newline at end of file
Browse code

Moved config loading to index.php

As `index.php` is the entry point of the webapp, loading configuration
data from the `config.ini` should take place there. This makes testing
easier, since a properly formatted `config.ini` (whose values are
overriden anyway) is no longer needed.

Christian Schorn authored on 10/31/2012 17:06:30
Showing 1 changed files
... ...
@@ -11,5 +11,9 @@ if (!ini_get('date.timezone')) {
11 11
 }
12 12
 
13 13
 require 'vendor/autoload.php';
14
+
15
+// Load configuration
16
+$config = GitList\Config::fromFile('config.ini');
17
+
14 18
 $app = require 'boot.php';
15
-$app->run();
16 19
\ No newline at end of file
20
+$app->run();
Browse code

Setting the default date timezone to make sure systems without a properly configured php.ini can run GitList

Klaus Silveira authored on 10/31/2012 01:57:47
Showing 1 changed files
... ...
@@ -5,6 +5,11 @@
5 5
  * https://github.com/klaussilveira/gitlist
6 6
  */
7 7
 
8
+// Set the default timezone for systems without date.timezone set in php.ini
9
+if (!ini_get('date.timezone')) {
10
+    date_default_timezone_set('UTC');
11
+}
12
+
8 13
 require 'vendor/autoload.php';
9 14
 $app = require 'boot.php';
10 15
 $app->run();
11 16
\ No newline at end of file
Browse code

New architecture to make tests easier

Klaus Silveira authored on 07/26/2012 06:42:29
Showing 1 changed files
... ...
@@ -6,18 +6,5 @@
6 6
  */
7 7
 
8 8
 require 'vendor/autoload.php';
9
-
10
-// Load configuration
11
-$config = new GitList\Config('config.ini');
12
-$config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
13
-
14
-// Startup and configure Silex application
15
-$app = new GitList\Application($config, __DIR__);
16
-
17
-// Mount the controllers
18
-$app->mount('', new GitList\Controller\MainController());
19
-$app->mount('', new GitList\Controller\BlobController());
20
-$app->mount('', new GitList\Controller\CommitController());
21
-$app->mount('', new GitList\Controller\TreeController());
22
-
23
-$app->run();
9
+$app = require 'boot.php';
10
+$app->run();
24 11
\ No newline at end of file
Browse code

Move services init to a specific GitList\Application class

Jérôme Tamarelle authored on 07/15/2012 09:11:42
Showing 1 changed files
... ...
@@ -12,29 +12,7 @@ $config = new GitList\Config('config.ini');
12 12
 $config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
13 13
 
14 14
 // Startup and configure Silex application
15
-$app = new Silex\Application();
16
-$app['debug'] = $config->get('app', 'debug');
17
-$app['filetypes'] = $config->getSection('filetypes');
18
-$app['cache.archives'] = __DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'archives';
19
-
20
-// Register services
21
-$app->register(new Silex\Provider\TwigServiceProvider(), array(
22
-    'twig.path'       => __DIR__ . '/views',
23
-    'twig.options'    => array('cache' => __DIR__ . '/cache'),
24
-));
25
-$app->register(new GitList\Provider\GitServiceProvider(), array(
26
-    'git.client'      => $config->get('git', 'client'),
27
-    'git.repos'       => $config->get('git', 'repositories'),
28
-    'git.hidden'      => $config->get('git', 'hidden') ? $config->get('git', 'hidden') : array(),
29
-));
30
-$app->register(new GitList\Provider\ViewUtilServiceProvider());
31
-$app->register(new GitList\Provider\RepositoryUtilServiceProvider());
32
-$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
33
-
34
-$app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
35
-    $twig->addFilter('md5', new Twig_Filter_Function('md5'));
36
-    return $twig;
37
-}));
15
+$app = new GitList\Application($config, __DIR__);
38 16
 
39 17
 // Mount the controllers
40 18
 $app->mount('', new GitList\Controller\MainController());
... ...
@@ -42,11 +20,4 @@ $app->mount('', new GitList\Controller\BlobController());
42 20
 $app->mount('', new GitList\Controller\CommitController());
43 21
 $app->mount('', new GitList\Controller\TreeController());
44 22
 
45
-// Handle errors
46
-$app->error(function (\Exception $e, $code) use ($app) {
47
-    return $app['twig']->render('error.twig', array(
48
-        'message' => $e->getMessage(),
49
-    ));
50
-});
51
-
52 23
 $app->run();
Browse code

Trying to decouple the Git communication library from the GitList application as much as possible

Klaus Silveira authored on 07/15/2012 05:04:23
Showing 1 changed files
... ...
@@ -15,7 +15,6 @@ $config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), D
15 15
 $app = new Silex\Application();
16 16
 $app['debug'] = $config->get('app', 'debug');
17 17
 $app['filetypes'] = $config->getSection('filetypes');
18
-$app['hidden'] = $config->get('git', 'hidden') ? $config->get('git', 'hidden') : array();
19 18
 $app['cache.archives'] = __DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'archives';
20 19
 
21 20
 // Register services
... ...
@@ -26,6 +25,7 @@ $app->register(new Silex\Provider\TwigServiceProvider(), array(
26 25
 $app->register(new GitList\Provider\GitServiceProvider(), array(
27 26
     'git.client'      => $config->get('git', 'client'),
28 27
     'git.repos'       => $config->get('git', 'repositories'),
28
+    'git.hidden'      => $config->get('git', 'hidden') ? $config->get('git', 'hidden') : array(),
29 29
 ));
30 30
 $app->register(new GitList\Provider\ViewUtilServiceProvider());
31 31
 $app->register(new GitList\Provider\RepositoryUtilServiceProvider());
Browse code

Better configuration handling and abstraction

Klaus Silveira authored on 07/15/2012 04:50:38
Showing 1 changed files
... ...
@@ -5,34 +5,27 @@
5 5
  * https://github.com/klaussilveira/gitlist
6 6
  */
7 7
 
8
-if (!file_exists('config.ini')) {
9
-    die("Please, create the config.ini file.");
10
-}
11
-
12
-$config = parse_ini_file('config.ini', true);
13
-
14
-if (empty($config['git']['repositories']) || !is_dir($config['git']['repositories'])) {
15
-    die("Please, edit the config.ini file and provide your repositories directory");
16
-}
17
-
18 8
 require 'vendor/autoload.php';
19 9
 
20
-$app = new Silex\Application();
21
-$app['debug'] = isset($config['app']['debug']) && $config['app']['debug'];
22
-$app['filetypes'] = $config['filetypes'];
23
-$app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
24
-$config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
10
+// Load configuration
11
+$config = new GitList\Config('config.ini');
12
+$config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
25 13
 
26
-$app['cache.archives'] = __DIR__.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'archives';
14
+// Startup and configure Silex application
15
+$app = new Silex\Application();
16
+$app['debug'] = $config->get('app', 'debug');
17
+$app['filetypes'] = $config->getSection('filetypes');
18
+$app['hidden'] = $config->get('git', 'hidden') ? $config->get('git', 'hidden') : array();
19
+$app['cache.archives'] = __DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'archives';
27 20
 
28
-// Register Git and Twig service providersclass_path
21
+// Register services
29 22
 $app->register(new Silex\Provider\TwigServiceProvider(), array(
30
-    'twig.path'       => __DIR__.'/views',
31
-    'twig.options'    => array('cache' => __DIR__.'/cache'),
23
+    'twig.path'       => __DIR__ . '/views',
24
+    'twig.options'    => array('cache' => __DIR__ . '/cache'),
32 25
 ));
33 26
 $app->register(new GitList\Provider\GitServiceProvider(), array(
34
-    'git.client'      => $config['git']['client'],
35
-    'git.repos'       => $config['git']['repositories'],
27
+    'git.client'      => $config->get('git', 'client'),
28
+    'git.repos'       => $config->get('git', 'repositories'),
36 29
 ));
37 30
 $app->register(new GitList\Provider\ViewUtilServiceProvider());
38 31
 $app->register(new GitList\Provider\RepositoryUtilServiceProvider());
... ...
@@ -43,12 +36,13 @@ $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
43 36
     return $twig;
44 37
 }));
45 38
 
39
+// Mount the controllers
46 40
 $app->mount('', new GitList\Controller\MainController());
47 41
 $app->mount('', new GitList\Controller\BlobController());
48 42
 $app->mount('', new GitList\Controller\CommitController());
49 43
 $app->mount('', new GitList\Controller\TreeController());
50 44
 
51
-// Error handling
45
+// Handle errors
52 46
 $app->error(function (\Exception $e, $code) use ($app) {
53 47
     return $app['twig']->render('error.twig', array(
54 48
         'message' => $e->getMessage(),
Browse code

Major refactoring of the application structure, mostly namespace changes and re-organization

Klaus Silveira authored on 07/15/2012 03:32:24
Showing 1 changed files
... ...
@@ -30,28 +30,23 @@ $app->register(new Silex\Provider\TwigServiceProvider(), array(
30 30
     'twig.path'       => __DIR__.'/views',
31 31
     'twig.options'    => array('cache' => __DIR__.'/cache'),
32 32
 ));
33
-$app->register(new Git\GitServiceProvider(), array(
33
+$app->register(new GitList\Provider\GitServiceProvider(), array(
34 34
     'git.client'      => $config['git']['client'],
35 35
     'git.repos'       => $config['git']['repositories'],
36 36
 ));
37
-$app->register(new Application\UtilsServiceProvider());
37
+$app->register(new GitList\Provider\ViewUtilServiceProvider());
38
+$app->register(new GitList\Provider\RepositoryUtilServiceProvider());
38 39
 $app->register(new Silex\Provider\UrlGeneratorServiceProvider());
39 40
 
40 41
 $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
41
-    // Add the md5() function to Twig scope
42 42
     $twig->addFilter('md5', new Twig_Filter_Function('md5'));
43
-
44 43
     return $twig;
45 44
 }));
46 45
 
47
-// Load controllers
48
-include 'controllers/archiveController.php';
49
-include 'controllers/indexController.php';
50
-include 'controllers/treeController.php';
51
-include 'controllers/blobController.php';
52
-include 'controllers/commitController.php';
53
-include 'controllers/statsController.php';
54
-include 'controllers/rssController.php';
46
+$app->mount('', new GitList\Controller\MainController());
47
+$app->mount('', new GitList\Controller\BlobController());
48
+$app->mount('', new GitList\Controller\CommitController());
49
+$app->mount('', new GitList\Controller\TreeController());
55 50
 
56 51
 // Error handling
57 52
 $app->error(function (\Exception $e, $code) use ($app) {
Browse code

Merge pull request #81 from GromNaN/zipball

Add zipball and tarball download (fix #66)

Klaus Silveira authored on 07/14/2012 14:50:21
Showing 0 changed files
Browse code

Enable app debug in config.ini

Jérôme Tamarelle authored on 07/14/2012 11:56:12
Showing 1 changed files
... ...
@@ -18,6 +18,7 @@ if (empty($config['git']['repositories']) || !is_dir($config['git']['repositorie
18 18
 require 'vendor/autoload.php';
19 19
 
20 20
 $app = new Silex\Application();
21
+$app['debug'] = isset($config['app']['debug']) && $config['app']['debug'];
21 22
 $app['filetypes'] = $config['filetypes'];
22 23
 $app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
23 24
 $config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
Browse code

Create zipball / tarball feature Archives are cached in cache/archives/repo/tree to never generate the same tree archive twice.

Jérôme Tamarelle authored on 07/14/2012 10:47:23
Showing 1 changed files
... ...
@@ -22,6 +22,8 @@ $app['filetypes'] = $config['filetypes'];
22 22
 $app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
23 23
 $config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
24 24
 
25
+$app['cache.archives'] = __DIR__.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'archives';
26
+
25 27
 // Register Git and Twig service providersclass_path
26 28
 $app->register(new Silex\Provider\TwigServiceProvider(), array(
27 29
     'twig.path'       => __DIR__.'/views',
... ...
@@ -42,6 +44,7 @@ $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
42 44
 }));
43 45
 
44 46
 // Load controllers
47
+include 'controllers/archiveController.php';
45 48
 include 'controllers/indexController.php';
46 49
 include 'controllers/treeController.php';
47 50
 include 'controllers/blobController.php';
Browse code

Merge remote-tracking branch 'upstream/master'

Michał Prochowski authored on 07/08/2012 20:03:22
Showing 0 changed files
Browse code

fixed URL management

Fabien Potencier authored on 07/06/2012 19:49:55
Showing 1 changed files
... ...
@@ -14,7 +14,6 @@ if (empty($config['git']['repositories']) || !is_dir($config['git']['repositorie
14 14
 require 'vendor/autoload.php';
15 15
 
16 16
 $app = new Silex\Application();
17
-$app['baseurl'] = rtrim($config['app']['baseurl'], '/');
18 17
 $app['filetypes'] = $config['filetypes'];
19 18
 $app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
20 19
 $config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
... ...
@@ -29,9 +28,14 @@ $app->register(new Git\GitServiceProvider(), array(
29 28
     'git.repos'       => $config['git']['repositories'],
30 29
 ));
31 30
 $app->register(new Application\UtilsServiceProvider());
31
+$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
32 32
 
33
-// Add the md5() function to Twig scope
34
-$app['twig']->addFilter('md5', new Twig_Filter_Function('md5'));
33
+$app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
34
+    // Add the md5() function to Twig scope
35
+    $twig->addFilter('md5', new Twig_Filter_Function('md5'));
36
+
37
+    return $twig;
38
+}));
35 39
 
36 40
 // Load controllers
37 41
 include 'controllers/indexController.php';
... ...
@@ -44,8 +48,7 @@ include 'controllers/rssController.php';
44 48
 // Error handling
45 49
 $app->error(function (\Exception $e, $code) use ($app) {
46 50
     return $app['twig']->render('error.twig', array(
47
-        'baseurl'   => $app['baseurl'],
48
-        'message'   => $e->getMessage(),
51
+        'message' => $e->getMessage(),
49 52
     ));
50 53
 });
51 54
 
Browse code

Master branch is now the future 0.3

Klaus Silveira authored on 07/06/2012 12:57:05
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 /**
4
- * GitList 0.2
4
+ * GitList 0.3
5 5
  * https://github.com/klaussilveira/gitlist
6 6
  */
7 7
 
Browse code

Updating installation instructions, going to 0.2

Klaus Silveira authored on 07/05/2012 16:24:21
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 
3 3
 /**
4
- * GitList 0.1
4
+ * GitList 0.2
5 5
  * https://github.com/klaussilveira/gitlist
6 6
  */
7 7
 
Browse code

Dropping PHAR, using Composer for dependency management

Klaus Silveira authored on 07/04/2012 15:07:46
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ if (empty($config['git']['repositories']) || !is_dir($config['git']['repositorie
11 11
     die("Please, edit the config.ini file and provide your repositories directory");
12 12
 }
13 13
 
14
-require_once 'phar://'.__DIR__.'/vendor/silex.phar';
14
+require 'vendor/autoload.php';
15 15
 
16 16
 $app = new Silex\Application();
17 17
 $app['baseurl'] = rtrim($config['app']['baseurl'], '/');
... ...
@@ -19,12 +19,9 @@ $app['filetypes'] = $config['filetypes'];
19 19
 $app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
20 20
 $config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
21 21
 
22
-// Register Git and Twig libraries
23
-$app['autoloader']->registerNamespace('Git', __DIR__.'/lib');
24
-$app['autoloader']->registerNamespace('Application', __DIR__.'/lib');
22
+// Register Git and Twig service providersclass_path
25 23
 $app->register(new Silex\Provider\TwigServiceProvider(), array(
26 24
     'twig.path'       => __DIR__.'/views',
27
-    'twig.class_path' => __DIR__.'/vendor',
28 25
     'twig.options'    => array('cache' => __DIR__.'/cache'),
29 26
 ));
30 27
 $app->register(new Git\GitServiceProvider(), array(
Browse code

Fix warnings: - Warning: parse_ini_file(config.ini) [function.parse-ini-file]: failed to open stream: No such file or directory in /home/mablo/www/gitlist/index.php on line 8

- Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/mablo/git/index.php/.git/HEAD) is not within the allowed path(s): (/usr/local/php5) in /home/mablo/www/gitlist/lib/Git/Client.php on line 90

Michał Prochowski authored on 07/04/2012 15:02:06
Showing 1 changed files
... ...
@@ -5,6 +5,10 @@
5 5
  * https://github.com/klaussilveira/gitlist
6 6
  */
7 7
 
8
+if (!file_exists('config.ini')) {
9
+    die("Please, create the config.ini file.");
10
+}
11
+
8 12
 $config = parse_ini_file('config.ini', true);
9 13
 
10 14
 if (empty($config['git']['repositories']) || !is_dir($config['git']['repositories'])) {
Browse code

Litle tweaks for config.ini-example - tweak for git.repositories config to don't care "with ending slash" cond. - tweak for app.baseurl config to don't care "without ending slash" cond.

Erik Amaru Ortiz authored on 06/10/2012 12:14:36
Showing 1 changed files
... ...
@@ -14,9 +14,10 @@ if (empty($config['git']['repositories']) || !is_dir($config['git']['repositorie
14 14
 require_once 'phar://'.__DIR__.'/vendor/silex.phar';
15 15
 
16 16
 $app = new Silex\Application();
17
-$app['baseurl'] = $config['app']['baseurl'];
17
+$app['baseurl'] = rtrim($config['app']['baseurl'], '/');
18 18
 $app['filetypes'] = $config['filetypes'];
19 19
 $app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
20
+$config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
20 21
 
21 22
 // Register Git and Twig libraries
22 23
 $app['autoloader']->registerNamespace('Git', __DIR__.'/lib');
Browse code

Make explicit the phar:// scheme

Ángel Guzmán Maeso authored on 06/09/2012 02:59:48
Showing 1 changed files
... ...
@@ -11,7 +11,7 @@ if (empty($config['git']['repositories']) || !is_dir($config['git']['repositorie
11 11
     die("Please, edit the config.ini file and provide your repositories directory");
12 12
 }
13 13
 
14
-require_once __DIR__.'/vendor/silex.phar';
14
+require_once 'phar://'.__DIR__.'/vendor/silex.phar';
15 15
 
16 16
 $app = new Silex\Application();
17 17
 $app['baseurl'] = $config['app']['baseurl'];
Browse code

Verify repository folder existence before anything, fixes #44

Klaus Silveira authored on 06/07/2012 05:43:16
Showing 1 changed files
... ...
@@ -7,7 +7,7 @@
7 7
 
8 8
 $config = parse_ini_file('config.ini', true);
9 9
 
10
-if (empty($config['git']['repositories'])) {
10
+if (empty($config['git']['repositories']) || !is_dir($config['git']['repositories'])) {
11 11
     die("Please, edit the config.ini file and provide your repositories directory");
12 12
 }
13 13
 
Browse code

Implementing hidden repository feature, fixes #30

Klaus Silveira authored on 06/07/2012 04:34:22
Showing 1 changed files
... ...
@@ -16,6 +16,7 @@ require_once __DIR__.'/vendor/silex.phar';
16 16
 $app = new Silex\Application();
17 17
 $app['baseurl'] = $config['app']['baseurl'];
18 18
 $app['filetypes'] = $config['filetypes'];
19
+$app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array();
19 20
 
20 21
 // Register Git and Twig libraries
21 22
 $app['autoloader']->registerNamespace('Git', __DIR__.'/lib');
Browse code

Adding support to syntax highlighting for custom extensions, fixes #34. Thanks @attiks

Klaus Silveira authored on 06/07/2012 03:55:56
Showing 1 changed files
... ...
@@ -15,6 +15,7 @@ require_once __DIR__.'/vendor/silex.phar';
15 15
 
16 16
 $app = new Silex\Application();
17 17
 $app['baseurl'] = $config['app']['baseurl'];
18
+$app['filetypes'] = $config['filetypes'];
18 19
 
19 20
 // Register Git and Twig libraries
20 21
 $app['autoloader']->registerNamespace('Git', __DIR__.'/lib');
Browse code

Reverting

Klaus Silveira authored on 05/24/2012 00:26:13
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@ $app['autoloader']->registerNamespace('Application', __DIR__.'/lib');
22 22
 $app->register(new Silex\Provider\TwigServiceProvider(), array(
23 23
     'twig.path'       => __DIR__.'/views',
24 24
     'twig.class_path' => __DIR__.'/vendor',
25
-//    'twig.options'    => array('cache' => __DIR__.'/cache'),
25
+    'twig.options'    => array('cache' => __DIR__.'/cache'),
26 26
 ));
27 27
 $app->register(new Git\GitServiceProvider(), array(
28 28
     'git.client'      => $config['git']['client'],
Browse code

Adding very simple pagination to commits, both repository and history. Fixes #4

Klaus Silveira authored on 05/23/2012 06:10:37
Showing 1 changed files
... ...
@@ -22,7 +22,7 @@ $app['autoloader']->registerNamespace('Application', __DIR__.'/lib');
22 22
 $app->register(new Silex\Provider\TwigServiceProvider(), array(
23 23
     'twig.path'       => __DIR__.'/views',
24 24
     'twig.class_path' => __DIR__.'/vendor',
25
-    'twig.options'    => array('cache' => __DIR__.'/cache'),
25
+//    'twig.options'    => array('cache' => __DIR__.'/cache'),
26 26
 ));
27 27
 $app->register(new Git\GitServiceProvider(), array(
28 28
     'git.client'      => $config['git']['client'],
Browse code

Initial commit

Klaus Silveira authored on 05/18/2012 04:38:33
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,52 @@
1
+<?php
2
+
3
+/**
4
+ * GitList 0.1
5
+ * https://github.com/klaussilveira/gitlist
6
+ */
7
+
8
+$config = parse_ini_file('config.ini', true);
9
+
10
+if (empty($config['git']['repositories'])) {
11
+    die("Please, edit the config.ini file and provide your repositories directory");
12
+}
13
+
14
+require_once __DIR__.'/vendor/silex.phar';
15
+
16
+$app = new Silex\Application();
17
+$app['baseurl'] = $config['app']['baseurl'];
18
+
19
+// Register Git and Twig libraries
20
+$app['autoloader']->registerNamespace('Git', __DIR__.'/lib');
21
+$app['autoloader']->registerNamespace('Application', __DIR__.'/lib');
22
+$app->register(new Silex\Provider\TwigServiceProvider(), array(
23
+    'twig.path'       => __DIR__.'/views',
24
+    'twig.class_path' => __DIR__.'/vendor',
25
+    'twig.options'    => array('cache' => __DIR__.'/cache'),
26
+));
27
+$app->register(new Git\GitServiceProvider(), array(
28
+    'git.client'      => $config['git']['client'],
29
+    'git.repos'       => $config['git']['repositories'],
30
+));
31
+$app->register(new Application\UtilsServiceProvider());
32
+
33
+// Add the md5() function to Twig scope
34
+$app['twig']->addFilter('md5', new Twig_Filter_Function('md5'));
35
+
36
+// Load controllers
37
+include 'controllers/indexController.php';
38
+include 'controllers/treeController.php';
39
+include 'controllers/blobController.php';
40
+include 'controllers/commitController.php';
41
+include 'controllers/statsController.php';
42
+include 'controllers/rssController.php';
43
+
44
+// Error handling
45
+$app->error(function (\Exception $e, $code) use ($app) {
46
+    return $app['twig']->render('error.twig', array(
47
+        'baseurl'   => $app['baseurl'],
48
+        'message'   => $e->getMessage(),
49
+    ));
50
+});
51
+
52
+$app->run();