Open yii-bot opened 7 years ago
are you using APC cache?
I will install APCu
and don't change configuration or settings of cache component (default yii2-advanced template settings)
https://github.com/bscheshirwork/docker-php/blob/master/yii2-alpine/Dockerfile#L67
'cache' => [
'class' => 'yii\caching\FileCache',
],
./yii cache/index
The following caches were found in the system:
* cache (yii\caching\FileCache)
So...
docker exec -ti dockerrun_php_1 php -i |grep 'apc.enable_cli'
apc.enable_cli => Off => Off
docker exec -ti dockerrun_php_1 php ./requirements.php
...
APC extension: WARNING!!!
Required by: ApcCache
This is can be as reason?
Console command migration
and console command cache
is not both use same CLI
? Or use someone API
?
If you flush cache on CLI but web is running in another container, that will have no effect. This is often the case with ApcCache, but can also occur with FileCache when files are located in different locations or containers.
That said, given that Gii is a dev tool we might add a flush schema cache call in the generator to ensure to always generate files from current schema.
Hm... backend
db cache is a different/separate and don't flush after flush console
db schema cache?
Console run migrate with
Yii::$app->db->schema->refresh();
Has no effect to backend
caches Yii::$app->db->schema
and/or frontend
and any of this is isolate...
I must use
(new \yii\console\controllers\CacheController('cache', Yii::$app->module))->actionFlushSchema();
to clear all (is 3min for advances) version of db cache?
Oh... Its same command
$connection = Yii::$app->get($db, false);
...
$schema = $connection->getSchema();
$schema->refresh();
and run all console command in same container
But it's work... %)
What else? Gii cache in high level don't clear if low-level db cache flush? %)
This issue has originally been reported by @bscheshirwork at https://github.com/yiisoft/yii2/issues/14210. Moved here by @samdark.
What steps will reproduce the problem?
gii: generate model
gii: generate crud based at model
change table schema (drop+create table in
db
using migration mechanism) andgii: generate model
gii: generate crud based at model
What is the expected result?
new views (and search model) in previews & generate result
What do you get instead?
old views (same at previous)
Additional info
after console command
all is ok.