Skip to content

Custom recipes in separate composer package v6 vs v7 (autoloading issue) #3293

@adrenth

Description

@adrenth
  • Deployer version: 7.0.1
  • Deployment OS: Linux

At v6 we had some packages containing custom recipes (basically a copy of like https://github.com/deployphp/recipes).
Unfortunately after upgrading to v7 this setup does not work anymore.

The autoloading has been broken and we get messages like:

 ErrorException in deploy.php on line 8:
  require_once(recipe/my-custom-recipe.php): Failed to open stream: No such file or directory

The composer.json file of the package contains this autoload configuration:

    "autoload": {
        "files": [
            "autoload.php"
        ]
    }

The autoload.php file contains:

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__);

The file structure of the package:

recipe/my-custom-recipe.php
composer.json
autoload.php

What is the best practice for adding custom recipes to projects (using a composer package)? Couldn't find any documentation on this subject.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions