@@ -37,7 +37,7 @@ import {ReleaseNoteModel} from "./ReleaseNoteModal";
3737export const languageAliases = [ "javascript" , "typescript" , "bash" , "csharp" , "wolfram" , "nb" , "wl" , "hs" , "py" ] as const ;
3838export const canonicalLanguages = [ "js" , "ts" , "cs" , "lean" , "lua" , "python" , "cpp" , "prolog" , "shell" , "groovy" , "r" ,
3939 "go" , "rust" , "java" , "powershell" , "kotlin" , "mathematica" , "haskell" , "scala" , "swift" , "racket" , "fsharp" , "c" , "dart" ,
40- "ruby" , "batch" , "sql" , "octave" , "maxima" , "applescript" , "zig" , "ocaml" ] as const ;
40+ "ruby" , "batch" , "sql" , "octave" , "maxima" , "applescript" , "zig" , "ocaml" , "php" ] as const ;
4141export const supportedLanguages = [ ...languageAliases , ...canonicalLanguages ] as const ;
4242export type LanguageId = typeof canonicalLanguages [ number ] ;
4343
@@ -440,6 +440,12 @@ export default class ExecuteCodePlugin extends Plugin {
440440 const transformedCode = await new CodeInjector ( this . app , this . settings , language ) . injectCode ( srcCode ) ;
441441 this . runCodeInShell ( transformedCode , out , button , this . settings . ocamlPath , this . settings . ocamlArgs , "ocaml" , language , file ) ;
442442 } )
443+ } else if ( language === "php" ) {
444+ button . addEventListener ( "click" , async ( ) => {
445+ button . className = runButtonDisabledClass ;
446+ const transformedCode = await new CodeInjector ( this . app , this . settings , language ) . injectCode ( srcCode ) ;
447+ this . runCodeInShell ( transformedCode , out , button , this . settings . phpPath , this . settings . phpArgs , this . settings . phpFileExtension , language , file ) ;
448+ } )
443449 }
444450
445451 }
0 commit comments