Instantiation example using an associative array of arguments.

  1. <?php
  2. /**
  3. * Instantiation Example
  4. *
  5. * This example uses an associative array of arguments to instantiate AbstractDB.
  6. * @package AbstractDB
  7. * @author Pacific-Cybersoft
  8. * @copyright (C) 2005 Pacific-Cybersoft. All Rights Reserved.
  9. * @version v 1.0.2
  10. * @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
  11. */
  12.  
  13. /**
  14. * Include the AbstractDB main class.
  15. */
  16. include("../abstractdb.class.php");
  17.  
  18. /**
  19. * @global AbstractDB An instance of the {@link AbstractDB} class.
  20. */
  21. $db = new AbstractDB(array(
  22. "Type"=>"mysql",
  23. "Username"=>"username",
  24. "Password"=>"password",
  25. "Hostname"=>"localhost",
  26. "Database"=>"cybermatrix",
  27. "Options"=>array(
  28. "Persistent"=>true,
  29. "Port"=>3306)
  30. ));
  31.  
  32. // Always good practice to close AbstractDB at the end of each script.
  33. $db->Close();
  34. ?>

Documentation generated on Wed, 16 Mar 2005 23:16:49 +1100 by phpDocumentor 1.3.0RC3