Skip to content

Commit 91e1ad2

Browse files
authored
Merge pull request #3 from JamesForks/php-support
Add PHP support
2 parents 6fed82b + 82bf2d3 commit 91e1ad2

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

parse_funcs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'.js': 'node',
1414
'.hs': 'haskell',
1515
'.exs': 'elixir',
16+
'.php': 'php',
1617
}
1718

1819
COMMENT_PREFIX = {
@@ -23,6 +24,7 @@
2324
'node': '//',
2425
'haskell': '--',
2526
'elixir': '#',
27+
'php': '//'
2628
}
2729

2830

@@ -58,7 +60,8 @@ def parse(path):
5860
glob('*.js') + \
5961
glob('*.pl') + \
6062
glob('*.hs') + \
61-
glob('*.exs')
63+
glob('*.exs') + \
64+
glob('*.php')
6265

6366
for f in files:
6467
ext_name = os.path.splitext(f)[1]

run_funcs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
'node',
1515
'golang',
1616
'elixir',
17-
'haskell']
17+
'haskell',
18+
'php']
1819

1920
RUN_CMDS = {
2021
'ruby': 'ruby',
@@ -23,7 +24,8 @@
2324
'perl': 'perl',
2425
'golang': 'go run',
2526
'elixir': 'elixir',
26-
'haskell': 'runhaskell'}
27+
'haskell': 'runhaskell',
28+
'php': 'php'}
2729

2830

2931
def run_fun(path, func):

test/func_samples/function.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
// GET /test/result/php.json
4+
5+
echo json_encode(['hello' => 'world']);

0 commit comments

Comments
 (0)