From f936ec44d0a4fce5b5a5b999abeed841957d14d3 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 9 Sep 2010 17:50:20 +0200 Subject: [PATCH] Consolidate on backends.php for backend configuration files. --- .../{sourceroots.php.dist => backends.php.dist} | 0 chora/config/conf.xml | 2 +- chora/docs/CHANGES | 1 + chora/docs/INSTALL | 4 ++-- chora/docs/UPGRADING | 22 ++++++++++++++++++++++ chora/lib/Application.php | 4 ++-- chora/lib/Test.php | 2 +- imp/config/{servers.php.dist => backends.php.dist} | 2 +- imp/config/conf.xml | 2 +- imp/config/hooks.php.dist | 4 ++-- imp/docs/CHANGES | 1 + imp/docs/INSTALL | 6 +++--- imp/docs/UPGRADING | 2 +- imp/lib/Auth.php | 6 +++--- imp/lib/Imap.php | 4 ++-- imp/lib/Quota/Hook.php | 2 +- imp/lib/Test.php | 2 +- kastalia/config/conf.xml | 0 .../config/{sources.php.dist => backends.php.dist} | 6 +++--- luxor/docs/CHANGES | 1 + luxor/lib/Luxor.php | 2 +- .../config/{sources.php.dist => backends.php.dist} | 0 turba/config/hooks.php.dist | 2 +- turba/config/prefs.php.dist | 2 +- turba/docs/CHANGES | 1 + turba/docs/INSTALL | 4 ++-- turba/docs/LDAP | 4 ++-- turba/docs/UPGRADING | 4 ++++ turba/lib/Api.php | 2 +- turba/lib/Application.php | 6 +++--- turba/lib/Driver.php | 2 +- turba/lib/Form/CreateAddressBook.php | 2 +- turba/lib/Test.php | 2 +- turba/lib/Turba.php | 4 ++-- turba/lib/tests/KolabTestBase.php | 2 +- turba/scripts/import_squirrelmail_file_abook.php | 2 +- turba/scripts/import_squirrelmail_sql_abook.php | 2 +- .../scripts/upgrades/2007-06-17_flatten_shares.php | 2 +- 38 files changed, 74 insertions(+), 44 deletions(-) rename chora/config/{sourceroots.php.dist => backends.php.dist} (100%) create mode 100644 chora/docs/UPGRADING rename imp/config/{servers.php.dist => backends.php.dist} (99%) mode change 100755 => 100644 kastalia/config/conf.xml rename luxor/config/{sources.php.dist => backends.php.dist} (91%) rename turba/config/{sources.php.dist => backends.php.dist} (100%) diff --git a/chora/config/sourceroots.php.dist b/chora/config/backends.php.dist similarity index 100% rename from chora/config/sourceroots.php.dist rename to chora/config/backends.php.dist diff --git a/chora/config/conf.xml b/chora/config/conf.xml index af65a0e16..a4c6a35da 100644 --- a/chora/config/conf.xml +++ b/chora/config/conf.xml @@ -86,7 +86,7 @@ $srconfig) { $perms['tree']['chora']['sourceroots'][$sourceroot] = false; $perms['title']['chora:sourceroots:' . $sourceroot] = $srconfig['name']; diff --git a/chora/lib/Test.php b/chora/lib/Test.php index 9382e1fdd..43734d1a1 100644 --- a/chora/lib/Test.php +++ b/chora/lib/Test.php @@ -42,7 +42,7 @@ class Chora_Test extends Horde_Test 'config/conf.php' => null, 'config/mime_drivers.php' => null, 'config/prefs.php' => null, - 'config/sourceroots.php' => null + 'config/backends.php' => null ); /** diff --git a/imp/config/servers.php.dist b/imp/config/backends.php.dist similarity index 99% rename from imp/config/servers.php.dist rename to imp/config/backends.php.dist index b4c0b550f..a44d919cf 100644 --- a/imp/config/servers.php.dist +++ b/imp/config/backends.php.dist @@ -282,7 +282,7 @@ * ADDED to the list of available namespaces returned by the * server. (IMAP only) * - * preferred: (string | array) Useful if you want to use the same servers.php + * preferred: (string | array) Useful if you want to use the same backends.php * file for different machines. If the hostname of the IMP machine * is identical to one of those in the preferred list, then that * entry will be selected by default on the login screen. Otherwise diff --git a/imp/config/conf.xml b/imp/config/conf.xml index 23fd025ff..1b91e05bf 100644 --- a/imp/config/conf.xml +++ b/imp/config/conf.xml @@ -47,7 +47,7 @@ json_encode(array('source_one', 'source_two')) // If 'value' is empty (''), all address books that the user has permissions diff --git a/turba/docs/CHANGES b/turba/docs/CHANGES index 365ca2cc6..7606ca104 100644 --- a/turba/docs/CHANGES +++ b/turba/docs/CHANGES @@ -2,6 +2,7 @@ v3.0-git -------- +[jan] Rename sources.php to backends.php. [mjr] If default addressbook is not browsable, try one from the addressbook pref (Request: 6536). [jan] Add duplicate search and merging. diff --git a/turba/docs/INSTALL b/turba/docs/INSTALL index da4927308..05109db55 100644 --- a/turba/docs/INSTALL +++ b/turba/docs/INSTALL @@ -150,10 +150,10 @@ Configuring Turba Documentation on the format and purpose of those files can be found in each file. You may edit these files if you wish to customize Turba's appearance - and behaviour. With the exception of the ``sources.php`` file the defaults + and behaviour. With the exception of the ``backends.php`` file the defaults will be correct for most sites. - You must configure ``sources.php`` to list your data sources (both SQL and + You must configure ``backends.php`` to list your data sources (both SQL and LDAP if necessary). This configuration file contains a large number of **examples**. Please remove or comment out those examples that **you don't need**. diff --git a/turba/docs/LDAP b/turba/docs/LDAP index 928727693..5eeaf1160 100644 --- a/turba/docs/LDAP +++ b/turba/docs/LDAP @@ -10,14 +10,14 @@ stored on the same LDAP server. This is not comprehensive, but it notes how some users have implemented personal LDAP address books. -1. Configure ``turba/config/sources.php``. +1. Configure ``turba/config/backends.php``. Note that OpenLDAP and some other LDAP servers use UTF8 to encode its data, so you should have ``encoding = 'utf8'`` set in the parameters for your LDAP address book source. There is an example of personal address books in - ``turba/config/sources.php.dist``. You will have to modify it to to match + ``turba/config/backends.php.dist``. You will have to modify it to to match the fields, settings, and schema of your LDAP server, but it's a solid place to start. diff --git a/turba/docs/UPGRADING b/turba/docs/UPGRADING index 4cb2a7501..ac8fc7bf3 100644 --- a/turba/docs/UPGRADING +++ b/turba/docs/UPGRADING @@ -13,6 +13,10 @@ use the updated data with your old Turba version anymore. Upgrading Turba from 2.x to 3.x =============================== + +The ``config/sources.php`` configuration file has been renamed to +``config/backends.php``. + The ``_turba_hook_encode_{attribute}`` hook has been moved to the 'encode_attribute' hook. diff --git a/turba/lib/Api.php b/turba/lib/Api.php index ba47d654d..22b63cea1 100644 --- a/turba/lib/Api.php +++ b/turba/lib/Api.php @@ -123,7 +123,7 @@ class Turba_Api extends Horde_Registry_Api global $prefs; // Bring in a clean copy of sources. - require TURBA_BASE . '/config/sources.php'; + require TURBA_BASE . '/config/backends.php'; if (!empty($_SESSION['turba']['has_share'])) { $shares = Turba::listShares(true); diff --git a/turba/lib/Application.php b/turba/lib/Application.php index ca5e0ca8e..0b1201b53 100644 --- a/turba/lib/Application.php +++ b/turba/lib/Application.php @@ -70,7 +70,7 @@ class Turba_Application extends Horde_Registry_Application // Turba source and attribute configuration. $attributes = Horde::loadConfiguration('attributes.php', 'attributes', 'turba'); - include TURBA_BASE . '/config/sources.php'; + include TURBA_BASE . '/config/backends.php'; /* UGLY UGLY UGLY - we should NOT be using this as a global * variable all over the place. */ @@ -147,7 +147,7 @@ class Turba_Application extends Horde_Registry_Application */ public function perms() { - require TURBA_BASE . '/config/sources.php'; + require TURBA_BASE . '/config/backends.php'; $perms['tree']['turba']['sources'] = false; $perms['title']['turba:sources'] = _("Sources"); @@ -387,7 +387,7 @@ class Turba_Application extends Horde_Registry_Application public function removeUserData($user) { /* We need a clean copy of the $cfgSources array here.*/ - require TURBA_BASE . '/config/sources.php'; + require TURBA_BASE . '/config/backends.php'; foreach ($cfgSources as $source) { if (empty($source['use_shares'])) { diff --git a/turba/lib/Driver.php b/turba/lib/Driver.php index 0fa8880eb..f10489ff3 100644 --- a/turba/lib/Driver.php +++ b/turba/lib/Driver.php @@ -56,7 +56,7 @@ class Turba_Driver implements Countable /** * Array of fields to search "approximately" (@see - * config/sources.php.dist). + * config/backends.php.dist). * * @var array */ diff --git a/turba/lib/Form/CreateAddressBook.php b/turba/lib/Form/CreateAddressBook.php index 3ffc4976a..d3c403907 100644 --- a/turba/lib/Form/CreateAddressBook.php +++ b/turba/lib/Form/CreateAddressBook.php @@ -33,7 +33,7 @@ class Turba_Form_CreateAddressBook extends Horde_Form function execute() { // Need a clean cfgSources array - include TURBA_BASE . '/config/sources.php'; + include TURBA_BASE . '/config/backends.php'; $driver = $GLOBALS['injector']->getInstance('Turba_Driver')->getDriver($cfgSources[$GLOBALS['conf']['shares']['source']]); diff --git a/turba/lib/Test.php b/turba/lib/Test.php index 0fe96ed2b..ed713b4d6 100644 --- a/turba/lib/Test.php +++ b/turba/lib/Test.php @@ -54,7 +54,7 @@ class Turba_Test extends Horde_Test 'config/conf.php' => null, 'config/mime_drivers.php' => null, 'config/prefs.php' => null, - 'config/sources.php' => null + 'config/backends.php' => null ); /** diff --git a/turba/lib/Turba.php b/turba/lib/Turba.php index 9a46681af..bcf531020 100644 --- a/turba/lib/Turba.php +++ b/turba/lib/Turba.php @@ -366,7 +366,7 @@ class Turba { * * This will only sync shares that are unique to Horde (basically, a SQL * driver source for now). Any backend that supports ACLs or similar - * mechanism should be configured from within sources.php or + * mechanism should be configured from within backends.php or * _horde_hook_share_* calls. * * @param array $sources The default $cfgSources array. @@ -502,7 +502,7 @@ class Turba { function getSourceFromShare($share) { // Require a fresh config file. - require TURBA_BASE . '/config/sources.php'; + require TURBA_BASE . '/config/backends.php'; $params = @unserialize($share->get('params')); $newConfig = $cfgSources[$params['source']]; diff --git a/turba/lib/tests/KolabTestBase.php b/turba/lib/tests/KolabTestBase.php index 226131551..f829764ac 100644 --- a/turba/lib/tests/KolabTestBase.php +++ b/turba/lib/tests/KolabTestBase.php @@ -149,7 +149,7 @@ class Turba_KolabTestBase extends Horde_Kolab_Test_Storage // Turba source and attribute configuration. include TURBA_BASE . '/config/attributes.php'; - include TURBA_BASE . '/config/sources.php'; + include TURBA_BASE . '/config/backends.php'; unset($cfgSources['kolab_global']); $this->prepareNewFolder($world['storage'], 'Contacts', 'contact', true); diff --git a/turba/scripts/import_squirrelmail_file_abook.php b/turba/scripts/import_squirrelmail_file_abook.php index 7291ef50f..0f60edc56 100755 --- a/turba/scripts/import_squirrelmail_file_abook.php +++ b/turba/scripts/import_squirrelmail_file_abook.php @@ -64,7 +64,7 @@ foreach($files as $file) { // Reset $cfgSources for current user. unset($cfgSources); - include TURBA_BASE . '/config/sources.php'; + include TURBA_BASE . '/config/backends.php'; $cfgSources = Turba::getConfigFromShares($cfgSources); $cfgSources = Turba::permissionsFilter($cfgSources); diff --git a/turba/scripts/import_squirrelmail_sql_abook.php b/turba/scripts/import_squirrelmail_sql_abook.php index 8f8db057c..87f52c719 100755 --- a/turba/scripts/import_squirrelmail_sql_abook.php +++ b/turba/scripts/import_squirrelmail_sql_abook.php @@ -61,7 +61,7 @@ while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) { // Reset $cfgSources for current user. unset($cfgSources); $hasShares = false; - include TURBA_BASE . '/config/sources.php'; + include TURBA_BASE . '/config/backends.php'; foreach ($cfgSources as $key => $cfg) { if (!empty($cfg['use_shares'])) { $has_share = true; diff --git a/turba/scripts/upgrades/2007-06-17_flatten_shares.php b/turba/scripts/upgrades/2007-06-17_flatten_shares.php index 607c1c8d6..5496aefd7 100755 --- a/turba/scripts/upgrades/2007-06-17_flatten_shares.php +++ b/turba/scripts/upgrades/2007-06-17_flatten_shares.php @@ -10,7 +10,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true)); // Re-load source config. -require TURBA_BASE . '/config/sources.php'; +require TURBA_BASE . '/config/backends.php'; // See if any of our sources are configured to use Horde_Share. if (empty($_SESSION['turba']['has_share'])) { -- 2.11.0