diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 3fe1808c0..3e85f9936 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -425,6 +425,7 @@ if (!function_exists('idn_to_ascii')) function rcube_autoload($classname) { if (strpos($classname, 'rcube') === 0) { + $classname = preg_replace('/^rcube_(cache|db|session|spellchecker)_/', '\\1/', $classname); $classname = 'Roundcube/' . $classname; } else if (strpos($classname, 'html_') === 0 || $classname === 'html') { diff --git a/program/lib/Roundcube/rcube_cache_apc.php b/program/lib/Roundcube/cache/apc.php similarity index 100% rename from program/lib/Roundcube/rcube_cache_apc.php rename to program/lib/Roundcube/cache/apc.php diff --git a/program/lib/Roundcube/rcube_cache_db.php b/program/lib/Roundcube/cache/db.php similarity index 100% rename from program/lib/Roundcube/rcube_cache_db.php rename to program/lib/Roundcube/cache/db.php diff --git a/program/lib/Roundcube/rcube_cache_memcache.php b/program/lib/Roundcube/cache/memcache.php similarity index 100% rename from program/lib/Roundcube/rcube_cache_memcache.php rename to program/lib/Roundcube/cache/memcache.php diff --git a/program/lib/Roundcube/rcube_cache_redis.php b/program/lib/Roundcube/cache/redis.php similarity index 100% rename from program/lib/Roundcube/rcube_cache_redis.php rename to program/lib/Roundcube/cache/redis.php diff --git a/program/lib/Roundcube/rcube_db_mssql.php b/program/lib/Roundcube/db/mssql.php similarity index 100% rename from program/lib/Roundcube/rcube_db_mssql.php rename to program/lib/Roundcube/db/mssql.php diff --git a/program/lib/Roundcube/rcube_db_mysql.php b/program/lib/Roundcube/db/mysql.php similarity index 100% rename from program/lib/Roundcube/rcube_db_mysql.php rename to program/lib/Roundcube/db/mysql.php diff --git a/program/lib/Roundcube/rcube_db_oracle.php b/program/lib/Roundcube/db/oracle.php similarity index 100% rename from program/lib/Roundcube/rcube_db_oracle.php rename to program/lib/Roundcube/db/oracle.php diff --git a/program/lib/Roundcube/rcube_db_pgsql.php b/program/lib/Roundcube/db/pgsql.php similarity index 100% rename from program/lib/Roundcube/rcube_db_pgsql.php rename to program/lib/Roundcube/db/pgsql.php diff --git a/program/lib/Roundcube/rcube_db_sqlite.php b/program/lib/Roundcube/db/sqlite.php similarity index 100% rename from program/lib/Roundcube/rcube_db_sqlite.php rename to program/lib/Roundcube/db/sqlite.php diff --git a/program/lib/Roundcube/rcube_db_sqlsrv.php b/program/lib/Roundcube/db/sqlsrv.php similarity index 100% rename from program/lib/Roundcube/rcube_db_sqlsrv.php rename to program/lib/Roundcube/db/sqlsrv.php diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php index a0c340fd7..578397612 100644 --- a/program/lib/Roundcube/rcube_spellchecker.php +++ b/program/lib/Roundcube/rcube_spellchecker.php @@ -55,7 +55,7 @@ class rcube_spellchecker 'dictionary' => $this->rc->config->get('spellcheck_dictionary'), ); - $cls = 'rcube_spellcheck_' . $this->engine; + $cls = 'rcube_spellchecker_' . $this->engine; if (class_exists($cls)) { $this->backend = new $cls($this, $this->lang); $this->backend->options = $this->options; diff --git a/program/lib/Roundcube/rcube_session_db.php b/program/lib/Roundcube/session/db.php similarity index 100% rename from program/lib/Roundcube/rcube_session_db.php rename to program/lib/Roundcube/session/db.php diff --git a/program/lib/Roundcube/rcube_session_memcache.php b/program/lib/Roundcube/session/memcache.php similarity index 100% rename from program/lib/Roundcube/rcube_session_memcache.php rename to program/lib/Roundcube/session/memcache.php diff --git a/program/lib/Roundcube/rcube_session_php.php b/program/lib/Roundcube/session/php.php similarity index 100% rename from program/lib/Roundcube/rcube_session_php.php rename to program/lib/Roundcube/session/php.php diff --git a/program/lib/Roundcube/rcube_session_redis.php b/program/lib/Roundcube/session/redis.php similarity index 100% rename from program/lib/Roundcube/rcube_session_redis.php rename to program/lib/Roundcube/session/redis.php diff --git a/program/lib/Roundcube/rcube_spellcheck_atd.php b/program/lib/Roundcube/spellchecker/atd.php similarity index 95% rename from program/lib/Roundcube/rcube_spellcheck_atd.php rename to program/lib/Roundcube/spellchecker/atd.php index fc5319ed8..c8e924355 100644 --- a/program/lib/Roundcube/rcube_spellcheck_atd.php +++ b/program/lib/Roundcube/spellchecker/atd.php @@ -24,7 +24,7 @@ * @package Framework * @subpackage Utils */ -class rcube_spellcheck_atd extends rcube_spellcheck_engine +class rcube_spellchecker_atd extends rcube_spellchecker_engine { const SERVICE_HOST = 'service.afterthedeadline.com'; const SERVICE_PORT = 80; @@ -41,7 +41,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine /** * Return a list of languages supported by this backend * - * @see rcube_spellcheck_engine::languages() + * @see rcube_spellchecker_engine::languages() */ function languages() { @@ -53,7 +53,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine /** * Set content and check spelling * - * @see rcube_spellcheck_engine::check() + * @see rcube_spellchecker_engine::check() */ function check($text) { @@ -163,7 +163,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine /** * Returns suggestions for the specified word * - * @see rcube_spellcheck_engine::get_words() + * @see rcube_spellchecker_engine::get_words() */ function get_suggestions($word) { @@ -179,7 +179,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine /** * Returns misspelled words * - * @see rcube_spellcheck_engine::get_suggestions() + * @see rcube_spellchecker_engine::get_suggestions() */ function get_words($text = null) { diff --git a/program/lib/Roundcube/rcube_spellcheck_enchant.php b/program/lib/Roundcube/spellchecker/enchant.php similarity index 94% rename from program/lib/Roundcube/rcube_spellcheck_enchant.php rename to program/lib/Roundcube/spellchecker/enchant.php index b2a86db76..635915d1f 100644 --- a/program/lib/Roundcube/rcube_spellcheck_enchant.php +++ b/program/lib/Roundcube/spellchecker/enchant.php @@ -24,7 +24,7 @@ * @package Framework * @subpackage Utils */ -class rcube_spellcheck_enchant extends rcube_spellcheck_engine +class rcube_spellchecker_enchant extends rcube_spellchecker_engine { private $enchant_broker; private $enchant_dictionary; @@ -33,7 +33,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine /** * Return a list of languages supported by this backend * - * @see rcube_spellcheck_engine::languages() + * @see rcube_spellchecker_engine::languages() */ function languages() { @@ -74,7 +74,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine /** * Set content and check spelling * - * @see rcube_spellcheck_engine::check() + * @see rcube_spellchecker_engine::check() */ function check($text) { @@ -118,7 +118,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine /** * Returns suggestions for the specified word * - * @see rcube_spellcheck_engine::get_words() + * @see rcube_spellchecker_engine::get_words() */ function get_suggestions($word) { @@ -139,7 +139,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine /** * Returns misspelled words * - * @see rcube_spellcheck_engine::get_suggestions() + * @see rcube_spellchecker_engine::get_suggestions() */ function get_words($text = null) { diff --git a/program/lib/Roundcube/rcube_spellcheck_engine.php b/program/lib/Roundcube/spellchecker/engine.php similarity index 98% rename from program/lib/Roundcube/rcube_spellcheck_engine.php rename to program/lib/Roundcube/spellchecker/engine.php index d6135f9a0..3fc9f4371 100644 --- a/program/lib/Roundcube/rcube_spellcheck_engine.php +++ b/program/lib/Roundcube/spellchecker/engine.php @@ -24,7 +24,7 @@ * @package Framework * @subpackage Utils */ -abstract class rcube_spellcheck_engine +abstract class rcube_spellchecker_engine { const MAX_SUGGESTIONS = 10; diff --git a/program/lib/Roundcube/rcube_spellcheck_googie.php b/program/lib/Roundcube/spellchecker/googie.php similarity index 95% rename from program/lib/Roundcube/rcube_spellcheck_googie.php rename to program/lib/Roundcube/spellchecker/googie.php index 985ae89d2..a1387256b 100644 --- a/program/lib/Roundcube/rcube_spellcheck_googie.php +++ b/program/lib/Roundcube/spellchecker/googie.php @@ -24,7 +24,7 @@ * @package Framework * @subpackage Utils */ -class rcube_spellcheck_googie extends rcube_spellcheck_engine +class rcube_spellchecker_googie extends rcube_spellchecker_engine { const GOOGIE_HOST = 'ssl://spell.roundcube.net'; const GOOGIE_PORT = 443; @@ -35,7 +35,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine /** * Return a list of languages supported by this backend * - * @see rcube_spellcheck_engine::languages() + * @see rcube_spellchecker_engine::languages() */ function languages() { @@ -50,7 +50,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine /** * Set content and check spelling * - * @see rcube_spellcheck_engine::check() + * @see rcube_spellchecker_engine::check() */ function check($text) { @@ -133,7 +133,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine /** * Returns suggestions for the specified word * - * @see rcube_spellcheck_engine::get_words() + * @see rcube_spellchecker_engine::get_words() */ function get_suggestions($word) { @@ -154,7 +154,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine /** * Returns misspelled words * - * @see rcube_spellcheck_engine::get_suggestions() + * @see rcube_spellchecker_engine::get_suggestions() */ function get_words($text = null) { diff --git a/program/lib/Roundcube/rcube_spellcheck_pspell.php b/program/lib/Roundcube/spellchecker/pspell.php similarity index 94% rename from program/lib/Roundcube/rcube_spellcheck_pspell.php rename to program/lib/Roundcube/spellchecker/pspell.php index f70517ae0..914a22309 100644 --- a/program/lib/Roundcube/rcube_spellcheck_pspell.php +++ b/program/lib/Roundcube/spellchecker/pspell.php @@ -24,7 +24,7 @@ * @package Framework * @subpackage Utils */ -class rcube_spellcheck_pspell extends rcube_spellcheck_engine +class rcube_spellchecker_pspell extends rcube_spellchecker_engine { private $plink; private $matches = array(); @@ -32,7 +32,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine /** * Return a list of languages supported by this backend * - * @see rcube_spellcheck_engine::languages() + * @see rcube_spellchecker_engine::languages() */ function languages() { @@ -80,7 +80,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine /** * Set content and check spelling * - * @see rcube_spellcheck_engine::check() + * @see rcube_spellchecker_engine::check() */ function check($text) { @@ -124,7 +124,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine /** * Returns suggestions for the specified word * - * @see rcube_spellcheck_engine::get_words() + * @see rcube_spellchecker_engine::get_words() */ function get_suggestions($word) { @@ -145,7 +145,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine /** * Returns misspelled words * - * @see rcube_spellcheck_engine::get_suggestions() + * @see rcube_spellchecker_engine::get_suggestions() */ function get_words($text = null) { diff --git a/tests/Framework/SpellcheckAtd.php b/tests/Framework/SpellcheckAtd.php deleted file mode 100644 index cc828240f..000000000 --- a/tests/Framework/SpellcheckAtd.php +++ /dev/null @@ -1,21 +0,0 @@ -assertInstanceOf('rcube_spellcheck_atd', $object, "Class constructor"); - $this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor"); - } -} diff --git a/tests/Framework/SpellcheckEnchant.php b/tests/Framework/SpellcheckEnchant.php deleted file mode 100644 index 85393e76c..000000000 --- a/tests/Framework/SpellcheckEnchant.php +++ /dev/null @@ -1,21 +0,0 @@ -assertInstanceOf('rcube_spellcheck_enchant', $object, "Class constructor"); - $this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor"); - } -} diff --git a/tests/Framework/SpellcheckGoogie.php b/tests/Framework/SpellcheckGoogie.php deleted file mode 100644 index dc7d70dcc..000000000 --- a/tests/Framework/SpellcheckGoogie.php +++ /dev/null @@ -1,21 +0,0 @@ -assertInstanceOf('rcube_spellcheck_googie', $object, "Class constructor"); - $this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor"); - } -} diff --git a/tests/Framework/SpellcheckPspell.php b/tests/Framework/SpellcheckPspell.php deleted file mode 100644 index bd622b206..000000000 --- a/tests/Framework/SpellcheckPspell.php +++ /dev/null @@ -1,21 +0,0 @@ -assertInstanceOf('rcube_spellcheck_pspell', $object, "Class constructor"); - $this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor"); - } -} diff --git a/tests/Framework/SpellcheckerAtd.php b/tests/Framework/SpellcheckerAtd.php new file mode 100644 index 000000000..d3152eaf3 --- /dev/null +++ b/tests/Framework/SpellcheckerAtd.php @@ -0,0 +1,21 @@ +assertInstanceOf('rcube_spellchecker_atd', $object, "Class constructor"); + $this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor"); + } +} diff --git a/tests/Framework/SpellcheckerEnchant.php b/tests/Framework/SpellcheckerEnchant.php new file mode 100644 index 000000000..aad69d9db --- /dev/null +++ b/tests/Framework/SpellcheckerEnchant.php @@ -0,0 +1,21 @@ +assertInstanceOf('rcube_spellchecker_enchant', $object, "Class constructor"); + $this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor"); + } +} diff --git a/tests/Framework/SpellcheckerGoogie.php b/tests/Framework/SpellcheckerGoogie.php new file mode 100644 index 000000000..f1713eb11 --- /dev/null +++ b/tests/Framework/SpellcheckerGoogie.php @@ -0,0 +1,21 @@ +assertInstanceOf('rcube_spellchecker_googie', $object, "Class constructor"); + $this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor"); + } +} diff --git a/tests/Framework/SpellcheckerPspell.php b/tests/Framework/SpellcheckerPspell.php new file mode 100644 index 000000000..5888a8c0a --- /dev/null +++ b/tests/Framework/SpellcheckerPspell.php @@ -0,0 +1,21 @@ +assertInstanceOf('rcube_spellchecker_pspell', $object, "Class constructor"); + $this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor"); + } +}