Skip to content

docs: Port "Paths helper" plugin service page from legacy dev docs#583

Open
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/port-paths-helper-7.2
Open

docs: Port "Paths helper" plugin service page from legacy dev docs#583
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/port-paths-helper-7.2

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

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


Tip: Use Slack message actions (⋯ menu → Update Docs) to capture doc updates without interrupting conversations 💬

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Source: https://github.com/mautic/developer-documentation/blob/main/source/includes/_plugin_services_paths_helper.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant