Hello Im trying to use a shell in cakephp 2.25, but when I execute that shell using exec_shell method (passing the correct path) it doesnt work, i have tried to use the shell in cmd (windows comand prompt) but it throws an error related with the database (error 42000), but if I execute that shell from mingw64 (it is a terminal installed when i setted up git on my pc) it works without problems, I have not already found something to solve it.
Im calling the shell like this D:my_path/app>Console\cake ShellClass MyShell firstArg
and im having this error:
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 #0 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Datasource\DboSource.php(459): PDOStatement->execute(Array) #1 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Datasource\Database\Mysql.php(183): DboSource->_execute('SHOW TABLES FRO...') #2 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1101): Mysql->listSources() #3 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(3214): Model->setSource('jkrg_registers') #4 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1305): Model->getDataSource() #5 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1391): Model->schema() #6 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(2646): Model->hasField('deleted') #7 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1519): Model->find('first', Array) #8 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\app\Model\JkrgRegister.php(232): Model->read(NULL, '5f18ae7c-4e54-4...') #9 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\app\Console\Command\JkondorShell.php(643): JkrgRegister->sendClosedRegister('5f18ae7c-4e54-4...') #10 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Console\Shell.php(392): JkondorShell->sendClosedRegister() #11 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Console\ShellDispatcher.php(201): Shell->runCommand('sendClosedRegis...', Array) #12 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Console\ShellDispatcher.php(69): ShellDispatcher->dispatch() #13 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\app\Console\cake.php(33): ShellDispatcher::run(Array) #14 {main} 42000
Thanks for reading.