Fully convert ansel to Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 20 Jan 2010 01:39:44 +0000 (18:39 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 20 Jan 2010 15:35:08 +0000 (08:35 -0700)
67 files changed:
ansel/browse.php
ansel/browse_edit.php
ansel/disclamer.php
ansel/edit_dates.php
ansel/faces/claim.php
ansel/faces/custom.php
ansel/faces/delete.php
ansel/faces/face.php
ansel/faces/gallery.php
ansel/faces/image.php
ansel/faces/img.php
ansel/faces/name.php
ansel/faces/report.php
ansel/faces/savecustom.php
ansel/faces/search/img.php
ansel/faces/search/tabs.php
ansel/gallery.php
ansel/gallery/captions.php
ansel/gallery/delete.php
ansel/gallery/sort.php
ansel/group.php
ansel/image.php
ansel/img/download.php
ansel/img/ecard.php
ansel/img/full.php
ansel/img/index.php
ansel/img/mini.php
ansel/img/prettythumb.php
ansel/img/screen.php
ansel/img/thumb.php
ansel/img/upload.php
ansel/img/upload_preview.php
ansel/index.php
ansel/lib/Ajax/Imple/EditCaption.php
ansel/lib/Ajax/Imple/EditFaces.php
ansel/lib/Ajax/Imple/Embed.php
ansel/lib/Ajax/Imple/GallerySlugCheck.php
ansel/lib/Ajax/Imple/ImageSaveGeotag.php
ansel/lib/Ajax/Imple/LocationAutoCompleter.php
ansel/lib/Ajax/Imple/TagActions.php
ansel/lib/Api.php
ansel/lib/Application.php
ansel/lib/Block/cloud.php
ansel/lib/Block/gallery.php
ansel/lib/Block/random_photo.php
ansel/lib/Block/recent_comments.php
ansel/lib/Block/recent_faces.php
ansel/lib/Block/recently_added.php
ansel/lib/Block/recently_added_geodata.php
ansel/lib/base.load.php [deleted file]
ansel/lib/base.php [deleted file]
ansel/map_edit.php
ansel/perms.php
ansel/preview.php
ansel/protect.php
ansel/report.php
ansel/rss.php
ansel/scripts/all_images_exif_to_tags.php
ansel/scripts/ansel.php
ansel/scripts/garbage_collection.php
ansel/scripts/recursive_import.php
ansel/scripts/upgrades/1.0_to_1.1.php
ansel/scripts/upgrades/2008-09-16_add_original_date_values.php
ansel/scripts/upgrades/2009-06-14_fix_geolocation_values.php
ansel/scripts/upgrades/2009-06-22_move_geolocation_values.php
ansel/view.php
ansel/xppublish.php

index 062fe2c..10bdcc5 100644 (file)
@@ -6,7 +6,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 Horde::addScriptFile('prototype.js', 'horde');
 $layout = new Horde_Block_Layout_View(
index 1b61f57..0496407 100644 (file)
@@ -6,7 +6,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 // Instantiate the blocks objects.
 $blocks = Horde_Block_Collection::singleton('myphotos', array('ansel'));
index 7e52ecf..0bdd75a 100644 (file)
@@ -8,7 +8,8 @@
  * @author Jan Zagar <jan.zagar@siol.net>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $vars = Horde_Variables::getDefaultVariables();
 $gallery = $ansel_storage->getGallery($vars->get('gallery'));
index ccedb31..3621671 100644 (file)
@@ -7,7 +7,9 @@
  *
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  */
-require_once dirname(__FILE__) . '/lib/base.php';
+
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $images = Horde_Util::getFormData('image', array());
 $actionID = Horde_Util::getFormData('actionID');
index da8a384..c55c162 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $faces = Ansel_Faces::factory();
 $face_id = Horde_Util::getFormData('face');
@@ -68,4 +70,4 @@ require ANSEL_TEMPLATES . '/menu.inc';
 
 $form->renderActive(null, null, null, 'post');
 
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
index 85416cd..617c4ae 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $image_id = (int)Horde_Util::getFormData('image');
 $face_id = (int)Horde_Util::getFormData('face');
index 075d500..54148a5 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $image_id = (int)Horde_Util::getFormData('image');
 $face_id = (int)Horde_Util::getFormData('face');
index 3ee2224..1d664fe 100644 (file)
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
+
 $faces = Ansel_Faces::factory();
 $face_id = Horde_Util::getFormData('face');
 try {
@@ -29,4 +32,4 @@ $title = _("Face") . ' :: ' . $face['face_name'];
 require ANSEL_TEMPLATES . '/common-header.inc';
 require ANSEL_TEMPLATES . '/menu.inc';
 require_once ANSEL_TEMPLATES . '/faces/face.inc';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
index 413323f..932966c 100644 (file)
@@ -11,7 +11,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $gallery_id = (int)Horde_Util::getFormData('gallery');
 if (empty($gallery_id)) {
index d1d0733..734faa7 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $faces = Ansel_Faces::factory();
 
@@ -38,4 +40,4 @@ if (!empty($result)) {
     require_once ANSEL_TEMPLATES . '/faces/image.inc';
 } else {
     echo _("No faces found");
-}
\ No newline at end of file
+}
index f07659c..625ab92 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $face_id = Horde_Util::getFormData('face');
 $faces = Ansel_Faces::factory();
index 717552d..5ba5606 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $image_id = (int)Horde_Util::getFormData('image');
 $face_id = (int)Horde_Util::getFormData('face');
index fc201cd..0d9a7f3 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $face_id = Horde_Util::getFormData('face');
 
@@ -68,4 +70,4 @@ require ANSEL_TEMPLATES . '/menu.inc';
 
 $form->renderActive(null, null, null, 'post');
 
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
index 39824fb..5fba259 100644 (file)
@@ -9,7 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $image_id = (int)Horde_Util::getFormData('image_id');
 $gallery_id = (int)Horde_Util::getFormData('gallery_id');
index 6b78b51..b87e851 100644 (file)
@@ -9,12 +9,9 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../../lib/base.php';
 
-/* Face search is allowd only to  */
-if (!Horde_Auth::isauthenticated()) {
-    exit;
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $thumb = Horde_Util::getGet('thumb');
 $tmp = Horde::getTempDir();
index 59e682b..aef5a04 100644 (file)
@@ -9,13 +9,11 @@
  *
  * @author Duck <duck@obala.net>
  */
-require_once dirname(__FILE__) . '/../../lib/base.php';
+
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $faces = Ansel_Faces::factory();
-/* Face search is allowed only to authenticated users */
-if (!Horde_Auth::isauthenticated()) {
-    Horde_Auth::authenticateFailure();
-}
 
 /* Show tabs */
 $vars = Horde_Variables::getDefaultVariables();
index 1296170..599bedd 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 // Redirect to the gallery list if no action has been requested.
 $actionID = Horde_Util::getFormData('actionID');
index 30558db..a95e814 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $galleryId = Horde_Util::getFormData('gallery');
 if (!$galleryId) {
index 7276fe5..6048d1a 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 // Delete/empty the gallery if we're provided with a valid galleryId.
 $actionID = Horde_Util::getPost('action');
index 3a9756a..1fb9d06 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 /* If we aren't provided with a gallery, redirect to the gallery
  * list. */
index d46f994..20e9c2c 100644 (file)
@@ -9,7 +9,8 @@
  * @author Ben Chavet <ben@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 // check for grouping
 $groupby = basename(Horde_Util::getFormData('groupby', $prefs->getValue('groupby')));
index 31942ed..78ef5d2 100644 (file)
@@ -12,7 +12,8 @@
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 /* Get all the form data */
 $actionID = Horde_Util::getFormData('actionID');
index 405b7c1..984725c 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $id = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($id);
index 4578afe..861e24f 100644 (file)
@@ -8,7 +8,8 @@
  * @author Michael Slusarz <slusarz@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 /* Abort if ecard sending is disabled. */
 if (empty($conf['ecard']['enable'])) {
index 4311002..4626277 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $id = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($id);
index 526c195..acefa94 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $id = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($id);
index 85aee68..19aadaa 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $id = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($id);
index 4b31b17..dc28e25 100644 (file)
@@ -8,7 +8,8 @@
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $style = Horde_Util::getFormData('style');
 $id = Horde_Util::getFormData('image');
index ea67fb4..3b5680e 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $id = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($id);
index eb83221..cb6e3d6 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $id = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($id);
index 1c3c74b..dcf0186 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $gallery_id = Horde_Util::getFormData('gallery');
 $gallery = &$ansel_storage->getGallery($gallery_id);
index a74f0bc..904ab7b 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $gallery_id = (int)Horde_Util::getFormData('gallery');
 $gallery = $ansel_storage->getGallery($gallery_id);
index 3fea934..689c022 100644 (file)
@@ -8,5 +8,7 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
+
 header('Location: ' . Ansel::getUrlFor('default_view', array()));
index a94ba50..ee0aee9 100644 (file)
@@ -50,8 +50,6 @@ class Ansel_Ajax_Imple_EditCaption extends Horde_Ajax_Imple_Base
 
     public function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
-
         if (Horde_Auth::getAuth()) {
             /* Are we requesting the unformatted text? */
             if (!empty($args['action']) && $args['action'] == 'load') {
index 78a1ad0..0d80014 100644 (file)
@@ -30,8 +30,6 @@ class Ansel_Ajax_Imple_EditFaces extends Horde_Ajax_Imple_Base
 
     function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
-
         if (Horde_Auth::getAuth()) {
             $action = $args['action'];
             $image_id = (int)$post['image'];
index 16b583d..81d8885 100644 (file)
@@ -30,8 +30,6 @@ class Ansel_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base
      */
     public function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
-
         /* First, determine the type of view we are asking for */
         $view = empty($args['gallery_view']) ? 'Mini' : $args['gallery_view'];
         $class = 'Ansel_View_EmbeddedRenderer_' . basename($view);
index a77718b..8c2b167 100644 (file)
@@ -26,7 +26,6 @@ class Ansel_Ajax_Imple_GallerySlugCheck extends Horde_Ajax_Imple_Base
 
     public function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
         if (empty($args['input'])) {
             return array('response' => '1');
          }
index 5f8c753..9246723 100644 (file)
@@ -23,8 +23,6 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
 
     public function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
-
         $type = $args['action'];
         $location = empty($post['location']) ? null : $post['location'];
         $lat = empty($post['lat']) ? null : $post['lat'];
index 4b287dc..fbab220 100644 (file)
@@ -50,8 +50,6 @@ class Ansel_Ajax_Imple_LocationAutoCompleter extends Horde_Ajax_Imple_AutoComple
 
     public function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
-
         // Avoid errors if 'input' isn't set and short-circuit empty searches.
         if (empty($args['input']) ||
             !($input = Horde_Util::getFormData($args['input']))) {
index 6f339f2..6bfd92a 100644 (file)
@@ -31,8 +31,6 @@ class Ansel_Ajax_Imple_TagActions extends Horde_Ajax_Imple_Base
 
     public function handle($args, $post)
     {
-        include_once dirname(__FILE__) . '/../../base.php';
-
         $action = $args['action'];
         $tags = $post['tags'];
         if (empty($action) || empty($tags)) {
index b44771b..1537500 100644 (file)
@@ -25,8 +25,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function browse($path = '', $properties = array())
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         // Default properties.
         if (!$properties) {
             $properties = array('name', 'icon', 'browseable');
@@ -181,8 +179,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function put($path, $content, $content_type)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (substr($path, 0, 5) == 'ansel') {
             $path = substr($path, 9);
         }
@@ -217,8 +213,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function commentCallback($image_id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!$GLOBALS['conf']['comments']['allow']) {
             return false;
         }
@@ -238,8 +232,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function hasComments()
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (($GLOBALS['conf']['comments']['allow'] == 'all' ||
             ($GLOBALS['conf']['comments']['allow'] == 'authenticated' &&
             Horde_Auth::getAuth()))) {
@@ -314,8 +306,6 @@ class Ansel_Api extends Horde_Registry_Api
         $gallery_data = null, $encoding = null, $slug = null,
         $compression = 'none', $skiphook = false)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $image_data = null;
 
         /* If no app is given use Ansel's own gallery which is initialized
@@ -405,7 +395,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function postBatchUpload($image_ids)
     {
-        require_once dirname(__FILE__) . '/base.php';
         if (!empty($conf['hooks']['postupload'])) {
             return Horde::callHook('_ansel_hook_postupload', array($image_ids), 'ansel');
         }
@@ -420,8 +409,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function removeImage($app = null, $gallery_id, $image_id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* Check global Ansel permissions */
         if (!($GLOBALS['perms']->getPermissions('ansel'))) {
             return PEAR::raiseError(_("Access denied deleting galleries."));
@@ -462,8 +449,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function createGallery($app = null, $attributes = array(), $perm = null, $parent = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!(Horde_Auth::isAdmin() ||
             (!$GLOBALS['perms']->exists('ansel') && Horde_Auth::getAuth()) ||
             $GLOBALS['perms']->hasPermission('ansel', Horde_Auth::getAuth(), Horde_Perms::EDIT))) {
@@ -500,8 +485,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function removeGallery($app = null, $gallery_id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* Check global Ansel permissions */
         if (!($GLOBALS['perms']->getPermissions('ansel'))) {
             return PEAR::raiseError(_("Access denied deleting galleries."));
@@ -549,8 +532,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function count($app = null, $gallery_id = null, $slug = '')
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -583,8 +564,6 @@ class Ansel_Api extends Horde_Registry_Api
     public function getDefaultImage($app = null, $gallery_id = null,
         $style = 'ansel_default', $slug = '')
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -618,8 +597,6 @@ class Ansel_Api extends Horde_Registry_Api
     public function getImageUrl($app = null, $image_id, $view = 'screen',
         $full = false, $style = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -646,8 +623,6 @@ class Ansel_Api extends Horde_Registry_Api
     public function getImageContent($image_id, $view = 'screen', $style = null,
         $app = null, $encoding = null, $compression = 'none')
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -716,8 +691,6 @@ class Ansel_Api extends Horde_Registry_Api
         $allLevels = true, $from = 0, $count = 0,
         $attributes = null, $sort_by = null, $direction = 0)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -751,8 +724,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function getGalleries($ids = array(), $app = null, $slugs = array())
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!is_null($app)) {
             $GLOBALS['ansel_storage'] = new Ansel_Storage($app);
         }
@@ -798,8 +769,6 @@ class Ansel_Api extends Horde_Registry_Api
         $allLevels = true, $from = 0, $count = 0,
         $default = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -834,8 +803,6 @@ class Ansel_Api extends Horde_Registry_Api
         $view = 'screen', $full = false, $from = 0,
         $count = 0, $style = null, $slug = '')
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized in
         base.php */
         if (!is_null($app)) {
@@ -908,7 +875,6 @@ class Ansel_Api extends Horde_Registry_Api
         $full = false, $limit = 10, $style = null,
         $slugs = array())
     {
-        require_once dirname(__FILE__) . '/base.php';
         if (!is_null($app)) {
             $GLOBALS['ansel_storage'] = new Ansel_Storage($app);
         }
@@ -952,8 +918,6 @@ class Ansel_Api extends Horde_Registry_Api
     public function countGalleries($app = null, $perm = Horde_Perms::SHOW, $attributes = null,
         $parent = null, $allLevels = true)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         /* If no app is given use Ansel's own gallery which is initialized
          * in base.php */
         if (!is_null($app)) {
@@ -976,8 +940,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function listTagInfo($tags = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         return Ansel_Tags::listTagInfo($tags);
     }
 
@@ -1008,8 +970,6 @@ class Ansel_Api extends Horde_Registry_Api
         $resource_type = 'all', $user = null, $raw = false,
         $app = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!is_null($app)) {
             $GLOBALS['ansel_storage'] = new Ansel_Storage($app);
         } else {
@@ -1071,8 +1031,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function galleryExists($app, $gallery_id = null, $slug = '')
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!is_null($app)) {
             $GLOBALS['ansel_storage'] = new Ansel_Storage($app);
         }
@@ -1087,8 +1045,6 @@ class Ansel_Api extends Horde_Registry_Api
      */
     public function getGalleryStyles()
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         return Ansel::getAvailableStyles();
     }
 
@@ -1107,8 +1063,6 @@ class Ansel_Api extends Horde_Registry_Api
     public function renderView($params = array(), $app = null,
         $view = 'Gallery')
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!is_null($app)) {
             $GLOBALS['ansel_storage'] = new Ansel_Storage($app);
         }
index 747d1fd..da5aa69 100644 (file)
@@ -2,6 +2,9 @@
 /**
  * Ansel application API.
  *
+ * This file defines Horde's core API interface. Other core Horde libraries
+ * can interact with Horde through this API.
+ *
  * Copyright 2004-2010 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * @author  Michael J. Rubinsky <mrubinsk@horde.org>
  * @package Ansel
  */
+
+if (!defined('ANSEL_BASE')) {
+    define('ANSEL_BASE', dirname(__FILE__) . '/..');
+}
+
+if (!defined('HORDE_BASE')) {
+    /* If horde does not live directly under the app directory, the HORDE_BASE
+     * constant should be defined in config/horde.local.php. */
+    if (file_exists(ANSEL_BASE . '/config/horde.local.php')) {
+        include ANSEL_BASE . '/config/horde.local.php';
+    } else {
+        define('HORDE_BASE', ANSEL_BASE . '/..');
+    }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
 class Ansel_Application extends Horde_Registry_Application
 {
+    /**
+     * The application's version.
+     *
+     * @var string
+     */
     public $version = 'H4 (2.0-git)';
 
     /**
+     * Initialization function.
+     *
+     * Global variables defined:
+     *   $ansel_db - TODO
+     *   $ansel_storage - TODO
+     *   $ansel_styles - TODO
+     *   $ansel_vfs - TODO
+     *   $cache - A Horde_Cache object.
+     *
+     * @throws Horde_Exception
+     */
+    protected function _init()
+    {
+        // Create a cache object if we need it.
+        if ($GLOBALS['conf']['ansel_cache']['usecache']) {
+            $GLOBALS['cache'] = Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'], Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
+        }
+
+        // Create db, share, and vfs instances.
+        $GLOBALS['ansel_db'] = Ansel::getDb();
+        if (is_a($GLOBALS['ansel_db'], 'PEAR_Error')) {
+            throw new Horde_Exception($GLOBALS['ansel_db']);
+        }
+
+        $GLOBALS['ansel_storage'] = new Ansel_Storage();
+        $GLOBALS['ansel_vfs'] = Ansel::getVFS();
+
+        // Get list of available styles for this client.
+        $GLOBALS['ansel_styles'] = Ansel::getAvailableStyles();
+        if ($logger = Horde::getLogger()) {
+            $GLOBALS['ansel_vfs']->setLogger($logger, $GLOBALS['conf']['log']['priority'
+        ]);
+    }
+
+    /**
      * Returns a list of available permissions.
      *
      * @return array  An array describing all available permissions.
index 5d5df1c..cec6253 100644 (file)
@@ -33,8 +33,6 @@ class Horde_Block_ansel_cloud extends Horde_Block {
 
     function _content()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         global $registry;
 
         /* Get the tags */
index 30d12ff..6134d04 100644 (file)
@@ -22,8 +22,6 @@ class Horde_Block_ansel_gallery extends Horde_Block {
 
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
                             'type' => 'enum',
@@ -112,8 +110,6 @@ class Horde_Block_ansel_gallery extends Horde_Block {
 
     function _getGallery($retry = false)
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         // Make sure we haven't already selected a gallery.
         if (is_a($this->_gallery, 'Ansel_Gallery')) {
             return $this->_gallery;
index 352bf40..33a0902 100644 (file)
@@ -28,8 +28,6 @@ class Horde_Block_ansel_random_photo extends Horde_Block {
 
     function _content()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $gallery = $GLOBALS['ansel_storage']->getRandomGallery();
         if (!$gallery) {
             return _("There are no photo galleries available.");
index 1e5ce09..5ba569e 100644 (file)
@@ -23,8 +23,6 @@ class Horde_Block_ansel_recent_comments extends Horde_Block {
 
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
                             'type' => 'enum',
@@ -42,8 +40,6 @@ class Horde_Block_ansel_recent_comments extends Horde_Block {
 
     function _title()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         if ($this->_params['gallery'] != 'all') {
             $gallery = $this->_getGallery();
             if (is_a($gallery, 'PEAR_Error')) {
index a47b5f6..ae22e2a 100644 (file)
@@ -34,7 +34,6 @@ class Horde_Block_ansel_recent_faces extends Horde_Block
 
     function _content()
     {
-        require_once dirname(__FILE__) . '/../base.php';
         $faces = Ansel_Faces::factory();
         $results = $faces->allFaces(0, $this->_params['limit']);
         $html = '';
index 1ff4547..aa07793 100644 (file)
@@ -20,8 +20,6 @@ class Horde_Block_ansel_recently_added extends Horde_Block {
 
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
                             'type' => 'enum',
@@ -46,8 +44,6 @@ class Horde_Block_ansel_recently_added extends Horde_Block {
 
     function _title()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         if ($this->_params['gallery'] != 'all') {
             $gallery = $this->_getGallery();
             if (is_a($gallery, 'PEAR_Error')) {
@@ -78,8 +74,6 @@ class Horde_Block_ansel_recently_added extends Horde_Block {
 
     function _content()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         if ($this->_params['gallery'] == 'all') {
             $galleries = array();
         } elseif (!is_array($this->_params['gallery'])) {
index 1ffb375..996ebde 100644 (file)
@@ -20,8 +20,6 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
 
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $params = array('gallery' => array(
                             'name' => _("Gallery"),
                             'type' => 'enum',
@@ -50,8 +48,6 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
 
     function _title()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         Horde::addScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel', array('external' => true));
         Horde::addScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel', array('external' => true));
         Horde::addScriptFile('googlemap.js');
@@ -85,8 +81,6 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
 
     function _content()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         if ($this->_params['gallery'] == 'all') {
             $galleries = array();
         } elseif (!is_array($this->_params['gallery'])) {
diff --git a/ansel/lib/base.load.php b/ansel/lib/base.load.php
deleted file mode 100644 (file)
index ce4e2ea..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Script to determine the correct *_BASE values.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Ansel
- */
-
-if (!defined('ANSEL_BASE')) {
-    define('ANSEL_BASE', dirname(__FILE__) . '/..');
-}
-
-if (!defined('HORDE_BASE')) {
-    /* If horde does not live directly under the app directory, the HORDE_BASE
-     * constant should be defined in config/horde.local.php. */
-    if (file_exists(ANSEL_BASE . '/config/horde.local.php')) {
-        include ANSEL_BASE . '/config/horde.local.php';
-    } else {
-        define('HORDE_BASE', ANSEL_BASE . '/..');
-    }
-}
diff --git a/ansel/lib/base.php b/ansel/lib/base.php
deleted file mode 100644 (file)
index 3e44e62..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * This file brings in all of the dependencies that every Ansel script will need
- * and sets up objects that all scripts use.
- *
- * Copyright 2003-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Chuck Hagenbuch <chuck@horde.org>
- * @author Michael J. Rubinsky <mrubinsk@horde.org>
- *
- * @package Ansel
- */
-
-// Determine BASE directories.
-require_once dirname(__FILE__) . '/base.load.php';
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$s_ctrl = 0;
-switch (Horde_Util::nonInputVar('imp_session_control')) {
-case 'readonly':
-    $s_ctrl = Horde_Registry::SESSION_READONLY;
-    break;
-}
-$registry = Horde_Registry::singleton($s_ctrl);
-
-// Authentication
-try {
-    $registry->pushApp('ansel', array('check_perms' => (Horde_Util::nonInputVar('ansel_authentication') != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
-    Horde_Auth::authenticateFailure('ansel', $e);
-}
-$conf = $GLOBALS['conf'];
-define('ANSEL_TEMPLATES', $registry->get('templates'));
-
-// Notification system.
-$GLOBALS['notification'] = Horde_Notification::singleton();
-$GLOBALS['notification']->attach('status');
-
-// Create a cache object if we need it.
-if ($conf['ansel_cache']['usecache']) {
-    $GLOBALS['cache'] = Horde_Cache::singleton($conf['cache']['driver'],
-                                               Horde::getDriverConfig('cache', $conf['cache']['driver']));
-}
-
-// Create db, share, and vfs instances.
-$GLOBALS['ansel_db'] = Ansel::getDb();
-if (is_a($GLOBALS['ansel_db'], 'PEAR_Error')) {
-    Horde::fatal($GLOBALS['ansel_db'], __FILE__, __LINE__, false);
-}
-$GLOBALS['ansel_storage'] = new Ansel_Storage();
-$GLOBALS['ansel_vfs'] = Ansel::getVFS();
-
-// Get list of available styles for this client.
-$GLOBALS['ansel_styles'] = Ansel::getAvailableStyles();
-if ($logger = Horde::getLogger()) {
-    $GLOBALS['ansel_vfs']->setLogger($logger, $GLOBALS['conf']['log']['priority']);
-}
index 1002246..bb0b855 100644 (file)
@@ -8,7 +8,8 @@
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 /* Script includes */
 Horde::addScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel', array('external' => true));
index 2d2a72f..4732bc9 100644 (file)
@@ -15,7 +15,9 @@ $fieldsList = array(
     'delete' => 3
 );
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
+
 require_once 'Horde/Group.php';
 
 $groups = Group::singleton();
index 1ade5bb..2305809 100644 (file)
@@ -8,7 +8,9 @@
  * @author Michael Rubinsky <mrubinsk@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
+
 $imageId = Horde_Util::getFormData('image');
 $image = &$ansel_storage->getImage($imageId);
 if (is_a($image, 'PEAR_Error')) {
index e27a3e7..d47edc7 100644 (file)
@@ -8,7 +8,8 @@
  * @author Duck <duck@obala.net>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $vars = Horde_Variables::getDefaultVariables();
 $gallery = $ansel_storage->getGallery($vars->get('gallery'));
index 1a39d65..00dc500 100644 (file)
@@ -11,7 +11,8 @@
  * @package Ansel
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $title = _("Do you really want to report this gallery?");
 $gallery_id = (int)Horde_Util::getFormData('gallery');
index dd410ab..e1bff42 100644 (file)
@@ -10,8 +10,8 @@
  * @package Ansel
  */
 
-$ansel_session_control = 'readonly';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel', array('session_control' => 'readonly'));
 
 // Get form data
 $stream_type = Horde_Util::getFormData('stream_type', 'all');
index 0deb7a9..51a0315 100755 (executable)
@@ -10,8 +10,7 @@
 */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -62,8 +61,7 @@ foreach ($opts as $opt) {
     }
 }
 
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 // Login to horde if username & password are set.
 if (!empty($username) && !empty($password)) {
index 51fcc0f..e97c16e 100755 (executable)
@@ -10,8 +10,7 @@
 */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -23,8 +22,7 @@ Horde_Cli::init();
 $cli = Horde_Cli::singleton();
 
 // Load Ansel.
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 // We accept the user name on the command-line.
 $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(),
index bc08260..871e481 100755 (executable)
@@ -10,8 +10,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -22,8 +21,7 @@ if (!Horde_Cli::runningFromCLI()) {
 // some variables, etc.
 Horde_Cli::init();
 
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 // Default arguments.
 $move = false;
index 44bd979..b485df3 100755 (executable)
@@ -10,8 +10,7 @@
 */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -23,8 +22,7 @@ Horde_Cli::init();
 $cli = Horde_Cli::singleton();
 
 // Load Ansel.
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 // We accept the user name on the command-line.
 $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'hu:p:lc:g:a:d:k',
index ad09895..767d08b 100644 (file)
@@ -10,8 +10,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_CLI::runningFromCLI()) {
@@ -22,8 +21,7 @@ if (!Horde_CLI::runningFromCLI()) {
 Horde_CLI::init();
 $cli = Horde_CLI::singleton();
 
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 // First update the tables
 $alter = array("ALTER TABLE ansel_images ADD COLUMN image_latitude VARCHAR(32) NOT NULL DEFAULT ''",
index f3dcacb..d7bd97c 100755 (executable)
@@ -12,8 +12,7 @@
 */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -24,8 +23,7 @@ if (!Horde_Cli::runningFromCLI()) {
 Horde_Cli::init();
 $cli = Horde_Cli::singleton();
 
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 $sql = 'SELECT image_id, image_original_date, image_uploaded_date FROM ansel_images';
 $results = $ansel_db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC);
index cd88494..4d09647 100755 (executable)
@@ -10,8 +10,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -22,8 +21,7 @@ if (!Horde_Cli::runningFromCLI()) {
 Horde_Cli::init();
 $cli = Horde_Cli::singleton();
 
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 $sql = 'SELECT image_id, image_latitude, image_longitude FROM ansel_images_geolocation;';
 $results = $ansel_db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC);
index 85b4b33..5e8853b 100644 (file)
@@ -10,8 +10,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -22,8 +21,7 @@ if (!Horde_Cli::runningFromCLI()) {
 Horde_Cli::init();
 $cli = Horde_Cli::singleton();
 
-$ansel_authentication = 'none';
-require_once ANSEL_BASE . '/lib/base.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 $sql = 'SELECT image_id, image_latitude, image_longitude FROM ansel_images_geolocation;';
 $results = $ansel_db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC);
index abd493b..e08cee9 100644 (file)
@@ -8,7 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel');
 
 $viewname = basename(Horde_Util::getFormData('view', 'Gallery'));
 $view = 'Ansel_View_' . $viewname;
index 985e778..339c4a1 100644 (file)
@@ -8,8 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-$ansel_authentication = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('ansel', array('authentication' => 'none'));
 
 $cmd = Horde_Util::getFormData('cmd');
 if (empty($cmd)) {