\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
\part{Skeleton Application}
\section{Description}
Skeleton is an application template. You can use it to kickstart development, see <a href="https://wiki.horde.org/CreatingYourFirstModule">Creating Your First Module</a>.<br />
It is also an educational example, trying to keep up with the framework's most recent best practices. Comments are decidedly wordy.

\section{Usage}
Skeleton does not provide any end user value. It does generate a DB schema, a portal block and a preference setting, but none of it implements any particular feature.<br />
The list shown in the only UI screen is generated from a mock array.

\section{Bugs}
List any tickets on <a href="http://bugs.horde.org/">http://bugs.horde.org/</a> that cover this issue or are relevant to it.

\section{People}
Ralf Lang for the H6 upgrade<br />
Jan Schneider and Chuck Hagenbuch for the original content.

\section{Resources}
Include links to protocol descriptions, specifications, RFCs, external applications, presentations on <a href="http://horde.org/papers/">http://horde.org/papers/</a> or elsewhere that are relevant, articles, API docs from <a href="http://dev.horde.org/">http://dev.horde.org/</a> - anything that might be useful to someone working on this.

\begin{itemize}
\item <a href="https://github.com/maintaina-com/skeleton/">https://github.com/maintaina-com/skeleton/</a> Refactored POC version of skeleton. Needs recent versions of horde/core, horde/horde-installer-plugin and horde/horde-deployment.


\end{itemize}
\section{UPGRADING}
As skeleton is not designed to be of any use, this section describes evolution of best practice as it becomes available. These MAY also be applied to other applications as time permits and is feasible.

Because skeleton is also used as a clone template, the version history should not be spammed with entries reflecting the changes.

\subsection{Registry Snippet}
A registry snippet has been placed in doc/registry.d/ - this prevents skeleton from showing up as a button with no text when installed. The snippet is automatically picked up by the horde-installer-plugin and copied to the var/config/horde/registry.d dir unless a file already exists. This is symlinked to web/horde/config/registry.d for BC reasons.

\subsection{Routes/Controllers: No more list.php and index.php}
The list.php UI page has been moved to the routes/controller framework. TODO link to a more detailed article on that framework feature.<br />
The index.php is no longer needed. With a sufficiently recent version of the horde/horde-deployment (2021-11-27 and beyond), there is a rewrite rule that forwards missing directory indexes to the routes/controller framework. A default route catches all links which are not handled by other routes or files

\subsection{Constructor injection replaces globals}
These globals are avoided:

\begin{itemize}
\item \$notification: replaced by constructor injection. Requires sufficiently recent horde/core (2021-11-27 and beyond)


\item \$registry: Replaced by constructor injection


\item \$page\_output: Replaced by constructor injection


\item \$session: Replaced by constructor injection


\end{itemize}
\subsection{Usage of injector (DIC) in controllers}
The injector is now offered by constructor injection. We pass the namespaced version, not the unnamespaced wrapper. The \$injector global should not be used.<br />
The injector SHOULD not need to be passed to controllers at all but there is too much horde code out there that gets and uses the injector as a replacement for missing factories, catalogs, service locators etc. Plans are to keep the injector in the signature but replace it with a wrapper that logs any uses of getInstance as debug messages. People need time to adopt.

\subsection{src/ code removes underscores for most non-publics}
Traditional code uses the PEAR convention, prepending names with underscores:

\begin{itemize}
\item for private and protected properties


\item for private and protected function names


\item for technically public code which is implementation specific


\end{itemize}
These underscores have been removed unless

\begin{itemize}
\item there is a name clash with another method


\item a protected variable or method needs to stay compatible with parent or child code which cannot currently be refactored


\end{itemize}
\subsection{lib/ code removed}
Original code in has been removed. As applications are not inherited from or used like libraries, this should not be a problem but you need a recent enough framework version. For horde/core before 3.0.0alpha9 and horde/horde before 6.0.0alpha6, you may need to add wrappers for integration points:

\begin{itemize}
\item lib/Application.php - Used for inter-app and DAV calls. Also contains fallback definition of the SKELETON\_BASE and HORDE\_BASE constants, though most likely not needed anymore


\item lib/Api.php - Used for inter-app and RPC. In real world applications, we might see some breakage if we actually use the API, as calling code may be liberal with typing. In the case of skeleton, the Api is empty anyway.


\item lib/Ajax/Application.php - Integration point for the AJAX framework.


\item lib/Test.php  - The integration point for the health check UI called under /horde/test.php. Though skeleton does not really implement any useful test


\end{itemize}
With Portal Blocks, there is a little issue: If you add wrappers and run a recent framework, blocks will show up twice. If you do not add wrappers and run an old framework, blocks will not show up. Advise is to not wrap blocks though. See also: <a href="https://www.ralf-lang.de/2021/12/01/horde-skeleton-modernized/">https://www.ralf-lang.de/2021/12/01/horde-skeleton-modernized/</a>

\subsection{Strict types applied and type hints turned to real types}
The strict typing mode is used consistently everywhere in src/.<br />
Most property, parameter and return type hints were turned into actual types. Many missing types were added.

Exceptions:

\begin{itemize}
\item We know of calling code which does not (yet) behave


\item Union types, Stringable etc are PHP 8 only but we currently target php 7.4 compatibility


\item Resources


\end{itemize}
\subsection{Code moves to PSR-4 with unnamespaced wrappers}
The code in src/ started out as a copy of the traditional, unnamespaced code in lib/ and then got namespaced. In some cases, structure and names were change. We want the class name to be useful in its most likely use cases without the namespace prepended. To avoid confusion or name clashes, factory got moved into the namespace of the driver. Horde\textbackslash\{\}Skeleton\textbackslash\{\}Driver\textbackslash\{\}Driver and Horde\textbackslash\{\}Skeleton\textbackslash\{\}Driver\textbackslash\{\}<a href="https://wiki.horde.org/DriverFactory">DriverFactory</a> may seem like duplication but consider:

\begin{itemize}
\item Inside the Driver namespace, we save on use statements


\item When importing a class to other namespaces, we have a useful name


\end{itemize}

\noindent\rule{\textwidth}{1pt}
Back to the <a href="https://wiki.horde.org/Project">Project List</a>

\end{document}
