hhvm support #1512

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
4 participants
@cebe
Member

cebe commented Dec 14, 2013

  • adjust travis.yml and tests to run on travis
  • make sure tests run without errors on hhvm

fixes #1511

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Dec 14, 2013

Member

Tests are running: https://travis-ci.org/yiisoft/yii2/jobs/15429299

Looks like the main problem is magic __get, __set and __call but the framework code should not rely on this feature. In general it looks like yii2 is useable with hhvm...

Member

cebe commented Dec 14, 2013

Tests are running: https://travis-ci.org/yiisoft/yii2/jobs/15429299

Looks like the main problem is magic __get, __set and __call but the framework code should not rely on this feature. In general it looks like yii2 is useable with hhvm...

composer.json
"minimum-stability": "dev",
- "replace": {

This comment has been minimized.

@qiangxue

qiangxue Dec 14, 2013

Member

Why "replace" is removed?

@qiangxue

qiangxue Dec 14, 2013

Member

Why "replace" is removed?

This comment has been minimized.

@cebe

cebe Dec 14, 2013

Member

because a regex causes composer to crash otherwise. as stated in the PR message, this is for testing only, not ment to merge, not even later. If there are changes needed we can do them in other branch/commit. This is mainly to test whether there is a sense in supporting hhvm or not. Looks quite okay right now.

@cebe

cebe Dec 14, 2013

Member

because a regex causes composer to crash otherwise. as stated in the PR message, this is for testing only, not ment to merge, not even later. If there are changes needed we can do them in other branch/commit. This is mainly to test whether there is a sense in supporting hhvm or not. Looks quite okay right now.

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Dec 14, 2013

Member

Open issues:

  • recursive calls to __get are not working right now in version 2.3.0, will be in 2.4.0 as pointed out in #hhvm irc channel on freenode.

  • array_multisort() has a problem with call_user_func_array and reference value

    4) yiiunit\framework\helpers\ArrayHelperTest::testMultisort
    
    Parameter 1 to array_multisort() expected to be a reference, value given
    
    /home/travis/build/yiisoft/yii2/framework/yii/helpers/BaseArrayHelper.php:393
    /home/travis/build/yiisoft/yii2/tests/unit/framework/helpers/ArrayHelperTest.php:114
    /home/travis/build/yiisoft/yii2/vendor/phpunit/phpunit/composer/bin/phpunit:63
    

    https://github.com/yiisoft/yii2/blob/master/framework/yii/helpers/BaseArrayHelper.php#L393

  • Undefined property: PDOException::$errorInfo - should be easy to add a check for that.
    issue reported: facebook/hhvm#1412

Member

cebe commented Dec 14, 2013

Open issues:

  • recursive calls to __get are not working right now in version 2.3.0, will be in 2.4.0 as pointed out in #hhvm irc channel on freenode.

  • array_multisort() has a problem with call_user_func_array and reference value

    4) yiiunit\framework\helpers\ArrayHelperTest::testMultisort
    
    Parameter 1 to array_multisort() expected to be a reference, value given
    
    /home/travis/build/yiisoft/yii2/framework/yii/helpers/BaseArrayHelper.php:393
    /home/travis/build/yiisoft/yii2/tests/unit/framework/helpers/ArrayHelperTest.php:114
    /home/travis/build/yiisoft/yii2/vendor/phpunit/phpunit/composer/bin/phpunit:63
    

    https://github.com/yiisoft/yii2/blob/master/framework/yii/helpers/BaseArrayHelper.php#L393

  • Undefined property: PDOException::$errorInfo - should be easy to add a check for that.
    issue reported: facebook/hhvm#1412

@DaSourcerer

This comment has been minimized.

Show comment
Hide comment
@DaSourcerer

DaSourcerer Dec 14, 2013

Contributor

Subscribing as I'm eager to know how this will turn out.

Contributor

DaSourcerer commented Dec 14, 2013

Subscribing as I'm eager to know how this will turn out.

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Dec 14, 2013

Member

@DaSourcerer FYI: there is a subscribe button below, so no need for a comment to watch ;-)

Member

cebe commented Dec 14, 2013

@DaSourcerer FYI: there is a subscribe button below, so no need for a comment to watch ;-)

@DaSourcerer

This comment has been minimized.

Show comment
Hide comment
@DaSourcerer

DaSourcerer Dec 14, 2013

Contributor

But then I couldn't have stated my genuine interest openly 😏

Contributor

DaSourcerer commented Dec 14, 2013

But then I couldn't have stated my genuine interest openly 😏

cebe added some commits Jan 4, 2014

