$dbParams = array( 'host' => 'localhost', 'username' => 'myuser', 'password' => 'mypassword', 'database' => 'mydatabase' ); $database = Gdn::factory('database')->create($dbParams);
$hashParams = array( 'salt' => 'mysalt', 'iterations' => '5000' ); $hash = Gdn::factory('hash')->create($hashParams); $password = 'mypassword'; $hashedPassword = $hash->hash($password);In this example, we create an array of parameters for the hash class and pass them to the Gdn factory to create an instance of the hash class. We then use this instance to hash a plaintext password, creating a secure hashed password for storage. Package Library The Gdn Factory is part of the Garden framework, which is a package library designed for building web applications in PHP. The Garden framework includes a number of packages for common functionality such as data storage, templating, and user authentication. The Gdn Factory is part of the core package, which provides a set of tools and utilities for use by other packages in the framework.