From 02f0d2185d480f2a55973f213f59d89379b3a9ac Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 4 May 2010 17:15:49 -0600 Subject: [PATCH] More H4 Jonah conversion --- jonah/README | 3 +- jonah/channels/aggregate.php | 5 +- jonah/channels/delete.php | 3 +- jonah/channels/edit.php | 3 +- jonah/channels/index.php | 2 +- jonah/config/conf.xml | 2 +- jonah/config/templates.php.dist | 4 +- jonah/delivery/html.php | 11 ++-- jonah/delivery/index.php | 1 - jonah/delivery/rss.php | 14 ++-- jonah/dispatcher.php | 10 ++- jonah/docs/CHANGES | 7 ++ jonah/docs/INSTALL | 8 +-- jonah/docs/TODO | 9 --- jonah/feed.php | 9 +-- jonah/index.php | 15 +---- jonah/lib/Api.php | 4 +- jonah/lib/Application.php | 3 +- jonah/lib/Block/cloud.php | 2 - jonah/lib/Block/delivery.php | 2 - jonah/lib/Block/latest.php | 2 - jonah/lib/Block/news.php | 5 +- jonah/lib/Block/news_popular.php | 3 - jonah/lib/Block/story.php | 2 - jonah/lib/Block/tree_menu.php | 2 - jonah/lib/Driver.php | 9 --- jonah/lib/Driver/sql.php | 5 -- jonah/lib/FeedParser.php | 2 - jonah/lib/Forms/Feed.php | 2 - jonah/lib/Forms/Story.php | 2 - jonah/lib/Jonah.php | 4 -- jonah/lib/News.php | 12 ---- jonah/lib/News/sql.php | 5 -- jonah/lib/Test.php | 70 ++++++++++++++++++++ jonah/lib/version.php | 1 - jonah/scripts/feed_tester.php | 33 +--------- jonah/scripts/sql/jonah.mssql.sql | 2 - jonah/scripts/sql/jonah.sql | 2 - .../upgrades/2008-08-22_add_channel_slugs.sql | 3 - .../upgrades/2008-08-22_add_story_authors.sql | 3 - .../scripts/upgrades/2008-12-17_add_full_feed.sql | 3 - jonah/stories/delete.php | 2 - jonah/stories/index.php | 2 - jonah/stories/pdf.php | 10 ++- jonah/stories/results.php | 3 +- jonah/stories/share.php | 11 ++-- jonah/stories/view.php | 8 +-- jonah/templates/common-header.inc | 3 - jonah/test.php | 74 ---------------------- jonah/themes/screen.css | 4 -- 50 files changed, 132 insertions(+), 274 deletions(-) delete mode 100644 jonah/docs/TODO create mode 100644 jonah/lib/Test.php delete mode 100644 jonah/lib/version.php delete mode 100644 jonah/test.php diff --git a/jonah/README b/jonah/README index 9e815e25d..4acfed164 100644 --- a/jonah/README +++ b/jonah/README @@ -1,5 +1,4 @@ Jonah -Version 0.1 What is Jonah? -------------- @@ -18,7 +17,7 @@ Jonah Documentation LICENSE - Jonah's license README - This file docs/CHANGES - A list of changes by release -docs/CREDITS - Who developed this +docs/CREDITS - Who developed this docs/HELP - How you can help docs/INSTALL - Installation instructions and notes diff --git a/jonah/channels/aggregate.php b/jonah/channels/aggregate.php index 97ca050eb..afdb20252 100644 --- a/jonah/channels/aggregate.php +++ b/jonah/channels/aggregate.php @@ -2,16 +2,13 @@ /** * Copyright 2004-2009 The Horde Project (http://www.horde.org/) * - * $Horde: jonah/channels/aggregate.php,v 1.19 2009/11/24 04:15:37 chuck Exp $ - * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE. * * @author Jan Schneider */ -@define('JONAH_BASE', dirname(__FILE__) . '/..'); -require_once dirname(__FILE__) . '/../lib/Application.php'; +require_once dirname(__FILE__) . '/lib/Application.php'; $jonah = Horde_Registry::appInit('jonah'); function _getLinks($id, $subid, $name, $title) diff --git a/jonah/channels/delete.php b/jonah/channels/delete.php index 4882e35dc..1b3d043a3 100644 --- a/jonah/channels/delete.php +++ b/jonah/channels/delete.php @@ -11,8 +11,7 @@ * @author Marko Djukic */ -define('JONAH_BASE', dirname(__FILE__) . '/..'); -require_once dirname(__FILE__) . '/../lib/Application.php'; +require_once dirname(__FILE__) . '/lib/Application.php'; $jonah = Horde_Registry::appInit('jonah'); require_once 'Horde/Form.php'; require_once 'Horde/Form/Renderer.php'; diff --git a/jonah/channels/edit.php b/jonah/channels/edit.php index d76050fe4..58f401453 100644 --- a/jonah/channels/edit.php +++ b/jonah/channels/edit.php @@ -11,8 +11,7 @@ * @author Marko Djukic */ -@define('JONAH_BASE', dirname(__FILE__) . '/..'); -require_once dirname(__FILE__) . '/../lib/Application.php'; +require_once dirname(__FILE__) . '/lib/Application.php'; $jonah = Horde_Registry::appInit('jonah'); require_once JONAH_BASE . '/lib/Forms/Feed.php'; require_once 'Horde/Form/Renderer.php'; diff --git a/jonah/channels/index.php b/jonah/channels/index.php index 61217200a..aa04165a7 100644 --- a/jonah/channels/index.php +++ b/jonah/channels/index.php @@ -11,7 +11,7 @@ * @author Marko Djukic */ -require_once dirname(__FILE__) . '/../lib/Application.php'; +require_once dirname(__FILE__) . '/lib/Application.php'; $jonah = Horde_Registry::appInit('jonah'); if (!Jonah::checkPermissions('jonah:news', Horde_Perms::EDIT)) { diff --git a/jonah/config/conf.xml b/jonah/config/conf.xml index 329213653..76f4d6ae9 100644 --- a/jonah/config/conf.xml +++ b/jonah/config/conf.xml @@ -1,5 +1,5 @@ - + diff --git a/jonah/config/templates.php.dist b/jonah/config/templates.php.dist index 044376f74..b380c46dd 100644 --- a/jonah/config/templates.php.dist +++ b/jonah/config/templates.php.dist @@ -1,9 +1,9 @@ _("Standard"), diff --git a/jonah/delivery/html.php b/jonah/delivery/html.php index 6f6f3d106..c2cfbcf87 100644 --- a/jonah/delivery/html.php +++ b/jonah/delivery/html.php @@ -2,8 +2,6 @@ /** * Script to handle requests for html delivery of stories. * - * $Horde: jonah/delivery/html.php,v 1.24 2009/06/10 05:24:47 slusarz Exp $ - * * Copyright 2004-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you did not @@ -12,10 +10,11 @@ * @author Jan Schneider */ -$session_control = 'readonly'; -@define('AUTH_HANDLER', true); -require_once dirname(__FILE__) . '/lib/Application.php'; -$jonah = Horde_Registry::appInit('jonah'); +require_once dirname(__FILE__) . '/../lib/Application.php'; +$jonah = Horde_Registry::appInit('jonah', array( + 'authentication' => 'none', + 'session_control' => 'readonly' +)); require JONAH_BASE . '/config/templates.php'; // TODO - check if a user, have button to add channel to their diff --git a/jonah/delivery/index.php b/jonah/delivery/index.php index 475c5391d..6669b3d97 100644 --- a/jonah/delivery/index.php +++ b/jonah/delivery/index.php @@ -24,7 +24,6 @@ foreach ($parts as $part) { if (strpos($part, '.') !== false) { $deliveryType = substr($part, strrpos($part, '.') + 1); $part = substr($part, 0, strrpos($part, '.')); - } switch($part) { diff --git a/jonah/delivery/rss.php b/jonah/delivery/rss.php index 8d2f77470..7d0a61992 100644 --- a/jonah/delivery/rss.php +++ b/jonah/delivery/rss.php @@ -1,7 +1,5 @@ */ -$session_control = 'readonly'; -@define('AUTH_HANDLER', true); -require_once dirname(__FILE__) . '/lib/Application.php'; -$jonah = Horde_Registry::appInit('jonah'); -require_once JONAH_BASE . '/lib/version.php'; +require_once dirname(__FILE__) . '/../lib/Application.php'; +$jonah = Horde_Registry::appInit('jonah', array( + 'authentication' => 'none', + 'session_control' => 'readonly' +)); $news = Jonah_News::factory(); @@ -65,7 +63,7 @@ if (is_a($stories, 'PEAR_Error')) { $template = new Horde_Template(); $template->set('charset', Horde_Nls::getCharset()); -$template->set('jonah', 'Jonah ' . JONAH_VERSION . ' (http://www.horde.org/jonah/)'); +$template->set('jonah', 'Jonah ' . $registry->getVersion() . ' (http://www.horde.org/jonah/)'); $template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl'); if (!empty($criteria['tag_id'])) { $template->set('channel_name', sprintf(_("Stories tagged with %s in %s"), $tag_name, @htmlspecialchars($channel['channel_name'], ENT_COMPAT, Horde_Nls::getCharset()))); diff --git a/jonah/dispatcher.php b/jonah/dispatcher.php index 4773c6dfe..49e59f099 100644 --- a/jonah/dispatcher.php +++ b/jonah/dispatcher.php @@ -7,10 +7,14 @@ * * @author Ben Klang */ -$session_control = 'readonly'; -@define('AUTH_HANDLER', true); -require_once dirname(__FILE__) . '/lib/Application.php'; + +require_once dirname(__FILE__) . '/../lib/Application.php'; +$jonah = Horde_Registry::appInit('jonah', array( + 'authentication' => 'none', + 'session_control' => 'readonly' +)); $jonah = Horde_Registry::appInit('jonah'); + require JONAH_BASE . '/config/templates.php'; // Grab, and hopefully match, the URL diff --git a/jonah/docs/CHANGES b/jonah/docs/CHANGES index 52874d1a8..dca43bc64 100644 --- a/jonah/docs/CHANGES +++ b/jonah/docs/CHANGES @@ -1,3 +1,10 @@ +-------- +v1.0-git +-------- + +[bak/mjr/mms] Converted to H4. + + ---- v0.1 ---- diff --git a/jonah/docs/INSTALL b/jonah/docs/INSTALL index 9f699d0ca..e67fd03f7 100644 --- a/jonah/docs/INSTALL +++ b/jonah/docs/INSTALL @@ -1,6 +1,6 @@ -========================== -|| INSTALLING Jonah 0.1 || -========================== +====================== +|| INSTALLING Jonah || +====================== This document contains instructions for installing the Jonah software on your system. @@ -230,5 +230,3 @@ QQQQQQWQQ@CauqmQQQQQQQQQWQQWQQQQQQQQQWQQWQQQQQQQWQQQQQQQQQQQQQQQQQQQQQQQQQQQWQQ QQQQBVbaoX2v2dWQQQQQQQQQQQQQQQQQQWQQQQQQQQQQQQWQQQQWQQQQQQWQQQQQWQQWQQQQWQQWQQQ QP5###Z#XXoSZLJQQQQQQQQWQQWQQQWQQQQQWQQQWQQQWQQQQQQQQQWQWQQQQQWQQQQQQQWQQQQQQQQ =============================================================================== - -$Horde: jonah/docs/INSTALL,v 1.21 2007/06/19 09:56:35 jan Exp $ diff --git a/jonah/docs/TODO b/jonah/docs/TODO deleted file mode 100644 index faac774b2..000000000 --- a/jonah/docs/TODO +++ /dev/null @@ -1,9 +0,0 @@ -============================= - Jonah Development TODO List -============================= - -:Last update: $Date: 2007/12/14 18:31:17 $ -:Revision: $Revision: 1.7 $ -:Contact: dev@lists.horde.org - -$Horde: jonah/docs/TODO,v 1.7 2007/12/14 18:31:17 mrubinsk Exp $ diff --git a/jonah/feed.php b/jonah/feed.php index 2d7fb21e4..102437769 100644 --- a/jonah/feed.php +++ b/jonah/feed.php @@ -2,8 +2,6 @@ /** * Script to handle requests for html delivery of stories. * - * $Horde: jonah/feed.php,v 1.6 2009/06/10 05:24:46 slusarz Exp $ - * * Copyright 2004-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you did not @@ -12,10 +10,13 @@ * @author Jan Schneider */ -$session_control = 'readonly'; -@define('AUTH_HANDLER', true); require_once dirname(__FILE__) . '/lib/Application.php'; +$jonah = Horde_Registry::appInit('jonah', array( + 'authentication' => 'none', + 'session_control' => 'readonly' +)); $jonah = Horde_Registry::appInit('jonah'); + require JONAH_BASE . '/config/templates.php'; /* Get the id and format of the feed to display. */ diff --git a/jonah/index.php b/jonah/index.php index 47fe5643a..cc5e6a4fb 100644 --- a/jonah/index.php +++ b/jonah/index.php @@ -1,7 +1,5 @@ */ -@define('JONAH_BASE', dirname(__FILE__)); -$jonah_configured = (is_readable(JONAH_BASE . '/config/conf.php') && - is_readable(JONAH_BASE . '/config/templates.php')); - -if (!$jonah_configured) { - require JONAH_BASE . '/../lib/Test.php'; - Horde_Test::configFilesMissing('Jonah', JONAH_BASE, - array('conf.php'), - array('templates.php' => 'This file defines the HTML (or other) templates that are used to generate different views of the news channels that Jonah provides.')); -} - -require JONAH_BASE . '/channels/index.php'; +require dirname(__FILE__) . '/channels/index.php'; diff --git a/jonah/lib/Api.php b/jonah/lib/Api.php index 6a2aa6ae7..6d67dda47 100644 --- a/jonah/lib/Api.php +++ b/jonah/lib/Api.php @@ -2,8 +2,6 @@ /** * Jonah external API interface. * - * $Horde: jonah/lib/Api.php,v 1.1 2009/11/11 01:32:03 mrubinsk Exp $ - * * This file defines Jonah's external API interface. Other * applications can interact with Jonah through this API. * @@ -231,4 +229,4 @@ class Jonah_Api extends Horde_Registry_Api return $results; } -} \ No newline at end of file +} diff --git a/jonah/lib/Application.php b/jonah/lib/Application.php index 253530067..4d61a801e 100644 --- a/jonah/lib/Application.php +++ b/jonah/lib/Application.php @@ -4,6 +4,7 @@ * * @package Jonah */ + if (!defined('JONAH_BASE')) { define('JONAH_BASE', dirname(__FILE__). '/..'); } @@ -92,4 +93,4 @@ class Jonah_Application extends Horde_Registry_Application return Jonah::getMenu(); } -} \ No newline at end of file +} diff --git a/jonah/lib/Block/cloud.php b/jonah/lib/Block/cloud.php index 178c16b71..2cf1c1a22 100644 --- a/jonah/lib/Block/cloud.php +++ b/jonah/lib/Block/cloud.php @@ -5,8 +5,6 @@ $block_name = _("Tag Cloud"); /** * Display Tag Cloud * - * $Horde: jonah/lib/Block/cloud.php,v 1.11 2009/12/10 17:42:36 jan Exp $ - * * Copyright 2007-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you diff --git a/jonah/lib/Block/delivery.php b/jonah/lib/Block/delivery.php index f03c6ed4a..7e6c74e13 100644 --- a/jonah/lib/Block/delivery.php +++ b/jonah/lib/Block/delivery.php @@ -6,8 +6,6 @@ $block_name = _("Feeds"); * This class extends Horde_Block:: to provide a list of deliverable internal * channels. * - * $Horde: jonah/lib/Block/delivery.php,v 1.22 2009/06/10 05:24:47 slusarz Exp $ - * * Copyright 2004-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you diff --git a/jonah/lib/Block/latest.php b/jonah/lib/Block/latest.php index e91712259..9b0a3a63d 100644 --- a/jonah/lib/Block/latest.php +++ b/jonah/lib/Block/latest.php @@ -6,8 +6,6 @@ $block_name = _("Latest News"); * This class extends Horde_Block:: to provide the api to embed news * in other Horde applications. * - * $Horde: jonah/lib/Block/latest.php,v 1.24 2009/07/09 08:18:26 slusarz Exp $ - * * Copyright 2002-2007 Roel Gloudemans * * See the enclosed file LICENSE for license information (BSD). If you diff --git a/jonah/lib/Block/news.php b/jonah/lib/Block/news.php index d2bc84452..50e5690f9 100644 --- a/jonah/lib/Block/news.php +++ b/jonah/lib/Block/news.php @@ -6,8 +6,6 @@ $block_name = _("Feed"); * This class extends Horde_Block:: to provide an api to embed news * in other Horde applications. * - * $Horde: jonah/lib/Block/news.php,v 1.49 2009/07/09 08:18:26 slusarz Exp $ - * * Copyright 2002-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you @@ -22,7 +20,7 @@ class Horde_Block_Jonah_news extends Horde_Block { function _params() { - require_once dirname(__FILE__) . '/../../lib/Application.php'; + require_once dirname(__FILE__) . '/../Application.php'; require JONAH_BASE . '/config/templates.php'; $params['source'] = array('name' => _("Feed"), @@ -82,7 +80,6 @@ class Horde_Block_Jonah_news extends Horde_Block { return _("No feed specified."); } - require_once 'Horde/Template.php'; $news = Jonah_News::factory(); $params = $this->_params(); diff --git a/jonah/lib/Block/news_popular.php b/jonah/lib/Block/news_popular.php index 28adc4fd3..af29ef874 100644 --- a/jonah/lib/Block/news_popular.php +++ b/jonah/lib/Block/news_popular.php @@ -6,8 +6,6 @@ $block_name = _("Most Popular Stories"); * This class extends Horde_Block:: to provide an api to embed news * in other Horde applications. * - * $Horde: jonah/lib/Block/news_popular.php,v 1.9 2009/07/09 08:18:26 slusarz Exp $ - * * Copyright 2002-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you @@ -80,7 +78,6 @@ class Horde_Block_Jonah_news_popular extends Horde_Block { return _("No feed specified."); } - require_once 'Horde/Template.php'; $news = Jonah_News::factory(); $params = $this->_params(); diff --git a/jonah/lib/Block/story.php b/jonah/lib/Block/story.php index c618b5be7..ad2c1fb09 100644 --- a/jonah/lib/Block/story.php +++ b/jonah/lib/Block/story.php @@ -6,8 +6,6 @@ $block_name = _("Story"); * This class extends Horde_Block:: to provide the api to embed news * in other Horde applications. * - * $Horde: jonah/lib/Block/story.php,v 1.11 2009/07/09 08:18:26 slusarz Exp $ - * * Copyright 2002-2007 Roel Gloudemans * * See the enclosed file LICENSE for license information (BSD). If you diff --git a/jonah/lib/Block/tree_menu.php b/jonah/lib/Block/tree_menu.php index 59f782bfc..7a2f70ec5 100644 --- a/jonah/lib/Block/tree_menu.php +++ b/jonah/lib/Block/tree_menu.php @@ -4,8 +4,6 @@ $block_name = _("Menu List"); $block_type = 'tree'; /** - * $Horde: jonah/lib/Block/tree_menu.php,v 1.7 2009/12/03 15:28:22 chuck Exp $ - * * @package Horde_Block */ class Horde_Block_jonah_tree_menu extends Horde_Block { diff --git a/jonah/lib/Driver.php b/jonah/lib/Driver.php index ee4b0a1ea..163285c35 100644 --- a/jonah/lib/Driver.php +++ b/jonah/lib/Driver.php @@ -1,17 +1,8 @@ _connect()), 'PEAR_Error')) { return $result; } @@ -1039,7 +1035,6 @@ class Jonah_Driver_sql extends Jonah_Driver { } /* Connect to the SQL server using the supplied parameters. */ - require_once 'DB.php'; $this->_db = &DB::connect($this->_params, array('persistent' => !empty($this->_params['persistent']))); if (is_a($this->_db, 'PEAR_Error')) { diff --git a/jonah/lib/FeedParser.php b/jonah/lib/FeedParser.php index 13a3b336d..5ffbd04d0 100644 --- a/jonah/lib/FeedParser.php +++ b/jonah/lib/FeedParser.php @@ -9,8 +9,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * $Horde: jonah/lib/FeedParser.php,v 1.23 2009/06/10 05:24:47 slusarz Exp $ - * * @author Chuck Hagenbuch * @package Jonah */ diff --git a/jonah/lib/Forms/Feed.php b/jonah/lib/Forms/Feed.php index fc30f521b..6f0823d26 100644 --- a/jonah/lib/Forms/Feed.php +++ b/jonah/lib/Forms/Feed.php @@ -17,8 +17,6 @@ require_once 'Horde/Form/Action.php'; * This class extends Horde_Form to provide the form to add/edit * feeds. * - * $Horde: jonah/lib/Forms/Feed.php,v 1.16 2009/06/10 05:24:48 slusarz Exp $ - * * Copyright 2002-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you diff --git a/jonah/lib/Forms/Story.php b/jonah/lib/Forms/Story.php index 68f334e24..1d460ccfe 100644 --- a/jonah/lib/Forms/Story.php +++ b/jonah/lib/Forms/Story.php @@ -17,8 +17,6 @@ require_once 'Horde/Form/Action.php'; * This class extends Horde_Form to provide the form to add/edit * stories. * - * $Horde: jonah/lib/Forms/Story.php,v 1.14 2009/02/16 16:47:03 chuck Exp $ - * * Copyright 2002-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you diff --git a/jonah/lib/Jonah.php b/jonah/lib/Jonah.php index 8b56613be..85031479d 100644 --- a/jonah/lib/Jonah.php +++ b/jonah/lib/Jonah.php @@ -6,15 +6,12 @@ /** * Jonah Base Class. * - * $Horde: jonah/lib/Jonah.php,v 1.141 2009/11/24 04:15:37 chuck Exp $ - * * @author Chuck Hagenbuch * @author Eric Rechlin * @package Jonah */ class Jonah { - /** * Internal Jonah channel. */ @@ -55,7 +52,6 @@ class Jonah { $options = array_merge($options, $conf['http']['proxy']); } - require_once 'HTTP/Request.php'; $http = new HTTP_Request($url, $options); @$http->sendRequest(); if ($http->getResponseCode() != 200) { diff --git a/jonah/lib/News.php b/jonah/lib/News.php index 5a39d8f01..1d5c5a91e 100644 --- a/jonah/lib/News.php +++ b/jonah/lib/News.php @@ -1,17 +1,8 @@ getInstance('Horde_Cache'); $timestamp = time(); if (is_a($cache, 'Horde_Cache') && ($stories = $cache->get($url, $interval))) { diff --git a/jonah/lib/News/sql.php b/jonah/lib/News/sql.php index f0a284880..9c2040bb9 100644 --- a/jonah/lib/News/sql.php +++ b/jonah/lib/News/sql.php @@ -19,8 +19,6 @@ * The table structure can be created by the scripts/db/jonah_news.sql * script. The needed tables are jonah_channels and jonah_stories. * - * $Horde: jonah/lib/News/sql.php,v 1.119 2010/02/01 10:32:04 jan Exp $ - * * Copyright 2002-2009 The Horde Project (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you did not @@ -634,8 +632,6 @@ class Jonah_News_sql extends Jonah_News { */ function listTagInfo($tags = array(), $channel_id = null) { - require_once 'Horde/Cache.php'; - if (is_a(($result = $this->_connect()), 'PEAR_Error')) { return $result; } @@ -877,7 +873,6 @@ class Jonah_News_sql extends Jonah_News { } /* Connect to the SQL server using the supplied parameters. */ - require_once 'DB.php'; $this->_db = &DB::connect($this->_params, array('persistent' => !empty($this->_params['persistent']))); if (is_a($this->_db, 'PEAR_Error')) { diff --git a/jonah/lib/Test.php b/jonah/lib/Test.php new file mode 100644 index 000000000..3d8381b11 --- /dev/null +++ b/jonah/lib/Test.php @@ -0,0 +1,70 @@ + + * @package Jonah + */ +class Jonah_Test extends Horde_Test +{ + /** + * The module list + * + * @var array + */ + protected $_moduleList = array( + 'gettext' => array( + 'descrip' => 'Gettext Support', + 'error' => 'Jonah will not run without gettext support. Compile php --with-gettext before continuing.' + ), + 'xml' => array( + 'descrip' => 'XML Support', + 'error' => 'Without XML support, Jonah WILL NOT WORK. You must fix this before going any further.' + ) + ); + + /** + * PHP settings list. + * + * @var array + */ + protected $_settingsList = array(); + + /** + * PEAR modules list. + * + * @var array + */ + protected $_pearList = array(); + + /** + * Required configuration files. + * + * @var array + */ + protected $_fileList = array( + 'config/conf.php' => null + ); + + /** + * Inter-Horde application dependencies. + * + * @var array + */ + protected $_appList = array(); + + /** + * Any application specific tests that need to be done. + * + * @return string HTML output. + */ + public function appTests() + { + } + +} diff --git a/jonah/lib/version.php b/jonah/lib/version.php deleted file mode 100644 index 07bff535f..000000000 --- a/jonah/lib/version.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jonah/scripts/feed_tester.php b/jonah/scripts/feed_tester.php index b8f5fde12..9cb386d1d 100755 --- a/jonah/scripts/feed_tester.php +++ b/jonah/scripts/feed_tester.php @@ -1,41 +1,12 @@ #!/usr/bin/php -q pushApp('jonah', false); - -// Include needed libraries. -require_once JONAH_BASE . '/lib/Jonah.php'; -require_once JONAH_BASE . '/lib/FeedParser.php'; - -/* Make sure there's no compression. */ -@ob_end_clean(); +require_once dirname(__FILE__) . '/../lib/Application.php'; +Horde_Registry::appInit('jonah', array('authentication' => 'none', 'cli' => true)); if (empty($argv[1]) || !file_exists($argv[1])) { exit("Need a valid filename.\n"); diff --git a/jonah/scripts/sql/jonah.mssql.sql b/jonah/scripts/sql/jonah.mssql.sql index 8463d3897..7c8caec1b 100644 --- a/jonah/scripts/sql/jonah.mssql.sql +++ b/jonah/scripts/sql/jonah.mssql.sql @@ -1,5 +1,3 @@ --- $Horde: jonah/scripts/sql/jonah.mssql.sql,v 1.9 2009/10/20 21:28:29 jan Exp $ - CREATE TABLE jonah_channels ( channel_id INT NOT NULL, channel_slug VARCHAR(64) NOT NULL, diff --git a/jonah/scripts/sql/jonah.sql b/jonah/scripts/sql/jonah.sql index 40b78534c..a103b8c46 100644 --- a/jonah/scripts/sql/jonah.sql +++ b/jonah/scripts/sql/jonah.sql @@ -1,5 +1,3 @@ --- $Horde: jonah/scripts/sql/jonah.sql,v 1.17 2009/10/20 21:28:30 jan Exp $ - CREATE TABLE jonah_channels ( channel_id INT NOT NULL, channel_slug VARCHAR(64) NOT NULL, diff --git a/jonah/scripts/upgrades/2008-08-22_add_channel_slugs.sql b/jonah/scripts/upgrades/2008-08-22_add_channel_slugs.sql index 80b05a4fc..d01fa53df 100644 --- a/jonah/scripts/upgrades/2008-08-22_add_channel_slugs.sql +++ b/jonah/scripts/upgrades/2008-08-22_add_channel_slugs.sql @@ -1,6 +1,3 @@ --- --- $Horde: jonah/scripts/upgrades/2008-08-22_add_channel_slugs.sql,v 1.1 2008/08/23 02:02:37 bklang Exp $ --- ALTER TABLE jonah_channels ADD COLUMN `channel_slug` VARCHAR(64); UPDATE jonah_channels SET channel_slug=channel_id; ALTER TABLE jonah_channels CHANGE channel_slug channel_slug VARCHAR(64) NOT NULL; diff --git a/jonah/scripts/upgrades/2008-08-22_add_story_authors.sql b/jonah/scripts/upgrades/2008-08-22_add_story_authors.sql index a381c6fd2..5ff563fb8 100644 --- a/jonah/scripts/upgrades/2008-08-22_add_story_authors.sql +++ b/jonah/scripts/upgrades/2008-08-22_add_story_authors.sql @@ -1,6 +1,3 @@ --- --- $Horde: jonah/scripts/upgrades/2008-08-22_add_story_authors.sql,v 1.1 2008/08/23 02:48:34 bklang Exp $ --- ALTER TABLE jonah_stories ADD COLUMN story_author VARCHAR(255); UPDATE jonah_stories SET story_author='Anonymous'; ALTER TABLE jonah_stories CHANGE COLUMN story_author story_author VARCHAR(255) NOT NULL; diff --git a/jonah/scripts/upgrades/2008-12-17_add_full_feed.sql b/jonah/scripts/upgrades/2008-12-17_add_full_feed.sql index b59c16888..7cfff66ee 100644 --- a/jonah/scripts/upgrades/2008-12-17_add_full_feed.sql +++ b/jonah/scripts/upgrades/2008-12-17_add_full_feed.sql @@ -1,6 +1,3 @@ --- --- $Horde: jonah/scripts/upgrades/2008-12-17_add_full_feed.sql,v 1.2 2009/10/20 21:28:30 jan Exp $ --- ALTER TABLE jonah_channels ADD COLUMN `channel_full_feed` SMALLINT; UPDATE jonah_channels SET channel_full_feed = 0; ALTER TABLE jonah_channels CHANGE channel_full_feed channel_full_feed SMALLINT DEFAULT 0 NOT NULL; diff --git a/jonah/stories/delete.php b/jonah/stories/delete.php index 0a1330f8e..10132700f 100644 --- a/jonah/stories/delete.php +++ b/jonah/stories/delete.php @@ -1,7 +1,5 @@ 'none', + 'session_control' => 'readonly' +)); $news = Jonah_News::factory(); diff --git a/jonah/stories/results.php b/jonah/stories/results.php index 83ef79c85..bf2e96277 100644 --- a/jonah/stories/results.php +++ b/jonah/stories/results.php @@ -2,9 +2,8 @@ /** * Display list of articles that match a tag query from an internal * channel. - * - * $Horde: jonah/stories/results.php,v 1.5 2009/11/24 04:15:38 chuck Exp $ */ + require_once dirname(__FILE__) . '/../lib/Application.php'; $jonah = Horde_Registry::appInit('jonah'); diff --git a/jonah/stories/share.php b/jonah/stories/share.php index e8330bee0..bf51b33ce 100644 --- a/jonah/stories/share.php +++ b/jonah/stories/share.php @@ -13,12 +13,11 @@ function _mail($story_part, $from, $recipients, $subject, $note) global $conf; /* Create the MIME message. */ - require_once JONAH_BASE . '/lib/version.php'; $mail = new Horde_Mime_Mail(array('subject' => $subject, 'to' => $recipients, 'from' => $from, 'charset' => Horde_Nls::getCharset())); - $mail->addHeader('User-Agent', 'Jonah ' . JONAH_VERSION); + $mail->addHeader('User-Agent', 'Jonah ' . $GLOBALS['registry']->getVersion()); /* If a note has been provided, add it to the message as a text part. */ if (strlen($note) > 0) { @@ -40,10 +39,12 @@ function _mail($story_part, $from, $recipients, $subject, $note) return $mail->send(Horde::getMailerConfig()); } -$session_control = 'readonly'; -@define('AUTH_HANDLER', true); require_once dirname(__FILE__) . '/../lib/Application.php'; -$jonah = Horde_Registry::appInit('jonah'); +$jonah = Horde_Registry::appInit('jonah', array( + 'authentication' => 'none', + 'session_control' => 'readonly' +)); + require_once 'Horde/Form.php'; require_once 'Horde/Form/Renderer.php'; diff --git a/jonah/stories/view.php b/jonah/stories/view.php index c2546c4f4..176926b79 100644 --- a/jonah/stories/view.php +++ b/jonah/stories/view.php @@ -1,7 +1,5 @@ */ -@define('AUTH_HANDLER', true); -@define('JONAH_BASE', dirname(__FILE__) . '/..'); require_once dirname(__FILE__) . '/../lib/Application.php'; -$jonah = Horde_Registry::appInit('jonah'); +$jonah = Horde_Registry::appInit('jonah', array( + 'authentication' => 'none' +)); $news = Jonah_News::factory(); diff --git a/jonah/templates/common-header.inc b/jonah/templates/common-header.inc index 1777eeaa0..d86687768 100644 --- a/jonah/templates/common-header.inc +++ b/jonah/templates/common-header.inc @@ -5,9 +5,6 @@ if (isset($language)) { } ?> - - - ' : '' ?>

The Horde_Util package was not found. If PHP\'s error_reporting setting is high enough and display_errors is on, there should be error messages printed above that may help you in debugging the problem. If you are simply missing these files, then you need to get the framework module from Horde CVS, and install the packages in it with the install-packages.php script.

'; - exit; -} - -/* Initialize the Horde_Test:: class. */ -if (!is_readable('../lib/Test.php')) { - echo 'ERROR: You must install Horde before running this script.'; - exit; -} -require_once '../lib/Test.php'; -$horde_test = new Horde_Test(); - -/* Jonah definitions. */ -$module = 'Jonah'; -require_once dirname(__FILE__) . '/lib/Application.php'; -$app = new Jonah_Application(); -$module_version = $app->version; - - -/* PHP module capabilities. */ -$module_list = array( - 'gettext' => array( - 'descrip' => 'Gettext Support', - 'error' => 'Jonah will not run without gettext support. Compile php --with-gettext before continuing.' - ), - 'xml' => array( - 'descrip' => 'XML Support', - 'error' => 'Without XML support, Jonah WILL NOT WORK. You must fix this before going any further.' - ) -); - -/* Jonah configuration files. */ -$file_list = array( - 'config/conf.php' => 'The file ./config/conf.php appears to be missing. You probably just forgot to copy ./config/conf.php.dist over. While you do that, take a look at the settings and make sure they are appropriate for your site.' -); - -require TEST_TEMPLATES . 'header.inc'; -require TEST_TEMPLATES . 'version.inc'; - -/* Display PHP Version information. */ -$php_info = $horde_test->getPhpVersionInformation(); -require TEST_TEMPLATES . 'php_version.inc'; - -?> - -

PHP Modules

-
    - phpModuleCheck($module_list) ?> -
- -

Jonah Configuration Files

-
    - requiredFileCheck($file_list) ?> -
- -