make tests run on hhvm on travis
- moved composer to own file
- removed coverage from phpunit
fixed test break with same php file and diff content
just create another file to not fail on hhvm
@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Jan 4, 2014

Member

tried once again. We now have the following issues:

Member

cebe commented Jan 4, 2014

tried once again. We now have the following issues:

@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Jan 13, 2014

Contributor

migration tool fails on HHVM because of this line - https://github.com/yiisoft/yii2/blob/master/framework/db/mysql/Schema.php#L190. HHVM returns error code int(1146), not string(42S02).
We can change it to

if ($previous instanceof \PDOException && ($previous->getCode() == '42S02'||$previous->getCode()==1146))

After that it fails with "Database Exception: Redis error: ERR wrong number of arguments for 'set' command" and also need some inspection =)

Contributor

SonicGD commented Jan 13, 2014

migration tool fails on HHVM because of this line - https://github.com/yiisoft/yii2/blob/master/framework/db/mysql/Schema.php#L190. HHVM returns error code int(1146), not string(42S02).
We can change it to

if ($previous instanceof \PDOException && ($previous->getCode() == '42S02'||$previous->getCode()==1146))

After that it fails with "Database Exception: Redis error: ERR wrong number of arguments for 'set' command" and also need some inspection =)

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Jan 13, 2014

Member

Can you show how to reproduce the issue? Also if behavior between php and hhvm is different you should report that to hhvm.

Member

cebe commented Jan 13, 2014

Can you show how to reproduce the issue? Also if behavior between php and hhvm is different you should report that to hhvm.

@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Jan 14, 2014

Contributor

@cebe, step by step:

  1. php -v
root@debian:/var/www/yii2/basic# php -v
HipHop VM 2.4.0-dev (rel)
Compiler: heads/master-0-gba8b4bf75a1a2461f3f00a4c048aacdb6835accb
Repo schema: e9c960b671eb36e3bd8085a0ed65937eefe140a9

/etc/hhvm/config.hdf:

MySQL {
  ReadTimeout = 5000
}

EnvVariables {
  HPHP_INTERPRETER = 1
}

ServerVariables {
  ALPHA_CONSOLE = 1
  TFBENV = 16777216
}

ErrorHandling {
  NoticeFrequency = 1
  WarningFrequency = 1
}

Http {
  SlowQueryThreshold = 0
}

ResourceLimit {
  SerializationSizeLimit=134217728
  SocketDefaultTimeout = 20
}
  1. curl -s http://getcomposer.org/installer | php
  2. php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
  3. cd basic && mkdir migrations
  4. edit config/db.php
  5. ./yii migrate
root@debian:/var/www/yii2/basic# ./yii migrate
Yii Migration Tool (based on Yii v2.0.0-dev)

HipHop Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist' in :
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(397): PDOStatement->execute()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#7 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#8 (): yii\console\controllers\MigrateController->actionUp()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#15 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#16 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#17 {main}

Next exception 'yii\db\Exception' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist
The SQL being executed was: SHOW FULL COLUMNS FROM `tbl_migration`' in /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php:424
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#7 (): yii\console\controllers\MigrateController->actionUp()
#8 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#15 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#16 {main}
exception 'PDOException' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist' in :
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(397): PDOStatement->execute()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#7 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#8 (): yii\console\controllers\MigrateController->actionUp()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#15 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#16 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#17 {main}

Next exception 'yii\db\Exception' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist
The SQL being executed was: SHOW FULL COLUMNS FROM `tbl_migration`' in /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php:424
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#7 (): yii\console\controllers\MigrateController->actionUp()
#8 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#15 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#16 {main}
Contributor

SonicGD commented Jan 14, 2014

@cebe, step by step:

  1. php -v
root@debian:/var/www/yii2/basic# php -v
HipHop VM 2.4.0-dev (rel)
Compiler: heads/master-0-gba8b4bf75a1a2461f3f00a4c048aacdb6835accb
Repo schema: e9c960b671eb36e3bd8085a0ed65937eefe140a9

/etc/hhvm/config.hdf:

MySQL {
  ReadTimeout = 5000
}

EnvVariables {
  HPHP_INTERPRETER = 1
}

ServerVariables {
  ALPHA_CONSOLE = 1
  TFBENV = 16777216
}

ErrorHandling {
  NoticeFrequency = 1
  WarningFrequency = 1
}

Http {
  SlowQueryThreshold = 0
}

ResourceLimit {
  SerializationSizeLimit=134217728
  SocketDefaultTimeout = 20
}
  1. curl -s http://getcomposer.org/installer | php
  2. php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
  3. cd basic && mkdir migrations
  4. edit config/db.php
  5. ./yii migrate
root@debian:/var/www/yii2/basic# ./yii migrate
Yii Migration Tool (based on Yii v2.0.0-dev)

HipHop Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist' in :
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(397): PDOStatement->execute()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#7 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#8 (): yii\console\controllers\MigrateController->actionUp()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#15 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#16 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#17 {main}

Next exception 'yii\db\Exception' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist
The SQL being executed was: SHOW FULL COLUMNS FROM `tbl_migration`' in /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php:424
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#7 (): yii\console\controllers\MigrateController->actionUp()
#8 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#15 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#16 {main}
exception 'PDOException' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist' in :
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(397): PDOStatement->execute()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#7 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#8 (): yii\console\controllers\MigrateController->actionUp()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#15 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#16 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#17 {main}

Next exception 'yii\db\Exception' with message 'SQLSTATE[42S02] [1146] Table 'cg2_test.tbl_migration' doesn't exist
The SQL being executed was: SHOW FULL COLUMNS FROM `tbl_migration`' in /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php:424
Stack trace:
#0 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Command.php(312): yii\db\Command->queryInternal()
#1 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(187): yii\db\Command->queryAll()
#2 /var/www/yii2/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(93): yii\db\mysql\Schema->findColumns()
#3 /var/www/yii2/basic/vendor/yiisoft/yii2/db/Schema.php(110): yii\db\mysql\Schema->loadTableSchema()
#4 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(575): yii\db\Schema->getTableSchema()
#5 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(614): yii\console\controllers\MigrateController->getMigrationHistory()
#6 /var/www/yii2/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(151): yii\console\controllers\MigrateController->getNewMigrations()
#7 (): yii\console\controllers\MigrateController->actionUp()
#8 /var/www/yii2/basic/vendor/yiisoft/yii2/base/InlineAction.php(53): call_user_func_array()
#9 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Controller.php(130): yii\base\InlineAction->runWithParams()
#10 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Controller.php(77): yii\base\Controller->runAction()
#11 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Module.php(586): yii\console\Controller->runAction()
#12 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(131): yii\base\Module->runAction()
#13 /var/www/yii2/basic/vendor/yiisoft/yii2/console/Application.php(99): yii\console\Application->runAction()
#14 /var/www/yii2/basic/vendor/yiisoft/yii2/base/Application.php(289): yii\console\Application->handleRequest()
#15 /var/www/yii2/basic/yii(22): yii\base\Application->run()
#16 {main}
@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Jan 14, 2014

Contributor

To see difference this script can be used:

try {
    $db = new PDO("mysql:host=localhost;dbname=db", 'login', 'password');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $res = $db->query('SHOW FULL COLUMNS FROM `tbl_migration`');
} catch (PDOException $e) {
    var_dump($e->getCode());
}

Try on php:

root@debian:/var/www/cg2# php -v
PHP 5.5.7-2 (cli) (built: Dec 12 2013 23:06:38) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
root@debian:/var/www/cg2# php hhvm-pdo.php 
string(5) "42S02"

Try on hhvm:

root@debian:/var/www/cg2# php -v
HipHop VM 2.4.0-dev (rel)
Compiler: heads/master-0-gba8b4bf75a1a2461f3f00a4c048aacdb6835accb
Repo schema: e9c960b671eb36e3bd8085a0ed65937eefe140a9
root@debian:/var/www/cg2# php hhvm-pdo.php
int(1146)
Contributor

SonicGD commented Jan 14, 2014

To see difference this script can be used:

try {
    $db = new PDO("mysql:host=localhost;dbname=db", 'login', 'password');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $res = $db->query('SHOW FULL COLUMNS FROM `tbl_migration`');
} catch (PDOException $e) {
    var_dump($e->getCode());
}

Try on php:

root@debian:/var/www/cg2# php -v
PHP 5.5.7-2 (cli) (built: Dec 12 2013 23:06:38) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
root@debian:/var/www/cg2# php hhvm-pdo.php 
string(5) "42S02"

Try on hhvm:

root@debian:/var/www/cg2# php -v
HipHop VM 2.4.0-dev (rel)
Compiler: heads/master-0-gba8b4bf75a1a2461f3f00a4c048aacdb6835accb
Repo schema: e9c960b671eb36e3bd8085a0ed65937eefe140a9
root@debian:/var/www/cg2# php hhvm-pdo.php
int(1146)
@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Jan 14, 2014

Contributor

I found this in hhvm tracker - facebook/hhvm#1498 (comment)

Contributor

SonicGD commented Jan 14, 2014

I found this in hhvm tracker - facebook/hhvm#1498 (comment)

@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Jan 14, 2014

Contributor

Also, redis cache fails when expiration time != 0

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');

$config = yii\helpers\ArrayHelper::merge(
    require(__DIR__ . '/console/config/main.php'),
    require(__DIR__ . '/console/config/main-test.php')
);

$application = new yii\console\Application($config);
\Yii::$app->cache->set("hhvmtest", "123");
try {
    \Yii::$app->cache->set("hhvmtest2", "456", 1);
} catch (\yii\base\Exception $ex) {
    echo $ex->getMessage() . "\n";
}
var_dump(\Yii::$app->cache->get('hhvmtest'));
var_dump(\Yii::$app->cache->get('hhvmtest2'));

PHP:

root@debian:/var/www/cg2# php -v
PHP 5.5.7-2 (cli) (built: Dec 12 2013 23:06:38) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
root@debian:/var/www/cg2# php hhvm-redis.php 
string(3) "123"
string(3) "456"

HHVM:

root@debian:/var/www/cg2# php -v
HipHop VM 2.4.0-dev (rel)
Compiler: heads/master-0-gba8b4bf75a1a2461f3f00a4c048aacdb6835accb
Repo schema: e9c960b671eb36e3bd8085a0ed65937eefe140a9
root@debian:/var/www/cg2# php hhvm-redis.php
Redis error: ERR wrong number of arguments for 'set' command
Redis command was: SET hhvmtest2 a:2:{i:0;s:3:"456";i:1;N;} PX 1000
string(3) "123"
bool(false)
Contributor

SonicGD commented Jan 14, 2014

Also, redis cache fails when expiration time != 0

require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');

$config = yii\helpers\ArrayHelper::merge(
    require(__DIR__ . '/console/config/main.php'),
    require(__DIR__ . '/console/config/main-test.php')
);

$application = new yii\console\Application($config);
\Yii::$app->cache->set("hhvmtest", "123");
try {
    \Yii::$app->cache->set("hhvmtest2", "456", 1);
} catch (\yii\base\Exception $ex) {
    echo $ex->getMessage() . "\n";
}
var_dump(\Yii::$app->cache->get('hhvmtest'));
var_dump(\Yii::$app->cache->get('hhvmtest2'));

PHP:

root@debian:/var/www/cg2# php -v
PHP 5.5.7-2 (cli) (built: Dec 12 2013 23:06:38) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
root@debian:/var/www/cg2# php hhvm-redis.php 
string(3) "123"
string(3) "456"

HHVM:

root@debian:/var/www/cg2# php -v
HipHop VM 2.4.0-dev (rel)
Compiler: heads/master-0-gba8b4bf75a1a2461f3f00a4c048aacdb6835accb
Repo schema: e9c960b671eb36e3bd8085a0ed65937eefe140a9
root@debian:/var/www/cg2# php hhvm-redis.php
Redis error: ERR wrong number of arguments for 'set' command
Redis command was: SET hhvmtest2 a:2:{i:0;s:3:"456";i:1;N;} PX 1000
string(3) "123"
bool(false)
@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Jan 14, 2014

Contributor

Hm, redis problem solved by upgrading redis-server from 2.4.14 (wheezy stable) to 2.8.3 (dotdeb).

Added: redis/redis-rb#372 (comment)
So yii2-redis require redis-server>=2.6.12. Maybe it should be mentioned somewhere.

Contributor

SonicGD commented Jan 14, 2014

Hm, redis problem solved by upgrading redis-server from 2.4.14 (wheezy stable) to 2.8.3 (dotdeb).

Added: redis/redis-rb#372 (comment)
So yii2-redis require redis-server>=2.6.12. Maybe it should be mentioned somewhere.

Merge branch 'master' into hhvm-support
* master: (870 commits)
  added `yiisoft/yii2-coding-standards` to yii2-dev suggested packages
  Removed unused variables
  Removed unused namespace imports
  Removed unused assignment
  support panel hiding.
  further improved custom panel setting.
  CS fix.
  tests improved
  code fix
  Added support to disable a debug panel.
  tests improved
  docs added
  updated elasticsearch querybuilder test to use yiitest index
  Fix typo
  Fixes #2346: ActiveQuery used in building sub-query should not need to set FROM clause explicitly.
  Update FixtureController.php
  reverting
  Fixes #2310
  The scripts in asset bundles are now registered in `View` at the end of `endBody()`. It was done in `endPage()` previously
  doc improvement [skip ci]
  ...

Conflicts:
	.travis.yml
@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Mar 3, 2014

Member

closing this as builds are now running and status is tracked in #1511

Member

cebe commented Mar 3, 2014

closing this as builds are now running and status is tracked in #1511

@cebe cebe closed this Mar 3, 2014

@cebe cebe deleted the cebe:hhvm-support branch Mar 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment