Skip to content

Add new plugin hooks documentation #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f507668
Add upgrade guidelines for GLPI 10.1
cedric-anne Apr 21, 2023
f24fbf8
Add required readthedocs configuration file
trasher Sep 14, 2023
646631d
High-Level API Internals Documentation (#149)
cconard96 Jan 22, 2024
81d8b9e
basic vue docs
cconard96 Aug 22, 2023
8dbee57
update external requirement
cconard96 Aug 22, 2023
0b0df27
Missing in ToC
trasher Apr 15, 2024
67f0370
Fix syntax
trasher Apr 15, 2024
0c343df
Iterator syntax (among other)
trasher Apr 16, 2024
d4cb9b3
add doc for new hook pre/post_itil_info_section
stonebuzz Sep 17, 2024
8c6024a
add hlapi versioning info
cconard96 Aug 1, 2024
5b07947
Add routing changes section to the GLPI 11.0 upgrade guidelines
cedric-anne Sep 25, 2024
291aa87
A mention about support of /markeplace URLs
cedric-anne Sep 25, 2024
8a76721
Add more upgrade instructions for GLPI 11.0 (#157)
cedric-anne Oct 28, 2024
54d25be
Add documentation on controllers
trasher Nov 6, 2024
287aa12
Update controllers docs
Pierstoval Nov 6, 2024
3b9ba5c
Add migration guide related resource access restrictions
Rom1-B Jan 14, 2025
5de3205
fix: apigen url
flegastelois Feb 16, 2024
cbb99c7
Update hooks.rst
tomolimo Mar 27, 2024
498e0e7
Add 4 anonymous hooks doc : add_javascript_anonymous_page, add_javasc…
MyvTsv Dec 20, 2024
21099a0
fix misc (#163)
SebSept Jan 14, 2025
750e6d2
update tests documentation (#162)
SebSept Jan 14, 2025
b90577a
Fix some warnings
trasher Jan 30, 2025
3145830
It's no longer possible to remove CSRF check in v11
trasher Jan 30, 2025
e17e0ed
Fix tests documentation (#168)
trasher Feb 5, 2025
319ab44
tutorial for developping a plugin (#166)
orthagh Feb 7, 2025
0a14d9a
add new hooks documentation
cconard96 May 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: source/conf.py

formats:
- htmlzip
- pdf
- epub

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: requirements.txt
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

#Watcher
ALLSPHINXLIVEOPTS = $(ALLSPHINXOPTS) -q \
-B \
--delay 1 \
--ignore "*.swp" \
--ignore "*.pdf" \
Expand Down Expand Up @@ -73,7 +72,7 @@ html:
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

livehtml:
$(SPHINXAUTOBUILD) -b html $(ALLSPHINXLIVEOPTS) $(BUILDDIR)/html
$(SPHINXAUTOBUILD) -b html $(ALLSPHINXLIVEOPTS) $(BUILDDIR)/html --host 0.0.0.0 --port 8007
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

Expand Down
Binary file added source/_static/images/API.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/Notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/NotificationTarget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/NotificationTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/api_external_token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/breadcrumbs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/crontask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/install_plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 5 additions & 29 deletions source/codingstandards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,33 +245,9 @@ Examples:
Checking standards
------------------

In order to check standards are respected, we provide a defaut configuration for `PHP CodeSniffer <http://pear.php.net/package/PHP_CodeSniffer>`_ rules. From the GLPI directory, just run:
Linting (checking and fixing coding standards) is a good way to ensure code quality and consistency of the code base.
This is done using [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer), [PHPStan](https://phpstan.org/), [ESLint](https://eslint.org/), [Stylelint](https://stylelint.io/) and [TwigCS](https://github.com/friendsoftwig/twigcs).

.. code-block::

phpcs .

If the above command does not provide any output, then, all is OK :)

An example error output would looks like:

.. code-block:: bash

phpcs .

FILE: /var/www/webapps/glpi/tests/HtmlTest.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 3
59 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 3
64 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 3

To automatically fix most of the issues, use `phpcbf`, it will per default rely on default configuration:

.. code-block::

phpcbf .
This can run the tasks using Docker, on your local host use `./tests/run_tests.sh lint` to proceed to all linting tasks, or use a scoped task, `./tests/run_tests.sh lint_php` to proceed to PHP linting only for example.
All possible lintings are listed in the `./tests/run_tests.sh` script.
For faster action you can run the scripts on your local machine or Docker development container using `node_modules/.bin/eslint . && echo "ESLint found no errors"` for example. You can find all the commands in [`.github/actions` directory](https://github.com/glpi-project/glpi/tree/main/.github/actions).
4 changes: 2 additions & 2 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'En'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -166,7 +166,7 @@
# html_logo = None

#Will be marked as missing during the build, but is provided from theme.
html_logo = 'static/images/glpi.png'
html_logo = '_static/images/glpi.png'

# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand Down
Loading