mirror of
https://github.com/nextcloud/documentation.git
synced 2025-10-26 11:18:02 +00:00
Merge pull request #1110 from nextcloud/backport/1109/stable15
[stable15] Warning fixes
This commit is contained in:
commit
9d71767bf5
@ -1,8 +1,8 @@
|
||||
.. _appclassloader:
|
||||
|
||||
===========
|
||||
Classloader
|
||||
===========
|
||||
|
||||
.. app_classloader:
|
||||
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>
|
||||
|
||||
The classloader is provided by Nextcloud and loads all your classes automatically. The only thing left to include by yourself are 3rdparty libraries. Those should be loaded in :file:`lib/AppInfo/Application.php`.
|
||||
|
||||
@ -58,7 +58,7 @@ Using a container
|
||||
-----------------
|
||||
|
||||
.. note:: Please do use automatic dependency injection (see below). For most
|
||||
apps there is no need to register services manually.
|
||||
apps there is no need to register services manually.
|
||||
|
||||
Passing dependencies into the constructor rather than instantiating them in the
|
||||
constructor has the following drawback: Every line in the source code where
|
||||
|
||||
@ -28,7 +28,7 @@ To create a controller, simply extend the Controller class and create a method t
|
||||
Connecting a controller and a route
|
||||
-----------------------------------
|
||||
|
||||
If you use a proper namespace for your app (see :ref:`app_classloader`) Nextcloud
|
||||
If you use a proper namespace for your app (see :ref:`appclassloader`) Nextcloud
|
||||
will resolve your controller and its dependencies automatically.
|
||||
|
||||
An example route name would look like this::
|
||||
|
||||
@ -138,7 +138,7 @@ can be abbreviated by using the **resources** key:
|
||||
<?php
|
||||
return [
|
||||
'resources' => [
|
||||
'author' => [url' => '/authors'],
|
||||
'author' => ['url' => '/authors'],
|
||||
],
|
||||
'routes' => [
|
||||
// your other routes here
|
||||
|
||||
@ -211,9 +211,9 @@ Database
|
||||
--------
|
||||
|
||||
Now that the routes are set up and connected the notes should be saved in the
|
||||
database. To do that first create a :doc:`database migration <storage/migration>`
|
||||
by creating a file **ownnotes/lib/Migration/VersionXXYYZZDateYYYYMMDDHHSSAA**,
|
||||
so for example **ownnotes/lib/Migration/Version000000Date20181224140601**""
|
||||
database. To do that first create a :doc:`database migration <storage/migrations>`
|
||||
by creating a file **ownnotes/lib/Migration/VersionXXYYZZDateYYYYMMDDHHSSAA**,
|
||||
so for example **ownnotes/lib/Migration/Version000000Date20181224140601**""
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ Two-factor auth providers apps are used to plug custom second factors into the N
|
||||
Implementing a simple two-factor auth provider
|
||||
----------------------------------------------
|
||||
|
||||
Two-factor auth providers must implement the ``OCP\Authentication\TwoFactorAuth\IProvider <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvider.php>``_ interface. The
|
||||
Two-factor auth providers must implement the `OCP\\Authentication\\TwoFactorAuth\\IProvider <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvider.php>`_ interface. The
|
||||
example below shows a minimalistic example of such a provider.
|
||||
|
||||
.. code-block:: php
|
||||
@ -124,7 +124,7 @@ Providing an icon (optional)
|
||||
----------------------------
|
||||
|
||||
To enhance how a provider is shown in the list of selectable providers on the login page, an icon
|
||||
can be specified. For that the provider class must implement the ``IProvidesIcons <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesIcons.php>``_
|
||||
can be specified. For that the provider class must implement the `IProvidesIcons <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesIcons.php>`_
|
||||
interface. The light icon will be used on the login page, whereas the dark one will be placed next
|
||||
to the heading of the optional personal settings (see below).
|
||||
|
||||
@ -134,7 +134,7 @@ Provide personal settings (optional)
|
||||
|
||||
Like other Nextcloud apps, two-factor providers often require user configuration to work. In Nextcloud
|
||||
15 a new, consolidated two-factor settings section was added. To add personal provider settings there,
|
||||
a provider must implement the ``IProvidesPersonalSettings <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesPersonalSettings.php>``_
|
||||
a provider must implement the `IProvidesPersonalSettings <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IProvidesPersonalSettings.php>`_
|
||||
interface.
|
||||
|
||||
|
||||
@ -142,7 +142,7 @@ Make a provider activatable by the admin (optional)
|
||||
---------------------------------------------------
|
||||
|
||||
In order to make it possible for an admin to enable the provider for a given user via the occ
|
||||
command line tool, it's necessary to implement the ``OCP\Authentication\TwoFactorAuth\IActivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IActivatableByAdmin.php>``_
|
||||
command line tool, it's necessary to implement the `OCP\\Authentication\\TwoFactorAuth\\IActivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IActivatableByAdmin.php>`_
|
||||
interface. As described in the linked interface documentation, this should only be implemented
|
||||
for providers that need no user interaction when activated.
|
||||
|
||||
@ -151,6 +151,6 @@ Make a provider deactivatable by the admin (optional)
|
||||
-----------------------------------------------------
|
||||
|
||||
In order to make it possible for an admin to disable the provider for a given user via the occ
|
||||
command line tool, it's necessary to implement the ``OCP\Authentication\TwoFactorAuth\IDeactivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IDeactivatableByAdmin.php>``_
|
||||
command line tool, it's necessary to implement the `OCP\\Authentication\\TwoFactorAuth\\IDeactivatableByAdmin <https://github.com/nextcloud/server/blob/master/lib/public/Authentication/TwoFactorAuth/IDeactivatableByAdmin.php>`_
|
||||
interface. As described in the linked interface documentation, this should only be implemented
|
||||
for providers that need no user interaction when deactivated.
|
||||
for providers that need no user interaction when deactivated.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user