From d6ce6cc582cb6889295187fc2ab96e065199b634 Mon Sep 17 00:00:00 2001 From: PanCakeConnaisseur Date: Sat, 10 Oct 2020 07:39:49 +0200 Subject: [PATCH 1/2] Add noob friendly explanations and fix wording Added some more explicit info for people unfamiliar with autoloading that might help understanding. Also fixed some wording and grammar mistakes and made naming coherent. Signed-off-by: Alexey Abel --- .../app_development/bootstrap.rst | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/developer_manual/app_development/bootstrap.rst b/developer_manual/app_development/bootstrap.rst index 7d279498e..9973e32a9 100644 --- a/developer_manual/app_development/bootstrap.rst +++ b/developer_manual/app_development/bootstrap.rst @@ -19,8 +19,8 @@ The `Application` class is the main entry point of an app. This class is optiona to register any services or run some code for every request. -Nextcloud will try to autoload the class from the namespace ``\OCA\\AppInfo\Application``, like e.g. -``\OCA\Mail\AppInfo\Application``. The file will therefore be located at ``lib/AppInfo``. +Nextcloud will try to autoload the class from the namespace ``\OCA\\AppInfo\Application``, like +``\OCA\MyApp\AppInfo\Application``, where *MyApp* would be the name of your app. The file will therefore have the location ``MyApp/lib/AppInfo/Application.php``. .. code-block:: php @@ -41,7 +41,7 @@ Nextcloud will try to autoload the class from the namespace ``\OCA\registerService(...)``. The emphasis is on **lazyness**. At this very early stage of the process lifetime, no other apps nor all of the server components are ready. Therefore the app **must not** try to use anything except the API provided by the context. That shall ensure that all apps can safely run their registration logic - before any services are queried from the DI container or related code is run. -2) Nextcloud will load groups of certain apps early, like filesystem or session apps, and other later. For this their optional + before any services are queried (instantiated) from the DI container or related code is run. +2) Nextcloud will load groups of certain apps early, e.g. filesystem or session apps, and other later. For that purpose, their optional :ref:`app-php` will be included. As ``app.php`` is deprecated, apps should try not to rely on this step. -3) Nextcloud will query the app's ``Application`` class (again), no matter if it implements ``IBootstrap`` or not. +3) Nextcloud will query the app's ``Application`` class (again), no matter whether it implements ``IBootstrap`` or not. 4) Nextcloud will invoke the ``boot`` method of every ``Application`` instance that implements ``IBootstrap``. At this stage - you may assume that all registrations via ``IBootstrap::register`` have been done. + you may assume that all registrations via ``IBootstrap::register`` have completed. Nextcloud 19 and older ********************** From 47be51356230546d96e34e0429294e1095ad4cf7 Mon Sep 17 00:00:00 2001 From: PanCakeConnaisseur Date: Thu, 15 Oct 2020 15:29:55 +0200 Subject: [PATCH 2/2] Make app in path lowercase Co-authored-by: Morris Jobke --- developer_manual/app_development/bootstrap.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_manual/app_development/bootstrap.rst b/developer_manual/app_development/bootstrap.rst index 9973e32a9..c8be92e48 100644 --- a/developer_manual/app_development/bootstrap.rst +++ b/developer_manual/app_development/bootstrap.rst @@ -20,7 +20,7 @@ to register any services or run some code for every request. Nextcloud will try to autoload the class from the namespace ``\OCA\\AppInfo\Application``, like -``\OCA\MyApp\AppInfo\Application``, where *MyApp* would be the name of your app. The file will therefore have the location ``MyApp/lib/AppInfo/Application.php``. +``\OCA\MyApp\AppInfo\Application``, where *MyApp* would be the name of your app. The file will therefore have the location ``myapp/lib/AppInfo/Application.php``. .. code-block:: php