$di = new FactoryDefault();
$di->setShared('modelsMetadata', function() use($config) {
$metadata = new Phalcon\Mvc\Model\MetaData\Files([
'metaDataDir' => $config->application->cacheDir . 'models-meta/'
]);
return $metadata;
});
and then, later...
$di->get('modelsMetadata')->reset();
Does not delete the ORM cache files. Directory and files have been CHMOD 777
phalcon Version => 3.1.2
Build Date => Apr 6 2017 14:20:49
Powered by Zephir => Version 0.9.7-1fae5e50ac
Directive => Local Value => Master Value
phalcon.db.escape_identifiers => On => On
phalcon.db.force_casting => Off => Off
phalcon.orm.events => On => On
phalcon.orm.virtual_foreign_keys => On => On
phalcon.orm.column_renaming => On => On
phalcon.orm.not_null_validations => On => On
phalcon.orm.exception_on_failed_save => Off => Off
phalcon.orm.enable_literals => On => On
phalcon.orm.late_state_binding => Off => Off
phalcon.orm.enable_implicit_joins => On => On
phalcon.orm.cast_on_hydrate => Off => Off
phalcon.orm.ignore_unknown_columns => Off => Off
PHP 7.0.18-1~dotdeb+8.1 (cli) ( NTS )