Move some framework classes to sub-directories

pull/5742/merge
Aleksander Machniak 7 years ago
parent d07b032bcd
commit 1058924e21

@ -425,6 +425,7 @@ if (!function_exists('idn_to_ascii'))
function rcube_autoload($classname) function rcube_autoload($classname)
{ {
if (strpos($classname, 'rcube') === 0) { if (strpos($classname, 'rcube') === 0) {
$classname = preg_replace('/^rcube_(cache|db|session|spellchecker)_/', '\\1/', $classname);
$classname = 'Roundcube/' . $classname; $classname = 'Roundcube/' . $classname;
} }
else if (strpos($classname, 'html_') === 0 || $classname === 'html') { else if (strpos($classname, 'html_') === 0 || $classname === 'html') {

@ -55,7 +55,7 @@ class rcube_spellchecker
'dictionary' => $this->rc->config->get('spellcheck_dictionary'), 'dictionary' => $this->rc->config->get('spellcheck_dictionary'),
); );
$cls = 'rcube_spellcheck_' . $this->engine; $cls = 'rcube_spellchecker_' . $this->engine;
if (class_exists($cls)) { if (class_exists($cls)) {
$this->backend = new $cls($this, $this->lang); $this->backend = new $cls($this, $this->lang);
$this->backend->options = $this->options; $this->backend->options = $this->options;

@ -24,7 +24,7 @@
* @package Framework * @package Framework
* @subpackage Utils * @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_HOST = 'service.afterthedeadline.com';
const SERVICE_PORT = 80; 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 * Return a list of languages supported by this backend
* *
* @see rcube_spellcheck_engine::languages() * @see rcube_spellchecker_engine::languages()
*/ */
function languages() function languages()
{ {
@ -53,7 +53,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine
/** /**
* Set content and check spelling * Set content and check spelling
* *
* @see rcube_spellcheck_engine::check() * @see rcube_spellchecker_engine::check()
*/ */
function check($text) function check($text)
{ {
@ -163,7 +163,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine
/** /**
* Returns suggestions for the specified word * Returns suggestions for the specified word
* *
* @see rcube_spellcheck_engine::get_words() * @see rcube_spellchecker_engine::get_words()
*/ */
function get_suggestions($word) function get_suggestions($word)
{ {
@ -179,7 +179,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine
/** /**
* Returns misspelled words * Returns misspelled words
* *
* @see rcube_spellcheck_engine::get_suggestions() * @see rcube_spellchecker_engine::get_suggestions()
*/ */
function get_words($text = null) function get_words($text = null)
{ {

@ -24,7 +24,7 @@
* @package Framework * @package Framework
* @subpackage Utils * @subpackage Utils
*/ */
class rcube_spellcheck_enchant extends rcube_spellcheck_engine class rcube_spellchecker_enchant extends rcube_spellchecker_engine
{ {
private $enchant_broker; private $enchant_broker;
private $enchant_dictionary; private $enchant_dictionary;
@ -33,7 +33,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
/** /**
* Return a list of languages supported by this backend * Return a list of languages supported by this backend
* *
* @see rcube_spellcheck_engine::languages() * @see rcube_spellchecker_engine::languages()
*/ */
function languages() function languages()
{ {
@ -74,7 +74,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
/** /**
* Set content and check spelling * Set content and check spelling
* *
* @see rcube_spellcheck_engine::check() * @see rcube_spellchecker_engine::check()
*/ */
function check($text) function check($text)
{ {
@ -118,7 +118,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
/** /**
* Returns suggestions for the specified word * Returns suggestions for the specified word
* *
* @see rcube_spellcheck_engine::get_words() * @see rcube_spellchecker_engine::get_words()
*/ */
function get_suggestions($word) function get_suggestions($word)
{ {
@ -139,7 +139,7 @@ class rcube_spellcheck_enchant extends rcube_spellcheck_engine
/** /**
* Returns misspelled words * Returns misspelled words
* *
* @see rcube_spellcheck_engine::get_suggestions() * @see rcube_spellchecker_engine::get_suggestions()
*/ */
function get_words($text = null) function get_words($text = null)
{ {

@ -24,7 +24,7 @@
* @package Framework * @package Framework
* @subpackage Utils * @subpackage Utils
*/ */
abstract class rcube_spellcheck_engine abstract class rcube_spellchecker_engine
{ {
const MAX_SUGGESTIONS = 10; const MAX_SUGGESTIONS = 10;

@ -24,7 +24,7 @@
* @package Framework * @package Framework
* @subpackage Utils * @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_HOST = 'ssl://spell.roundcube.net';
const GOOGIE_PORT = 443; 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 * Return a list of languages supported by this backend
* *
* @see rcube_spellcheck_engine::languages() * @see rcube_spellchecker_engine::languages()
*/ */
function languages() function languages()
{ {
@ -50,7 +50,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
/** /**
* Set content and check spelling * Set content and check spelling
* *
* @see rcube_spellcheck_engine::check() * @see rcube_spellchecker_engine::check()
*/ */
function check($text) function check($text)
{ {
@ -133,7 +133,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
/** /**
* Returns suggestions for the specified word * Returns suggestions for the specified word
* *
* @see rcube_spellcheck_engine::get_words() * @see rcube_spellchecker_engine::get_words()
*/ */
function get_suggestions($word) function get_suggestions($word)
{ {
@ -154,7 +154,7 @@ class rcube_spellcheck_googie extends rcube_spellcheck_engine
/** /**
* Returns misspelled words * Returns misspelled words
* *
* @see rcube_spellcheck_engine::get_suggestions() * @see rcube_spellchecker_engine::get_suggestions()
*/ */
function get_words($text = null) function get_words($text = null)
{ {

@ -24,7 +24,7 @@
* @package Framework * @package Framework
* @subpackage Utils * @subpackage Utils
*/ */
class rcube_spellcheck_pspell extends rcube_spellcheck_engine class rcube_spellchecker_pspell extends rcube_spellchecker_engine
{ {
private $plink; private $plink;
private $matches = array(); private $matches = array();
@ -32,7 +32,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine
/** /**
* Return a list of languages supported by this backend * Return a list of languages supported by this backend
* *
* @see rcube_spellcheck_engine::languages() * @see rcube_spellchecker_engine::languages()
*/ */
function languages() function languages()
{ {
@ -80,7 +80,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine
/** /**
* Set content and check spelling * Set content and check spelling
* *
* @see rcube_spellcheck_engine::check() * @see rcube_spellchecker_engine::check()
*/ */
function check($text) function check($text)
{ {
@ -124,7 +124,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine
/** /**
* Returns suggestions for the specified word * Returns suggestions for the specified word
* *
* @see rcube_spellcheck_engine::get_words() * @see rcube_spellchecker_engine::get_words()
*/ */
function get_suggestions($word) function get_suggestions($word)
{ {
@ -145,7 +145,7 @@ class rcube_spellcheck_pspell extends rcube_spellcheck_engine
/** /**
* Returns misspelled words * Returns misspelled words
* *
* @see rcube_spellcheck_engine::get_suggestions() * @see rcube_spellchecker_engine::get_suggestions()
*/ */
function get_words($text = null) function get_words($text = null)
{ {

@ -1,21 +0,0 @@
<?php
/**
* Test class to test rcube_spellcheck_atd class
*
* @package Tests
*/
class Framework_SpellcheckAtd extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellcheck_atd(null, 'en');
$this->assertInstanceOf('rcube_spellcheck_atd', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor");
}
}

@ -1,21 +0,0 @@
<?php
/**
* Test class to test rcube_spellcheck_enchant class
*
* @package Tests
*/
class Framework_SpellcheckEnchant extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellcheck_enchant(null, 'en');
$this->assertInstanceOf('rcube_spellcheck_enchant', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor");
}
}

@ -1,21 +0,0 @@
<?php
/**
* Test class to test rcube_spellcheck_googie class
*
* @package Tests
*/
class Framework_SpellcheckGoogie extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellcheck_googie(null, 'en');
$this->assertInstanceOf('rcube_spellcheck_googie', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor");
}
}

@ -1,21 +0,0 @@
<?php
/**
* Test class to test rcube_spellcheck_pspell class
*
* @package Tests
*/
class Framework_SpellcheckPspell extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellcheck_pspell(null, 'en');
$this->assertInstanceOf('rcube_spellcheck_pspell', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellcheck_engine', $object, "Class constructor");
}
}

@ -0,0 +1,21 @@
<?php
/**
* Test class to test rcube_spellcheck_atd class
*
* @package Tests
*/
class Framework_SpellcheckerAtd extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellchecker_atd(null, 'en');
$this->assertInstanceOf('rcube_spellchecker_atd', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor");
}
}

@ -0,0 +1,21 @@
<?php
/**
* Test class to test rcube_spellcheck_enchant class
*
* @package Tests
*/
class Framework_SpellcheckerEnchant extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellchecker_enchant(null, 'en');
$this->assertInstanceOf('rcube_spellchecker_enchant', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor");
}
}

@ -0,0 +1,21 @@
<?php
/**
* Test class to test rcube_spellcheck_googie class
*
* @package Tests
*/
class Framework_SpellcheckerGoogie extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellchecker_googie(null, 'en');
$this->assertInstanceOf('rcube_spellchecker_googie', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor");
}
}

@ -0,0 +1,21 @@
<?php
/**
* Test class to test rcube_spellcheck_pspell class
*
* @package Tests
*/
class Framework_SpellcheckerPspell extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_spellchecker_pspell(null, 'en');
$this->assertInstanceOf('rcube_spellchecker_pspell', $object, "Class constructor");
$this->assertInstanceOf('rcube_spellchecker_engine', $object, "Class constructor");
}
}
Loading…
Cancel
Save