Feature #27728
Standard-Settings in localconf.php are not valid
| Status: | On Hold | Start date: | 2011-06-28 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Stefano Kowalke | % Done: | 0% |
|
| Category: | NamingConventions | Spent time: | - | |
| Target version: | 0.0.7 | |||
| Branch: | Tags: | typo3v4 | ||
| Votes: | 0 |
Description
The localconf.php does not comply with the CGL, so you can't use these sniffs e.g. as pre-commit hooks, as you'll never be able to commit.
I'm pretty new to sniffs, but wouldn't it be possible to define exemptions?
Related issues
| blocked by Coding Guidelines - Task #36631: Note that configuration files should follow the CGL | Resolved | 2012-04-26 |
History
Updated by Stefano Kowalke almost 2 years ago
- Status changed from New to Rejected
- Assignee set to Stefano Kowalke
- Target version set to 0.0.4
You have to exclude this file from checking
phpcs --ignore=typo3conf/localconf.php /path/to/typo3
You can read at [1] how you can combining this with the pre-commit hook.
[1] http://pear.php.net/manual/en/package.php.php-codesniffer.svn-pre-commit.php
Updated by Markus Stauffiger almost 2 years ago
Surely I can ignore it, but wouldn't it make sense to have this file checked as well?
Updated by Stefano Kowalke almost 2 years ago
- Status changed from Rejected to On Hold
Markus Stauffiger wrote:
Surely I can ignore it, but wouldn't it make sense to have this file checked as well?
The localconf.php is a special file, because they won't be execute like a normal PHP files. Its just a configuration file. TYPO3 parse the file and read data from it (of course TYPO3 writes to it too). There are special requirements of formatting for this file. If the formatting is wrong, TYPO3 will complain about it (I think, not tested) in form of don't work properly.
PHP_CodeSniffer provides a feature to exclude files per rule. [1] But I don't know which sniff will fit this requirements, to set it up. So for now the best is ignoring this file completly.
The purpose of the codesniffer project is to check core and extension files, not those in the "userspace" aka dummy package.
[1] http://www.squizlabs.com/php-codesniffer/rule-based-exclude-patterns
Updated by Andy Grunwald about 1 year ago
- Tags set to typo3v4
Stefano has opened a ticket (#36631) for it to clarify this question :)
After we got this answer it make sense to react on this.
Updated by Stefano Kowalke 9 months ago
- Target version changed from 0.0.4 to 0.0.5
Updated by Stefano Kowalke 9 months ago
- Target version changed from 0.0.5 to 0.0.6
Updated by Chris topher about 1 month ago
I would not put any major effort into checking localconf.php nowadays. If your sniffs are working, then it's fine. If that means that the file cannot be checked, then don't check it.
That is different with LocalConfiguration.php: LocalConfiguration.php should follow the CGL for the following reasons: It is generated out of FactoryConfiguration.php. This file comes from the Core, which itself must follow CGL. Additionally it is only to be processed by the Core; the Core, which itself has to follow CGL. AdditionalConfiguration.php should follow the CGL as well. Maybe it is not necessarily generated by the Core, although that might happen as well (using the Upgrade Wizard). Additionally it belongs to the system in a way just like LocalConfiguration.php. I will update the CGL accordingly (#36631).
Updated by Stefano Kowalke about 1 month ago
- Target version changed from 0.0.6 to 0.0.7
Updated by Chris topher about 1 month ago
Documentation updated.