[commits] [Wiki] changed: Project/NoMorePear

Ralf Lang (B1 Systems GmbH) lang at b1-systems.de
Sun Nov 24 09:36:02 UTC 2019


rlang  Sun, 24 Nov 2019 09:36:02 +0000

Modified page: https://wiki.horde.org/Project/NoMorePear
New Revision:  13
Change log:  Move .horde.yml format definition to separate page, also  
mark done tasks

@@ -26,97 +26,54 @@
  ++++ l10n/translation tools?


  +++ 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
+See ((Doc/Dev/HordeYmlFormat|Developer Doc on .horde.yml format)) for  
both original format and proposed additions.

-++++ 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: classmap: list of directories to recursively scan for php  
files containing classes
-
-The default if absent would be equivalent to psr-0: "Horde_Foo": /Lib
-
-++++ Composer native definitions
-
-Example:  
https://github.com/maintaina-com/Dav/commit/71dd9714a8d49c28b5cfe1b0bcd089eb6fa93226
-components version:  
https://github.com/maintaina-com/components/commit/3ffe6013081287bb02260e2d55291f98b93f6e15
-
-It is now possible in horde.yml to define dependencies for the  
composer.json file which are not derived from pear dependencies.
-This allows unbundling composer libraries like sabre dav from  
wrapping horde libraries like horde/dav.
-New libraries which do not intend to support pear installations at  
all could easily just define their dependencies here
-
-++++ Composer vendor-bin
-
-By default, the composer.json writer will treat all executable files  
living directly under package/bin as vendor binaries.
-This can be overridden:
-commands: optional: List of paths relative to package root which  
should be offered as vendor binaries. If you provide commands, no  
automatic search in bin/ will happen.
-nocommands: optional: List of paths relative to package root which  
should not be offered as vendor binaries. nocommands wins over  
commands list or implicitly found bin/

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


-components/lib/Helper/Composer.php currently depends on conductor and  
gets its data from package.xml
-anything handling package.xml is broken without pear though. Always  
need to register the horde channel
-
-rewrite all pear.horde.org dependencies to vcs type dependencies  
github/horde/
-
+[DONE] components/lib/Helper/Composer.php currently depends on  
conductor and gets its data from package.xml
+anything handling package.xml is broken without pear though. Always  
need to register the horde channel
+
+[DONE] rewrite all pear.horde.org dependencies to vcs type  
dependencies github/horde/
+
  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
+[DONE] 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
+[DONE] Check if the app provides a registry snippet in /doc/registry.d/
+[DONE] write horde.local.php if necessary
+[WONTDO SEE BELOW] installing base should provide some initialization
+[DONE] The installer allows the deployment/bundle to provide pre-made  
configs for horde and apps

  ++++ 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
+[DONE] horde libs are type "horde-library" and get installed to  
/vendor/Horde/Foo
+[DONE] js/ dir content of horde-library packages and the horde base  
app are copied or linked to web/js/
+[DONE] automatically rewrite registry path of hordeJs fileroot and  
webroot to web/js/

  +++ Packagist

  Add tool chain to create and update packages on packagist for easier  
consumption.

  +++ Autoloading and fixed loading
  ++++ Examining horde base bootstrapping:

-horde/horde/index.php require_once lib/Application
-Horde/Application.php require_once core.php
-core.php checks for horde.local.php  -- possible to announce a  
composer setup here
-Either include_once Horde/Autoloader/Cache.php or require_once  
Horde/Autoloader/Default.php
+
+[NO TODO] horde/horde/index.php require_once lib/Application
+[NO TODO]Horde/Application.php require_once core.php
+[DONE] core.php checks for horde.local.php  -- composer installer  
will write necessary autoloading instructions there.
+[DONE] Either include_once Horde/Autoloader/Cache.php or require_once  
Horde/Autoloader/Default.php - fixed by adding a search path

  ++++ Examining nag bootstrapping:
  horde/nag/index.php and other client pages require_once  
nag/lib/Application.php
  nag probes for horde_dir (either info from horde.local.php or  
directory above nag dir)
@@ -129,11 +86,12 @@
  Horde_Autoloader_Default has unconditional require_onces
  Horde_Autoloader_Default registers unconditionally when loaded
  Horde_Autoloader_Cache requires/registers Horde_Autoloader_Default  
unconditionally

+[DONE] Fixed by providing suitable search paths in horde.local.php

  ++++ 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, db migrations, classmaps and packages
@@ -146,20 +104,20 @@
  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
+[UNSURE] Unit tests should be marked as autoload-dev (root package  
only autoloads)
+[DONE] migrations should be autodetected by the composer writer.
+[DONE] special case classmaps should be hinted by .horde.yml


  ++++ Horde_Test
  Horde_Test bundles phpunit. A Horde Library uses a copy of  
boilerplate code from horde_test to initialize autoloading. This  
boilerplate makes some PEARish assumptions (universal include hierarchy)

  This pull request offers a new template and fixes other  
unconditional require_once instances  
https://github.com/horde/Test/pull/1
  This should hopefully work for PEAR installs, composer installs and  
full git checkouts just the same.

+[DONE] Running the unit tests via the components app, when installed  
into a composer deployment, is also possible without fixing AllTests &  
friends.

  ++ Proof of concept

  There is a proof of concept in https://github.com/maintaina-com
@@ -169,9 +127,9 @@
  In this project, the components tool is used via git-tools as a  
frontend or as an installed app via composer exec horde-components.

  Various patches have been applied. Most relevant is a rewrite of the  
Components_Helper_Composer class.

-This class now writes a thoroughly different composer file than  
before and it takes its data from horde.yml
+This class now writes a thoroughly different composer file than  
before and it takes its data from .horde.yml
  rather than package.xml

  To generate a new composer.json file for an app, run




More information about the commits mailing list