db.conf.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Example Database connection settings and DB relationship mapping
  4. * $dbmap[Table A]['has_one'][Table B] = array('foreign_key'=> Table B's column that links to Table A );
  5. * $dbmap[Table B]['belongs_to'][Table A] = array('foreign_key'=> Table A's column where Table B links to );
  6. //Food relationship
  7. $dbmap['Food']['belongs_to']['FoodType'] = array('foreign_key'=>'id');
  8. $dbmap['Food']['has_many']['Article'] = array('foreign_key'=>'food_id');
  9. $dbmap['Food']['has_one']['Recipe'] = array('foreign_key'=>'food_id');
  10. $dbmap['Food']['has_many']['Ingredient'] = array('foreign_key'=>'food_id', 'through'=>'food_has_ingredient');
  11. //Food Type
  12. $dbmap['FoodType']['has_many']['Food'] = array('foreign_key'=>'food_type_id');
  13. //Article
  14. $dbmap['Article']['belongs_to']['Food'] = array('foreign_key'=>'id');
  15. //Recipe
  16. $dbmap['Recipe']['belongs_to']['Food'] = array('foreign_key'=>'id');
  17. //Ingredient
  18. $dbmap['Ingredient']['has_many']['Food'] = array('foreign_key'=>'ingredient_id', 'through'=>'food_has_ingredient');
  19. */
  20. //$dbconfig[ Environment or connection name] = array(Host, Database, User, Password, DB Driver, Make Persistent Connection?);
  21. /**
  22. * Database settings are case sensitive.
  23. * To set collation and charset of the db connection, use the key 'collate' and 'charset'
  24. * array('localhost', 'database', 'root', '1234', 'mysql', true, 'collate'=>'utf8_unicode_ci', 'charset'=>'utf8');
  25. */
  26. $dbconfig['dev'] = array('192.168.73.139','zhclass','root','root','mysql',false, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8');
  27. //$dbconfig['dev'] = array('localhost','zhclass','zhclass','DkY1mPoWKD2UOvWL','mysql',false, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8');
  28. //$dbconfig['dev'] = array('localhost', 'zhwenku', 'zhwenku', 'zhwenku.3850', 'mysql', false, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8');
  29. //$dbconfig['zhzdjg'] = array('localhost', 'glzj.com.cn', 'glzjcomcn', 'glzjcomcn.3850888', 'mysql', true, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8');
  30. //$dbconfig['prod'] = array('localhost', 'zhwenku', 'root', '', 'mysql', true, 'charset' => 'utf8');
  31. ?>