TYPO3 CMS  TYPO3_8-7
DefaultFactory.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
27  public function getStructure()
28  {
29  $rootNode = new RootNode($this->getDefaultStructureDefinition(), null);
30  $structureFacade = new StructureFacade($rootNode);
31  return $structureFacade;
32  }
33 
40  protected function getDefaultStructureDefinition()
41  {
42  $filePermission = $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask'];
43  $directoryPermission = $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'];
44 
45  return [
46  // Cut off trailing forward / from PATH_site, so root node has no trailing slash like all others
47  'name' => substr(PATH_site, 0, -1),
48  'targetPermission' => $directoryPermission,
49  'children' => [
50  [
51  'name' => 'typo3temp',
52  'type' => DirectoryNode::class,
53  'targetPermission' => $directoryPermission,
54  'children' => [
55  [
56  'name' => 'index.html',
57  'type' => FileNode::class,
58  'targetPermission' => $filePermission,
59  'targetContent' => '',
60  ],
61  [
62  'name' => 'assets',
63  'type' => DirectoryNode::class,
64  'targetPermission' => $directoryPermission,
65  'children' => [
66  [
67  'name' => 'compressed',
68  'type' => DirectoryNode::class,
69  'targetPermission' => $directoryPermission
70  ],
71  [
72  'name' => 'css',
73  'type' => DirectoryNode::class,
74  'targetPermission' => $directoryPermission
75  ],
76  [
77  'name' => 'js',
78  'type' => DirectoryNode::class,
79  'targetPermission' => $directoryPermission
80  ],
81  [
82  'name' => 'images',
83  'type' => DirectoryNode::class,
84  'targetPermission' => $directoryPermission
85  ],
86  [
87  'name' => '_processed_',
88  'type' => DirectoryNode::class,
89  'targetPermission' => $directoryPermission
90  ]
91  ]
92  ],
93  [
94  'name' => 'var',
95  'type' => DirectoryNode::class,
96  'targetPermission' => $directoryPermission,
97  'children' => [
98  [
99  'name' => '.htaccess',
100  'type' => FileNode::class,
101  'targetPermission' => $filePermission,
102  'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess',
103  ],
104  [
105  'name' => 'charset',
106  'type' => DirectoryNode::class,
107  'targetPermission' => $directoryPermission,
108  ],
109  [
110  'name' => 'Cache',
111  'type' => DirectoryNode::class,
112  'targetPermission' => $directoryPermission,
113  ],
114  [
115  'name' => 'locks',
116  'type' => DirectoryNode::class,
117  'targetPermission' => $directoryPermission,
118  ]
119  ]
120  ],
121  ],
122  ],
123  [
124  'name' => 'typo3conf',
125  'type' => DirectoryNode::class,
126  'targetPermission' => $directoryPermission,
127  'children' => [
128  [
129  'name' => 'ext',
130  'type' => DirectoryNode::class,
131  'targetPermission' => $directoryPermission,
132  ],
133  [
134  'name' => 'l10n',
135  'type' => DirectoryNode::class,
136  'targetPermission' => $directoryPermission,
137  ],
138  ],
139  ],
140  [
141  'name' => 'uploads',
142  'type' => DirectoryNode::class,
143  'targetPermission' => $directoryPermission,
144  'children' => [
145  [
146  'name' => 'index.html',
147  'type' => FileNode::class,
148  'targetPermission' => $filePermission,
149  'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/uploads-index.html',
150  ],
151  [
152  'name' => 'media',
153  'type' => DirectoryNode::class,
154  'targetPermission' => $directoryPermission,
155  'children' => [
156  [
157  'name' => 'index.html',
158  'type' => FileNode::class,
159  'targetPermission' => $filePermission,
160  'targetContent' => '',
161  ],
162  ],
163  ],
164  ],
165  ],
166  [
167  'name' => !empty($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir']) ? rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') : 'fileadmin',
168  'type' => DirectoryNode::class,
169  'targetPermission' => $directoryPermission,
170  'children' => [
171  [
172  'name' => '_temp_',
173  'type' => DirectoryNode::class,
174  'targetPermission' => $directoryPermission,
175  'children' => [
176  [
177  'name' => '.htaccess',
178  'type' => FileNode::class,
179  'targetPermission' => $filePermission,
180  'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess',
181  ],
182  [
183  'name' => 'index.html',
184  'type' => FileNode::class,
185  'targetPermission' => $filePermission,
186  'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html',
187  ],
188  ],
189  ],
190  [
191  'name' => 'user_upload',
192  'type' => DirectoryNode::class,
193  'targetPermission' => $directoryPermission,
194  'children' => [
195  [
196  'name' => '_temp_',
197  'type' => DirectoryNode::class,
198  'targetPermission' => $directoryPermission,
199  'children' => [
200  [
201  'name' => 'index.html',
202  'type' => FileNode::class,
203  'targetPermission' => $filePermission,
204  'targetContent' => '',
205  ],
206  [
207  'name' => 'importexport',
208  'type' => DirectoryNode::class,
209  'targetPermission' => $directoryPermission,
210  'children' => [
211  [
212  'name' => '.htaccess',
213  'type' => FileNode::class,
214  'targetPermission' => $filePermission,
215  'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-user_upload-temp-importexport-htaccess',
216  ],
217  [
218  'name' => 'index.html',
219  'type' => FileNode::class,
220  'targetPermission' => $filePermission,
221  'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html',
222  ],
223  ],
224  ],
225  ],
226  ],
227  [
228  'name' => 'index.html',
229  'type' => FileNode::class,
230  'targetPermission' => $filePermission,
231  'targetContent' => '',
232  ],
233  ],
234  ],
235  ],
236  ],
237  ],
238  ];
239  }
240 }
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']