@@ -81,7 +81,6 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @PublicPage |
83 | 83 | * @NoCSRFRequired |
84 | - |
|
85 | 84 | * @return Response |
86 | 85 | */ |
87 | 86 | public function getRoot($site) { |
@@ -92,7 +91,6 @@ discard block |
||
92 | 91 | /** |
93 | 92 | * @param string $site |
94 | 93 | * @param $page |
95 | - |
|
96 | 94 | * @PublicPage |
97 | 95 | * @NoCSRFRequired |
98 | 96 | * |
@@ -91,7 +91,7 @@ |
||
91 | 91 | |
92 | 92 | /** |
93 | 93 | * @param string $site |
94 | - * @param $page |
|
94 | + * @param string $page |
|
95 | 95 | |
96 | 96 | * @PublicPage |
97 | 97 | * @NoCSRFRequired |
@@ -54,6 +54,9 @@ |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | + /** |
|
58 | + * @param string $requestUrl |
|
59 | + */ |
|
57 | 60 | public function setRequestUrl($requestUrl) { |
58 | 61 | $this->requestUrl = $requestUrl; |
59 | 62 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | protected function getTwigVariables() { |
132 | 132 | $twigVariables = parent::getTwigVariables(); |
133 | 133 | $twigVariables['theme_url'] = |
134 | - \OC_App::getAppWebPath(Application::APP_NAME) . '/Pico/themes/' . $this->getConfig('theme'); |
|
134 | + \OC_App::getAppWebPath(Application::APP_NAME).'/Pico/themes/'.$this->getConfig('theme'); |
|
135 | 135 | |
136 | 136 | return $twigVariables; |
137 | 137 | } |
@@ -113,7 +113,7 @@ |
||
113 | 113 | |
114 | 114 | /** |
115 | 115 | * @param Website $website |
116 | - * @param $asset |
|
116 | + * @param string $asset |
|
117 | 117 | * |
118 | 118 | * @return string |
119 | 119 | * @throws AssetDoesNotExistException |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | $website->pathCantContainSpecificFolders($asset); |
124 | 124 | |
125 | 125 | try { |
126 | - $website->viewerMustHaveAccess(self::DIR_ASSETS . $asset); |
|
126 | + $website->viewerMustHaveAccess(self::DIR_ASSETS.$asset); |
|
127 | 127 | $userFolder = $this->rootFolder->getUserFolder($website->getUserId()); |
128 | 128 | |
129 | 129 | /** @var File $file */ |
130 | - $file = $userFolder->get($website->getPath() . self::DIR_ASSETS . $asset); |
|
130 | + $file = $userFolder->get($website->getPath().self::DIR_ASSETS.$asset); |
|
131 | 131 | $content = $file->getContent(); |
132 | 132 | |
133 | 133 | return $content; |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | |
187 | 187 | $this->themesService->hasToBeAValidTheme($website->getTheme()); |
188 | 188 | |
189 | - $appBaseUrl = \OC::$WEBROOT . '/index.php/apps/' . Application::APP_NAME; |
|
189 | + $appBaseUrl = \OC::$WEBROOT.'/index.php/apps/'.Application::APP_NAME; |
|
190 | 190 | $pico->setConfig( |
191 | 191 | [ |
192 | 192 | 'site_title' => $website->getName(), |
193 | - 'base_url' => $appBaseUrl . '/pico/' . $website->getSite(), |
|
193 | + 'base_url' => $appBaseUrl.'/pico/'.$website->getSite(), |
|
194 | 194 | 'theme' => $website->getTheme(), |
195 | 195 | 'content_dir' => 'content/', |
196 | 196 | 'content_ext' => '.md', |
@@ -90,7 +90,7 @@ |
||
90 | 90 | /** |
91 | 91 | * Check if a theme exist. |
92 | 92 | * |
93 | - * @param $theme |
|
93 | + * @param string $theme |
|
94 | 94 | * |
95 | 95 | * @throws ThemeDoesNotExistException |
96 | 96 | */ |
@@ -136,8 +136,8 @@ |
||
136 | 136 | */ |
137 | 137 | private function limitToDBField(IQueryBuilder &$qb, $field, $value) { |
138 | 138 | $expr = $qb->expr(); |
139 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias . '.' : ''; |
|
140 | - $qb->andWhere($expr->eq($pf . $field, $qb->createNamedParameter($value))); |
|
139 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->defaultSelectAlias.'.' : ''; |
|
140 | + $qb->andWhere($expr->eq($pf.$field, $qb->createNamedParameter($value))); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
86 | - $this->ownerView = new View($this->getUserId() . '/files/'); |
|
86 | + $this->ownerView = new View($this->getUserId().'/files/'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | try { |
142 | 142 | $ownerFile = $this->rootFolder->getUserFolder($this->getUserId()) |
143 | - ->get($this->getPath() . $local); |
|
143 | + ->get($this->getPath().$local); |
|
144 | 144 | |
145 | 145 | return $ownerFile->getId(); |
146 | 146 | } catch (NotFoundException $e) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $this->filename = $filename; |
51 | 51 | |
52 | 52 | // TODO: get the content from File |
53 | - $this->content = file_get_contents($base . $filename); |
|
53 | + $this->content = file_get_contents($base.$filename); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $ak = array_keys($data); |
82 | 82 | $temp = $this->getContent(); |
83 | 83 | foreach ($ak as $k) { |
84 | - $temp = str_replace('%%' . $k . '%%', $data[$k], $temp); |
|
84 | + $temp = str_replace('%%'.$k.'%%', $data[$k], $temp); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $this->setContent($temp); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | class FileService { |
37 | 37 | |
38 | 38 | |
39 | - const INSTALL_DIR = __DIR__ . '/../../Pico/'; |
|
39 | + const INSTALL_DIR = __DIR__.'/../../Pico/'; |
|
40 | 40 | |
41 | 41 | /** @var IRootFolder */ |
42 | 42 | private $rootFolder; |
@@ -96,19 +96,19 @@ discard block |
||
96 | 96 | $dir = MiscService::endSlash($dir); |
97 | 97 | |
98 | 98 | $files = []; |
99 | - foreach (new DirectoryIterator($base . $dir) as $file) { |
|
99 | + foreach (new DirectoryIterator($base.$dir) as $file) { |
|
100 | 100 | |
101 | 101 | if (substr($file->getFilename(), 0, 1) === '.') { |
102 | 102 | continue; |
103 | 103 | } |
104 | 104 | |
105 | 105 | if ($file->isDir()) { |
106 | - $files[] = $dir . $file->getFilename() . '/'; |
|
107 | - $files = array_merge($files, $this->getSourceFiles($base, $dir . $file->getFilename())); |
|
106 | + $files[] = $dir.$file->getFilename().'/'; |
|
107 | + $files = array_merge($files, $this->getSourceFiles($base, $dir.$file->getFilename())); |
|
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | |
111 | - $files[] = $dir . $file->getFilename(); |
|
111 | + $files[] = $dir.$file->getFilename(); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | return $files; |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | $dir = MiscService::endSlash($dir); |
130 | 130 | |
131 | 131 | $files = []; |
132 | - foreach (new DirectoryIterator($base . $dir) as $file) { |
|
132 | + foreach (new DirectoryIterator($base.$dir) as $file) { |
|
133 | 133 | |
134 | 134 | if (substr($file->getFilename(), 0, 1) === '.') { |
135 | 135 | continue; |
136 | 136 | } |
137 | 137 | |
138 | 138 | if ($file->isDir()) { |
139 | - $files[] = $dir . $file->getFilename() . '/'; |
|
140 | - $files = array_merge($files, $this->getSourceFiles($base, $dir . $file->getFilename())); |
|
139 | + $files[] = $dir.$file->getFilename().'/'; |
|
140 | + $files = array_merge($files, $this->getSourceFiles($base, $dir.$file->getFilename())); |
|
141 | 141 | continue; |
142 | 142 | } |
143 | 143 | |
144 | - $files[] = $dir . $file->getFilename(); |
|
144 | + $files[] = $dir.$file->getFilename(); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $files; |
@@ -187,13 +187,13 @@ discard block |
||
187 | 187 | private function createAppDataFolder(Folder $appNode, $dir) { |
188 | 188 | $appFolder = $appNode->newFolder($dir); |
189 | 189 | |
190 | - $files = $this->getSourceFiles(self::INSTALL_DIR . $dir); |
|
190 | + $files = $this->getSourceFiles(self::INSTALL_DIR.$dir); |
|
191 | 191 | foreach ($files as $file) { |
192 | 192 | if (substr($file, -1) === '/') { |
193 | 193 | $appFolder->newFolder($file); |
194 | 194 | } else { |
195 | 195 | $newFile = $appFolder->newFile($file); |
196 | - $newFile->putContent(file_get_contents(self::INSTALL_DIR . $dir . '/' . $file)); |
|
196 | + $newFile->putContent(file_get_contents(self::INSTALL_DIR.$dir.'/'.$file)); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if ($this->appDataFolder === null) { |
209 | 209 | |
210 | 210 | $instanceId = $this->configService->getSystemValue('instanceid', null); |
211 | - $name = 'appdata_' . $instanceId; |
|
211 | + $name = 'appdata_'.$instanceId; |
|
212 | 212 | |
213 | 213 | /** @var Folder $globalAppDataFolder */ |
214 | 214 | try { |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | */ |
165 | 165 | private function generateFile(TemplateFile $file, Website $website) { |
166 | 166 | try { |
167 | - $this->initFolder(pathinfo($website->getPath() . $file->getFilename(), PATHINFO_DIRNAME)); |
|
167 | + $this->initFolder(pathinfo($website->getPath().$file->getFilename(), PATHINFO_DIRNAME)); |
|
168 | 168 | |
169 | 169 | if (substr($file->getFilename(), -5) === 'empty') { |
170 | 170 | return; |
171 | 171 | } |
172 | 172 | |
173 | - $new = $this->websiteFolder->newFile($website->getPath() . $file->getFilename()); |
|
173 | + $new = $this->websiteFolder->newFile($website->getPath().$file->getFilename()); |
|
174 | 174 | $new->putContent($file->getContent()); |
175 | 175 | } catch (Exception $e) { |
176 | 176 | throw new WriteAccessException( |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | private function generateData(Website $website) { |
199 | 199 | return [ |
200 | 200 | 'site_title' => $website->getName(), |
201 | - 'base_url' => \OC::$WEBROOT . $website->getSite() |
|
201 | + 'base_url' => \OC::$WEBROOT.$website->getSite() |
|
202 | 202 | ]; |
203 | 203 | } |
204 | 204 |