ProLoser / BakingPlate

Boost your CakePHP baking with a collection of community best-practices built with HTML5BoilerPlate
54 stars 9 forks source link

Install error - Plugin BakingPlate could not be found #28

Closed novrian closed 12 years ago

novrian commented 12 years ago

Hi ProLoser, I'm using cakePHP 2.2.1

I followed installation instructions on wiki (Instructions on 2.x), and when I try to run cake BakingPlate.plate I've got the following error :

#0 D:\xampp\php\pear\Cake\Core\App.php(364): CakePlugin::path('BakingPlate')
#1 D:\xampp\php\pear\Cake\Core\App.php(225): App::pluginPath('BakingPlate')
#2 D:\xampp\php\pear\Cake\Core\App.php(542): App::path('Console/Command', 'Bakin

gPlate')
#3 [internal function]: App::load('PlateShell')
#4 [internal function]: spl_autoload_call('PlateShell')
#5 D:\xampp\php\pear\Cake\Console\ShellDispatcher.php(240): class_exists('PlateS

hell')
#6 D:\xampp\php\pear\Cake\Console\ShellDispatcher.php(191): ShellDispatcher->_ge

tShell('BakingPlate.pla...')
#7 D:\xampp\php\pear\Cake\Console\ShellDispatcher.php(69): ShellDispatcher->disp

atch()
#8 D:\xampp\php\cake.php(41): ShellDispatcher::run(Array)
#9 {main}```

Additional info on my cake shell :

-app: cakephp_tes -working: D:__SERVER\cakephp_tes -root: D:__SERVER -core: D:\xampp\php\pear



Is there something wrong with the installations?
Thanks in advance, and sorry for my bad English :)
ProLoser commented 12 years ago

What is the path to the bakingplate folder?

On Sat, Aug 25, 2012 at 2:29 AM, Novrian Y.F. notifications@github.comwrote:

Hi ProLoser, I'm using cakePHP 2.2.1

I followed installation instructions on wiki (Instructions on 2.x), and when I try to run cake BakingPlate.plate I've got the following error : Error: Plugin BakingPlate could not be found.

0 D:\xampp\php\pear\Cake\Core\App.php(364):

CakePlugin::path('BakingPlate')

1 https://github.com/ProLoser/BakingPlate/issues/1D:\xampp\php\pear\Cake\Core\App.php(225): App::pluginPath('BakingPlate')

2 https://github.com/ProLoser/BakingPlate/issues/2D:\xampp\php\pear\Cake\Core\App.php(542): App::path('Console/Command',

'Bakin gPlate')

3 https://github.com/ProLoser/BakingPlate/issues/3 [internal

function]: App::load('PlateShell')

4 https://github.com/ProLoser/BakingPlate/issues/4 [internal

function]: spl_autoload_call('PlateShell')

5 https://github.com/ProLoser/BakingPlate/issues/5D:\xampp\php\pear\Cake\Console\ShellDispatcher.php(240):

class_exists('PlateS hell')

6 https://github.com/ProLoser/BakingPlate/issues/6D:\xampp\php\pear\Cake\Console\ShellDispatcher.php(191):

ShellDispatcher->_ge tShell('BakingPlate.pla...')

7 https://github.com/ProLoser/BakingPlate/issues/7D:\xampp\php\pear\Cake\Console\ShellDispatcher.php(69):

ShellDispatcher->disp atch()

8 https://github.com/ProLoser/BakingPlate/issues/8D:\xampp\php\cake.php(41): ShellDispatcher::run(Array)

9 https://github.com/ProLoser/BakingPlate/issues/9 {main}

Additional info on my cake shell : app: cakephp_tes working: D:__SERVER\cakephp_tes root: D:__SERVER core: D:\xampp\php\pear

Is there something wrong with the installations? Thanks in advance, and sorry for my bad English :)

— Reply to this email directly or view it on GitHubhttps://github.com/ProLoser/BakingPlate/issues/28.

Dean J Sofer DeanSofer@gmail.com

BS Computer Information Systems California State Polytechnic University, Pomona Telephone: 714-900-2254 Website: www.DeanSofer.com Github: github.com/ProLoser

novrian commented 12 years ago

My cakephp path is D:\__SERVER\cakephp_tes My app path is D:\__SERVER\cakephp_tes\app The BakingPlate path is D:\__SERVER\cakephp_tes\plugins\BakingPlate

ProLoser commented 12 years ago

Shouldn't it be Plugin not plugins?

Dean J Sofer DeanSofer@gmail.com

BS Computer Information Systems California State Polytechnic University, Pomona Telephone: 714-900-2254 Website: www.DeanSofer.com Github: github.com/ProLoser

novrian commented 12 years ago

I moved the BakingPlate folder from ROOT/plugins to APP/Plugin, and it works. Please change the git command installations instructions on wiki (for cake 2.x) :)

Next, I'm baking with this command cake BakingPlate.plate bake The command resulted output is :

Welcome to BakingPlate
---------------------------------------------------------------
What is the path to the project you want to bake?
[D:\__SERVER\cakephp_tes\app\myapp] > D:\__SERVER\cakephp_tes\app
Skel Directory: D:\__SERVER\cakephp_tes\app\Plugin\BakingPlate\Console\Templates
\skel
Will be copied to: D:\__SERVER\cakephp_tes\app
---------------------------------------------------------------
Look okay? (y/n/q)
[y] >
---------------------------------------------------------------
Created: app in D:\__SERVER\cakephp_tes\app
---------------------------------------------------------------
 * Random hash key created for 'Security.salt'
 * Random seed created for 'Security.cipherSeed'
Unable to set console path for app/Console.
CakePHP is on your `include_path`. CAKE_CORE_INCLUDE_PATH will be set, but commented out.
Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in D:\__SERVER\cakephp_tes\app\webroot\index.php
Project baked but with some issues..

... rest of command output ...

The command output tells me that Skel directory will be copied to my app directory But I couldn't see changes on my app directory when the command was finished.

What's wrong with that?

ProLoser commented 12 years ago

You seem to be using a somewhat unusual setup. There are also small issues with using the plugin on new projects.

Anyway, try making the entire target directory writeable, OR try removing it. Normally you don't bake a project onto a pre-existing project.

novrian commented 12 years ago

All directory should be writeable because I'm using WinOS.

Okay, I'll change the scenarios. Here's the brief : I'll put bakingplate plugin to this directory D:\__SERVER\bakingplate\app\Plugin Then I set configuration in Bootstrap D:\__SERVER\bakingplate\app\Config\bootstrap.php My target app directory is here D:\__SERVER\cakephp_tes\app NOTE : This is fresh cakephp with empty app directory

Then I'll run this command cake BakingPlate.plate bake Here's the resulted output

♀
Welcome to BakingPlate
---------------------------------------------------------------
What is the path to the project you want to bake?
[d:\__SERVER\bakingplate\app\myapp] > D:\__SERVER\cakephp_tes\app
Skel Directory: d:\__SERVER\bakingplate\app\Plugin\BakingPlate\Console\Templates
\skel
Will be copied to: D:\__SERVER\cakephp_tes\app
---------------------------------------------------------------
Look okay? (y/n/q)
[y] >
---------------------------------------------------------------
Created: app in D:\__SERVER\cakephp_tes\app
---------------------------------------------------------------
 * Random hash key created for 'Security.salt'
 * Random seed created for 'Security.cipherSeed'
 * app/Console/cake.php path set.
CakePHP is on your `include_path`. CAKE_CORE_INCLUDE_PATH will be set, but comme
nted out.
 * CAKE_CORE_INCLUDE_PATH set to D:\xampp\php\pear in webroot/index.php
 * CAKE_CORE_INCLUDE_PATH set to D:\xampp\php\pear in webroot/test.php
Could not set permissions on D:\__SERVER\cakephp_tes\app\\tmp
chmod -R 0777 D:\__SERVER\cakephp_tes\app\\tmp
Project baked but with some issues..

Making temp folders writeable...
webroot\uploads

Initialized empty Git repository in D:/__SERVER/cakephp_tes/app/.git/

Adding core git submodules...

Adding git://github.com/cakephp/debug_kit.git to Plugin/DebugKit
remote: Counting objects: 4641, done.
remote: Compressing objects: 100% (1784/1784), done.
remote: Total 4641 (delta 2444), reused 4507 (delta 2321)
Receiving objects: 100% (4641/4641), 697.50 KiB | 41 KiB/s, done.
Resolving deltas: 100% (2444/2444), done.

Adding git://github.com/ProLoser/linkable.git to Plugin/Linkable
remote: Counting objects: 259, done.
remote: Compressing objects: 100% (130/130), done.
remote: Total 259 (delta 70), reused 222 (delta 51)
Receiving objects: 100% (259/259), 40.95 KiB | 27 KiB/s, done.
Resolving deltas: 100% (70/70), done.

Adding git://github.com/ProLoser/CakePHP-Batch.git to Plugin/Batch
remote: Counting objects: 194, done.
remote: Compressing objects: 100% (86/86), done.
rRemote: Total 194 (delta 58), reused 178 (delta 42)
Receiving objects:  61% (119/194), 12.00 KiB | 6 KiB/s
Receiving objects: 100% (194/194), 31.49 KiB | 6 KiB/s, done.
Resolving deltas: 100% (58/58), done.

Your database configuration was not found. Take a moment to create one.
---------------------------------------------------------------
Database Configuration:
---------------------------------------------------------------
Name:
[default] >
Datasource: (Mysql/Postgres/Sqlite/Sqlserver)
[Mysql] >
Persistent Connection? (y/n)
[n] >
Database Host:
[localhost] >
Port?
[n] >
User:
[root] >
Password:
>
The password you supplied was empty. Use an empty password? (y/n)
[n] > y
Database Name:
[cake] > cakephp_tes
Table Prefix?
[n] > app_
Table encoding?
[n] >

---------------------------------------------------------------
The following database configuration will be created:
---------------------------------------------------------------
Name:         default
Datasource:       Mysql
Persistent:   false
Host:         localhost
User:         root
Pass:
Database:     cakephp_tes
Table prefix: app_
---------------------------------------------------------------
Look okay? (y/n)
[y] > y
Do you wish to add another database configuration?
[n] >

Creating file D:\__SERVER\cakephp_tes\app\Config\database.php
Wrote `D:\__SERVER\cakephp_tes\app\Config\database.php`

When I try to access http://localhost/cakephp_tes, I've got this error :

Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in D:\__SERVER\cakephp_tes\lib\Cake\Cache\Cache.php on line 309

Warning: D:\__SERVER\cakephp_tes\app\tmp\cache\persistent\ is not writable in D:\__SERVER\cakephp_tes\lib\Cake\Cache\Engine\FileEngine.php on line 336

Warning: D:\__SERVER\cakephp_tes\app\tmp\cache\models\ is not writable in D:\__SERVER\cakephp_tes\lib\Cake\Cache\Engine\FileEngine.php on line 336

Warning (512): D:\__SERVER\cakephp_tes\app\tmp\cache\ is not writable [CORE\Cake\Cache\Engine\FileEngine.php, line 336]

Warning (2): file_put_contents(D:\__SERVER\cakephp_tes\app\tmp\logs\error.log) [function.file-put-contents]: failed to open stream: No such file or directory [CORE\Cake\Log\Engine\FileLog.php, line 87]

Plugin BakingPlate could not be found.

Warning (512): _cake_core_ cache was unable to write 'cake_en-us' to File cache [CORE\Cake\Cache\Cache.php, line 309]

Error: An Internal Error Has Occurred.

Stack Trace

    CORE\Cake\Core\App.php line 364 → CakePlugin::path(string)
    CORE\Cake\Core\App.php line 225 → App::pluginPath(string)
    CORE\Cake\Core\App.php line 542 → App::path(string, string)
    [internal function] → App::load(string)
    [internal function] → spl_autoload_call(string)
    CORE\Cake\Controller\ComponentCollection.php line 99 → class_exists(string)
    CORE\Cake\Controller\ComponentCollection.php line 52 → ComponentCollection->load(string, array)
    CORE\Cake\Controller\Controller.php line 635 → ComponentCollection->init(PagesController)
    CORE\Cake\Routing\Dispatcher.php line 182 → Controller->constructClasses()
    CORE\Cake\Routing\Dispatcher.php line 161 → Dispatcher->_invoke(PagesController, CakeRequest, CakeResponse)
    APP\webroot\index.php line 98 → Dispatcher->dispatch(CakeRequest, CakeResponse)

Warning (512): _cake_core_ cache was unable to write 'file_map' to File cache [CORE\Cake\Cache\Cache.php, line 309]

Warning (512): _cake_core_ cache was unable to write 'object_map' to File cache [CORE\Cake\Cache\Cache.php, line 309]

Base on the error report, I'll check my app directory D:\__SERVER\cakehphp_tes\app There are no tmp directory. I assuming the BakingPlate.plate command didn't generate this directory automatically. So I've got to make directory manually by copying tmp from fresh cakephp install.

Then I copied BakingPlate plugin to D:\__SERVER\cakephp\app\Plugin NOTE : Assuming with error Plugin BakingPlate could not be found

Then I visit back this url http://localhost/cakephp_tes Baking was successful but still got the following error (notices, I guess). Here you are :

Strict (2048): Declaration of PlateComponent::initialize() should be compatible with Component::initialize(Controller $controller) [APP\Plugin\BakingPlate\Controller\Component\PlateComponent.php, line 12]

Strict (2048): Declaration of PlateComponent::startup() should be compatible with Component::startup(Controller $controller) [APP\Plugin\BakingPlate\Controller\Component\PlateComponent.php, line 12]

Strict (2048): Declaration of PlateComponent::beforeRender() should be compatible with Component::beforeRender(Controller $controller) [APP\Plugin\BakingPlate\Controller\Component\PlateComponent.php, line 12]

Strict (2048): Declaration of PlateComponent::shutdown() should be compatible with Component::shutdown(Controller $controller) [APP\Plugin\BakingPlate\Controller\Component\PlateComponent.php, line 12]

Strict (2048): Declaration of PlateComponent::beforeRedirect() should be compatible with Component::beforeRedirect(Controller $controller, $url, $status = NULL, $exit = true) [APP\Plugin\BakingPlate\Controller\Component\PlateComponent.php, line 12]

Strict (2048): Declaration of AppModel::beforeValidate() should be compatible with Model::beforeValidate($options = Array) [APP\Model\AppModel.php, line 33]
ProLoser commented 12 years ago

Do you mind submitting a PR regarding the strict errors? Might have been a change in the latest versions, but I'm sure it's an easy fix. As to why the plugin wasn't found, my guess might be that when running from that app directory it is unaware of the global plugins path (this is because you're running it from within another project). And I am not sure why the tmp folder wasn't created.

ProLoser commented 12 years ago

For the sake of testing, try throwing the plugin into your xampp/pear/Plugin (or is it pear/Cake/Plugin ?) folder. Well you should be able to locate what I'm referring to.

Then try building the project in a completely new location again. You should not be baking a new project from within an existing project. I'm not sure if this will fix the tmp directory creation though.

sams commented 12 years ago

TMP Dir: the BakingPlate skel does not have a tmp directory the ProjectTask does not create it it just changes it permissions.

Adding an empty tmp dir to the skel sorts it, the cake skel has all dirs in place https://github.com/cakephp/cakephp/tree/master/lib/Cake/Console/Templates/skel/tmp

BakingPlate also creates uploads, ccss & cjs currently (I think it should not)

Strick Warnings: Just update the code as directed in notice

fixed in my branch see last two commits c59043e9ccc24d2efbf7e8f5b888c55d488a5c89 16a48f7a6433836ea0f527ef351160f9bca42b25