/[web]/planet/common/app/app.php
ViewVC logotype

Contents of /planet/common/app/app.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1619 - (show annotations) (download)
Mon Aug 13 10:45:23 2012 UTC (11 years, 8 months ago) by dams
File size: 1457 byte(s)
- Import moonmoon
- Create repo per langs

1 <?php
2
3 //Debug ?
4 $debug = isset($_GET['debug']) ? $_GET['debug'] : 0;
5 if ($debug) {
6 error_reporting(E_ALL);
7 } else {
8 error_reporting(0);
9 }
10
11 include(dirname(__FILE__).'/lib/lib.opml.php');
12 include(dirname(__FILE__).'/lib/simplepie/simplepie.inc');
13 include(dirname(__FILE__).'/lib/spyc-0.5/spyc.php');
14
15 include_once(dirname(__FILE__).'/classes/PlanetConfig.php');
16 include_once(dirname(__FILE__).'/classes/PlanetFeed.php');
17 include_once(dirname(__FILE__).'/classes/PlanetItem.php');
18 include_once(dirname(__FILE__).'/classes/PlanetError.php');
19 include_once(dirname(__FILE__).'/classes/Planet.class.php');
20 include_once(dirname(__FILE__).'/classes/Simplel10n.class.php');
21
22 $savedConfig = dirname(__FILE__).'/../custom/config.yml';
23 $moon_version = file_get_contents(dirname(__FILE__).'/../VERSION');
24
25 if (is_file($savedConfig)){
26
27 $conf = Spyc::YAMLLoad($savedConfig);
28
29 // this is a check to upgrade older config file without l10n
30 if(!isset($conf['locale'])) {
31 $resetPlanetConfig = new PlanetConfig($conf);
32 file_put_contents($savedConfig, $resetPlanetConfig->toYaml());
33 $conf = Spyc::YAMLLoad($savedConfig);
34 }
35
36 $PlanetConfig = new PlanetConfig($conf);
37 $Planet = new Planet($PlanetConfig);
38 }
39
40 $l10n = new Simplel10n($conf['locale']);
41
42 // this is an helper function. We will usually use that function and not Simplel10n::getString()
43 function _g($str, $comment='') {
44 return Simplel10n::getString($str);
45 }
46
47

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30