From: Robin Appelman Date: Tue, 14 Oct 2014 13:49:00 +0000 (+0200) Subject: Rename to NullQueryLogger X-Git-Tag: v8.0.0alpha1~468^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a8358bc509ed4f7771ae68f69fafed811a7e568;p=nextcloud-server.git Rename to NullQueryLogger --- diff --git a/lib/private/diagnostics/dummyeventlogger.php b/lib/private/diagnostics/dummyeventlogger.php deleted file mode 100644 index f1386d2e88c..00000000000 --- a/lib/private/diagnostics/dummyeventlogger.php +++ /dev/null @@ -1,40 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace OC\Diagnostics; - -use OCP\Diagnostics\IEventLogger; - -/** - * Dummy event logger that doesn't actually log anything - */ -class DummyEventLogger implements IEventLogger { - /** - * Mark the start of an event - * - * @param $id - * @param $description - */ - public function start($id, $description) { - } - - /** - * Mark the end of an event - * - * @param $id - */ - public function end($id) { - } - - /** - * @return \OCP\Diagnostics\IEvent[] - */ - public function getEvents(){ - return array(); - } -} diff --git a/lib/private/diagnostics/dummyquerylogger.php b/lib/private/diagnostics/dummyquerylogger.php deleted file mode 100644 index 1617b204e90..00000000000 --- a/lib/private/diagnostics/dummyquerylogger.php +++ /dev/null @@ -1,31 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace OC\Diagnostics; - -use OCP\Diagnostics\IQueryLogger; - -class DummyQueryLogger implements IQueryLogger { - /** - * @param string $sql - * @param array $params - * @param array $types - */ - public function startQuery($sql, array $params = null, array $types = null) { - } - - public function stopQuery() { - } - - /** - * @return \OCP\Diagnostics\IQuery[] - */ - public function getQueries() { - return array(); - } -} diff --git a/lib/private/diagnostics/nulleventlogger.php b/lib/private/diagnostics/nulleventlogger.php new file mode 100644 index 00000000000..fd71ee9e110 --- /dev/null +++ b/lib/private/diagnostics/nulleventlogger.php @@ -0,0 +1,40 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Diagnostics; + +use OCP\Diagnostics\IEventLogger; + +/** + * Dummy event logger that doesn't actually log anything + */ +class NullEventLogger implements IEventLogger { + /** + * Mark the start of an event + * + * @param $id + * @param $description + */ + public function start($id, $description) { + } + + /** + * Mark the end of an event + * + * @param $id + */ + public function end($id) { + } + + /** + * @return \OCP\Diagnostics\IEvent[] + */ + public function getEvents(){ + return array(); + } +} diff --git a/lib/private/diagnostics/nullquerylogger.php b/lib/private/diagnostics/nullquerylogger.php new file mode 100644 index 00000000000..8467b4dd26c --- /dev/null +++ b/lib/private/diagnostics/nullquerylogger.php @@ -0,0 +1,31 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Diagnostics; + +use OCP\Diagnostics\IQueryLogger; + +class NullQueryLogger implements IQueryLogger { + /** + * @param string $sql + * @param array $params + * @param array $types + */ + public function startQuery($sql, array $params = null, array $types = null) { + } + + public function stopQuery() { + } + + /** + * @return \OCP\Diagnostics\IQuery[] + */ + public function getQueries() { + return array(); + } +} diff --git a/lib/private/server.php b/lib/private/server.php index 496c26e2503..f7ffee484ea 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -6,7 +6,7 @@ use OC\AppFramework\Http\Request; use OC\AppFramework\Db\Db; use OC\AppFramework\Utility\SimpleContainer; use OC\Cache\UserCache; -use OC\Diagnostics\DummyQueryLogger; +use OC\Diagnostics\NullQueryLogger; use OC\Diagnostics\EventLogger; use OC\Diagnostics\QueryLogger; use OC\Security\CertificateManager; @@ -15,7 +15,7 @@ use OC\Files\Node\Root; use OC\Files\View; use OC\Security\Crypto; use OC\Security\SecureRandom; -use OC\Diagnostics\DummyEventLogger; +use OC\Diagnostics\NullEventLogger; use OCP\IServerContainer; use OCP\ISession; use OC\Tagging\TagMapper; @@ -229,14 +229,14 @@ class Server extends SimpleContainer implements IServerContainer { if (defined('DEBUG') and DEBUG) { return new EventLogger(); } else { - return new DummyEventLogger(); + return new NullEventLogger(); } }); $this->registerService('QueryLogger', function ($c) { if (defined('DEBUG') and DEBUG) { return new QueryLogger(); } else { - return new DummyQueryLogger(); + return new NullQueryLogger(); } }); }