This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:dev:all:wb-adaption [13.06.2015 15:57] – [Abstrakte Klassen und Interfaces] translated mrbaseman | en:dev:all:wb-adaption [13.06.2015 16:37] – [Funktionen und Methoden] translated mrbaseman | ||
---|---|---|---|
Line 47: | Line 47: | ||
In general, abstract classes and interfaces follow the same conventions as classes, with an additional rule: The names of abstract classes and interfaces should end with the term " | In general, abstract classes and interfaces follow the same conventions as classes, with an additional rule: The names of abstract classes and interfaces should end with the term " | ||
- | ==== Emulierte Namespaces | + | ==== Emulated namespaces |
- | In diesem Modus ist in Klassennamen zusätzlich der Unterstrich | + | In this mode in class names the underscore |
- | Die Klassenbibliotheken von WebsiteBaker | + | The class libraries of WebsiteBaker |
- | **Klassen des Kerns**: sind im Verzeichnis | + | **The core classes**: reside in the directory |
- | **Klassen der Module**: Klassen der Module im jeweiligen Modulverzeichnis | + | **Classes of modules**: classes of modules in the appropriate module directory |
- | **Klassen des ACP**: (AdminControlPanel => ehem. Backend) sind im Verzeichnis | + | **Classes of ACP**: (AdminControlPanel => Former backend) are located in the directory |
- | **Klassen der third-party libraries**: | + | **Classes of third-party libraries**: |
+ | ==== Filenames ==== | ||
+ | As far as the above-mentioned rules for class names have been complied with, the filename would clearly result from the class name. The class **m_MyModul_PluginAbstract** accordingly can be found in the file **'' | ||
+ | For all other files, only alphanumeric characters and the dash (**-**) are allowed. Spaces are strictly prohibited.\\ | ||
+ | Each file which contains executable PHP code should end with the extension **.php** and be carried out in UpperCamelCase. | ||
- | ==== Dateinamen | + | ==== Directories |
- | Soweit die vorgenannten Regeln für Klassennamen eingehalten wurden, ergeben sich die Dateinamen eindeutig aus den Klassennamen. Die Klasse **m_MyModul_PluginAbstract** findet sich demnach in der Datei **'' | + | For naming directories the same basis as for files apply. Only alphanumeric characters and a few special characters of standard |
- | Für alle anderen Dateien sind nur alphanummerische Zeichen und der Bindestrich (**-**) gestattet. Leerzeichen sind völlig verboten.\\ | + | |
- | Jede Datei, die ausführbaren PHP Code enthält sollte mit der Endung **.php** enden und in UpperCamelCase-Schreibweise ausgeführt sein. | + | |
- | ==== Verzeichnise ==== | + | |
- | Zur Benennung von Verzeichnissen gelten die selben Grundlagen wie für Dateien. Es sind nur alphanummerische Zeichen sowie nur wenige Sonderzeichen des Standard | + | |
- | ==== Funktionen und Methoden ==== | + | |
- | Funktions- und Methodennamen dürfen nur Alphanummerische Zeichen enthalten. Unterstriche sind nicht gestattet. Nummern sind in Funktionsnamen gestattet aber in den meisten Fällen nicht empfohlen. | + | ==== Functions and Methods ==== |
- | Wortreichtum wird generell befürwortet. Funktionsnamen sollten so wortreich wie möglich sein um deren Zweck und Verhalten möglichst genau zu erklären. | + | |
- | Funktionen oder Methoden sollen möglichst immer in // | + | Function and method names may only contain alphanumeric characters. Underscores are not permitted. Numbers are however permitted |
- | :!: **Achtung:** Es dürfen niemals doppelte Unterstriche als Prefix für Methoden-, Funktions- oder Variablennamen verwendet werden. Es besteht hier die Gefahr, dass es zu Überschneidungen mit aktuellen oder zukünftigen, PHP-eigenen | + | Functions or methods have to be written whenever possible in // |
+ | |||
+ | :!: **Warning:** doulble underscores may never be used as a prefix for method, function, or variable names. There is the danger that it overlaps with current or future, PHP's intrinsic | ||