Skip to content
New issue

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

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

Already on GitHub? # to your account

Plugin not found #303

Open
looo87 opened this issue Sep 12, 2017 · 4 comments
Open

Plugin not found #303

looo87 opened this issue Sep 12, 2017 · 4 comments

Comments

@looo87
Copy link

looo87 commented Sep 12, 2017

So I followed the documentation (2.x) but cant get it to work and it might be because of my folders management.

I have something like this

Project
|-- Cakephp 1
||-- app
|||-- Plugin (here I have AssetCompress)
|-- Cakephp 2
||-- app
|||-- Plugin (here I have AssetCompress)
|-- Cakephp 3
||-- app
|||-- Plugin (here I have AssetCompress)
|-- Library ( here is my ShellDispatcher)

My config looks right:

    Project/Cakephp(1,2,3)/app/Config/asset_compress.ini
           [General]
           cacheConfig = true
           timestamp = true

          [css]
          path = WEBROOT/css/*
          cacheFiles = false
          timestamp = true
          cachePath = WEBROOT/cache_css/
          filters[] = YuiCss

          [this.css]
          files[] = this.css

    project/cakephp(1,2,3)/app/Config/bootstrap.php
          CakePlugin::load('AssetCompress', array('bootstrap' => true));

    Project/Cakephp(1,2,3)/app/Controller/AppController.php
            public $helpers = ['AssetCompress.AssetCompress'];
           
   view.ctp 
            <?php echo $this->AssetCompress->css('this') ?>
         --> outputs:
              <link rel="stylesheet" type="text/css" ref="https://www.example.com/cache_css/this.css">

So am I doing something wrong or do I have to ajust something?
Thank you in advance!

@markstory markstory modified the milestone: 3.2.x Sep 12, 2017
@markstory
Copy link
Owner

I'm not sure what's going on. Do you have 3 different cakephp apps in a single project all using different versions of CakePHP?

@looo87
Copy link
Author

looo87 commented Sep 13, 2017

No, I have the same version of cakephp in all 3 cases, but the library (or lib -- with shelldispatcher) is not present in every instance of cake. It's in the root folder of the project and I think it was made like this to not have shelldispatcher multiple times.

@markstory
Copy link
Owner

Not sure then. I've not come across an application structure like that before.

@agarzon
Copy link

agarzon commented Feb 15, 2018

Having similar problem.

Cake 3.5.12

$ composer require markstory/asset_compress

Then in bootstrap.php

Plugin::load('AssetCompress', ['bootstrap' => true]);

I get:

Missing Plugin Cake\Core\Exception\MissingPluginException
Error: The application is trying to load a file from the AssetCompress plugin.
Make sure your plugin AssetCompress is in the /app/plugins/ directory and was loaded. 

And from CLI:

Exception: Plugin AssetCompress could not be found. in [/home/agarzon/projects/ppc/vendor/cakephp/cakephp/src/Core/Plugin.php, line 149]

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants