From e45a3e489f6f551686e5f258b026b49e0092e359 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Wed, 17 Oct 2012 13:20:50 +0000 Subject: [PATCH] Use camel case for plugins' classes names --- .../server_side/webim/libs/classes/EventDispatcherTest.php | 2 +- .../phpunit_autotest_plugin_manager_plugin.php | 2 +- .../request_processor_test/request_processor_test_plugin.php | 2 +- src/messenger/webim/libs/classes/plugin_manager.php | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/messenger/tests/server_side/webim/libs/classes/EventDispatcherTest.php b/src/messenger/tests/server_side/webim/libs/classes/EventDispatcherTest.php index 8481c0a6..3a0b4ef7 100644 --- a/src/messenger/tests/server_side/webim/libs/classes/EventDispatcherTest.php +++ b/src/messenger/tests/server_side/webim/libs/classes/EventDispatcherTest.php @@ -13,7 +13,7 @@ class EventDispatcherTest extends PHPUnit_Framework_TestCase { protected static $plugin = null; public static function setUpBeforeClass() { - self::$plugin = new Phpunit_autotest_plugin_managerPlugin(); + self::$plugin = new PhpunitAutotestPluginManagerPlugin(); } public static function tearDownAfterClass() { diff --git a/src/messenger/tests/server_side/webim/plugins/phpunit_autotest_plugin_manager/phpunit_autotest_plugin_manager_plugin.php b/src/messenger/tests/server_side/webim/plugins/phpunit_autotest_plugin_manager/phpunit_autotest_plugin_manager_plugin.php index 7cbff02f..28be6d32 100644 --- a/src/messenger/tests/server_side/webim/plugins/phpunit_autotest_plugin_manager/phpunit_autotest_plugin_manager_plugin.php +++ b/src/messenger/tests/server_side/webim/plugins/phpunit_autotest_plugin_manager/phpunit_autotest_plugin_manager_plugin.php @@ -3,7 +3,7 @@ /** * Test plugin for PHPUnit tests */ -Class Phpunit_autotest_plugin_managerPlugin extends Plugin{ +Class PhpunitAutotestPluginManagerPlugin extends Plugin{ public $eventsRegistered = false; public $listenersRegistered = false; diff --git a/src/messenger/tests/server_side/webim/plugins/request_processor_test/request_processor_test_plugin.php b/src/messenger/tests/server_side/webim/plugins/request_processor_test/request_processor_test_plugin.php index b0e31f98..f64aa098 100644 --- a/src/messenger/tests/server_side/webim/plugins/request_processor_test/request_processor_test_plugin.php +++ b/src/messenger/tests/server_side/webim/plugins/request_processor_test/request_processor_test_plugin.php @@ -3,7 +3,7 @@ /** * Test plugin for PHPUnit tests */ -Class Request_processor_testPlugin extends Plugin{ +Class RequestProcessorTestPlugin extends Plugin{ public $callList = array(); diff --git a/src/messenger/webim/libs/classes/plugin_manager.php b/src/messenger/webim/libs/classes/plugin_manager.php index 22a3bb80..cbdefaf6 100644 --- a/src/messenger/webim/libs/classes/plugin_manager.php +++ b/src/messenger/webim/libs/classes/plugin_manager.php @@ -93,7 +93,9 @@ Class PluginManager { $plugin_dependences = isset($plugin['dependences']) ? $plugin['dependences'] : array(); - $plugin_classname = ucfirst($plugin_name) . "Plugin"; + $plugin_name_parts = explode('_', $plugin_name); + $plugin_name_parts = array_map('ucfirst', $plugin_name_parts); + $plugin_classname = implode('', $plugin_name_parts) . "Plugin"; // Check plugin dependences foreach ($plugin_dependences as $dependence) { if (empty(self::$loaded_plugins[$dependence])) {