phalcon / phalcon-devtools

Phalcon Developer Tools
https://docs.phalcon.io/latest/en/devtools
Other
1.33k stars 629 forks source link

Getting connection gone away #982

Closed kaioken closed 7 years ago

kaioken commented 7 years ago

Questions should go to https://forum.phalconphp.com Documentation issues should go to https://github.com/phalcon/docs/issues

Expected and Actual Behavior

Describe what you are trying to achieve and what goes wrong.

Running this command phalcon model company --namespace="Incursio\Models" --extends="Baka"

Provide output if related

Warning: PDO::query(): Error reading result set's header in /root/vendor/phalcon/devtools/scripts/Phalcon/Builder/Model.php on line 243 ERROR: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

By removing this code all works correctly
 foreach ($db->describeReferences($tableName, $schema) as $reference) {
244                 if ($reference->getReferencedTable() != $this->options->get('name')) {
245                     continue;
246                 }
247
248                 $entityNamespace = '';
249                 if ($this->options->contains('namespace')) {
250                     $entityNamespace = $this->options->get('namespace')."\\";
251                 }
252
253                 $refColumns = $reference->getReferencedColumns();
254                 $columns = $reference->getColumns();
255                 $initialize[] = $this->snippet->getRelation(
256                     'hasMany',
257                     $this->options->get('camelize') ? Utils::lowerCamelize($refColumns[0]) : $refColumns[0],
258                     $entityNamespace . Utils::camelize($tableName),
259                     $this->options->get('camelize') ? Utils::lowerCamelize($columns[0]) : $columns[0],
260                     "['alias' => '" . Utils::camelize($tableName) . "']"
261                 );
262             }

Details

sergeysviridenko commented 7 years ago

I couldn't reproduce this issue.

Phalcon DevTools Version: 3.2.0 Phalcon Version: 3.2.1

sergeyklay commented 7 years ago

@kaioken Can you try latest stable DevTools?

sergeysviridenko commented 7 years ago

There is no reaction. I propose close this issue. If problem will appear again we'll reopen this issue.