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

+3
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

+4
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

+3
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

+4
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

+3
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

+4
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

+9
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

+8-90
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

+3
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

+4
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/index.php/hello/index"

codeigniter-3.0/_benchmark/setup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/sh

cygnite-1.3/_benchmark/hello_world.sh

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

cygnite-1.3/_benchmark/setup.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
composer install --no-dev --optimize-autoloader
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/public/index.php/hello/index"

fuel-1.8-dev/_benchmark/setup.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
composer install --prefer-source --no-dev --optimize-autoloader
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/public/index.php/hello/index"

fuel-2.0-dev/_benchmark/setup.sh

+4
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 components/demo/cache/ components/demo/logs/

ice-1.0/_benchmark/hello_world.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/public/index.php?_url=/hello/index"

ice-1.0/_benchmark/setup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/sh

laravel-4.2/_benchmark/hello_world.sh

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

laravel-4.2/_benchmark/setup.sh

+4
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 app/storage/*

laravel-5.0/_benchmark/hello_world.sh

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

laravel-5.0/_benchmark/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
composer install --no-dev --optimize-autoloader
4+
chmod o+w storage/*
5+
sudo chmod o+w storage/framework/*
6+
php artisan optimize --force
7+
php artisan config:cache
8+
php artisan route:cache

list.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
list="
4+
#no-framework
5+
#phalcon-1.3
6+
phalcon-2.0
7+
ice-1.0
8+
slim-2.6
9+
codeigniter-3.0
10+
lumen-5.0
11+
yii-2.0
12+
silex-1.2
13+
cygnite-1.3
14+
bear-1.0
15+
fuel-1.8-dev
16+
cake-3.0
17+
aura-2.0
18+
#bear-0.10
19+
#symfony-2.5
20+
symfony-2.6
21+
#laravel-4.2
22+
laravel-5.0
23+
#fuel-2.0-dev
24+
zf-2.4
25+
typo3-flow-2.3
26+
"

lumen-5.0/_benchmark/hello_world.sh

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

lumen-5.0/_benchmark/setup.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
composer install --no-dev --optimize-autoloader
4+
chmod o+w storage/*
5+
chmod o+w storage/framework/*
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/index.php"

no-framework/_benchmark/setup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/sh

phalcon-1.3/_benchmark/hello_world.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/public/index.php?_url=/hello/index"

phalcon-1.3/_benchmark/setup.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
chmod o+w app/cache/

phalcon-2.0/_benchmark/hello_world.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
url="$base/$fw/public/index.php?_url=/hello/index"

phalcon-2.0/_benchmark/setup.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
chmod o+w app/cache/

setup.sh

+16-99
Original file line numberDiff line numberDiff line change
@@ -15,103 +15,20 @@ if [ ! `which curl` ]; then
1515
exit 1;
1616
fi
1717

18-
# Yii 2.0 requires composer-asset-plugin
19-
composer global require "fxp/composer-asset-plugin:1.0.0-beta3"
20-
21-
cd yii-2.0
22-
basename `pwd`
23-
composer install --no-dev --optimize-autoloader
24-
chmod o+w assets/ runtime/ web/assets/
25-
26-
cd ../fuel-1.8-dev
27-
basename `pwd`
28-
composer install --prefer-source --no-dev --optimize-autoloader
29-
30-
cd ../laravel-4.2
31-
basename `pwd`
32-
composer install --no-dev --optimize-autoloader
33-
chmod o+w app/storage/*
34-
35-
cd ../cake-3.0
36-
basename `pwd`
37-
sudo rm -rf tmp/*
38-
COMPOSER_PROCESS_TIMEOUT=3600 composer install --no-dev --optimize-autoloader
39-
40-
cd ../symfony-2.5
41-
basename `pwd`
42-
export SYMFONY_ENV=prod
43-
composer install --no-dev --optimize-autoloader
44-
php app/console cache:clear --env=prod --no-debug
45-
chmod o+w app/cache/ app/logs/
46-
chmod -R o+w app/cache/*
47-
48-
cd ../symfony-2.6
49-
basename `pwd`
50-
export SYMFONY_ENV=prod
51-
composer install --no-dev --optimize-autoloader
52-
php app/console cache:clear --env=prod --no-debug
53-
chmod o+w app/cache/ app/logs/
54-
chmod -R o+w app/cache/*
55-
56-
cd ../phalcon-1.3
57-
basename `pwd`
58-
chmod o+w app/cache/
59-
60-
cd ../bear-0.10
61-
basename `pwd`
62-
composer install --no-dev --optimize-autoloader
63-
chmod o+w var/tmp/ var/log/
64-
65-
cd ../bear-1.0
66-
basename `pwd`
67-
composer install --no-dev --optimize-autoloader
68-
chmod o+w var/tmp/ var/log/
69-
70-
cd ../laravel-5.0
71-
basename `pwd`
72-
composer install --no-dev --optimize-autoloader
73-
chmod o+w storage/*
74-
sudo chmod o+w storage/framework/*
75-
php artisan optimize --force
76-
php artisan config:cache
77-
php artisan route:cache
78-
79-
cd ../fuel-2.0-dev
80-
basename `pwd`
81-
composer install --no-dev --optimize-autoloader
82-
chmod o+w components/demo/cache/ components/demo/logs/
83-
84-
cd ../silex-1.2
85-
basename `pwd`
86-
composer install --no-dev --optimize-autoloader
87-
88-
cd ../slim-2.6
89-
basename `pwd`
90-
composer install --no-dev --optimize-autoloader
91-
92-
cd ../zf-2.4
93-
basename `pwd`
94-
composer install --no-dev --optimize-autoloader
95-
chmod o+w data/cache/
96-
97-
cd ../typo3-flow-2.3
98-
basename `pwd`
99-
export FLOW_CONTEXT=Production
100-
composer install --no-dev --optimize-autoloader
101-
./flow flow:cache:warmup
102-
sed -i -e "s/{ exit(); }/{ printf(\"\\\n%' 8d:%f\", memory_get_peak_usage(true), microtime(true) - \$_SERVER['REQUEST_TIME_FLOAT']); exit(); }/" Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Http/RequestHandler.php
103-
104-
cd ../lumen-5.0
105-
basename `pwd`
106-
composer install --no-dev --optimize-autoloader
107-
chmod o+w storage/*
108-
chmod o+w storage/framework/*
109-
110-
cd ../aura-2.0
111-
basename `pwd`
112-
composer install --no-dev --optimize-autoloader
113-
chmod o+w tmp/cache/ tmp/log/
18+
if [ $# -eq 0 ]; then
19+
# include framework list
20+
. ./list.sh
21+
targets="$list"
22+
else
23+
targets="$@"
24+
fi
11425

115-
cd ../cygnite-1.3
116-
basename `pwd`
117-
composer install --no-dev --optimize-autoloader
26+
for fw in $targets
27+
do
28+
if [ -d "$fw" ]; then
29+
echo "$fw"
30+
cd "$fw"
31+
. "_benchmark/setup.sh"
32+
cd ..
33+
fi
34+
done

silex-1.2/_benchmark/hello_world.sh

+3
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"

0 commit comments

Comments
 (0)