Skip to content

Instantly share code, notes, and snippets.

@marijnh
Created March 26, 2011 20:47
Show Gist options
  • Save marijnh/888623 to your computer and use it in GitHub Desktop.
Save marijnh/888623 to your computer and use it in GitHub Desktop.
non-embedded PHP mode for codemirror
(function() {
function keywords(str) {
var obj = {}, words = str.split(" ");
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
var phpKeywords =
keywords("abstract and array as break case catch cfunction class clone const continue declare " +
"default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends " +
"final for foreach function global goto if implements interface instanceof namespace " +
"new or private protected public static switch throw try use var while xor");
CodeMirror.defineMIME("application/x-httpd-php", {name: "clike", keywords: phpKeywords, multiLineStrings: true, $vars: true});
)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment