@@ -564,36 +564,6 @@ The built in configuration engines are:
564564
565565By default your application will use ``PhpConfig ``.
566566
567- Disabling Generic Tables
568- ========================
569-
570- While utilizing generic table classes - also called auto-tables - when quickly
571- creating new applications and baking models is useful, generic table class can
572- make debugging more difficult in some scenarios.
573-
574- You can check if any query was emitted from a generic table class via DebugKit
575- via the SQL panel in DebugKit. If you're still having trouble diagnosing an
576- issue that could be caused by auto-tables, you can throw an exception when
577- CakePHP implicitly uses a generic ``Cake\ORM\Table `` instead of your concrete
578- class like so::
579-
580- // In your bootstrap.php
581- use Cake\Event\EventManager;
582- use Cake\Http\Exception\InternalErrorException;
583-
584- $isCakeBakeShellRunning = (PHP_SAPI === 'cli' && isset($argv[1]) && $argv[1] === 'bake');
585- if (!$isCakeBakeShellRunning) {
586- EventManager::instance()->on('Model.initialize', function($event) {
587- $subject = $event->getSubject();
588- if (get_class($subject) === 'Cake\ORM\Table') {
589- $msg = sprintf(
590- 'Missing table class or incorrect alias when registering table class for database table %s.',
591- $subject->getTable());
592- throw new InternalErrorException($msg);
593- }
594- });
595- }
596-
597567.. meta ::
598568 :title lang=en: Configuration
599- :keywords lang=en: finished configuration,legacy database,database configuration,value pairs,default connection,optional configuration,example database,php class,configuration database,default database,configuration steps,index database,configuration details,class database,host localhost,inflections,key value,database connection,piece of cake,basic web,auto tables,auto-tables,generic table,class
569+ :keywords lang=en: finished configuration,legacy database,database configuration,value pairs,default connection,optional configuration,example database,php class,configuration database,default database,configuration steps,index database,configuration details,class database,host localhost,inflections,key value,database connection,piece of cake,basic web
0 commit comments