K
K
kikimarik2019-08-28 18:00:06
Yii
kikimarik, 2019-08-28 18:00:06

\yii\db\ActiveRecord::tableName() return empty table name after php change?

After updating the php build, there was a problem with AR, it loses all table names. For example, for news
var_dump(frontend\models\News::tableName());
it returns now string(5) "{{%}}"
On the last build, php returned string(9) "{{%news}}"as it should. If you register by hand in the model

public static function tableName()
    {
        return 'news';
    }

That's all right. That is, it was the auto-detection of the table name based on the model class name that stopped working.
The move was from php7.0 to php7.1. I will be grateful for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kikimarik, 2019-08-29
@kikimarik

Having delved into the architecture of the framework, it became clear that the problem was with the regular
expression Error PREG_JIT_STACKLIMIT_ERROR. Decided for now by disabling PCRE JIT in php.ini pcre.jit = 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question