Using Db::getInstance() in a CLI script <p>I've been wanting to create a add-on cron script that utilises Prestashop's DB class instead of instantiating the database handle directly, but I can't seem to figure out where did the "Db" class commonly referenced by "Db::getInstance()" calls get defined.</p> <p>classes/Db.php defines an abstract DbCore class. MySQLCore extends Db as you can see, however Db is never defined anywhere:</p> <pre><code>[/home/xxxx/www/shop/classes]# grep -r "extends Db" ../ ../classes/MySQL.php:class MySQLCore extends Db </code></pre> <p>According to another thread on Prestashop forums, the abstract DbCore class is implemented in a class located in override/classes/db, however that directory does not exist.</p> <pre><code>[/home/xxxx/www/shop/override]# cd ../override/ [/home/xxxx/www/shop/override]# ls ./ ../ classes/ controllers/ [/home/xxxx/www/shop/override]# cd classes/ [/home/xxxx/www/shop/override/classes]# ls ./ ../ _FrontController.php* _Module.php* _MySQL.php* </code></pre> <p>Our shop is working, so obviously I am missing something. We are running Prestashop 1.4.1, so perhaps the docs are no longer applicable.</p> <p>Quite clearly in many places in the code base functions from the Db class are being used, but this last grep through the code found nothing:</p> <pre><code>grep -rwI "Db" . | grep -v "::" ./modules/productcomments/productcommentscriterion.php:require_once(dirname(__FILE__).'/../../classes/Db.php'); ./classes/MySQL.php:class MySQLCore extends Db ./classes/Db.php: * Get Db object instance (Singleton) ./classes/Db.php: * @return object Db instance ./classes/Db.php: * Build a Db object </code></pre> <p>Is there something I am missing? Where did this magical Db class come from?</p>