diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-08 18:11:25 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-08 18:11:25 +0100 |
commit | 3de81be692db69452c9c652605133ac71ab12dec (patch) | |
tree | 6d789b1f26413090ef69e25bcfee51844c8ccbc3 /lib/private | |
parent | 0f281cdd30d5efddcb19389a4ea1917604238044 (diff) | |
parent | fa97e3a5a304e3e67e50667281ee1f8b55ee0030 (diff) | |
download | nextcloud-server-3de81be692db69452c9c652605133ac71ab12dec.tar.gz nextcloud-server-3de81be692db69452c9c652605133ac71ab12dec.zip |
Merge pull request #21494 from owncloud/underscores-in-class-names
Remove underscores from class names - part 1
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/db/mdb2schemamanager.php | 2 | ||||
-rw-r--r-- | lib/private/db/mdb2schemawriter.php | 18 | ||||
-rw-r--r-- | lib/private/template.php | 2 | ||||
-rw-r--r-- | lib/private/templatelayout.php | 57 |
4 files changed, 41 insertions, 38 deletions
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php index aef485ed686..6fa9a63ec00 100644 --- a/lib/private/db/mdb2schemamanager.php +++ b/lib/private/db/mdb2schemamanager.php @@ -55,7 +55,7 @@ class MDB2SchemaManager { * TODO: write more documentation */ public function getDbStructure($file) { - return \OC_DB_MDB2SchemaWriter::saveSchemaToFile($file, $this->conn); + return \OC\DB\MDB2SchemaWriter::saveSchemaToFile($file, $this->conn); } /** diff --git a/lib/private/db/mdb2schemawriter.php b/lib/private/db/mdb2schemawriter.php index 8b74b545b3b..0ff04008b61 100644 --- a/lib/private/db/mdb2schemawriter.php +++ b/lib/private/db/mdb2schemawriter.php @@ -24,7 +24,12 @@ * */ -class OC_DB_MDB2SchemaWriter { +namespace OC\DB; + +use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\Index; + +class MDB2SchemaWriter { /** * @param string $file @@ -34,7 +39,7 @@ class OC_DB_MDB2SchemaWriter { static public function saveSchemaToFile($file, \OC\DB\Connection $conn) { $config = \OC::$server->getConfig(); - $xml = new SimpleXMLElement('<database/>'); + $xml = new \SimpleXMLElement('<database/>'); $xml->addChild('name', $config->getSystemValue('dbname', 'owncloud')); $xml->addChild('create', 'true'); $xml->addChild('overwrite', 'false'); @@ -56,7 +61,8 @@ class OC_DB_MDB2SchemaWriter { } /** - * @param SimpleXMLElement $xml + * @param \Doctrine\DBAL\Schema\Table $table + * @param \SimpleXMLElement $xml */ private static function saveTable($table, $xml) { $xml->addChild('name', $table->getName()); @@ -81,7 +87,8 @@ class OC_DB_MDB2SchemaWriter { } /** - * @param SimpleXMLElement $xml + * @param Column $column + * @param \SimpleXMLElement $xml */ private static function saveColumn($column, $xml) { $xml->addChild('name', $column->getName()); @@ -147,7 +154,8 @@ class OC_DB_MDB2SchemaWriter { } /** - * @param SimpleXMLElement $xml + * @param Index $index + * @param \SimpleXMLElement $xml */ private static function saveIndex($index, $xml) { $xml->addChild('name', $index->getName()); diff --git a/lib/private/template.php b/lib/private/template.php index c2528c26851..b1655061a28 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -222,7 +222,7 @@ class OC_Template extends \OC\Template\Base { $data = parent::fetchPage(); if( $this->renderAs ) { - $page = new OC_TemplateLayout($this->renderAs, $this->app); + $page = new \OC\TemplateLayout($this->renderAs, $this->app); // Add custom headers $headers = ''; diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php index bf25b2d31a9..c29e712cccf 100644 --- a/lib/private/templatelayout.php +++ b/lib/private/templatelayout.php @@ -32,6 +32,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ +namespace OC; + use Assetic\Asset\AssetCollection; use Assetic\Asset\FileAsset; use Assetic\AssetWriter; @@ -41,14 +43,7 @@ use Assetic\Filter\CssRewriteFilter; use Assetic\Filter\JSqueezeFilter; use Assetic\Filter\SeparatorFilter; -/** - * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -class OC_TemplateLayout extends OC_Template { +class TemplateLayout extends \OC_Template { private static $versionHash = ''; @@ -69,7 +64,7 @@ class OC_TemplateLayout extends OC_Template { // Decide which page we show if($renderAs == 'user') { parent::__construct( 'core', 'layout.user' ); - if(in_array(OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { + if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { $this->assign('bodyid', 'body-settings'); }else{ $this->assign('bodyid', 'body-user'); @@ -77,7 +72,7 @@ class OC_TemplateLayout extends OC_Template { // Update notification if($this->config->getSystemValue('updatechecker', true) === true && - OC_User::isAdminUser(OC_User::getUser())) { + \OC_User::isAdminUser(\OC_User::getUser())) { $updater = new \OC\Updater( \OC::$server->getHTTPHelper(), \OC::$server->getConfig(), @@ -109,9 +104,9 @@ class OC_TemplateLayout extends OC_Template { // Add navigation entry $this->assign( 'application', ''); $this->assign( 'appid', $appId ); - $navigation = OC_App::getNavigation(); + $navigation = \OC_App::getNavigation(); $this->assign( 'navigation', $navigation); - $settingsNavigation = OC_App::getSettingsNavigation(); + $settingsNavigation = \OC_App::getSettingsNavigation(); $this->assign( 'settingsnavigation', $settingsNavigation); foreach($navigation as $entry) { if ($entry['active']) { @@ -126,21 +121,21 @@ class OC_TemplateLayout extends OC_Template { break; } } - $userDisplayName = OC_User::getDisplayName(); + $userDisplayName = \OC_User::getDisplayName(); $appsMgmtActive = strpos(\OC::$server->getRequest()->getRequestUri(), \OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')) === 0; if ($appsMgmtActive) { $l = \OC::$server->getL10N('lib'); $this->assign('application', $l->t('Apps')); } $this->assign('user_displayname', $userDisplayName); - $this->assign('user_uid', OC_User::getUser()); + $this->assign('user_uid', \OC_User::getUser()); $this->assign('appsmanagement_active', $appsMgmtActive); $this->assign('enableAvatars', $this->config->getSystemValue('enable_avatars', true)); - if (OC_User::getUser() === false) { + if (\OC_User::getUser() === false) { $this->assign('userAvatarSet', false); } else { - $this->assign('userAvatarSet', \OC::$server->getAvatarManager()->getAvatar(OC_User::getUser())->exists()); + $this->assign('userAvatarSet', \OC::$server->getAvatarManager()->getAvatar(\OC_User::getUser())->exists()); } } else if ($renderAs == 'error') { @@ -154,11 +149,11 @@ class OC_TemplateLayout extends OC_Template { } // Send the language to our layouts - $this->assign('language', OC_L10N::findLanguage()); + $this->assign('language', \OC_L10N::findLanguage()); if(empty(self::$versionHash)) { - $v = OC_App::getAppVersions(); + $v = \OC_App::getAppVersions(); $v['core'] = implode('.', \OCP\Util::getVersion()); self::$versionHash = md5(implode(',', $v)); } @@ -169,7 +164,7 @@ class OC_TemplateLayout extends OC_Template { $this->generateAssets(); } else { // Add the js files - $jsFiles = self::findJavascriptFiles(OC_Util::$scripts); + $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts); $this->assign('jsfiles', array()); if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') { $this->append( 'jsfiles', \OC::$server->getURLGenerator()->linkToRoute('js_config', ['v' => self::$versionHash])); @@ -181,7 +176,7 @@ class OC_TemplateLayout extends OC_Template { } // Add the css files - $cssFiles = self::findStylesheetFiles(OC_Util::$styles); + $cssFiles = self::findStylesheetFiles(\OC_Util::$styles); $this->assign('cssfiles', array()); foreach($cssFiles as $info) { $web = $info[1]; @@ -198,13 +193,13 @@ class OC_TemplateLayout extends OC_Template { */ static public function findStylesheetFiles($styles) { // Read the selected theme from the config file - $theme = OC_Util::getTheme(); + $theme = \OC_Util::getTheme(); $locator = new \OC\Template\CSSResourceLocator( - OC::$server->getLogger(), + \OC::$server->getLogger(), $theme, - array( OC::$SERVERROOT => OC::$WEBROOT ), - array( OC::$THIRDPARTYROOT => OC::$THIRDPARTYWEBROOT )); + array( \OC::$SERVERROOT => \OC::$WEBROOT ), + array( \OC::$THIRDPARTYROOT => \OC::$THIRDPARTYWEBROOT )); $locator->find($styles); return $locator->getResources(); } @@ -215,20 +210,20 @@ class OC_TemplateLayout extends OC_Template { */ static public function findJavascriptFiles($scripts) { // Read the selected theme from the config file - $theme = OC_Util::getTheme(); + $theme = \OC_Util::getTheme(); $locator = new \OC\Template\JSResourceLocator( - OC::$server->getLogger(), + \OC::$server->getLogger(), $theme, - array( OC::$SERVERROOT => OC::$WEBROOT ), - array( OC::$THIRDPARTYROOT => OC::$THIRDPARTYWEBROOT )); + array( \OC::$SERVERROOT => \OC::$WEBROOT ), + array( \OC::$THIRDPARTYROOT => \OC::$THIRDPARTYWEBROOT )); $locator->find($scripts); return $locator->getResources(); } public function generateAssets() { $assetDir = \OC::$server->getConfig()->getSystemValue('assetdirectory', \OC::$SERVERROOT); - $jsFiles = self::findJavascriptFiles(OC_Util::$scripts); + $jsFiles = self::findJavascriptFiles(\OC_Util::$scripts); $jsHash = self::hashFileNames($jsFiles); if (!file_exists("$assetDir/assets/$jsHash.js")) { @@ -253,7 +248,7 @@ class OC_TemplateLayout extends OC_Template { $writer->writeAsset($jsCollection); } - $cssFiles = self::findStylesheetFiles(OC_Util::$styles); + $cssFiles = self::findStylesheetFiles(\OC_Util::$styles); $cssHash = self::hashFileNames($cssFiles); if (!file_exists("$assetDir/assets/$cssHash.css")) { @@ -289,7 +284,7 @@ class OC_TemplateLayout extends OC_Template { * Converts the absolute file path to a relative path from \OC::$SERVERROOT * @param string $filePath Absolute path * @return string Relative path - * @throws Exception If $filePath is not under \OC::$SERVERROOT + * @throws \Exception If $filePath is not under \OC::$SERVERROOT */ public static function convertToRelativePath($filePath) { $relativePath = explode(\OC::$SERVERROOT, $filePath); |