From d80854dc9a670e0ee996cc89a59af2c5f8521205 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 13 Jun 2014 10:07:24 +0200 Subject: use geshi from geshi's new pear channel --- README.rst | 9 ++------- data/config.default.php | 1 - src/phorkie/Renderer/Geshi.php | 6 +----- src/phorkie/SetupCheck.php | 8 +++----- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/README.rst b/README.rst index 1270c30..043c438 100644 --- a/README.rst +++ b/README.rst @@ -98,8 +98,8 @@ on your machine: $ pear channel-discover pear.twig-project.org $ pear install twig/Twig - $ pear channel-discover mediawiki.googlecode.com/svn - $ pear install mediawiki/geshi + $ pear channel-discover pear.geshi.org + $ pear install geshi/geshi $ pear channel-discover zustellzentrum.cweiske.de $ pear install zz/mime_type_plaindetect-alpha @@ -110,11 +110,6 @@ on your machine: $ pear channel-discover pear2.php.net $ pear install pear2/pear2_services_linkback-alpha -Note that this version of GeSHi is a bit outdated, but it's the fastest -way to install it. -If you install it manually be sure to update the -path from ``data/config.default.php``. - ====== Search diff --git a/data/config.default.php b/data/config.default.php index 8f796f4..2beb354 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -12,7 +12,6 @@ $GLOBALS['phorkie']['cfg'] = array( 'topbar' => '', 'setupcheck' => true, 'elasticsearch' => null, - 'geshi' => 'MediaWiki/geshi/geshi/geshi.php', 'index' => 'new',//"new" or "list" 'perPage' => 10, 'defaultListPage' => 'last',//a number or "last" diff --git a/src/phorkie/Renderer/Geshi.php b/src/phorkie/Renderer/Geshi.php index 08c6c74..9cb15a2 100644 --- a/src/phorkie/Renderer/Geshi.php +++ b/src/phorkie/Renderer/Geshi.php @@ -13,12 +13,8 @@ class Renderer_Geshi */ public function toHtml(File $file, Tool_Result $res = null) { - /** - * Yes, geshi needs to be in your include path - * We use the mediawiki geshi extension package. - */ if (!class_exists('\\GeSHi', true)) { - require_once $GLOBALS['phorkie']['cfg']['geshi']; + require_once 'geshi.php'; } $geshi = new \GeSHi($file->getContent(), $this->getType($file)); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index 53e4fd0..fbc99c7 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -47,11 +47,9 @@ class SetupCheck } if (!class_exists('GeSHi', true)) { - $geshi = stream_resolve_include_path( - $GLOBALS['phorkie']['cfg']['geshi'] - ); - if ($geshi === false) { - $this->fail('GeSHi not available'); + @include_once 'geshi.php'; + if (!class_exists('GeSHi', false)) { + $this->fail('PEAR package not installed: pear.geshi.org/geshi'); } } -- cgit v1.2.3 From 94b076f028c2a12f522887caf02b6289957cf4fe Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 13 Jun 2014 11:29:09 +0200 Subject: handle undefined local clone urls --- src/phorkie/Repository/LinkbackReceiver.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/phorkie/Repository/LinkbackReceiver.php b/src/phorkie/Repository/LinkbackReceiver.php index c9b3d03..c808f45 100644 --- a/src/phorkie/Repository/LinkbackReceiver.php +++ b/src/phorkie/Repository/LinkbackReceiver.php @@ -120,13 +120,19 @@ class Repository_LinkbackReceiver */ protected function localizeGitUrls($arGitUrls) { - $pub = $GLOBALS['phorkie']['cfg']['git']['public']; - $pri = $GLOBALS['phorkie']['cfg']['git']['private']; + $pub = $pri = null; + if (isset($GLOBALS['phorkie']['cfg']['git']['public'])) { + $pub = $GLOBALS['phorkie']['cfg']['git']['public']; + } + if (isset($GLOBALS['phorkie']['cfg']['git']['private'])) { + $pri = $GLOBALS['phorkie']['cfg']['git']['private']; + } $arRemoteCloneUrls = array(); foreach ($arGitUrls as $remoteTitle => $arUrls) { foreach ($arUrls as $remoteCloneUrl) { - if (substr($remoteCloneUrl, 0, strlen($pub)) == $pub + if ($pub !== null + && substr($remoteCloneUrl, 0, strlen($pub)) == $pub && substr($remoteCloneUrl, -4) == '.git' ) { $id = substr($remoteCloneUrl, strlen($pub), -4); @@ -136,7 +142,8 @@ class Repository_LinkbackReceiver $arRemoteCloneUrls[$repo->gitDir] = $remoteTitle; } catch (Exception $e) { } - } else if (substr($remoteCloneUrl, 0, strlen($pri)) == $pri + } else if ($pri !== null + && substr($remoteCloneUrl, 0, strlen($pri)) == $pri && substr($remoteCloneUrl, -4) == '.git' ) { $id = substr($remoteCloneUrl, strlen($pri), -4); -- cgit v1.2.3 From cd8a7a527e9586c22695487cd7b470c60d2fa0f3 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 13 Jun 2014 11:29:25 +0200 Subject: PEAR is not E_STRICT compliant --- www/www-header.php | 1 + 1 file changed, 1 insertion(+) diff --git a/www/www-header.php b/www/www-header.php index b58bd95..f13108d 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -1,5 +1,6 @@ Date: Wed, 25 Jun 2014 11:15:31 +0200 Subject: let the session expire in 2 weeks --- www/www-header.php | 1 + 1 file changed, 1 insertion(+) diff --git a/www/www-header.php b/www/www-header.php index f13108d..56c7b8e 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -1,6 +1,7 @@