summaryrefslogtreecommitdiffstats
path: root/common/app/app.php
diff options
context:
space:
mode:
authorDamien Lallement <dams@mageia.org>2012-08-13 10:45:23 +0000
committerDamien Lallement <dams@mageia.org>2012-08-13 10:45:23 +0000
commitff32e499745367b816d10f25e63ff3328214c32f (patch)
tree238d19398f5951d69d32c8ed9a460f5193446981 /common/app/app.php
parent5bed2fb79d7b554dd90d2eb58422cfa649aebe08 (diff)
downloadplanet-ff32e499745367b816d10f25e63ff3328214c32f.tar
planet-ff32e499745367b816d10f25e63ff3328214c32f.tar.gz
planet-ff32e499745367b816d10f25e63ff3328214c32f.tar.bz2
planet-ff32e499745367b816d10f25e63ff3328214c32f.tar.xz
planet-ff32e499745367b816d10f25e63ff3328214c32f.zip
- Import moonmoon
- Create repo per langs
Diffstat (limited to 'common/app/app.php')
-rwxr-xr-xcommon/app/app.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/common/app/app.php b/common/app/app.php
new file mode 100755
index 0000000..0703ac5
--- /dev/null
+++ b/common/app/app.php
@@ -0,0 +1,47 @@
+<?php
+
+//Debug ?
+$debug = isset($_GET['debug']) ? $_GET['debug'] : 0;
+if ($debug) {
+ error_reporting(E_ALL);
+} else {
+ error_reporting(0);
+}
+
+include(dirname(__FILE__).'/lib/lib.opml.php');
+include(dirname(__FILE__).'/lib/simplepie/simplepie.inc');
+include(dirname(__FILE__).'/lib/spyc-0.5/spyc.php');
+
+include_once(dirname(__FILE__).'/classes/PlanetConfig.php');
+include_once(dirname(__FILE__).'/classes/PlanetFeed.php');
+include_once(dirname(__FILE__).'/classes/PlanetItem.php');
+include_once(dirname(__FILE__).'/classes/PlanetError.php');
+include_once(dirname(__FILE__).'/classes/Planet.class.php');
+include_once(dirname(__FILE__).'/classes/Simplel10n.class.php');
+
+$savedConfig = dirname(__FILE__).'/../custom/config.yml';
+$moon_version = file_get_contents(dirname(__FILE__).'/../VERSION');
+
+if (is_file($savedConfig)){
+
+ $conf = Spyc::YAMLLoad($savedConfig);
+
+ // this is a check to upgrade older config file without l10n
+ if(!isset($conf['locale'])) {
+ $resetPlanetConfig = new PlanetConfig($conf);
+ file_put_contents($savedConfig, $resetPlanetConfig->toYaml());
+ $conf = Spyc::YAMLLoad($savedConfig);
+ }
+
+ $PlanetConfig = new PlanetConfig($conf);
+ $Planet = new Planet($PlanetConfig);
+}
+
+$l10n = new Simplel10n($conf['locale']);
+
+// this is an helper function. We will usually use that function and not Simplel10n::getString()
+function _g($str, $comment='') {
+ return Simplel10n::getString($str);
+}
+
+