[commits] [Wiki] changed: Doc/Dev/Libraries

Ralf Lang (B1 Systems GmbH) lang at b1-systems.de
Fri Nov 19 14:05:06 UTC 2021


rlang  Fri, 19 Nov 2021 14:05:06 +0000

Modified page: https://wiki.horde.org/Doc/Dev/Libraries
New Revision:  3
Change log:  Horde 6 proposal

@@ -1,7 +1,83 @@
  [[toc]]
++ Horde Library Structure (H6 Proposal)

-+ Horde Library Structure
+This page will document the structure of Horde 6 framework libraries  
as proposed by the maintaina-com POC (or any other library using  
Horde's coding standards and directory organization).
+
+++ lib/
+
+Contains source files. Filenames and class names should follow the  
PSR-0 standard, with no namespaces.
+The full directory path should be represented here, so if the package  
name is Horde_Xml_Element, the structure would be:
+
+<code>
+lib/
+  Horde/
+    Xml/
+      Element/
+        ...
+      Element.php
+</code>
+
+++ src/
+
+Contains source files. Following the PSR-4 standard, the vendor  
namespace and the namespaces from the package name are omitted.
+If a package is named horde/xml_element, then the src/ top level  
represents the Horde\Xml\Element namespace. Class names should be  
chosen so that they make some sense without the namespace.
+Sub namespaces are directories. Underscores have no specific meaning  
but are out of fashion.
+
+<code>
+src/
+    Subtypes/
+      LeafElement.php
+      NodeElement.php
+    XmlElement.php
+</code>
+
+++ migration/
+
+Contains Database Migration files do change the data schema on upgrades.
+Files reside directly under the migration dir and are prepended by numbers.
+
+<code>
+migration/
+  1_xml_base_tables.php
+  2_upgrade_indexes.php
+</code>
+
+++ data/
+
+Contains data files, such as SQL scripts.
+
+++ doc/
+
+Contains documentation files. Similar to lib/, the full tree is represented.
+
+++ bin/
+
+Contains CLI scripts which make the library accessible to admins  
(housekeeping etc)
+These will by default be propagated to composer's vendor/bin dir.
+
+++ script/
+
+Contains command-line scripts
+
+++ test/
+
+Contains fixtures and PHPUnit tests.
+Follows the PSR-4 standard
+
+
+<code>
+test/
+    /fixtures/
+      ComplicatedTree.php
+    /Helpers/
+      XmlConsumerMock.php
+    XmlElementTest.php
+    AllTests.php
+</code>
+
+
++ Horde Library Structure (H4/H5)

  This page will document the structure of Horde 4 framework libraries  
(or any other library using Horde's coding standards and directory  
organization).

  ++ lib/



More information about the commits mailing list