Skip to content
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

S6 : How to call OrphanageManager #428

Open
PauchardThomas opened this issue Aug 1, 2022 · 4 comments
Open

S6 : How to call OrphanageManager #428

PauchardThomas opened this issue Aug 1, 2022 · 4 comments
Assignees
Milestone

Comments

@PauchardThomas
Copy link

Question

Hello, following the controller part from orphanage doc, i'm trying to acces to the OrphanageManager :

$manager = $this->get('oneup_uploader.orphanage_manager')->get('gallery');

However, $this->get('') not existing on AbstractController on Symfony6, and I cannot use DependencyInjection with Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager

How can I call the manager with S6 ?

Thnaks

Q A
Version 4.0
@bytehead
Copy link
Member

bytehead commented Aug 3, 2022

and I cannot use DependencyInjection

Why not? Missing autoconfiguration/autowiring?

@PauchardThomas
Copy link
Author

PauchardThomas commented Aug 3, 2022

When I'm trying to inject Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager , here what's i'm getting :
Cannot autowire argument $manager of "App\Controller\MyController::myfunction()": it references class "Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager" but no such service exists. You should maybe alias this class to the existing "oneup_uploader.orphanage_manager" service.

Here my conf :

# Read the documentation: https://github.com/1up-lab/OneupUploaderBundle/blob/master/Resources/doc/index.md
oneup_uploader:
    mappings:
        # This is a mapping example, remove it and create your own mappings.
        gallery:
            #use_orphanage: true
            frontend: dropzone # or any uploader you use in the frontend
            storage:
                directory: "%kernel.project_dir%/public/uploads/gallery/"
            use_orphanage: true
    chunks:
        maxage: 86400 # 24h
        storage:
            directory: "%kernel.cache_dir%/uploader/chunks"
    orphanage:
        maxage: 86400 # 24h
        directory: "%kernel.cache_dir%/uploader/orphanage"

Should I add something to my services.yaml ?

@bytehead bytehead added the bug label Aug 3, 2022
@bytehead
Copy link
Member

bytehead commented Aug 3, 2022

Thanks for the feedback, I'll try to provide a fix! 👍

@bytehead
Copy link
Member

bytehead commented Aug 3, 2022

Should I add something to my services.yaml ?

As a temporary fix you could add following to your services.yaml:

# config/services.yaml

services:
    # ... 
    # Alias
    Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager: "@oneup_uploader.orphanage_manager"
    # ...

@bytehead bytehead added this to the 4.x milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants