Tuesday, February 24, 2015

Re: 3.0 Problem with cake bake remplate --connection

Oops. Title should read "template" not "remplate"...


On Tuesday, 24 February 2015 22:37:18 UTC-5, Joe T. wrote:
Looking for clarification of the bake command, or confirmation if this is a bug...

i can specify a connection for cake bake model, but it appears template also wants a connection, so i tried to specify the same connection config as i have been for models. However, template didn't use the specified connection (user would have been 'kodiak_www_admin' for the 'admin' DB config).

If my command is wrong, what should it be? Documentation looks kinda brief at http://book.cakephp.org/3.0/en/bake/usage.html unless there's somewhere else i missed?

i added the --prefix Admin for the Template bake because i get the impression i should provide the same for Templates as for Controllers?

-- WORKS
C
:\Sites\project>App\Console\cake bake model --connection admin Listings

-- NOPE
C
:\Sites\project>App\Console\cake bake template --connection admin --prefix Admin Listings

Welcome to CakePHP v3.0.0-RC2 Console
---------------------------------------------------------------
App : App
Path: C:\Sites\project\App\
---------------------------------------------------------------
Exception: SQLSTATE[HY000] [1045] Access denied for user 'kodiak_www'@'localhost' (using password: YES) in [C:\Sites\project\vendor\cakephp\cakephp\src\Database\Driver\PDODriverTrait.php, line 48]
2015-02-25 03:00:34 Error: [PDOException] SQLSTATE[HY000] [1045] Access denied for user 'kodiak_www'@'localhost' (using password: YES)
Stack Trace:
#0 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Driver\PDODriverTrait.php(48): PDO->__construct('mysql:host=loca...', 'kodiak_www', '-------------', Array)
#1 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Driver\Mysql.php(86): Cake\Database\Driver\Mysql->_connect('mysql:host=loca...', Array)
#2 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Schema\BaseSchema.php(46): Cake\Database\Driver\Mysql->connect()
#3 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Dialect\MysqlDialectTrait.php(62): Cake\Database\Schema\BaseSchema->__construct(Object(Cake\Database\Driver\Mysql))
#4 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Schema\Collection.php(52): Cake\Database\Driver\Mysql->schemaDialect()
#5 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Schema\CachedCollection.php(44): Cake\Database\Schema\Collection->__construct(Object(Cake\Database\Connection))
#6 C:\Sites\project\vendor\cakephp\cakephp\src\Database\Connection.php(319): Cake\Database\Schema\CachedCollection->__construct(Object(Cake\Database\Connection), true)
#7 C:\Sites\kodiakinvestmentsllc.com-cake3\vendor\cakephp\cakephp\src\ORM\Table.php(410): Cake\Database\Connection->schemaCollection()
#8 C:\Sites\project\vendor\cakephp\bake\src\Shell\Task\TemplateTask.php(273): Cake\ORM\Table->schema()
#9 C:\Sites\project\vendor\cakephp\bake\src\Shell\Task\TemplateTask.php(139): Bake\Shell\Task\TemplateTask->_loadController()
#10 [internal function]: Bake\Shell\Task\TemplateTask->main('Listings')
#11 C:\Sites\project\vendor\cakephp\cakephp\src\Console\Shell.php(387): call_user_func_array(Array, Array)
#12 C:\Sites\project\vendor\cakephp\cakephp\src\Console\Shell.php(382): Cake\Console\Shell->runCommand(Array, false)
#13 C:\Sites\project\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(200): Cake\Console\Shell->runCommand(Array, true)
#14 C:\Sites\project\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(171): Cake\Console\ShellDispatcher->_dispatch()
#15 C:\Sites\project\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(122): Cake\Console\ShellDispatcher->dispatch()
#16 C:\Sites\project\App\Console\cake.php(20): Cake\Console\ShellDispatcher::run(Array)
#17 {main}


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: