Merge remote-tracking branch 'origin/master'
authorChristian Weiske <cweiske@cweiske.de>
Fri, 4 Jul 2014 05:37:06 +0000 (07:37 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 4 Jul 2014 05:37:06 +0000 (07:37 +0200)
Conflicts:
src/phorkie/Renderer/Geshi.php
src/phorkie/SetupCheck.php

1  2 
data/config.default.php
src/phorkie/Renderer/Geshi.php
www/www-header.php

diff --combined data/config.default.php
index 22bbc4a7eba573d52b94a794ac6011210a9c2fca,2beb3549568693a9d4634cef92af31ea9c163074..2e588fadc39fb8a93a68bfade175f5285d899e6d
@@@ -1,18 -1,10 +1,18 @@@
  <?php
 +$pharFile = \Phar::running();
 +if ($pharFile == '') {
 +    $phorkieDir = __DIR__ . '/../';
 +} else {
 +    //remove phar:// from the path
 +    $phorkieDir = dirname(substr($pharFile, 7)) . '/';
 +}
 +
  $GLOBALS['phorkie']['cfg'] = array(
      'debug'         => false,
 -    'gitdir'        => __DIR__ . '/../repos/git/',
 -    'workdir'       => __DIR__ . '/../repos/work/',
 +    'gitdir'        => $phorkieDir . 'repos/git/',
 +    'workdir'       => $phorkieDir . 'repos/work/',
      'tpl'           => __DIR__ . '/templates/',
 -    'baseurl'       => '/',
 +    'baseurl'       => null,
      'avatars'       => true,
      'css'           => '',
      'iconpng'       => '',//phorkie browser icon (favicon)
@@@ -20,7 -12,6 +20,6 @@@
      'topbar'        => '',
      'setupcheck'    => true,
      'elasticsearch' => null,
-     'geshi'         => 'MediaWiki/geshi/geshi/geshi.php',
      'index'         => 'new',//"new" or "list"
      'perPage'       => 10,
      'defaultListPage' => 'last',//a number or "last"
index c4227161a91d72448891be6cd2714ee26139ccdf,9cb15a20d106da7ae27f3302ac1164ae3502fa39..0c545ed5dff3e9d674959eb9e2f07566a991a99c
@@@ -13,14 -13,10 +13,14 @@@ class Renderer_Gesh
       */
      public function toHtml(File $file, Tool_Result $res = null)
      {
 -        if (!class_exists('\\GeSHi', true)) {
 -            require_once 'geshi.php';
 +        /**
 +         * Yes, geshi needs to be in your include path
-          * We use the mediawiki geshi extension package.
++         * We use the geshi pear package.
 +         */
 +        if (!class_exists('\\geshi', true)) {
 +            require_once $GLOBALS['phorkie']['cfg']['geshi'];
          }
 -        $geshi = new \GeSHi($file->getContent(), $this->getType($file));
 +        $geshi = new \geshi($file->getContent(), $this->getType($file));
          $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
          $geshi->set_header_type(GESHI_HEADER_DIV);
  
diff --combined www/www-header.php
index 94ee1d7e658424d160f58aa803b4289988bb5b2c,56c7b8ed94461fb3d8169d537be35ac2bb54d4cf..3fa4e0e7ba6e05b38d10cf9ffb4d41ff5ffdb525
@@@ -1,5 -1,7 +1,7 @@@
  <?php
  namespace phorkie;
+ error_reporting(error_reporting() & ~E_STRICT);
+ session_set_cookie_params(14 * 86400);//2 weeks session expiry time
  session_start();
  
  require_once __DIR__ . '/../src/phorkie/autoload.php';
@@@ -30,21 -32,8 +32,21 @@@ set_exception_handler
  );
  
  require_once __DIR__ . '/../data/config.default.php';
 -if (file_exists(__DIR__ . '/../data/config.php')) {
 -    require_once __DIR__ . '/../data/config.php';
 +$pharFile = \Phar::running();
 +if ($pharFile == '') {
 +    $cfgFilePath = __DIR__ . '/../data/config.php';
 +} else {
 +    //remove phar:// from the path
 +    $cfgFilePath = substr($pharFile, 7) . '.config.php';
 +}
 +$GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = false;
 +if (file_exists($cfgFilePath)) {
 +    $GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = true;
 +    require_once $cfgFilePath;
 +}
 +
 +if ($GLOBALS['phorkie']['cfg']['baseurl'] === null) {
 +    $GLOBALS['phorkie']['cfg']['baseurl'] = Tools::detectBaseUrl();
  }
  
  // Set/Get git commit session variables