Skip to content

Commit 0c507bb

Browse files
committed
Refactor setup.sh and benchmark.sh
1 parent ae91653 commit 0c507bb

File tree

48 files changed

+214
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+214
-189
lines changed

aura-2.0/_benchmark/hello_world.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/web/index.php/hello/index"

aura-2.0/_benchmark/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
composer install --no-dev --optimize-autoloader
4+
chmod o+w tmp/cache/ tmp/log/

bear-0.10/_benchmark/hello_world.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/var/www/index.php/hello"

bear-0.10/_benchmark/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
composer install --no-dev --optimize-autoloader
4+
chmod o+w var/tmp/ var/log/

bear-1.0/_benchmark/hello_world.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/var/www/index.php/hello"

bear-1.0/_benchmark/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
composer install --no-dev --optimize-autoloader
4+
chmod o+w var/tmp/ var/log/

benchmark.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
base="http://127.0.0.1/php-framework-benchmark"
44

55
cd `dirname $0`
6+
7+
if [ $# -eq 0 ]; then
8+
# include framework list
9+
. ./list.sh
10+
export targets="$list"
11+
else
12+
export targets="$@"
13+
fi
14+
615
cd benchmarks
716

817
sh hello_world.sh "$base"

benchmarks/hello_world.sh

Lines changed: 8 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -18,95 +18,13 @@ mv "$check_file" "$check_file.old"
1818
mv "$error_file" "$error_file.old"
1919
mv "$url_file" "$url_file.old"
2020

21-
22-
:<<'#COMMENT'
23-
fw="no-framework"
24-
url="$base/$fw/index.php"
25-
benchmark "$fw" "$url"
26-
#COMMENT
27-
28-
#fw="phalcon-1.3"
29-
#url="$base/$fw/public/index.php?_url=/hello/index"
30-
#benchmark "$fw" "$url"
31-
32-
fw="phalcon-2.0"
33-
url="$base/$fw/public/index.php?_url=/hello/index"
34-
benchmark "$fw" "$url"
35-
36-
fw="ice-1.0"
37-
url="$base/$fw/public/index.php?_url=/hello/index"
38-
benchmark "$fw" "$url"
39-
40-
fw="slim-2.6"
41-
url="$base/$fw/index.php/hello/index"
42-
benchmark "$fw" "$url"
43-
44-
fw="codeigniter-3.0"
45-
url="$base/$fw/index.php/hello/index"
46-
benchmark "$fw" "$url"
47-
48-
fw="lumen-5.0"
49-
url="$base/$fw/public/index.php/hello/index"
50-
benchmark "$fw" "$url"
51-
52-
fw="yii-2.0"
53-
url="$base/$fw/web/index.php?r=hello/index"
54-
benchmark "$fw" "$url"
55-
56-
fw="silex-1.2"
57-
url="$base/$fw/web/index.php/hello/index"
58-
benchmark "$fw" "$url"
59-
60-
fw="cygnite-1.3"
61-
url="$base/$fw/index.php/hello/index"
62-
benchmark "$fw" "$url"
63-
64-
fw="bear-1.0"
65-
url="$base/$fw/var/www/index.php/hello"
66-
benchmark "$fw" "$url"
67-
68-
fw="fuel-1.8-dev"
69-
url="$base/$fw/public/index.php/hello/index"
70-
benchmark "$fw" "$url"
71-
72-
fw="cake-3.0"
73-
url="$base/$fw/index.php/hello/index"
74-
benchmark "$fw" "$url"
75-
76-
fw="aura-2.0"
77-
url="$base/$fw/web/index.php/hello/index"
78-
benchmark "$fw" "$url"
79-
80-
#fw="bear-0.10"
81-
#url="$base/$fw/var/www/index.php/hello"
82-
#benchmark "$fw" "$url"
83-
84-
#fw="symfony-2.5"
85-
#url="$base/$fw/web/app.php/hello/index"
86-
#benchmark "$fw" "$url"
87-
88-
fw="symfony-2.6"
89-
url="$base/$fw/web/app.php/hello/index"
90-
benchmark "$fw" "$url"
91-
92-
#fw="laravel-4.2"
93-
#url="$base/$fw/public/index.php/hello/index"
94-
#benchmark "$fw" "$url"
95-
96-
fw="laravel-5.0"
97-
url="$base/$fw/public/index.php/hello/index"
98-
benchmark "$fw" "$url"
99-
100-
#fw="fuel-2.0-dev"
101-
#url="$base/$fw/public/index.php/hello/index"
102-
#benchmark "$fw" "$url"
103-
104-
fw="zf-2.4"
105-
url="$base/$fw/public/index.php/application/hello/index"
106-
benchmark "$fw" "$url"
107-
108-
fw="typo3-flow-2.3"
109-
url="$base/$fw/Web/index.php/flow/benchmark"
110-
benchmark "$fw" "$url"
21+
for fw in `echo $targets`
22+
do
23+
if [ -d "$fw" ]; then
24+
echo "$fw"
25+
. "$fw/_benchmark/hello_world.sh"
26+
benchmark "$fw" "$url"
27+
fi
28+
done
11129

11230
cat "$error_file"

cake-3.0/_benchmark/hello_world.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/index.php/hello/index"

cake-3.0/_benchmark/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
sudo rm -rf tmp/*
4+
COMPOSER_PROCESS_TIMEOUT=3600 composer install --no-dev --optimize-autoloader

0 commit comments

Comments
 (0)