rlang  Thu, 14 Feb 2019 09:23:27 +0000

Modified page: https://wiki.horde.org/Project/NoMorePear
New Revision:  5
Change log:  format and suggestions for .horde.yml

@@ -1,9 +1,9 @@
 [[toc]]

 + No More Pear: Move to composer

-Remove any hard runtime or installation dependency on pear
+Remove any hard runtime or installation dependency on pear and pearisms

 ++ Bugs

List any tickets on http://bugs.horde.org/ that cover this issue or are relevant to it.
@@ -24,13 +24,46 @@
 https://github.com/horde/Core/pull/2

 ++++ l10n/translation tools?

-+++ Installation
-
-++++ Document .horde.yml format and how it relates to composer json and pear xml
+
++++ Document .horde.yml format and how it relates to composer json and pear xml
+TODO: beautify, break out to separate page
+
+id: string, mandatory, uppercase and minus Horde_ for libs, lowercase for apps (horde, turba, Autoloader, Exception)
+name: string, mandatory, Uppercase (Horde, Turba, Autoloader, Exception)
+full: string, mandatory, a one-line description
+description: string, mandatory, a multi-line description
+list: string, mandatory, may be empty: a hint on the mailing list appropriate for the component
+type: string, mandatory, either "application" or "library"
+homepage: string, mandatory, a related informational url
+authors: list, each element has string attributes name, user, email, active (true/false), role (lead, developer) +version: has sub keys api and release each with a version string (1.0.0 format) +state: has sub keys api and release, each with a stabilitiy string (stable, beta, alpha)
+license: has subkeys identifier and uri
+license: identifier: An SPDX license identifier string
+license: uri: a link to a fulltext license
+dependencies: top level structure for several optional keys
+dependencies: required: multilevel list of mandatory dependencies (php, pear, ext) - The key and all sub keys are optional +dependencies: required: php: optional key. The value should be a version constraint string +dependencies: required: pear: optional key. This is a list of channel/package keys and version constraint values. For pecl extensions, there may be additional sub keys instead of a version string +dependencies: required: ext: optional key. This is a list of php binary extensions (hash, pdo, ...) as keys and version constraint strings as values. +dependencies: optional: multilevel list of optional, suggested collaborators (pear, ext) - The key and all sub keys are optional +dependencies: required: pear: optional key. This is a list of channel/package keys and version constraint values. For pecl extensions, there may be
+
+++++ Suggested additions to the format
+
+I suggest to add an optional top level key "autoload", inspired by corresponding composer.yml strucute
+It hints how autoloaders should expect to find php classes from the package.
+Structure would be
+autoload: psr-0: list of "Class_Prefix" : "dir"
+autoload: psr-4: list of "\\Prefix" : "dir"
+autoload: map: list of directories to recursively scan for php files containing classes
+
+The default if absent would be equivalent to psr-0: "Horde_Foo": /Lib


++++ Installation

 ++++ Generate composer json file from .horde.yml


@@ -42,18 +75,18 @@
 https://github.com/horde/components/pull/3

 Other resources
Do we want to keep a whitelist of other channels/packages which should be pulled from packagist or github rather than pear?
-
+
 ++++ Composer plugin: install apps below base rather than vendor/

 (we don't want /vendor/ web-readable)
horde apps are type "horde-application" and get installed to /$appname or base/appname
 Installing/updating an app should clear cache and autoloader cache
 Check if the app provides a registry snippet in /doc/
 write horde.local.php if necessary
 installing base should provide some initialization
-
+
++++ Composer plugin: copy, move or link js content from libraries to horde/js
 horde libs are type "horde-library" and get installed to /vendor/Horde/Foo
 Maybe we find some trick

@@ -86,22 +119,27 @@
 ++++ Examining git-tools as a composer-native app:

git-tools binary detects the composer autoloader entrypoint vendor/autoload.php and require_once it. the composer autoloader is configured to provide a psr-4 autoloader for the \\Horde\\GitTools namespace to ./lib
-
-++++ PSR-0 and packages
-
+
+++++ PSR-0, db migrations, classmaps and packages
+
 Most horde library packages are simple to map to the psr-0 autoloader.
 Package Horde_Foo would have all its classes in lib/Horde/Foo.
-
+
Some packages though have class names you would not expect from the package name
 Horde_Core has Horde_ErrorHandler & friends
 Horde_Form has multiple classes in one file
 Horde_Util has Horde_String
-
+
These either need to be scanned for additional mappings or need "classmap" style autoload hints.
+Unit tests should be marked as autoload-dev (root package only autoloads)
+migrations should be autodetected by the composer writer. (TODO: simply auto-add a classmap?)
+
+special case classmaps should be hinted by .horde.yml
+

-We also need to think about db migrations and unit tests.
+I am adding a new

 ++ Resources

https://getcomposer.org/doc/articles/custom-installers.md composer notes on custom installers and plugins

--
commits mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]

Reply via email to