]> iEval git - gruntmaster-daemon.git/commitdiff
Add PHP
authorSergiu <srg.pscs@gmail.com>
Thu, 21 Jan 2016 04:17:48 +0000 (06:17 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 23 Jan 2016 16:09:13 +0000 (16:09 +0000)
gruntmaster-compile
lib/Gruntmaster/Daemon.pm
t/01-jobs.t
t/problems/hello/tests/php/meta.yml [new file with mode: 0644]
t/problems/hello/tests/php/prog.php [new file with mode: 0644]

index cea2733e7a6c10c8ebe128e0bdaca18616e50be5..0ab18fc693a86dc0a72f9779217b8c3ac7514639 100755 (executable)
@@ -38,15 +38,16 @@ given ($format){
                exit
        }
 
-       when ([qw/GOLFSCRIPT JULIA PERL PYTHON RUBY SBCL/]){
+       when ([qw/GOLFSCRIPT JULIA PERL PHP PYTHON RUBY SBCL/]){
                open IN, '<', $name;
                open OUT, '>', $basename;
-               print OUT "#!/usr/bin/golfscript\n"    if $_ eq 'GOLFSCRIPT';
-               print OUT "#!/usr/bin/julia -O\n"      if $_ eq 'JULIA';
-               print OUT "#!/usr/bin/perl\n"          if $_ eq 'PERL';
-               print OUT "#!/usr/bin/python\n"        if $_ eq 'PYTHON';
-               print OUT "#!/usr/bin/ruby\n"          if $_ eq 'RUBY';
-               print OUT "#!/usr/bin/sbcl --script\n" if $_ eq 'SBCL';
+               print OUT "#!/usr/bin/golfscript\n"                                                             if $_ eq 'GOLFSCRIPT';
+               print OUT "#!/usr/bin/julia -O\n"                                                               if $_ eq 'JULIA';
+               print OUT "#!/usr/bin/perl\n"                                                                   if $_ eq 'PERL';
+               print OUT "#!/usr/bin/php -d ONLINE_JUDGE=true\n"                                               if $_ eq 'PHP';
+               print OUT "#!/usr/bin/python\n"                                                                 if $_ eq 'PYTHON';
+               print OUT "#!/usr/bin/ruby\n"                                                                   if $_ eq 'RUBY';
+               print OUT "#!/usr/bin/sbcl --script\n"                                                          if $_ eq 'SBCL';
                print OUT while <IN>;
                close OUT;
                close IN;
@@ -125,6 +126,10 @@ Compile commands for each format:
 
   cp $input $output
 
+=item PHP
+
+  cp $input $output
+
 =item PYTHON
 
   cp $input $output
index ad4e727e774d5e704cb6431e73952f7efef256fa..b6d3a522f5935d6585dc612901b1d51634724648 100644 (file)
@@ -30,6 +30,7 @@ use constant FORMAT_EXTENSION => {
        MONO => 'cs',
        PASCAL => 'pas',
        PERL => 'pl',
+       PHP => 'php',
        PYTHON => 'py',
        RUBY => 'rb',
        RUST => 'rs',
index e3464fc43e882cdb350dc01ab789efb2abf4ced9..90f7d706f1fca3ccc84e767407197d8952ccfe92 100644 (file)
@@ -31,6 +31,7 @@ use constant COMPILER => {
           GCCGO gccgo
           HASKELL ghc
           PERL perl
+          PHP php
           PYTHON python
           RUBY ruby
           RUST rustc
diff --git a/t/problems/hello/tests/php/meta.yml b/t/problems/hello/tests/php/meta.yml
new file mode 100644 (file)
index 0000000..0f9f474
--- /dev/null
@@ -0,0 +1,7 @@
+test_name: PHP
+test_description: Hello world in PHP
+problem: hello
+files:
+  prog:
+    format: PHP
+    name: prog.php
diff --git a/t/problems/hello/tests/php/prog.php b/t/problems/hello/tests/php/prog.php
new file mode 100644 (file)
index 0000000..c1319fb
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+echo("Hello World!\n");
+?>
This page took 0.038425 seconds and 4 git commands to generate.