docs: Port "Paths helper" plugin service page from legacy dev docs#583
docs: Port "Paths helper" plugin service page from legacy dev docs#583promptless-for-oss wants to merge 1 commit into
Conversation
| Retrieving system paths | ||
| *********************** | ||
|
|
||
| Call ``getSystemPath(string $name, bool $fullPath = false)`` to resolve a system location. By default, it returns a path relative to the Mautic root. Pass ``true`` as the second argument to get the absolute path instead. The ``cache``, ``logs``, and ``temporary`` locations are always absolute, regardless of the ``$fullPath`` argument. |
There was a problem hiding this comment.
Grounded the getSystemPath(string $name, bool $fullPath = false) signature and the relative-by-default behavior on the current PathsHelper class (7.x), where the getSystemPath() switch returns cache, logs, and temporary/tmp as absolute paths regardless of $fullPath, and throws \InvalidArgumentException for unknown names.
Source: https://raw.githubusercontent.com/mautic/mautic/7.x/app/bundles/CoreBundle/Helper/PathsHelper.php
|
|
||
| Please read the :xref:`dev docs contributing guidelines` and :xref:`Contributing to Mautic’s documentation` to get started. | ||
| Inject ``Mautic\CoreBundle\Helper\PathsHelper`` into your service, or retrieve the ``mautic.helper.paths`` service from the container in legacy code. | ||
|
|
There was a problem hiding this comment.
Ported the original legacy _plugin_services_paths_helper.md content: the mautic.helper.paths service name, the Mautic\CoreBundle\Helper\PathsHelper class, the getSystemPath('images') / getSystemPath('images', true) relative-vs-absolute example, and the guidance to use the tmp/temporary location for temporary files instead of cache.
Open this suggestion in Promptless to view citations and reasoning process
Replaces the stub "Paths helper" page (docs/plugin_services/paths_helper.rst) with ported and updated content from the legacy developer docs. Documents the mautic.helper.paths service, DI usage of PathsHelper, and getSystemPath() including relative vs. absolute paths and the tmp/temporary location. Grounded in the current PathsHelper class on mautic/mautic 7.x. Targets the 7.2 base branch per issues #371/#370.
Trigger Events
blockedlabel is to set content, structure, and tone in one branch, then backport/cherry pick i...Tip: Use Slack message actions (⋯ menu → Update Docs) to capture doc updates without interrupting conversations 💬