Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created January 13, 2013 01:57
Show Gist options
  • Save danlamanna/4521796 to your computer and use it in GitHub Desktop.
Save danlamanna/4521796 to your computer and use it in GitHub Desktop.
(with-temp-buffer
(insert-file-contents (concat (wp/exists) wp/config-file))
(goto-char (point-min))
(while (search-forward-regexp "define\s*(\s*['\"]\\(DB_\\(HOST\\|NAME\\|PASSWORD\\|USER\\)\\)['\"]\s*,\s*['\"]\\([^'\"]*\\)['\"]\s*)" nil t)
(add-to-list 'db-credentials `(,(match-string 1) . ,(match-string 3)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment