monstra-cms / monstra

THIS PROJECT IS NOT SUPPORTED ANYMORE! Check FLEXTYPE.ORG
http://flextype.org
MIT License
396 stars 121 forks source link

Core: IDIORM optimization #28

Closed Awilum closed 11 years ago

Awilum commented 11 years ago

Now IDIORM waste a ~1 mb of memory even if we don't need MySQL. New constant/option must be created for this.

e.g.

if (MONSTRA_MYSQL) {
     ORM::configure(MONSTRA_DB_DSN);
     ORM::configure('username', MONSTRA_DB_USER);
     ORM::configure('password',  MONSTRA_DB_PASSWORD);
}
mbarzda commented 11 years ago

Why not

if (defined('MONSTRA_DB_DSN')) {
    ORM::configure(MONSTRA_DB_DSN);
    ORM::configure('username', MONSTRA_DB_USER);
    ORM::configure('password',  MONSTRA_DB_PASSWORD);
}

? And defines.php by default:

//define('MONSTRA_DB_DSN', 'mysql:dbname=monstra;host=localhost;port=3306');
//define('MONSTRA_DB_USER', 'root');
//define('MONSTRA_DB_PASSWORD', 'password');
Awilum commented 11 years ago

Okay. It's good solution for now. Thanks.