public static function configure($dsn, $options = array()) { self::$dsn = $dsn; self::$options = array_merge(self::$options, $options); }
protected static function configureWithOptions(array $options, $jobsTable = 'jobs') { if (!isset($options['driver'])) { throw new DJException("Please provide the database driver used in configure options array."); } if (!isset($options['user'])) { throw new DJException("Please provide the database user in configure options array."); } if (!isset($options['password'])) { throw new DJException("Please provide the database password in configure options array."); } self::$user = $options['user']; self::$password = $options['password']; self::$jobsTable = $jobsTable; self::$dsn = $options['driver'] . ':'; foreach ($options as $key => $value) { // skips options already used if ($key == 'driver' || $key == 'user' || $key == 'password') { continue; } // searches for retries if ($key == 'retries') { self::$retries = (int) $value; continue; } self::$dsn .= $key . '=' . $value . ';'; } }
public static function configure($dsn) { self::$dsn = $dsn; }