فهرست منبع

Merging master fixes into round-14 (#2254)

Nate 9 سال پیش
والد
کامیت
c829d7ef61
100فایلهای تغییر یافته به همراه515 افزوده شده و 2382 حذف شده
  1. 16 0
      .github/PULL_REQUEST_TEMPLATE.md
  2. 3 0
      .gitignore
  3. 2 2
      .travis.yml
  4. 0 2
      config/create-postgres-database.sql
  5. 0 29
      config/create-postgres-old.sql
  6. 0 29
      config/create-postgres-upper-quote.sql
  7. 4 0
      config/create-postgres.sql
  8. 2 53
      config/create.sql
  9. 1 1
      config/travis_setup.sh
  10. 1 1
      frameworks/C++/silicon/CMakeLists.txt
  11. 1 1
      frameworks/C++/silicon/setup_lwan_mysql.sh
  12. 1 1
      frameworks/C++/silicon/setup_mhd_epoll_mysql.sh
  13. 1 1
      frameworks/C++/silicon/setup_mhd_tpc_mysql.sh
  14. 3 3
      frameworks/CSharp/aspnetcore/benchmark_config.json
  15. 1 1
      frameworks/CSharp/aspnetcore/run-linux.sh
  16. 1 1
      frameworks/CSharp/aspnetcore/run-windows.ps1
  17. 17 4
      frameworks/CSharp/revenj/Revenj.Bench/RestService.cs
  18. 3 3
      frameworks/Clojure/pedestal/project.clj
  19. 62 76
      frameworks/Clojure/pedestal/src/pedestal/service.clj
  20. 1 1
      frameworks/Elixir/phoenix/lib/hello/repo.ex
  21. 6 7
      frameworks/Elixir/phoenix/mix.exs
  22. 3 2
      frameworks/Elixir/phoenix/setup.sh
  23. 30 10
      frameworks/Elixir/phoenix/web/controllers/page_controller.ex
  24. 3 3
      frameworks/Elixir/phoenix/web/models/fortune.ex
  25. 3 3
      frameworks/Elixir/phoenix/web/models/world.ex
  26. 1 1
      frameworks/Elixir/phoenix/web/templates/layout/app.html.eex
  27. 10 6
      frameworks/Elixir/phoenix/web/web.ex
  28. 0 8
      frameworks/Erlang/misultin/.gitignore
  29. 0 13
      frameworks/Erlang/misultin/Makefile
  30. 0 23
      frameworks/Erlang/misultin/benchmark_config.json
  31. 0 9
      frameworks/Erlang/misultin/priv/app.config
  32. 0 5
      frameworks/Erlang/misultin/rebar.config
  33. 0 11
      frameworks/Erlang/misultin/setup.sh
  34. 0 9
      frameworks/Erlang/misultin/src/misultin_bench.app.src
  35. 0 16
      frameworks/Erlang/misultin/src/misultin_bench_app.erl
  36. 0 18
      frameworks/Erlang/misultin/src/misultin_bench_sup.erl
  37. 0 53
      frameworks/Erlang/misultin/src/web_handler.erl
  38. 0 7
      frameworks/Erlang/misultin/start-dev.sh
  39. 8 5
      frameworks/Haskell/servant/driver/Main.hs
  40. 1 1
      frameworks/Haskell/servant/servant-bench.cabal
  41. 1 1
      frameworks/Haskell/servant/setup.sh
  42. 10 0
      frameworks/Haskell/yesod-postgres/.gitignore
  43. 9 0
      frameworks/Haskell/yesod-postgres/README.md
  44. 43 0
      frameworks/Haskell/yesod-postgres/bench/bench.cabal
  45. 194 0
      frameworks/Haskell/yesod-postgres/bench/src/Main.hs
  46. 5 0
      frameworks/Haskell/yesod-postgres/bench/stack.yaml
  47. 28 0
      frameworks/Haskell/yesod-postgres/benchmark_config.json
  48. 9 0
      frameworks/Haskell/yesod-postgres/setup.sh
  49. 2 0
      frameworks/Haskell/yesod-postgres/source_code
  50. 4 4
      frameworks/Java/curacao/pom.xml
  51. 1 1
      frameworks/Java/curacao/src/main/resources/application.conf
  52. 1 1
      frameworks/Java/rapidoid/benchmark_config.json
  53. 2 2
      frameworks/Java/revenj/pom.xml
  54. 11 1
      frameworks/Java/revenj/src/main/java/hello/Context.java
  55. 1 1
      frameworks/Java/revenj/src/main/java/hello/QueriesServlet.java
  56. 1 1
      frameworks/Java/revenj/src/main/java/hello/UpdatesServlet.java
  57. 6 6
      frameworks/JavaScript/nodejs/README.md
  58. 0 21
      frameworks/JavaScript/ringojs/benchmark_config.json
  59. 1 1
      frameworks/PHP/clancats/setup.sh
  60. 1 1
      frameworks/PHP/lumen/setup.sh
  61. 0 10
      frameworks/PHP/micromvc/.gitignore
  62. 0 92
      frameworks/PHP/micromvc/Bootstrap.php
  63. 0 41
      frameworks/PHP/micromvc/CLI
  64. 0 28
      frameworks/PHP/micromvc/Class/Controller/Benchmark/Db.php
  65. 0 14
      frameworks/PHP/micromvc/Class/Controller/Benchmark/Json.php
  66. 0 21
      frameworks/PHP/micromvc/Class/Controller/Index.php
  67. 0 19
      frameworks/PHP/micromvc/Class/Controller/Page404.php
  68. 0 153
      frameworks/PHP/micromvc/Class/Controller/School.php
  69. 0 8
      frameworks/PHP/micromvc/Class/Model/Benchmark/World.php
  70. 0 22
      frameworks/PHP/micromvc/Class/Model/Car.php
  71. 0 28
      frameworks/PHP/micromvc/Class/Model/Club.php
  72. 0 22
      frameworks/PHP/micromvc/Class/Model/Dorm.php
  73. 0 22
      frameworks/PHP/micromvc/Class/Model/Membership.php
  74. 0 34
      frameworks/PHP/micromvc/Class/Model/Student.php
  75. 0 80
      frameworks/PHP/micromvc/Class/MyController.php
  76. 0 25
      frameworks/PHP/micromvc/Command/Backup.php
  77. 0 25
      frameworks/PHP/micromvc/Command/Create.php
  78. 0 25
      frameworks/PHP/micromvc/Command/Restore.php
  79. 0 27
      frameworks/PHP/micromvc/Command/Run.php
  80. 0 521
      frameworks/PHP/micromvc/Common.php
  81. 0 73
      frameworks/PHP/micromvc/Config/Config.php
  82. 0 36
      frameworks/PHP/micromvc/Config/Route.php
  83. 0 29
      frameworks/PHP/micromvc/Config/Sample.Migration.php
  84. 0 0
      frameworks/PHP/micromvc/Locale/.gitignore
  85. 0 51
      frameworks/PHP/micromvc/Public/.htaccess
  86. 0 212
      frameworks/PHP/micromvc/Public/Admin/CSS/admin.css
  87. 0 90
      frameworks/PHP/micromvc/Public/Admin/CSS/base.css
  88. 0 37
      frameworks/PHP/micromvc/Public/Admin/CSS/style.css
  89. BIN
      frameworks/PHP/micromvc/Public/Admin/Images/bullet_arrow_down.png
  90. BIN
      frameworks/PHP/micromvc/Public/Admin/Images/bullet_arrow_up.png
  91. BIN
      frameworks/PHP/micromvc/Public/Admin/Images/error.png
  92. 0 1
      frameworks/PHP/micromvc/Public/Admin/Images/famfamfam.com
  93. BIN
      frameworks/PHP/micromvc/Public/Admin/Images/message.png
  94. BIN
      frameworks/PHP/micromvc/Public/Admin/Images/success.png
  95. BIN
      frameworks/PHP/micromvc/Public/Admin/Images/warning.png
  96. 0 89
      frameworks/PHP/micromvc/Public/CSS/base.css
  97. 0 86
      frameworks/PHP/micromvc/Public/CSS/style.css
  98. BIN
      frameworks/PHP/micromvc/Public/Images/error.png
  99. 0 1
      frameworks/PHP/micromvc/Public/Images/famfamfam.com.txt
  100. BIN
      frameworks/PHP/micromvc/Public/Images/message.png

+ 16 - 0
.github/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,16 @@
+....................................
+
+MAKE SURE YOU ARE OPENING A PULL 
+REQUEST AGAINST THE CORRECT BRANCH
+
+....................................
+
+master = bug fixes directly 
+addressing the current preview round
+
+round-X = new features, frameworks, 
+tests, and any other larger changes 
+that you would like to see in the 
+next round
+
+....................................

+ 3 - 0
.gitignore

@@ -83,3 +83,6 @@ nimcache
 # crystal
 .crystal
 *.out
+
+#don't ignore merge request templates
+!.github/

+ 2 - 2
.travis.yml

@@ -55,7 +55,6 @@ env:
     - "TESTDIR=Erlang/cowboy"
     - "TESTDIR=Erlang/elli"
     - "TESTDIR=Erlang/mochiweb"
-    - "TESTDIR=Erlang/misultin"
     - "TESTDIR=Go/beego"
     - "TESTDIR=Go/echo"
     - "TESTDIR=Go/falcore"
@@ -69,6 +68,7 @@ env:
     - "TESTDIR=Haskell/snap"
     - "TESTDIR=Haskell/wai"
     - "TESTDIR=Haskell/yesod"
+    - "TESTDIR=Haskell/yesod-postgres"
     - "TESTDIR=Haskell/servant"
     - "TESTDIR=Haskell/spock"
     - "TESTDIR=Java/activeweb"
@@ -140,7 +140,6 @@ env:
     - "TESTDIR=PHP/limonade"
     - "TESTDIR=PHP/lithium"
     - "TESTDIR=PHP/lumen"
-    - "TESTDIR=PHP/micromvc"
     - "TESTDIR=PHP/phalcon"
     - "TESTDIR=PHP/phalcon-micro"
     - "TESTDIR=PHP/phpixie"
@@ -212,6 +211,7 @@ before_install:
 services:
   - postgresql
   - redis-server
+  - mongodb
 
 addons:
   postgresql: "9.3"

+ 0 - 2
config/create-postgres-database.sql

@@ -2,5 +2,3 @@ CREATE USER benchmarkdbuser WITH PASSWORD 'benchmarkdbpass';
 
 DROP DATABASE IF EXISTS hello_world;
 CREATE DATABASE hello_world WITH ENCODING 'UTF8';
-
-GRANT ALL PRIVILEGES ON DATABASE hello_world to benchmarkdbuser;

+ 0 - 29
config/create-postgres-old.sql

@@ -1,29 +0,0 @@
-DROP TABLE IF EXISTS World;
-CREATE TABLE  "World" (
-  id integer NOT NULL,
-  randomNumber integer NOT NULL default 0,
-  PRIMARY KEY  (id)
-);
-
-INSERT INTO "World" (id, randomNumber)
-SELECT x.id, random() * 10000 + 1 FROM generate_series(1,10000) as x(id);
-
-DROP TABLE IF EXISTS Fortune;
-CREATE TABLE  "Fortune" (
-  id integer NOT NULL,
-  message varchar(2048) NOT NULL,
-  PRIMARY KEY  (id)
-);
-
-INSERT INTO fortune (id, message) VALUES (1, 'fortune: No such file or directory');
-INSERT INTO fortune (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');
-INSERT INTO fortune (id, message) VALUES (3, 'After enough decimal places, nobody gives a damn.');
-INSERT INTO fortune (id, message) VALUES (4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
-INSERT INTO fortune (id, message) VALUES (5, 'A computer program does what you tell it to do, not what you want it to do.');
-INSERT INTO fortune (id, message) VALUES (6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
-INSERT INTO fortune (id, message) VALUES (7, 'Any program that runs right is obsolete.');
-INSERT INTO fortune (id, message) VALUES (8, 'A list is only as strong as its weakest link. — Donald Knuth');
-INSERT INTO fortune (id, message) VALUES (9, 'Feature: A bug with seniority.');
-INSERT INTO fortune (id, message) VALUES (10, 'Computers make very fast, very accurate mistakes.');
-INSERT INTO fortune (id, message) VALUES (11, '<script>alert("This should not be displayed in a browser alert box.");</script>');
-INSERT INTO fortune (id, message) VALUES (12, 'フレームワークのベンチマーク');

+ 0 - 29
config/create-postgres-upper-quote.sql

@@ -1,29 +0,0 @@
-DROP TABLE IF EXISTS "World";
-CREATE TABLE  "World" (
-  id integer NOT NULL,
-  randomNumber integer NOT NULL default 0,
-  PRIMARY KEY  (id)
-);
-
-INSERT INTO "World" (id, randomNumber)
-SELECT x.id, random() * 10000 + 1 FROM generate_series(1,10000) as x(id);
-
-DROP TABLE IF EXISTS "Fortune";
-CREATE TABLE "Fortune" (
-  id integer NOT NULL,
-  message varchar(2048) NOT NULL,
-  PRIMARY KEY  (id)
-);
-
-INSERT INTO "Fortune" (id, message) VALUES (1, 'fortune: No such file or directory');
-INSERT INTO "Fortune" (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');
-INSERT INTO "Fortune" (id, message) VALUES (3, 'After enough decimal places, nobody gives a damn.');
-INSERT INTO "Fortune" (id, message) VALUES (4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
-INSERT INTO "Fortune" (id, message) VALUES (5, 'A computer program does what you tell it to do, not what you want it to do.');
-INSERT INTO "Fortune" (id, message) VALUES (6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
-INSERT INTO "Fortune" (id, message) VALUES (7, 'Any program that runs right is obsolete.');
-INSERT INTO "Fortune" (id, message) VALUES (8, 'A list is only as strong as its weakest link. — Donald Knuth');
-INSERT INTO "Fortune" (id, message) VALUES (9, 'Feature: A bug with seniority.');
-INSERT INTO "Fortune" (id, message) VALUES (10, 'Computers make very fast, very accurate mistakes.');
-INSERT INTO "Fortune" (id, message) VALUES (11, '<script>alert("This should not be displayed in a browser alert box.");</script>');
-INSERT INTO "Fortune" (id, message) VALUES (12, 'フレームワークのベンチマーク');

+ 4 - 0
config/create-postgres.sql

@@ -5,6 +5,7 @@ CREATE TABLE  World (
   randomNumber integer NOT NULL default 0,
   PRIMARY KEY  (id)
 );
+GRANT SELECT, UPDATE ON World to benchmarkdbuser;
 
 INSERT INTO World (id, randomnumber)
 SELECT x.id, random() * 10000 + 1 FROM generate_series(1,10000) as x(id);
@@ -15,6 +16,7 @@ CREATE TABLE Fortune (
   message varchar(2048) NOT NULL,
   PRIMARY KEY  (id)
 );
+GRANT SELECT ON Fortune to benchmarkdbuser;
 
 INSERT INTO Fortune (id, message) VALUES (1, 'fortune: No such file or directory');
 INSERT INTO Fortune (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');
@@ -36,6 +38,7 @@ CREATE TABLE  "World" (
   randomNumber integer NOT NULL default 0,
   PRIMARY KEY  (id)
 );
+GRANT SELECT, UPDATE ON "World" to benchmarkdbuser;
 
 INSERT INTO "World" (id, randomnumber)
 SELECT x.id, random() * 10000 + 1 FROM generate_series(1,10000) as x(id);
@@ -46,6 +49,7 @@ CREATE TABLE "Fortune" (
   message varchar(2048) NOT NULL,
   PRIMARY KEY  (id)
 );
+GRANT SELECT ON "Fortune" to benchmarkdbuser;
 
 INSERT INTO "Fortune" (id, message) VALUES (1, 'fortune: No such file or directory');
 INSERT INTO "Fortune" (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');

+ 2 - 53
config/create.sql

@@ -3,59 +3,6 @@ DROP DATABASE IF EXISTS hello_world;
 CREATE DATABASE hello_world;
 USE hello_world;
 
-DROP TABLE IF EXISTS World;
-CREATE TABLE  World (
-  id int(10) unsigned NOT NULL auto_increment,
-  randomNumber int NOT NULL default 0,
-  PRIMARY KEY  (id)
-)
-ENGINE=INNODB;
-GRANT ALL ON hello_world.world TO 'benchmarkdbuser'@'%' IDENTIFIED BY 'benchmarkdbpass';
-GRANT ALL ON hello_world.world TO 'benchmarkdbuser'@'localhost' IDENTIFIED BY 'benchmarkdbpass';
-
-DROP PROCEDURE IF EXISTS load_data;
-
-DELIMITER #
-CREATE PROCEDURE load_data()
-BEGIN
-
-declare v_max int unsigned default 10000;
-declare v_counter int unsigned default 0;
-
-  TRUNCATE TABLE World;
-  START TRANSACTION;
-  while v_counter < v_max do
-    INSERT INTO World (randomNumber) VALUES ( floor(0 + (rand() * 10000)) );
-    SET v_counter=v_counter+1;
-  end while;
-  commit;
-END #
-
-DELIMITER ;
-
-CALL load_data();
-
-DROP TABLE IF EXISTS Fortune;
-CREATE TABLE  Fortune (
-  id int(10) unsigned NOT NULL auto_increment,
-  message varchar(2048) CHARACTER SET 'utf8' NOT NULL,
-  PRIMARY KEY  (id)
-)
-ENGINE=INNODB;
-
-INSERT INTO Fortune (message) VALUES ('fortune: No such file or directory');
-INSERT INTO Fortune (message) VALUES ('A computer scientist is someone who fixes things that aren''t broken.');
-INSERT INTO Fortune (message) VALUES ('After enough decimal places, nobody gives a damn.');
-INSERT INTO Fortune (message) VALUES ('A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
-INSERT INTO Fortune (message) VALUES ('A computer program does what you tell it to do, not what you want it to do.');
-INSERT INTO Fortune (message) VALUES ('Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
-INSERT INTO Fortune (message) VALUES ('Any program that runs right is obsolete.');
-INSERT INTO Fortune (message) VALUES ('A list is only as strong as its weakest link. — Donald Knuth');
-INSERT INTO Fortune (message) VALUES ('Feature: A bug with seniority.');
-INSERT INTO Fortune (message) VALUES ('Computers make very fast, very accurate mistakes.');
-INSERT INTO Fortune (message) VALUES ('<script>alert("This should not be displayed in a browser alert box.");</script>');
-INSERT INTO Fortune (message) VALUES ('フレームワークのベンチマーク');
-
 DROP TABLE IF EXISTS world;
 CREATE TABLE  world (
   id int(10) unsigned NOT NULL auto_increment,
@@ -63,6 +10,8 @@ CREATE TABLE  world (
   PRIMARY KEY  (id)
 )
 ENGINE=INNODB;
+GRANT SELECT, UPDATE ON hello_world.world TO 'benchmarkdbuser'@'%' IDENTIFIED BY 'benchmarkdbpass';
+GRANT SELECT, UPDATE ON hello_world.world TO 'benchmarkdbuser'@'localhost' IDENTIFIED BY 'benchmarkdbpass';
 
 DROP PROCEDURE IF EXISTS load_data;
 

+ 1 - 1
config/travis_setup.sh

@@ -83,7 +83,7 @@ echo "Populating Postgres database"
 psql --version
 sudo useradd benchmarkdbuser -p benchmarkdbpass
 sudo -u postgres psql template1 < config/create-postgres-database.sql
-sudo -u benchmarkdbuser psql hello_world < config/create-postgres.sql
+sudo -u postgres psql hello_world < config/create-postgres.sql
 sudo sed -i "s|#listen_addresses = 'localhost'|listen_addresses = '*'|g" /etc/postgresql/9.3/main/postgresql.conf
 sudo sed -i 's|max_connections = 255|max_connections = 500|g' /etc/postgresql/9.3/main/postgresql.conf
 sudo service postgresql stop

+ 1 - 1
frameworks/C++/silicon/CMakeLists.txt

@@ -16,4 +16,4 @@ set_target_properties(silicon_epoll_mysql PROPERTIES COMPILE_FLAGS "-DTFB_USE_EP
 target_link_libraries(silicon_epoll_mysql microhttpd mysqlclient)
 
 add_executable(silicon_lwan_mysql techempower_lwan.cc)
-target_link_libraries(silicon_lwan_mysql mysqlclient lwan-common curl z pthread dl)
+target_link_libraries(silicon_lwan_mysql mysqlclient lwan curl z pthread dl luajit-5.1)

+ 1 - 1
frameworks/C++/silicon/setup_lwan_mysql.sh

@@ -5,7 +5,7 @@ fw_depends silicon lwan
 rm -rf build
 mkdir build
 cd build
-cmake .. -DCMAKE_CXX_COMPILER=clang++-3.5
+cmake .. -DCMAKE_CXX_COMPILER=clang++-3.8
 make silicon_lwan_mysql
 
 $TROOT/build/silicon_lwan_mysql ${DBHOST} 8080 &

+ 1 - 1
frameworks/C++/silicon/setup_mhd_epoll_mysql.sh

@@ -5,7 +5,7 @@ fw_depends silicon microhttpd
 rm -rf build
 mkdir build
 cd build
-cmake .. -DCMAKE_CXX_COMPILER=clang++-3.5
+cmake .. -DCMAKE_CXX_COMPILER=clang++-3.8
 make silicon_epoll_mysql
 
 $TROOT/build/silicon_epoll_mysql ${DBHOST} 8080 ${MAX_THREADS} &

+ 1 - 1
frameworks/C++/silicon/setup_mhd_tpc_mysql.sh

@@ -5,7 +5,7 @@ fw_depends silicon microhttpd
 rm -rf build
 mkdir build
 cd build
-cmake .. -DCMAKE_CXX_COMPILER=clang++-3.5
+cmake .. -DCMAKE_CXX_COMPILER=clang++-3.8
 make silicon_tpc_mysql
 
 $TROOT/build/silicon_tpc_mysql ${DBHOST} 8080 ${MAX_THREADS} &

+ 3 - 3
frameworks/CSharp/aspnetcore/benchmark_config.json

@@ -7,7 +7,7 @@
       "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
-      "classification": "Fullstack",
+      "classification": "Micro",
       "database": "None",
       "framework": "aspnetcore",
       "language": "C#",
@@ -45,7 +45,7 @@
       "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
-      "classification": "Fullstack",
+      "classification": "Micro",
       "database": "None",
       "framework": "aspnetcore",
       "language": "C#",
@@ -83,7 +83,7 @@
       "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
-      "classification": "Fullstack",
+      "classification": "Micro",
       "database": "None",
       "framework": "aspnetcore",
       "language": "C#",

+ 1 - 1
frameworks/CSharp/aspnetcore/run-linux.sh

@@ -5,4 +5,4 @@ sudo apt-get install unzip libunwind8 -y
 cd Benchmarks
 dotnet restore
 dotnet build -c Release -f netcoreapp1.0
-dotnet run -c Release server.urls=http://*:8080 scenarios=$1 server=kestrel threadCount=8 NonInteractive=true &
+dotnet run -c Release server.urls=http://*:8080 scenarios=$1 server=kestrel threadCount=1 NonInteractive=true &

+ 1 - 1
frameworks/CSharp/aspnetcore/run-windows.ps1

@@ -5,4 +5,4 @@ $scenarios = (-split $scenarios) -join ","
 cd Benchmarks
 dotnet restore
 dotnet build -c Release -f netcoreapp1.0
-Start-Process -NoNewWindow dotnet "run -c Release server.urls=http://*:8080 server=$server threadCount=8 NonInteractive=true scenarios=$scenarios"
+Start-Process -NoNewWindow dotnet "run -c Release server.urls=http://*:8080 server=$server threadCount=1 NonInteractive=true scenarios=$scenarios"

+ 17 - 4
frameworks/CSharp/revenj/Revenj.Bench/RestService.cs

@@ -98,7 +98,8 @@ namespace Revenj.Bench
 			return ReturnJSON(world, ctx.Stream);
 		}
 
-		private void LoadWorlds(int repeat, Context ctx)
+		/* bulk loading of worlds. use such pattern for production code */
+		private void LoadWorldsFast(int repeat, Context ctx)
 		{
 			var reader = ctx.BulkReader;
 			var lazyResult = ctx.LazyWorlds;
@@ -114,6 +115,18 @@ namespace Revenj.Bench
 				worlds[i] = lazyResult[i].Value;
 		}
 
+		/* multiple roundtrips loading of worlds. don't write such production code */
+		private void LoadWorldsSlow(int repeat, Context ctx)
+		{
+			var worlds = ctx.Worlds;
+			var repository = ctx.WorldRepository;
+			for (int i = 0; i < repeat; i++)
+			{
+				var id = Random.Next(10000) + 1;
+				worlds[i] = repository.Find(IDs[id]);
+			}
+		}
+
 		public Stream MultipleQueries(string count)
 		{
 			int repeat;
@@ -121,7 +134,7 @@ namespace Revenj.Bench
 			if (repeat < 1) repeat = 1;
 			else if (repeat > 500) repeat = 500;
 			var ctx = GetContext(Services);
-			LoadWorlds(repeat, ctx);
+			LoadWorldsSlow(repeat, ctx);
 			var cms = ctx.Stream;
 			ctx.Worlds.Serialize(cms, repeat);
 			ThreadContext.Response.ContentType = "application/json";
@@ -137,7 +150,7 @@ namespace Revenj.Bench
 			if (repeat < 1) repeat = 1;
 			else if (repeat > 500) repeat = 500;
 			var ctx = GetContext(Services);
-			LoadWorlds(repeat, ctx);
+			LoadWorldsSlow(repeat, ctx);
 			var result = new World[repeat];
 			Array.Copy(ctx.Worlds, result, repeat);
 			for (int i = 0; i < result.Length; i++)
@@ -169,6 +182,6 @@ namespace Revenj.Bench
 			cms.Position = 0;
 			ThreadContext.Response.ContentType = "text/html; charset=UTF-8";
 			return cms;
-	}
+		}
 	}
 }

+ 3 - 3
frameworks/Clojure/pedestal/project.clj

@@ -4,15 +4,15 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.8.0"]
-                 [io.pedestal/pedestal.service "0.4.1"]
-                 [io.pedestal/pedestal.jetty "0.4.1"]
+                 [io.pedestal/pedestal.service "0.5.0"]
+                 [io.pedestal/pedestal.jetty "0.5.0"]
                  [ch.qos.logback/logback-classic "1.1.2" :exclusions [org.slf4j/slf4j-api]]
                  [org.slf4j/jul-to-slf4j "1.7.7"]
                  [org.slf4j/jcl-over-slf4j "1.7.7"]
                  [org.slf4j/log4j-over-slf4j "1.7.7"]
                  [org.clojure/data.json "0.2.6"]
                  [org.clojure/java.jdbc "0.4.2"]
-                 [korma "0.4.0"]
+                 [korma "0.4.2"]
                  [mysql/mysql-connector-java "5.1.38"]
                  [hiccup "1.0.5"]]
   :min-lein-version "2.0.0"

+ 62 - 76
frameworks/Clojure/pedestal/src/pedestal/service.clj

@@ -13,19 +13,26 @@
             [clojure.data.json :as json]
             [clojure.java.jdbc :as jdbc]))
 
-
-(defn json-serialization
-  "Test 1: JSON serialization"
+(defn sanitize-queries-param
+  "Sanitizes the `queries` parameter. Clamps the value between 1 and 500.
+  Invalid (string) values become 1."
   [request]
-  (bootstrap/json-response {:message "Hello, World!"}))
-
-
-;; MySQL connection
-(defdb mysql-db
+  (let [queries (-> request
+                    :params
+                    :queries)
+        n (try (Integer/parseInt queries)
+               (catch Exception e 1))] ; default to 1 on parse failure
+    (cond
+      (< n 1) 1
+      (> n 500) 500
+      :else n)))
+
+;; MySQL database connection
+(defdb db-mysql
   (mysql {
     :classname "com.mysql.jdbc.Driver"
     :subprotocol "mysql"
-    :subname "//127.0.0.1:3306/hello_world"
+    :subname "//127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
     :user "benchmarkdbuser"
     :password "benchmarkdbpass"
     ;;OPTIONAL KEYS
@@ -37,65 +44,32 @@
 (defentity world
   (pk :id)
   (table :world)
-  (entity-fields :id :randomNumber) ;; Default fields for select
-  (database mysql-db))
+  (entity-fields :id :randomNumber) ; Default fields for select
+  (database db-mysql))
 
-
-(defn random-world
+(defn get-random-world-korma
   "Query a random World record from the database"
   []
   (let [id (inc (rand-int 9999))] ; Num between 1 and 10,000
     (select world
             (where {:id id }))))
 
-
 (defn run-queries
-  "Run query repeatedly -- Always returns an array"
+  "Run query repeatedly, return an array"
   [queries]
-  (flatten (take queries (repeatedly random-world))))
-
-
-(defn single-query-test
-  "Test 2: Single database query"
-  [request]
-  (bootstrap/json-response (first (run-queries 1))))
-
-
-(defn sanitizeQueriesParam
-  "Sanitizes the `queries` parameter. Caps the value between 1 and 500.
-  Invalid (stringy) values become 1"
-  [request]
-  (let [queries (-> request
-                    :params
-                    :queries)]
-    (if-let [n (if (= (re-find #"\A-?\d+" queries) nil)
-                   1
-                   (Integer/parseInt queries))]
-      (cond
-        (< n 1) 1
-        (> n 500) 500
-        :else n))))
+  (flatten ; Make it a list of maps
+    (take queries ; Number of queries to run
+          (repeatedly get-random-world-korma))))
 
-
-(defn multiple-query-test
-  "Test 3: Multiple database queries"
-  [request]
-  (-> request
-      (sanitizeQueriesParam)
-      (run-queries)
-      (bootstrap/json-response)))
-
-
-; Set up entity Fortune and the database representation
+;; Set up entity Fortune and the database representation
 (defentity fortune
   (pk :id)
   (table :fortune)
   (entity-fields :id :message)
-  (database mysql-db))
-
+  (database db-mysql))
 
-(defn get-all-fortunes
-  "Query all Fortune records from the database."
+(defn get-all-fortunes-korma
+  "Query all Fortune records from the database using Korma."
   []
   (select fortune
           (fields :id :message)))
@@ -107,10 +81,9 @@
   []
   (sort-by #(:message %)
     (conj
-      (get-all-fortunes)
+      (get-all-fortunes-korma)
       { :id 0 :message "Additional fortune added at request time." })))
 
-
 (defn fortunes-hiccup
   "Render the given fortunes to simple HTML using Hiccup."
   [fortunes]
@@ -128,6 +101,34 @@
         [:td (escape-html (:message x))]])
      ]]))
 
+(defn update-and-persist
+  "Using Korma: Changes the :randomNumber of a number of world entities.
+  Persists the changes to sql then returns the updated entities"
+  [queries]
+  (let [results (map #(assoc % :randomNumber (inc (rand-int 9999))) (run-queries queries))]
+    (doseq [{:keys [id randomNumber]} results]
+      (update world
+              (set-fields {:randomNumber randomNumber})
+              (where {:id id})))
+    results))
+
+(defn json-serialization
+  "Test 1: JSON serialization"
+  [request]
+  (bootstrap/json-response {:message "Hello, World!"}))
+
+(defn single-query-test
+  "Test 2: Single database query"
+  [request]
+  (bootstrap/json-response (first (run-queries 1))))
+
+(defn multiple-queries-test
+  "Test 3: Multiple database queries"
+  [request]
+  (-> request
+      (sanitize-queries-param)
+      (run-queries)
+      (bootstrap/json-response)))
 
 (defn fortune-test
   "Test 4: Fortunes"
@@ -137,28 +138,13 @@
     (fortunes-hiccup)
     (ring-resp/response)
     (ring-resp/content-type "text/html")
-    (ring-resp/charset "utf-8")))         ;; Apply charset after content type
-
-
-(defn update-and-persist
-  "Changes the :randomNumber of a number of world entities.
-  Persists the changes to sql then returns the updated entities"
-  [request]
-  (let [results (-> request
-                    (sanitizeQueriesParam)
-                    (run-queries))]
-    (for [w results]
-      (update-in w [:randomNumber (inc (rand-int 9999))]
-        (update world
-                (set-fields {:randomNumber (:randomNumber w)})
-                (where {:id [:id w]}))))
-    results))
-
+    (ring-resp/charset "utf-8")))
 
 (defn db-updates
   "Test 5: Database updates"
   [request]
   (-> request
+      (sanitize-queries-param)
       (update-and-persist)
       (bootstrap/json-response)))
 
@@ -168,15 +154,15 @@
   [request]
   (ring-resp/response "Hello, World!"))
 
-
+;; Define route handlers
 (defroutes routes
   [[
+  [  "/plaintext" {:get plaintext}]
   [  "/json"      {:get json-serialization}]
   [  "/db"        {:get single-query-test}]
-  [  "/queries"   {:get multiple-query-test}]
+  [  "/queries"   {:get multiple-queries-test}]
   [  "/fortunes"  {:get fortune-test}]
-  [  "/updates"   {:get db-updates}]
-  [  "/plaintext" {:get plaintext}]]])
+  [  "/updates"   {:get db-updates}]]])
 
 
 (def service

+ 1 - 1
frameworks/Elixir/phoenix/lib/hello/repo.ex

@@ -1,3 +1,3 @@
 defmodule Hello.Repo do
-    use Ecto.Repo, otp_app: :hello
+  use Ecto.Repo, otp_app: :hello
 end

+ 6 - 7
frameworks/Elixir/phoenix/mix.exs

@@ -3,8 +3,8 @@ defmodule Hello.Mixfile do
 
   def project do
    [app: :hello,
-    version: "0.0.1",
-    elixir: "~> 1.1",
+    version: "0.1.0",
+    elixir: "~> 1.3",
     elixirc_paths: elixirc_paths(Mix.env),
     compilers: [:phoenix] ++ Mix.compilers,
     build_embedded: Mix.env == :prod,
@@ -26,12 +26,11 @@ defmodule Hello.Mixfile do
   #
   # Type `mix help deps` for examples and options
   defp deps do
-    [{:phoenix, "~> 1.0.3"},
-     {:phoenix_ecto, "~> 1.1"},
+    [{:phoenix, "~> 1.2"},
+     {:phoenix_ecto, "~> 3.0"},
      {:postgrex, ">= 0.0.0"},
      {:cowboy, "~> 1.0.0"},
-     {:phoenix_html, "~> 2.1"},
-     {:phoenix_live_reload, "~> 1.0", only: :dev},
-     {:exrm, "~> 0.19.8"}]
+     {:phoenix_html, "~> 2.6"},
+     {:phoenix_live_reload, "~> 1.0", only: :dev}]
   end
 end

+ 3 - 2
frameworks/Elixir/phoenix/setup.sh

@@ -8,7 +8,8 @@ rm -rf _build deps
 
 export MIX_ENV=prod
 mix local.hex --force
-mix deps.get --force
+mix local.rebar --force
+mix deps.get --force --only prod
 mix compile --force
 
-elixir --detached -S mix phoenix.server
+elixir --erl "+K true" --detached  -pa _build/prod/consolidated -S mix phoenix.server

+ 30 - 10
frameworks/Elixir/phoenix/web/controllers/page_controller.ex

@@ -4,16 +4,22 @@ defmodule Hello.PageController do
   alias Hello.Fortune
 
   def index(conn, _params) do
-    json conn, %{"TE Benchmarks\n" => "Started"}
+    conn
+    |> merge_resp_headers(%{"content-type" => "application/json"})
+    |> json(%{"TE Benchmarks\n" => "Started"})
   end
 
   # avoid namespace collision
   def _json(conn, _params) do
-    json conn, %{message: "Hello, world!"}
+    conn
+    |> merge_resp_headers(%{"content-type" => "application/json"})
+    |> json(%{message: "Hello, world!"})
   end
 
   def db(conn, _params) do
-    json conn, Repo.get(World, :random.uniform(10000))
+    conn
+    |> merge_resp_headers(%{"content-type" => "application/json"})
+    |> json(Repo.get(World, :rand.uniform(10000)))
   end
 
   def queries(conn, params) do
@@ -26,11 +32,20 @@ defmodule Hello.PageController do
     rescue
       ArgumentError -> 1
     end
-    json conn, Enum.map(1..q, fn _ -> Repo.get(World, :random.uniform(10000)) end)
+
+    conn
+    |> merge_resp_headers(%{"content-type" => "application/json"})
+    |> json(Enum.map(1..q, fn _ -> Repo.get(World, :rand.uniform(10000)) end))
   end
 
   def fortunes(conn, _params) do
-    fortunes = List.insert_at(Repo.all(Fortune), 0, %Fortune{:id => 0, :message  => "Additional fortune added at request time."})
+    additional_fortune = %Fortune{
+      id: 0,
+      message: "Additional fortune added at request time."
+    }
+
+    fortunes = [additional_fortune | Repo.all(Fortune)]
+
     render conn, "fortunes.html", fortunes: Enum.sort(fortunes, fn f1, f2 -> f1.message < f2.message end)
   end
 
@@ -44,14 +59,19 @@ defmodule Hello.PageController do
     rescue
       ArgumentError -> 1
     end
-    json conn, Enum.map(1..q, fn _ ->
-      w = Repo.get(World, :random.uniform(10000))
-      changeset = World.changeset(w, %{randomNumber: :random.uniform(10000)})
+
+    conn
+    |> merge_resp_headers(%{"content-type" => "application/json"})
+    |> json(Enum.map(1..q, fn _ ->
+      w = Repo.get(World, :rand.uniform(10000))
+      changeset = World.changeset(w, %{randomNumber: :rand.uniform(10000)})
       Repo.update(changeset)
-      w end)
+      w end))
   end
 
   def plaintext(conn, _params) do
-    text conn, "Hello, world!"
+    conn
+    |> merge_resp_headers(%{"content-type" => "text/plain"})
+    |> text("Hello, world!")
   end
 end

+ 3 - 3
frameworks/Elixir/phoenix/web/models/fortune.ex

@@ -6,11 +6,11 @@ defmodule Hello.Fortune do
     field :message, :string
   end
 
-  @required_fields ~w(message)
+  @required_fields ~w(message)a
   @optional_fields ~w()
 
-  def changeset(model, params \\ nil) do
+  def changeset(model, params \\ %{}) do
     model
-    |> cast(params, @required_fields, @optional_fields)
+    |> cast(params, @required_fields)
   end
 end

+ 3 - 3
frameworks/Elixir/phoenix/web/models/world.ex

@@ -6,11 +6,11 @@ defmodule Hello.World do
     field :randomnumber, :integer
   end
 
-  @required_fields ~w(randomnumber)
+  @required_fields ~w(randomnumber)a
   @optional_fields ~w()
 
-  def changeset(model, params \\ nil) do
+  def changeset(model, params \\ %{}) do
     model
-    |> cast(params, @required_fields, @optional_fields)
+    |> cast(params, @required_fields)
   end
 end

+ 1 - 1
frameworks/Elixir/phoenix/web/templates/layout/app.html.eex

@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><title>Fortunes</title></head><body><%= @inner %></body></html>
+<!DOCTYPE html><html lang="en"><head><title>Fortunes</title></head><body><%= render @view_module, @view_template, assigns %></body></html>

+ 10 - 6
frameworks/Elixir/phoenix/web/web.ex

@@ -14,7 +14,11 @@ defmodule Hello.Web do
 
   def model do
     quote do
-      use Ecto.Model
+      use Ecto.Schema
+
+      import Ecto
+      import Ecto.Changeset
+      import Ecto.Query
     end
   end
 
@@ -24,7 +28,7 @@ defmodule Hello.Web do
 
       # Alias the data repository and import query/model functions
       alias Hello.Repo
-      import Ecto.Model
+      import Ecto
       import Ecto.Query
 
       # Import URL helpers from the router
@@ -40,11 +44,11 @@ defmodule Hello.Web do
       import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2,
                                         action_name: 1, controller_module: 1]
 
-      # Import URL helpers from the router
-      import Hello.Router.Helpers
 
       # Import all HTML functions (forms, tags, etc)
       use Phoenix.HTML
+
+      import Hello.Router.Helpers
     end
   end
 
@@ -60,8 +64,8 @@ defmodule Hello.Web do
       use Phoenix.Channel
       # Alias the data repository and import query/model functions
       alias Hello.Repo
-      import Ecto.Model
-      import Ecto.Query, only: [from: 2]
+      import Ecto
+      import Ecto.Query
     end
   end
 

+ 0 - 8
frameworks/Erlang/misultin/.gitignore

@@ -1,8 +0,0 @@
-.eunit
-deps
-ebin
-*.o
-*.beam
-*.plt
-erl_crash.dump
-/.rebar/

+ 0 - 13
frameworks/Erlang/misultin/Makefile

@@ -1,13 +0,0 @@
-REBAR=./rebar
-
-all:
-	@$(REBAR) -r get-deps compile
-
-clean:
-	@$(REBAR) clean
-
-run:
-	@./start.sh
-
-stop:
-	@killall beam.smp

+ 0 - 23
frameworks/Erlang/misultin/benchmark_config.json

@@ -1,23 +0,0 @@
-{
-  "framework": "misultin",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "MySQL",
-      "framework": "Misultin",
-      "language": "Erlang",
-      "orm": "Raw",
-      "platform": "Erlang",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "misultin",
-      "notes": "",
-      "versus": ""
-  }}]
-}

+ 0 - 9
frameworks/Erlang/misultin/priv/app.config

@@ -1,9 +0,0 @@
-%% -*- erlang -*-
-[{misultin_bench, [{http_port, 8080}]},
-
- {erl_bench, [{db_pool, 256},
-              {db_user, "benchmarkdbuser"},
-              {db_password, "benchmarkdbpass"},
-              {db_host, "localhost"},
-              {db_port, 3306},
-              {db_name, "hello_world"}]}].

+ 0 - 5
frameworks/Erlang/misultin/rebar.config

@@ -1,5 +0,0 @@
-%% -*- erlang -*-
-{deps, [
-  {erl_bench, ".*", {git, "git://github.com/utkarshkukreti/erl_bench.git", "cb70233d7de1e800893cf1460f181a706aa08a38"}},
-  {misultin, "0.9", {git, "git://github.com/ostinelli/misultin.git", {tag, "misultin-0.9"}}}
-]}.

+ 0 - 11
frameworks/Erlang/misultin/setup.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-sed -i 's|"benchmarkdbpass", ".*", 3306|"benchmarkdbpass", "'"${DBHOST}"'", 3306|g' src/misultin_bench_sup.erl
-
-fw_depends erlang
-
-rm -rf deps/* ebin/*
-rebar get-deps
-rebar compile
-
-erl +K true +sbwt very_long +swt very_low -pa ebin deps/*/ebin -boot start_sasl -config priv/app.config -s misultin_bench_app -noshell -detached

+ 0 - 9
frameworks/Erlang/misultin/src/misultin_bench.app.src

@@ -1,9 +0,0 @@
-%% -*- erlang -*-
-{application, misultin_bench,
- [{description, ""},
-  {vsn, "0.1"},
-  {modules, []},
-  {registered, []},
-  {mod, {misultin_bench_app, []}},
-  {env, []},
-  {applications, [kernel, stdlib, crypto, erl_bench]}]}.

+ 0 - 16
frameworks/Erlang/misultin/src/misultin_bench_app.erl

@@ -1,16 +0,0 @@
--module(misultin_bench_app).
--behaviour(application).
--export([start/0]).
--export([start/2, stop/1]).
-
-start() ->
-    application:ensure_all_started(misultin_bench).
-
-start(_Type, _StartArgs) ->
-    {ok, Port} = application:get_env(misultin_bench, http_port),
-    Options = [{loop, fun(Req) -> web_handler:dispatch(Req) end},
-               {port, Port}],
-    misultin_bench_sup:start_link(Options).
-
-stop(_State) ->
-    ok.

+ 0 - 18
frameworks/Erlang/misultin/src/misultin_bench_sup.erl

@@ -1,18 +0,0 @@
--module(misultin_bench_sup).
--behaviour(supervisor).
--export([start_link/1]).
--export([init/1]).
-
-start_link(Options) ->
-    supervisor:start_link(?MODULE, [Options]).
-
-init([Options]) ->
-    Misultin = supervisor(misultin, Options),
-    Processes = [Misultin],
-    Strategy = {one_for_one, 5, 30},
-    {ok, {Strategy, Processes}}.
-
-supervisor(Mod, Options) ->
-    {Mod,
-     {Mod, start_link, [Options]},
-     permanent, infinity, supervisor, [Mod]}.

+ 0 - 53
frameworks/Erlang/misultin/src/web_handler.erl

@@ -1,53 +0,0 @@
--module(web_handler).
--export([dispatch/1]).
-
-dispatch(Req) ->
-    Method = Req:get(method),
-    {_UriType, Uri} = Req:get(uri),
-    Path = string:tokens(Uri, "/"),
-    handle(Method, Path, Req).
-
-%% handle
-
-handle('GET', ["json"], Req) ->
-    json(Req, erl_bench:hello_json());
-
-handle('GET', ["plaintext"], Req) ->
-    plain(Req, erl_bench:hello_plain());
-
-handle('GET', ["db"], Req) ->
-    json(Req, erl_bench:random_json());
-
-handle('GET', ["queries"], Req) ->
-    Queries = queries(Req),
-    json(Req, erl_bench:randoms_json(Queries));
-
-handle('GET', ["updates"], Req) ->
-    Queries = queries(Req),
-    json(Req, erl_bench:update_randoms_json(Queries));
-
-handle('GET', ["fortunes"], Req) ->
-    html(Req, erl_bench:fortunes_html());
-
-handle(_Method, _Path, Req) ->
-    Req:respond(404, [{"Content-Type", "text/plain"}], "Not Found").
-
-%% private
-
-json(Req, Json) ->
-    Req:ok([{"Content-Type", "application/json"}], Json).
-
-plain(Req, Text) ->
-    Req:ok([{"Content-Type", "text/plain"}], Text).
-
-html(Req, Html) ->
-    Req:ok([{"Content-Type", "text/html"}], Html).
-
-queries(Req) ->
-    Params = Req:parse_qs(),
-    Queries = (catch list_to_integer(proplists:get_value("queries", Params, "1"))),
-    case {is_number(Queries), Queries > 500} of
-        {true, true} -> 500;
-        {false, _}   -> 1;
-        _ -> Queries
-    end.

+ 0 - 7
frameworks/Erlang/misultin/start-dev.sh

@@ -1,7 +0,0 @@
-#!/bin/sh
-exec erl \
-     +K true +sbwt very_long +swt very_low \
-     -pa ebin deps/*/ebin \
-     -boot start_sasl \
-     -config priv/app.config \
-     -s misultin_bench_app

+ 8 - 5
frameworks/Haskell/servant/driver/Main.hs

@@ -1,13 +1,16 @@
 {-# LANGUAGE OverloadedStrings #-}
 module Main (main) where
 
-import Data.ByteString
+import Data.ByteString.Char8
 import ServantBench
 import Hasql.Connection (settings)
+import System.Environment (getArgs)
 
 main :: IO ()
-main = run 7041 dbSettings
+main = do
+  [host] <- getArgs
+  run 7041 $ dbSettings (pack host)
 
-dbSettings :: ByteString
-dbSettings
-  = settings "localhost" 5432 "benchmarkdbuser" "benchmarkdbpass" "hello_world"
+dbSettings :: ByteString -> ByteString
+dbSettings host
+  = settings host 5432 "benchmarkdbuser" "benchmarkdbpass" "hello_world"

+ 1 - 1
frameworks/Haskell/servant/servant-bench.cabal

@@ -39,7 +39,7 @@ library
 
 executable servant-exe
   main-is:             Main.hs
-  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N -O2
+  ghc-options:         -Wall -threaded -rtsopts -O2
   build-depends:       base
                      , servant-bench
                      , bytestring

+ 1 - 1
frameworks/Haskell/servant/setup.sh

@@ -5,4 +5,4 @@ fw_depends stack
 ${IROOT}/stack --allow-different-user setup
 ${IROOT}/stack --allow-different-user build
 
-${IROOT}/stack --allow-different-user exec servant-exe -- +RTS -A32m -N${MAX_THREADS} &
+${IROOT}/stack --allow-different-user exec servant-exe -- ${DBHOST} +RTS -A32m -N${MAX_THREADS} &

+ 10 - 0
frameworks/Haskell/yesod-postgres/.gitignore

@@ -0,0 +1,10 @@
+/bench/.stack-work/
+dist*
+static/tmp/
+config/client_session_key.aes
+*.hi
+*.o
+*.sqlite3
+.hsenv*
+yesod-devel/
+

+ 9 - 0
frameworks/Haskell/yesod-postgres/README.md

@@ -0,0 +1,9 @@
+# Yesod Benchmarking Test
+
+This is the Yesod portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
+
+
+## Infrastructure Software Versions
+The tests were run with:
+* GHC 7.10.3
+* Yesod 1.4

+ 43 - 0
frameworks/Haskell/yesod-postgres/bench/bench.cabal

@@ -0,0 +1,43 @@
+name:              bench
+version:           0.0.0
+cabal-version:     >= 1.8
+build-type:        Simple
+
+executable         bench
+    main-is:           Main.hs
+    hs-source-dirs:    src
+
+    ghc-options:       -Wall -threaded -O2 -rtsopts
+
+    extensions: TemplateHaskell
+                QuasiQuotes
+                OverloadedStrings
+                MultiParamTypeClasses
+                TypeFamilies
+                GADTs
+                EmptyDataDecls
+                CPP
+
+    build-depends: base
+                 , yesod
+                 , text
+                 , persistent
+                 , persistent-postgresql
+                 , persistent-template
+                 , warp
+                 , auto-update
+                 , primitive
+                 , mwc-random
+                 , resource-pool
+                 , network
+                 , monad-logger
+                 , mtl
+                 , wai
+                 , http-types
+                 , aeson
+                 , blaze-builder
+                 , blaze-html
+                 , bytestring
+                 , resource-pool
+                 , resourcet
+                 , shakespeare

+ 194 - 0
frameworks/Haskell/yesod-postgres/bench/src/Main.hs

@@ -0,0 +1,194 @@
+{-# LANGUAGE EmptyDataDecls             #-}
+{-# LANGUAGE FlexibleContexts           #-}
+{-# LANGUAGE FlexibleInstances          #-}
+{-# LANGUAGE GADTs                      #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses      #-}
+{-# LANGUAGE OverloadedStrings          #-}
+{-# LANGUAGE QuasiQuotes                #-}
+{-# LANGUAGE RankNTypes                 #-}
+{-# LANGUAGE RecordWildCards            #-}
+{-# LANGUAGE TemplateHaskell            #-}
+{-# LANGUAGE TypeFamilies               #-}
+{-# LANGUAGE ViewPatterns               #-}
+{-# LANGUAGE LambdaCase                 #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+module Main (main, resourcesApp, Widget, WorldId) where
+import           Control.Concurrent            (runInUnboundThread)
+import           Control.Monad                 (forM)
+import           Control.Monad.Logger          (runNoLoggingT)
+import           Control.Monad.Primitive       (PrimState)
+import           Control.Monad.Trans.Resource  (InternalState)
+import qualified Data.ByteString.Char8 as C8
+import           Data.Pool                     (Pool)
+import           Data.IORef                    (newIORef)
+import           Data.Function                 (on)
+import           Data.List                     (sortBy)
+import           Data.Text                     (Text)
+import           Database.Persist             
+import qualified Database.Persist.Postgresql    as Pg
+import Database.Persist.Sql
+import           Database.Persist.TH           (mkPersist, mpsGeneric,
+                                                persistLowerCase, sqlSettings)
+import qualified Network.Wai.Handler.Warp      as Warp
+import           System.Environment            (getArgs)
+import           System.IO.Unsafe              (unsafePerformIO)
+import qualified System.Random.MWC             as R
+import Text.Blaze.Html
+import           Yesod
+import Data.Maybe (fromJust)
+
+mkPersist sqlSettings { mpsGeneric = True } [persistLowerCase|
+World sql=World
+    randomNumber Int sql=randomnumber
+|]
+
+mkPersist sqlSettings { mpsGeneric = True } [persistLowerCase|
+Fortune sql=Fortune
+    message Text sql=message
+|]
+
+instance ToJSON (Entity World) where
+  toJSON (Entity wId wRow) = object [
+    "id" .= wId
+    ,"randomNumber" .= (worldRandomNumber wRow)
+    ]
+
+instance ToMarkup FortuneId where
+  toMarkup = toMarkup . fromSqlKey
+
+data App = App
+    { appGen      :: !(R.Gen (PrimState IO))
+    , appDbPool   :: !(Pool Pg.SqlBackend)
+    }
+
+
+mkYesod "App" [parseRoutes|
+/json               JsonR     GET
+/plaintext          PlaintextR   GET
+/db                 DbR          GET
+
+/queries/#Int       QueriesR     GET
+!/queries/#Text      DefaultQueriesR     GET
+
+/fortunes           FortunesR    GET
+
+/updates/#Int       UpdatesR     GET
+!/updates/#Text     DefaultUpdatesR GET
+|]
+
+fakeInternalState :: InternalState
+fakeInternalState = unsafePerformIO $ newIORef $ error "fakeInternalState forced"
+{-# NOINLINE fakeInternalState #-}
+
+instance Yesod App where
+    makeSessionBackend _ = return Nothing
+    {-# INLINE makeSessionBackend #-}
+    shouldLog _ _ _ = False
+    {-# INLINE shouldLog #-}
+    yesodMiddleware = id
+    {-# INLINE yesodMiddleware #-}
+    cleanPath _ = Right
+    {-# INLINE cleanPath #-}
+    yesodWithInternalState _ _ = ($ fakeInternalState)
+    {-# INLINE yesodWithInternalState #-}
+    maximumContentLength _ _ = Nothing
+    {-# INLINE maximumContentLength #-}
+
+getJsonR :: Handler Value
+getJsonR = returnJson $ object ["message" .= ("Hello, World!" :: Text)]
+
+runPg dbAction = do
+  app <- getYesod
+  runSqlPool dbAction (appDbPool app)
+
+getRandomRow = do
+  app <- getYesod
+  randomNumber <- liftIO $ ((R.uniformR (1, 10000) (appGen app)) :: IO Int)
+  let wId = (toSqlKey $ fromIntegral randomNumber) :: WorldId
+  get wId >>= \case
+    Nothing -> return Nothing
+    Just x -> return $ Just (Entity wId x)
+
+getDbR :: Handler Value
+getDbR = do
+  (runPg getRandomRow) >>= \case
+    -- TODO: Throw appropriate HTTP response
+    Nothing -> error "This shouldn't be happening"
+    Just worldE -> returnJson worldE
+
+getQueriesR :: Int -> Handler Value
+getQueriesR cnt = do
+  result <- (runPg $ forM [1..sanitizedCnt] (\_ -> fmap fromJust getRandomRow))
+  returnJson result
+  where
+    sanitizedCnt
+      | cnt<1 = 1
+      | cnt>500 = 500
+      | otherwise = cnt
+
+getDefaultQueriesR :: Text -> Handler Value
+getDefaultQueriesR _ = getQueriesR 1
+
+getFortunesR :: Handler Html
+getFortunesR = do
+  fortunesFromDb <- runPg $ selectList [] []
+  let fortunes = sortBy (compare `on` fortuneMessage . entityVal) $ (Entity (toSqlKey 0) Fortune{fortuneMessage="Additional fortune added at request time."}):fortunesFromDb
+  defaultLayout $ do
+      setTitle "Fortunes"
+      [whamlet|
+              <table>
+                <tr>
+                  <th>id
+                  <th>message
+                $forall fortune <- fortunes
+                  <tr>
+                    <td>#{entityKey fortune}
+                    <td>#{fortuneMessage $ entityVal fortune}
+                    |]
+
+getUpdatesR :: Int -> Handler Value
+getUpdatesR cnt = do
+  worldRows <- runPg $ forM [1..sanitizedCount] (\_ -> fmap fromJust getRandomRow)
+  app <- getYesod
+  updatedWorldRows <- runPg $ mapM (replaceWorldRow app) worldRows
+  returnJson updatedWorldRows
+  where
+    sanitizedCount
+      | cnt<1 = 1
+      | cnt>500 = 500
+      | otherwise = cnt
+
+    replaceWorldRow app (Entity wId wRow) = do
+      randomNumber <- liftIO $ ((R.uniformR (1, 10000) (appGen app)) :: IO Int)
+      -- TODO: Should I be using replace, or update, or updateGet -- which is
+      -- idiomatic Yesod code for this operation?
+      let newRow = wRow{worldRandomNumber=randomNumber}
+      replace wId newRow
+      return (Entity wId newRow)
+
+
+getDefaultUpdatesR :: Text -> Handler Value
+getDefaultUpdatesR _ = getUpdatesR 1
+
+getPlaintextR :: Handler Text
+getPlaintextR = return "Hello, World!"
+
+main :: IO ()
+main = R.withSystemRandom $ \gen -> do
+    [cores, host] <- getArgs
+    let connString = ("host=" ++ host ++ " port=5432 user=benchmarkdbuser password=benchmarkdbpass dbname=hello_world") 
+    dbPool <- runNoLoggingT $ Pg.createPostgresqlPool (C8.pack connString) 256
+    app <- toWaiAppPlain App
+        { appGen = gen
+        , appDbPool = dbPool
+        }
+
+    runInUnboundThread $ Warp.runSettings
+        ( Warp.setPort 8000
+        $ Warp.setHost "*"
+        $ Warp.setOnException (\_ _ -> return ())
+          Warp.defaultSettings
+        ) app
+

+ 5 - 0
frameworks/Haskell/yesod-postgres/bench/stack.yaml

@@ -0,0 +1,5 @@
+flags: {}
+packages:
+- '.'
+extra-deps: []
+resolver: lts-6.3

+ 28 - 0
frameworks/Haskell/yesod-postgres/benchmark_config.json

@@ -0,0 +1,28 @@
+{
+  "framework": "yesod-postgres",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "plaintext_url": "/plaintext",
+      "db_url": "/db",
+      "query_url": "/queries/",
+      "fortune_url": "/fortunes",
+      "update_url": "/updates/",
+      "port": 8000,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "Postgres",
+      "framework": "yesod",
+      "language": "Haskell",
+      "orm": "Raw",
+      "platform": "Wai",
+      "webserver": "Warp",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "yesod-postgres",
+      "notes": "",
+      "versus": "wai"
+    }
+  }]
+}

+ 9 - 0
frameworks/Haskell/yesod-postgres/setup.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+fw_depends stack
+
+cd bench
+
+${IROOT}/stack --allow-different-user build --install-ghc
+
+${IROOT}/stack --allow-different-user exec bench -- ${MAX_THREADS} ${DBHOST} +RTS -A32m -N${MAX_THREADS} &

+ 2 - 0
frameworks/Haskell/yesod-postgres/source_code

@@ -0,0 +1,2 @@
+./yesod-postgres/bench/src/
+./yesod-postgres/bench/src/Main.hs

+ 4 - 4
frameworks/Java/curacao/pom.xml

@@ -20,12 +20,12 @@
         <dependency>
             <groupId>curacao</groupId>
             <artifactId>curacao</artifactId>
-            <version>4.0.4</version>
+            <version>4.2.0</version>
         </dependency>
         <dependency>
             <groupId>curacao</groupId>
             <artifactId>curacao-gson</artifactId>
-            <version>4.0.4</version>
+            <version>4.2.0</version>
         </dependency>
 
         <!-- Servlet -->
@@ -40,12 +40,12 @@
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-core</artifactId>
-            <version>1.1.5</version>
+            <version>1.1.7</version>
         </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
-            <version>1.1.5</version>
+            <version>1.1.7</version>
         </dependency>
 
     </dependencies>

+ 1 - 1
frameworks/Java/curacao/src/main/resources/application.conf

@@ -1,6 +1,6 @@
 curacao {
   boot-package = "benchmark"
-  async-context-timeout = 0
+  async-context-timeout = 30s
   thread-pool {
     name-format = "curacao-%d"
   }

+ 1 - 1
frameworks/Java/rapidoid/benchmark_config.json

@@ -6,7 +6,7 @@
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,
-      "approach": "Realistic",
+      "approach": "Stripped",
       "classification": "Platform",
       "database": "None",
       "framework": "rapidoid",

+ 2 - 2
frameworks/Java/revenj/pom.xml

@@ -14,7 +14,7 @@
 		<dependency>
 			<groupId>org.revenj</groupId>
 			<artifactId>revenj-core</artifactId>
-			<version>0.9.7</version>
+			<version>0.9.9</version>
 		</dependency>
                 <dependency>
                         <groupId>org.apache.commons</groupId>
@@ -33,7 +33,7 @@
 			<plugin>
 				<groupId>com.dslplatform</groupId>
 				<artifactId>dsl-platform-maven-plugin</artifactId>
-				<version>0.8</version>
+				<version>0.9</version>
 				<executions>
 					<execution>
 						<phase>generate-sources</phase>

+ 11 - 1
frameworks/Java/revenj/src/main/java/hello/Context.java

@@ -57,8 +57,9 @@ class Context {
 		return random.nextInt(10000) + 1;
 	}
 
+	/* bulk loading of worlds. use such pattern for production code */
 	@SuppressWarnings("unchecked")
-	public World[] loadWorlds(final int count) throws IOException {
+	public World[] loadWorldsFast(final int count) throws IOException {
 		bulkReader.reset();
 		for (int i = 0; i < count; i++) {
 			callables[i] = bulkReader.find(World.class, Integer.toString(getRandom10k()));
@@ -73,4 +74,13 @@ class Context {
 		}
 		return buffer;
 	}
+
+	/* multiple roundtrips loading of worlds. don't write such production code */
+	@SuppressWarnings("unchecked")
+	public World[] loadWorldsSlow(final int count) throws IOException {
+		for (int i = 0; i < count; i++) {
+			buffer[i] = worlds.find(getRandom10k(), connection).get();
+		}
+		return buffer;
+	}
 }

+ 1 - 1
frameworks/Java/revenj/src/main/java/hello/QueriesServlet.java

@@ -15,7 +15,7 @@ public class QueriesServlet extends HttpServlet {
 		final int count = Utils.parseBoundParam(req);
 		final Context ctx = Utils.getContext();
 		final JsonWriter json = ctx.json;
-		final World[] worlds = ctx.loadWorlds(count);
+		final World[] worlds = ctx.loadWorldsSlow(count);
 		json.serialize(worlds, count);
 		json.toStream(res.getOutputStream());
 	}

+ 1 - 1
frameworks/Java/revenj/src/main/java/hello/UpdatesServlet.java

@@ -18,7 +18,7 @@ public class UpdatesServlet extends HttpServlet {
 		final int count = Utils.parseBoundParam(req);
 		final Context ctx = Utils.getContext();
 		final JsonWriter json = ctx.json;
-		final World[] worlds = ctx.loadWorlds(count);
+		final World[] worlds = ctx.loadWorldsSlow(count);
 		final ArrayList<World> changed = new ArrayList<>(count);
 		for (int i = 0; i < count; i++) {
 			changed.add(worlds[i].setRandomNumber(ctx.getRandom10k()));

+ 6 - 6
frameworks/JavaScript/nodejs/README.md

@@ -13,13 +13,13 @@ The logic for the test cases live in these.
 
 ## Infrastructure Software Versions
 The tests were run with:
-* [Node.js v0.12.2](http://nodejs.org/)
+* [Node.js v6.3.0](http://nodejs.org/)
 
-* [Node MySQL 2.7.0](https://github.com/felixge/node-mysql/)
-* [Sequelize 3.1.1](https://github.com/sequelize/sequelize)
-* [Node MongoDB Driver 2.0.33](https://github.com/mongodb/node-mongodb-native)
-* [Mongoose 4.0.4](http://mongoosejs.com/)
-* [Node Redis 0.12.1](https://github.com/mranney/node_redis)
+* [Node MySQL 2.11.1](https://github.com/felixge/node-mysql/)
+* [Sequelize 3.6.0](https://github.com/sequelize/sequelize)
+* [Node MongoDB Driver 2.1.1](https://github.com/mongodb/node-mongodb-native)
+* [Mongoose 4.5.3](http://mongoosejs.com/)
+* [Node Redis 2.6.2](https://github.com/mranney/node_redis)
 * [Hiredis 0.4.0 (C lib for Redis)](https://github.com/redis/hiredis)
 
 ## Test URLs

+ 0 - 21
frameworks/JavaScript/ringojs/benchmark_config.json

@@ -12,27 +12,6 @@
       "port": 8080,
       "approach": "Realistic",
       "classification": "Platform",
-      "database": "None",
-      "framework": "ringo",
-      "language": "JavaScript",
-      "orm": "Raw",
-      "platform": "ringojs",
-      "webserver": "Jetty",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "ringojs",
-      "notes": "",
-      "versus": ""
-    },
-    "raw": {
-      "setup_file": "setup",
-      "db_url": "/db",
-      "query_url": "/db?queries=",
-      "fortune_url": "/fortune",
-      "update_url": "/updates?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Platform",
       "database": "MySQL",
       "framework": "ringo",
       "language": "JavaScript",

+ 1 - 1
frameworks/PHP/clancats/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-sed -i 's|localhost|'"${DBHOST}"'|g' index.php
+sed -i 's|localhost|'"${DBHOST}"'|g' app/config/database.config.php
 sed -i 's|root /home/ubuntu/FrameworkBenchmarks|root '"${TROOT}"'|g' deploy/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
 

+ 1 - 1
frameworks/PHP/lumen/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-sed -i 's|localhost|'"${DBHOST}"'|g' index.php
+sed -i 's|localhost|'"${DBHOST}"'|g' .env
 sed -i 's|root .*/FrameworkBenchmarks/lumen|root '"${TROOT}"'|g' deploy/nginx.conf
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
 

+ 0 - 10
frameworks/PHP/micromvc/.gitignore

@@ -1,10 +0,0 @@
-/app/cache
-/app/logs
-/bin
-/vendors
-/build
-/dist
-.DS_Store
-/tags
-.idea
-/deploy/php-fpm.pid

+ 0 - 92
frameworks/PHP/micromvc/Bootstrap.php

@@ -1,92 +0,0 @@
-<?php
-/**
- * Bootstrap
- *
- * This file contains initialization code run immediately after system startup.
- * Setup i18n and l10n handling, configure system, prepare event hooks.
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2010 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-
-// System Start Time
-define('START_TIME', microtime(true));
-
-// System Start Memory
-define('START_MEMORY_USAGE', memory_get_usage());
-
-// Extension of all PHP files
-define('EXT', '.php');
-
-// Directory separator (Unix-Style works on all OS)
-define('DS', '/');
-
-// Absolute path to the system folder
-define('SP', realpath(__DIR__). DS);
-
-// Is this an AJAX request?
-define('AJAX_REQUEST', strtolower(getenv('HTTP_X_REQUESTED_WITH')) === 'xmlhttprequest');
-
-// The current TLD address, scheme, and port
-define('DOMAIN', (strtolower(getenv('HTTPS')) == 'on' ? 'https' : 'http') . '://'
-	. getenv('HTTP_HOST') . (($p = getenv('SERVER_PORT')) != 80 AND $p != 443 ? ":$p" : ''));
-
-// The current site path
-define('PATH', parse_url(getenv('REQUEST_URI'), PHP_URL_PATH));
-
-require(SP . 'vendor/autoload' . EXT);
-
-// Include common system functions
-require(SP . 'Common' . EXT);
-
-\Micro\View::$directory = SP . 'View/';
-
-\Micro\Cookie::$settings = config()->cookie;
-
-// Register events
-foreach(config()->events as $event => $class)
-{
-	event($event, NULL, $class);
-}
-
-/*
-if(preg_match_all('/[\-a-z]{2,}/i', getenv('HTTP_ACCEPT_LANGUAGE'), $locales))
-{
-	$locales = $locales[0];
-}
-*/
-
-// Get locale from user agent
-if(isset($_COOKIE['lang']))
-{
-	$preference = $_COOKIE['lang'];
-}
-else
-{
-	$preference = Locale::acceptFromHttp(getenv('HTTP_ACCEPT_LANGUAGE'));
-}
-
-// Match preferred language to those available, defaulting to generic English
-$locale = Locale::lookup(config()->languages, $preference, false, 'en');
-
-// Default Locale
-Locale::setDefault($locale);
-setlocale(LC_ALL, $locale . '.utf-8');
-//putenv("LC_ALL", $locale);
-
-// Default timezone of server
-date_default_timezone_set('UTC');
-
-// iconv encoding
-iconv_set_encoding("internal_encoding", "UTF-8");
-
-// multibyte encoding
-mb_internal_encoding('UTF-8');
-
-// Enable global error handling
-set_error_handler(array('\Micro\Error', 'handler'));
-register_shutdown_function(array('\Micro\Error', 'fatal'));
-

+ 0 - 41
frameworks/PHP/micromvc/CLI

@@ -1,41 +0,0 @@
-<?php if(PHP_SAPI !== 'cli') die();
-/**
- * CLI
- *
- * This file is the command-line interface (CLI) entry point for the system
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2010 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-
-// Include bootstrap
-require('Bootstrap.php');
-
-// Require a CLI path
-if(empty($argv[1]))
-{
-	die("Please enter a path to the CLI file.\nExample: " . colorize('php cli file.php', 'blue') . "\n");
-}
-
-// Build path to file
-$file = SP . 'Command/' . str_replace(EXT, '', trim($argv[1], '/')) . EXT;
-
-// Does the file exist?
-if( ! is_file($file)) die("Please enter a valid file path\n");
-
-// Require a valid, safe path
-if( ! preg_match('/^[\w\-~\/\.+]{1,600}/', $argv[1])) die(colorize("Invalid path given", 'red'). "\n");
-
-try
-{
-	require($file);
-}
-catch (Exception $e)
-{
-	\Micro\Error::exception($e);
-}
-
-// End

+ 0 - 28
frameworks/PHP/micromvc/Class/Controller/Benchmark/Db.php

@@ -1,28 +0,0 @@
-<?php
-
-namespace Controller\Benchmark;
-
-use Model\Benchmark\World;
-
-class Db extends \MyController
-{
-    public function run()
-    {
-        $queries = get('queries', 1);
-        $this->worlds = array();
-        $this->load_database();
-
-        for ($i = 0; $i < $queries; ++$i) {
-            $this->worlds[] = World::row(array('id' => mt_rand(1, 10000)))->to_array();
-        }
-
-        if ($queries == 1) {
-            $this->worlds = $this->worlds[0];
-        }
-    }
-
-    public function send() {
-        headers_sent() OR header('Content-type: application/json');
-        echo json_encode($this->worlds);
-    }
-}

+ 0 - 14
frameworks/PHP/micromvc/Class/Controller/Benchmark/Json.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace Controller\Benchmark;
-
-class Json extends \MyController
-{
-    public function run(){}
-
-    public function send()
-    {
-        headers_sent() OR header('Content-type: application/json');
-        echo json_encode(array('message' => 'Hello, World!'));
-    }
-}

+ 0 - 21
frameworks/PHP/micromvc/Class/Controller/Index.php

@@ -1,21 +0,0 @@
-<?php
-
-namespace Controller;
-
-class Index extends \MyController
-{
-	public function run()
-	{
-		// Load database
-		//$this->db = new DB(config('database'));
-
-		// Set ORM database connection
-		//ORM::$db = $this->db;
-
-		// Load the theme sidebar since we don't need the full page
-		$this->sidebar = new \Micro\View('Sidebar');
-
-		// Load the welcome view
-		$this->content = new \Micro\View('Index/Index');
-	}
-}

+ 0 - 19
frameworks/PHP/micromvc/Class/Controller/Page404.php

@@ -1,19 +0,0 @@
-<?php
-/**
- * 404 Page
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Controller;
-
-class Page404 extends \MyController
-{
-	public function run()
-	{
-		$this->show_404();
-	}
-}

+ 0 - 153
frameworks/PHP/micromvc/Class/Controller/School.php

@@ -1,153 +0,0 @@
-<?php
-/**
- * School
- *
- * Shows an example of a school system using the ORM
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Controller;
-
-class School extends \MyController
-{
-
-	public function run()
-	{
-		$this->load_database();
-
-		// You can over-ride this in certain models if needed,
-		// allowing you to use multiple databases.
-		// Model_Name::$db = new DB(config('other_database'));
-
-		// New Dorm
-		$d = new \Model\Dorm();
-		$d->name = 'Dorm 1';
-		$d->save();
-
-		// New Student in Dorm
-		$s1 = new \Model\Student();
-		$s1->name = 'Mary';
-		$s1->dorm_id = $d->id;
-		$s1->save();
-
-		// New Student in Dorm
-		$s2 = new \Model\Student();
-		$s2->name = 'Jane';
-		$s2->dorm_id = $d->id;
-		$s2->save();
-
-		// New Car for student
-		$c = new \Model\Car();
-		$c->name = 'Truck';
-		$c->student_id = $s1->id;
-		$c->save(); // Insert
-
-		$c->name = $s1->name. '\'s Truck'; // Change car name
-		$c->save(); // Update
-
-		// New Softball club
-		$c = new \Model\Club();
-		$c->name = 'Softball';
-		$c->save();
-
-		// Mary is in softball
-		$m = new \Model\Membership();
-		$m->club_id = $c->id;
-		$m->student_id = $s1->id;
-		$m->save();
-
-		// Jane is in softball
-		$m = new \Model\Membership();
-		$m->club_id = $c->id;
-		$m->student_id = $s2->id;
-		$m->save();
-
-		$this->content = dump('Created school objects');
-
-		$clubs = \Model\Club::fetch();
-		foreach($clubs as $club)
-		{
-			$club->load();
-			foreach($club->students() as $student)
-			{
-				/*
-				 * This student may have already been removed
-				 */
-				if($student->load())
-				{
-					$this->content .= dump('Removing '. $student->name. ' and her records');
-
-					// Remove their car, club membership, and them
-					$student->delete();
-				}
-			}
-			$club->delete();
-		}
-
-		foreach(\Model\Dorm::fetch() as $dorm)
-		{
-			$this->content .= dump('Removing the '. $dorm->name. ' dorm');
-			$dorm->delete(); // Delete the dorm
-		}
-
-		$this->content .= dump('Removed school objects');
-
-		// Load the view file
-		$this->content .= new \Micro\View('School/Index');
-
-		// Load global theme sidebar
-		$this->sidebar = new \Micro\View('Sidebar');
-
-	}
-}
-
-/* Table Schema:
-
-CREATE TABLE IF NOT EXISTS `car` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `name` varchar(100) DEFAULT NULL,
-  `student_id` int(11) DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  KEY `student_id` (`student_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;
-
--- --------------------------------------------------------
-
-CREATE TABLE IF NOT EXISTS `club` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `name` varchar(100) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;
-
--- --------------------------------------------------------
-
-CREATE TABLE IF NOT EXISTS `dorm` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `name` varchar(100) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;
-
--- --------------------------------------------------------
-
-CREATE TABLE IF NOT EXISTS `membership` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `club_id` int(11) DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  KEY `club_id` (`club_id`),
-  KEY `student_id` (`student_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;
-
--- --------------------------------------------------------
-
-CREATE TABLE IF NOT EXISTS `student` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `dorm_id` smallint(6) DEFAULT NULL,
-  `name` varchar(100) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;
-
-*/

+ 0 - 8
frameworks/PHP/micromvc/Class/Model/Benchmark/World.php

@@ -1,8 +0,0 @@
-<?php
-
-namespace Model\Benchmark;
-
-class World extends \Micro\ORM
-{
-    public static $table = 'World';
-}

+ 0 - 22
frameworks/PHP/micromvc/Class/Model/Car.php

@@ -1,22 +0,0 @@
-<?php
-/**
- * Car Model
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Model;
-
-class Car extends \Micro\ORM
-{
-	public static $table = 'car';
-	public static $foreign_key = 'car_id';
-
-	public static $belongs_to = array(
-		'student' => '\Model\Student',
-	);
-
-}

+ 0 - 28
frameworks/PHP/micromvc/Class/Model/Club.php

@@ -1,28 +0,0 @@
-<?php
-/**
- * Club Model
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Model;
-
-class Club extends \Micro\ORM
-{
-	public static $table = 'club';
-	public static $foreign_key = 'club_id';
-
-	public static $has = array(
-		'memberships' => '\Model\Membership'
-	);
-
-	public static $has_many_through = array(
-		'students' => array(
-			'club_id' => '\Model\Membership',
-			'student_id' => '\Model\Student'
-		),
-	);
-}

+ 0 - 22
frameworks/PHP/micromvc/Class/Model/Dorm.php

@@ -1,22 +0,0 @@
-<?php
-/**
- * Dorm Model
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Model;
-
-class Dorm extends \Micro\ORM
-{
-	public static $table = 'dorm';
-	public static $foreign_key = 'dorm_id';
-
-	public static $has = array(
-		'students' => '\Model\Student',
-	);
-
-}

+ 0 - 22
frameworks/PHP/micromvc/Class/Model/Membership.php

@@ -1,22 +0,0 @@
-<?php
-/**
- * Membership Model
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Model;
-
-class Membership extends \Micro\ORM
-{
-	public static $table = 'membership';
-	public static $foreign_key = 'membership_id';
-
-	public static $belongs_to = array(
-		'student' => '\Model\Student',
-		'club' => '\Model\Club',
-	);
-}

+ 0 - 34
frameworks/PHP/micromvc/Class/Model/Student.php

@@ -1,34 +0,0 @@
-<?php
-/**
- * Student Model
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-namespace Model;
-
-class Student extends \Micro\ORM
-{
-	public static $table = 'student';
-	public static $foreign_key = 'student_id';
-	public static $cascade_delete = TRUE;
-
-	public static $has = array(
-		'car' => '\Model\Car',
-		'memberships' => '\Model\Membership'
-	);
-
-	public static $belongs_to = array(
-		'dorm' => '\Model\Dorm',
-	);
-
-	public static $has_many_through = array(
-		'clubs' => array(
-			'student_id' => '\Model\Membership',
-			'club_id' => '\Model\Club'
-		),
-	);
-}

+ 0 - 80
frameworks/PHP/micromvc/Class/MyController.php

@@ -1,80 +0,0 @@
-<?php
-/**
- * MyController
- *
- * Basic DEMO outline for standard controllers
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-abstract class MyController extends \Micro\Controller
-{
-	// Global view template
-	public $template = 'Layout';
-
-	/**
-	 * Called after the controller is loaded, before the method
-	 *
-	 * @param string $method name
-	 */
-	public function initialize($method)
-	{
-		\Micro\Session::start();
-	}
-
-
-	/**
-	 * Load database connection
-	 */
-	public function load_database($name = 'database')
-	{
-		// Load database
-		$db = new \Micro\Database(config()->$name);
-
-		// Set default ORM database connection
-		if(empty(\Micro\ORM::$db))
-		{
-			\Micro\ORM::$db = $db;
-		}
-
-		return $db;
-	}
-
-
-	/**
-	 * Show a 404 error page
-	 */
-	public function show_404()
-	{
-		headers_sent() OR header('HTTP/1.0 404 Page Not Found');
-		$this->content = new \Micro\View('404');
-	}
-
-
-	/**
-	 * Save user session and render the final layout template
-	 */
-	public function send()
-	{
-		\Micro\Session::save();
-
-		headers_sent() OR header('Content-Type: text/html; charset=utf-8');
-
-		$layout = new \Micro\View($this->template);
-		$layout->set((array) $this);
-		print $layout;
-
-		$layout = NULL;
-
-		if(config()->debug_mode)
-		{
-			print new \Micro\View('System/Debug');
-		}
-	}
-
-}
-
-// End

+ 0 - 25
frameworks/PHP/micromvc/Command/Backup.php

@@ -1,25 +0,0 @@
-<?php
-
-// Start database connection
-$db = new \Micro\Database(config()->database);
-
-// Connect to databse server
-$db->connect();
-
-// Set name of migration object
-$migration = '\Micro\Migration\\' . ($db->type == 'mysql' ? 'MySQL' : 'PGSQL');
-
-// Create migration object
-$migration = new $migration;
-
-// Set database connection
-$migration->db = $db;
-
-// Set the database name
-$migration->name = 'default';
-
-// Load table configuration
-$migration->tables = config('Migration');
-
-// Backup existing database table
-$migration->backup_data();

+ 0 - 25
frameworks/PHP/micromvc/Command/Create.php

@@ -1,25 +0,0 @@
-<?php
-
-// Start database connection
-$db = new \Micro\Database(config()->database);
-
-// Connect to databse server
-$db->connect();
-
-// Set name of migration object
-$migration = '\Micro\Migration\\' . ($db->type == 'mysql' ? 'MySQL' : 'PGSQL');
-
-// Create migration object
-$migration = new $migration;
-
-// Set database connection
-$migration->db = $db;
-
-// Set the database name
-$migration->name = 'default';
-
-// Load table configuration
-$migration->tables = config('Migration');
-
-// Backup existing database table
-$migration->create_schema();

+ 0 - 25
frameworks/PHP/micromvc/Command/Restore.php

@@ -1,25 +0,0 @@
-<?php
-
-// Start database connection
-$db = new \Micro\Database(config()->database);
-
-// Connect to databse server
-$db->connect();
-
-// Set name of migration object
-$migration = '\Micro\Migration\\' . ($db->type == 'mysql' ? 'MySQL' : 'PGSQL');
-
-// Create migration object
-$migration = new $migration;
-
-// Set database connection
-$migration->db = $db;
-
-// Set the database name
-$migration->name = 'default';
-
-// Load table configuration
-$migration->tables = config('Migration');
-
-// Backup existing database table
-$migration->restore_data();

+ 0 - 27
frameworks/PHP/micromvc/Command/Run.php

@@ -1,27 +0,0 @@
-<?php
-
-// Start database connection
-$db = new \Micro\Database(config()->database);
-
-// Connect to databse server
-$db->connect();
-
-// Set name of migration object
-$migration = '\Micro\Migration\\' . ($db->type == 'mysql' ? 'MySQL' : 'PGSQL');
-
-// Create migration object
-$migration = new $migration;
-
-// Set database connection
-$migration->db = $db;
-
-// Set the database name
-$migration->name = 'default';
-
-// Load table configuration
-$migration->tables  = config('Migration');
-
-// Backup existing database table
-$migration->backup_data();
-$migration->create_schema();
-$migration->restore_data();

+ 0 - 521
frameworks/PHP/micromvc/Common.php

@@ -1,521 +0,0 @@
-<?php
-/**
- * Core Bootstrap
- *
- * This file contains all common system functions and View and Controller classes.
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2011 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-
-
-/**
- * Attach (or remove) multiple callbacks to an event and trigger those callbacks when that event is called.
- *
- * @param string $event name
- * @param mixed $value the optional value to pass to each callback
- * @param mixed $callback the method or function to call - FALSE to remove all callbacks for event
- */
-function event($event, $value = NULL, $callback = NULL)
-{
-	static $events;
-
-	// Adding or removing a callback?
-	if($callback !== NULL)
-	{
-		if($callback)
-		{
-			$events[$event][] = $callback;
-		}
-		else
-		{
-			unset($events[$event]);
-		}
-	}
-	elseif(isset($events[$event])) // Fire a callback
-	{
-		foreach($events[$event] as $function)
-		{
-			$value = call_user_func($function, $value);
-		}
-		return $value;
-	}
-}
-
-
-/**
- * Fetch a config value from a module configuration file
- *
- * @param string $file name of the config
- * @param boolean $clear to clear the config object
- * @return object
- */
-function config($file = 'Config', $clear = FALSE)
-{
-	static $configs = array();
-
-	if($clear)
-	{
-		unset($configs[$file]);
-		return;
-	}
-
-	if(empty($configs[$file]))
-	{
-		//$configs[$file] = new \Micro\Config($file);
-		require(SP . 'Config/' . $file . EXT);
-		$configs[$file] = (object) $config;
-		//print dump($configs);
-	}
-
-	return $configs[$file];
-}
-
-
-/**
- * Return an HTML safe dump of the given variable(s) surrounded by "pre" tags.
- * You can pass any number of variables (of any type) to this function.
- *
- * @param mixed
- * @return string
- */
-function dump()
-{
-	$string = '';
-	foreach(func_get_args() as $value)
-	{
-		$string .= '<pre>' . h($value === NULL ? 'NULL' : (is_scalar($value) ? $value : print_r($value, TRUE))) . "</pre>\n";
-	}
-	return $string;
-}
-
-
-/**
- * Safely fetch a $_POST value, defaulting to the value provided if the key is
- * not found.
- *
- * @param string $key name
- * @param mixed $default value if key is not found
- * @param boolean $string TRUE to require string type
- * @return mixed
- */
-function post($key, $default = NULL, $string = FALSE)
-{
-	if(isset($_POST[$key]))
-	{
-		return $string ? (string)$_POST[$key] : $_POST[$key];
-	}
-	return $default;
-}
-
-
-/**
- * Safely fetch a $_GET value, defaulting to the value provided if the key is
- * not found.
- *
- * @param string $key name
- * @param mixed $default value if key is not found
- * @param boolean $string TRUE to require string type
- * @return mixed
- */
-function get($key, $default = NULL, $string = FALSE)
-{
-	if(isset($_GET[$key]))
-	{
-		return $string ? (string)$_GET[$key] : $_GET[$key];
-	}
-	return $default;
-}
-
-
-/**
- * Safely fetch a $_SESSION value, defaulting to the value provided if the key is
- * not found.
- *
- * @param string $k the post key
- * @param mixed $d the default value if key is not found
- * @return mixed
- */
-function session($k, $d = NULL)
-{
-	return isset($_SESSION[$k]) ? $_SESSION[$k] : $d;
-}
-
-
-/**
- * Create a random 32 character MD5 token
- *
- * @return string
- */
-function token()
-{
-	return md5(str_shuffle(chr(mt_rand(32, 126)) . uniqid() . microtime(TRUE)));
-}
-
-
-/**
- * Write to the application log file using error_log
- *
- * @param string $message to save
- * @return bool
- */
-function log_message($message)
-{
-	//$path = SP . 'Storage/Log/' . date('Y-m-d') . '.log';
-	$path = 'stderr';
-
-	// Append date and IP to log message
-	return error_log(date('H:i:s ') . getenv('REMOTE_ADDR') . " $message\n", 3, $path);
-}
-
-
-/**
- * Send a HTTP header redirect using "location" or "refresh".
- *
- * @param string $url the URL string
- * @param int $c the HTTP status code
- * @param string $method either location or redirect
- */
-function redirect($url = NULL, $code = 302, $method = 'location')
-{
-	if(strpos($url, '://') === FALSE)
-	{
-		$url = site_url($url);
-	}
-
-	//print dump($url);
-
-	header($method == 'refresh' ? "Refresh:0;url = $url" : "Location: $url", TRUE, $code);
-}
-
-
-/*
- * Return the full URL to a path on this site or another.
- *
- * @param string $uri may contain another sites TLD
- * @return string
- *
-function site_url($uri = NULL)
-{
-	return (strpos($uri, '://') === FALSE ? \Micro\URL::get() : '') . ltrim($uri, '/');
-}
-*/
-
-/**
- * Return the full URL to a location on this site
- *
- * @param string $path to use or FALSE for current path
- * @param array $params to append to URL
- * @return string
- */
-function site_url($path = NULL, array $params = NULL)
-{
-	// In PHP 5.4, http_build_query will support RFC 3986
-	return DOMAIN . ($path ? '/'. trim($path, '/') : PATH)
-		. ($params ? '?'. str_replace('+', '%20', http_build_query($params, TRUE, '&')) : '');
-}
-
-
-/**
- * Return the current URL with path and query params
- *
- * @return string
- *
-function current_url()
-{
-	return DOMAIN . getenv('REQUEST_URI');
-}
-*/
-
-/**
- * Convert a string from one encoding to another encoding
- * and remove invalid bytes sequences.
- *
- * @param string $string to convert
- * @param string $to encoding you want the string in
- * @param string $from encoding that string is in
- * @return string
- */
-function encode($string, $to = 'UTF-8', $from = 'UTF-8')
-{
-	// ASCII is already valid UTF-8
-	if($to == 'UTF-8' AND is_ascii($string))
-	{
-		return $string;
-	}
-
-	// Convert the string
-	return @iconv($from, $to . '//TRANSLIT//IGNORE', $string);
-}
-
-
-/**
- * Tests whether a string contains only 7bit ASCII characters.
- *
- * @param string $string to check
- * @return bool
- */
-function is_ascii($string)
-{
-	return ! preg_match('/[^\x00-\x7F]/S', $string);
-}
-
-
-/**
- * Encode a string so it is safe to pass through the URL
- *
- * @param string $string to encode
- * @return string
- */
-function base64_url_encode($string = NULL)
-{
-	return strtr(base64_encode($string), '+/=', '-_~');
-}
-
-
-/**
- * Decode a string passed through the URL
- *
- * @param string $string to decode
- * @return string
- */
-function base64_url_decode($string = NULL)
-{
-	return base64_decode(strtr($string, '-_~', '+/='));
-}
-
-
-/**
- * Convert special characters to HTML safe entities.
- *
- * @param string $string to encode
- * @return string
- */
-function h($string)
-{
-	return htmlspecialchars($string, ENT_QUOTES, 'utf-8');
-}
-
-
-/**
- * Filter a valid UTF-8 string so that it contains only words, numbers,
- * dashes, underscores, periods, and spaces - all of which are safe
- * characters to use in file names, URI, XML, JSON, and (X)HTML.
- *
- * @param string $string to clean
- * @param bool $spaces TRUE to allow spaces
- * @return string
- */
-function sanitize($string, $spaces = TRUE)
-{
-	$search = array(
-		'/[^\w\-\. ]+/u',			// Remove non safe characters
-		'/\s\s+/',					// Remove extra whitespace
-		'/\.\.+/', '/--+/', '/__+/'	// Remove duplicate symbols
-	);
-
-	$string = preg_replace($search, array(' ', ' ', '.', '-', '_'), $string);
-
-	if( ! $spaces)
-	{
-		$string = preg_replace('/--+/', '-', str_replace(' ', '-', $string));
-	}
-
-	return trim($string, '-._ ');
-}
-
-
-/**
- * Create a SEO friendly URL string from a valid UTF-8 string.
- *
- * @param string $string to filter
- * @return string
- */
-function sanitize_url($string)
-{
-	return urlencode(mb_strtolower(sanitize($string, FALSE)));
-}
-
-
-/**
- * Filter a valid UTF-8 string to be file name safe.
- *
- * @param string $string to filter
- * @return string
- */
-function sanitize_filename($string)
-{
-	return sanitize($string, FALSE);
-}
-
-
-/**
- * Return a SQLite/MySQL/PostgreSQL datetime string
- *
- * @param int $timestamp
- */
-function sql_date($timestamp = NULL)
-{
-	return date('Y-m-d H:i:s', $timestamp ?: time());
-}
-
-
-/**
- * Make a request to the given URL using cURL.
- *
- * @param string $url to request
- * @param array $options for cURL object
- * @return object
- */
-function curl_request($url, array $options = NULL)
-{
-	$ch = curl_init($url);
-
-	$defaults = array(
-		CURLOPT_HEADER => 0,
-		CURLOPT_RETURNTRANSFER => 1,
-		CURLOPT_TIMEOUT => 5,
-	);
-
-	// Connection options override defaults if given
-	curl_setopt_array($ch, (array) $options + $defaults);
-
-	// Create a response object
-	$object = new stdClass;
-
-	// Get additional request info
-	$object->response = curl_exec($ch);
-	$object->error_code = curl_errno($ch);
-	$object->error = curl_error($ch);
-	$object->info = curl_getinfo($ch);
-
-	curl_close($ch);
-
-	return $object;
-}
-
-
-/**
- * Create a RecursiveDirectoryIterator object
- *
- * @param string $dir the directory to load
- * @param boolean $recursive to include subfolders
- * @return object
- */
-function directory($dir, $recursive = TRUE)
-{
-	$i = new \RecursiveDirectoryIterator($dir);
-
-	if( ! $recursive) return $i;
-
-	return new \RecursiveIteratorIterator($i, \RecursiveIteratorIterator::SELF_FIRST);
-}
-
-
-/**
- * Make sure that a directory exists and is writable by the current PHP process.
- *
- * @param string $dir the directory to load
- * @param string $chmod value as octal
- * @return boolean
- */
-function directory_is_writable($dir, $chmod = 0755)
-{
-	// If it doesn't exist, and can't be made
-	if(! is_dir($dir) AND ! mkdir($dir, $chmod, TRUE)) return FALSE;
-
-	// If it isn't writable, and can't be made writable
-	if(! is_writable($dir) AND !chmod($dir, $chmod)) return FALSE;
-
-	return TRUE;
-}
-
-
-/**
- * Convert any given variable into a SimpleXML object
- *
- * @param mixed $object variable object to convert
- * @param string $root root element name
- * @param object $xml xml object
- * @param string $unknown element name for numeric keys
- * @param string $doctype XML doctype
- */
-function to_xml($object, $root = 'data', $xml = NULL, $unknown = 'element', $doctype = "<?xml version = '1.0' encoding = 'utf-8'?>")
-{
-	if(is_null($xml))
-	{
-		$xml = simplexml_load_string("$doctype<$root/>");
-	}
-
-	foreach((array) $object as $k => $v)
-	{
-		if(is_int($k))
-		{
-			$k = $unknown;
-		}
-
-		if(is_scalar($v))
-		{
-			$xml->addChild($k, h($v));
-		}
-		else
-		{
-			$v = (array) $v;
-			$node = array_diff_key($v, array_keys(array_keys($v))) ? $xml->addChild($k) : $xml;
-			self::from($v, $k, $node);
-		}
-	}
-
-	return $xml;
-}
-
-
-/**
- * Return an IntlDateFormatter object using the current system locale
- *
- * @param string $locale string
- * @param integer $datetype IntlDateFormatter constant
- * @param integer $timetype IntlDateFormatter constant
- * @param string $timezone Time zone ID, default is system default
- * @return IntlDateFormatter
- */
-function __date($locale = NULL, $datetype = IntlDateFormatter::MEDIUM, $timetype = IntlDateFormatter::SHORT, $timezone = NULL)
-{
-	return new IntlDateFormatter($locale ?: setlocale(LC_ALL, 0), $datetype, $timetype, $timezone);
-}
-
-
-/**
- * Format the given string using the current system locale
- * Basically, it's sprintf on i18n steroids.
- *
- * @param string $string to parse
- * @param array $params to insert
- * @return string
- */
-function __($string, array $params = NULL)
-{
-	return msgfmt_format_message(setlocale(LC_ALL, 0), $string, $params);
-}
-
-
-/**
- * Color output text for the CLI
- *
- * @param string $text to color
- * @param string $color of text
- * @param string $background color
- */
-function colorize($text, $color, $bold = FALSE)
-{
-	// Standard CLI colors
-	$colors = array_flip(array(30 => 'gray', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white', 'black'));
-
-	// Escape string with color information
-	return"\033[" . ($bold ? '1' : '0') . ';' . $colors[$color] . "m$text\033[0m";
-}
-
-// End

+ 0 - 73
frameworks/PHP/micromvc/Config/Config.php

@@ -1,73 +0,0 @@
-<?php
-/**
- * Config
- *
- * Core system configuration file
- *
- * @package		MicroMVC
- * @author		David Pennington
- * @copyright	(c) 2010 MicroMVC Framework
- * @license		http://micromvc.com/license
- ********************************** 80 Columns *********************************
- */
-
-// Base site url - Not currently supported!
-$config['site_url'] = '/';
-
-// Enable debug mode?
-$config['debug_mode'] = FALSE;
-
-// Load boostrap file?
-$config['bootstrap'] = TRUE;
-
-// Available translations (Array of Locales)
-$config['languages'] = array('en');
-
-/**
- * Database
- *
- * This system uses PDO to connect to MySQL, SQLite, or PostgreSQL.
- * Visit http://us3.php.net/manual/en/pdo.drivers.php for more info.
- */
-$config['database'] = array(
-	'dns' => "mysql:host=localhost;port=3306;dbname=hello_world",
-	'username' => 'benchmarkdbuser',
-	'password' => 'benchmarkdbpass',
-	'params' => array()
-);
-
-
-/**
- * System Events
- */
-$config['events'] = array(
-	//'pre_controller'	=> 'Class::method',
-	//'post_controller'	=> 'Class::method',
-);
-
-/**
- * Cookie Handling
- *
- * To insure your cookies are secure, please choose a long, random key!
- * @link http://php.net/setcookie
- */
-$config['cookie'] = array(
-	'key' => 'very-secret-key',
-	'timeout' => time()+(60*60*4), // Ignore submitted cookies older than 4 hours
-	'expires' => 0, // Expire on browser close
-	'path' => '/',
-	'domain' => '',
-	'secure' => '',
-	'httponly' => '',
-);
-
-
-/**
- * API Keys and Secrets
- *
- * Insert you API keys and other secrets here.
- * Use for Akismet, ReCaptcha, Facebook, and more!
- */
-
-//$config['XXX_api_key'] = '...';
-

+ 0 - 36
frameworks/PHP/micromvc/Config/Route.php

@@ -1,36 +0,0 @@
-<?php
-/**
- * URL Routing
- *
- * URLs are very important to the future usability of your site. Take
- * time to think about your structure in a way that is meaningful. Place
- * your most common page routes at the top for better performace.
- *
- * - Routes are matched from left-to-right.
- * - Regex can also be used to define routes if enclosed in "/.../"
- * - Each regex catch pattern (...) will be viewed as a parameter.
- * - The remaning (unmached) URL path will be passed as parameters.
- *
- ** Simple Example **
- * URL Path:	/forum/topic/view/45/Hello-World
- * Route:		"forum/topic/view" => 'Forum\Controller\Forum\View'
- * Result:		Forum\Controller\Forum\View->action('45', 'Hello-World');
- *
- ** Regex Example **
- * URL Path:	/John_Doe4/recent/comments/3
- * Route:		"/^(\w+)/recent/comments/' => 'Comments\Controller\Recent'
- * Result:		Comments\Controller\Recent->action($username = 'John_Doe4', $page = 3)
- */
-$config = array();
-
-$config['routes'] = array(
-	''					=> '\Controller\Index',
-	'404'				=> '\Controller\Page404',
-	'school'			=> '\Controller\School',
-    'json'			    => '\Controller\Benchmark\Json',
-    'db'			    => '\Controller\Benchmark\Db',
-
-	// Example paths
-	//'example/path'		=> '\Controller\Example\Hander',
-	//'example/([^/]+)'	=> '\Controller\Example\Param',
-);

+ 0 - 29
frameworks/PHP/micromvc/Config/Sample.Migration.php

@@ -1,29 +0,0 @@
-<?php
-
-/* Example Column Options:
-$column = array(
-	'type' => 'primary|string|integer|boolean|decimal|datetime',
-	'length' => NULL,
-	'index' => FALSE,
-	'null' => TRUE,
-	'default' => NULL,
-	'unique' => FALSE,
-	'precision' => 0, // (optional, default 0) The precision for a decimal (exact numeric) column. (Applies only if a decimal column is used.)
-	'scale' => 0, // (optional, default 0) The scale for a decimal (exact numeric) column. (Applies only if a decimal column is used.)
-);
-*/
-
-$config = array(
-
-	'test_table' => array(
-		'id' => array('type' => 'primary'),
-		'title' => array('type' => 'string', 'length' => 100),
-		'text' => array('type' => 'string'),
-		'created' => array('type' => 'datetime'),
-		'modified' => array('type' => 'datetime'),
-	),
-
-
-
-
-);

+ 0 - 0
frameworks/PHP/micromvc/Locale/.gitignore


+ 0 - 51
frameworks/PHP/micromvc/Public/.htaccess

@@ -1,51 +0,0 @@
-##############################
-# MicroMVC Apache2 settings
-##############################
-
-# 1and1.com users might need to un-comment this line
-#AddType x-mapp-php5 .php
-
-# Disable directory browsing
-Options All -Indexes
-
-# Prevent folder listing
-#IndexIgnore *
-
-# Set the default file for indexes
-DirectoryIndex index.php index.html
-
-<IfModule mod_rewrite.c>
-
-	# mod_rewrite rules
-	RewriteEngine on
-
-	# The RewriteBase of the system (change if you are using this sytem in a sub-folder).
-	RewriteBase /
-
-	# If the file/dir does not exist, route everything to index.php
-	RewriteCond %{REQUEST_FILENAME} !-f
-	RewriteCond %{REQUEST_FILENAME} !-d
-	RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico)
-	RewriteRule ^(.*)$ index.php/$1 [QSA,L]
-
-	#############################
-	# Prevent Image hotlinking (must be blank refer or this site)
-	#RewriteCond %{HTTP_REFERER} !^$
-	#RewriteCond %{HTTP_REFERER} !^http://(micromvc|othersite) [NC]
-	#RewriteRule .*\.(gif|jpg|png)$ [NC,F]
-
-	#############################
-	# Deny any people (or bots) from the following sites: (to stop spam comments)
-	#RewriteCond %{HTTP_REFERER} nienschanz\.ru [NC,OR]
-	#RewriteCond %{HTTP_REFERER} porn\.com
-	#RewriteRule .* - [F]
-
-	# You can also uncomment this if you know the IP:
-	#Deny from 192.168.1.1
-
-</IfModule>
-
-# Cache static content for one week
-#<FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$">
-#	#Header set Cache-Control "max-age=604800"
-#</FilesMatch>

+ 0 - 212
frameworks/PHP/micromvc/Public/Admin/CSS/admin.css

@@ -1,212 +0,0 @@
-/* Typography - Choose your font and size (base.css default is 16px) */
-body
-{
-	font-size:80%;
-	line-height:1.5em;
-	font-family:Helvetica,Arial,sans-serif;
-	background: #202020;
-}
-/*IE*/
-html>body{font-size:13px}
-pre,code
-{
-	font-family:"DejaVu Sans Mono","Bitstream Vera Sans Mono",Monaco,"Courier New",monospace;
-}
-
-a img, img { border: none; }
-a {color: #2A90BF;text-decoration: none;}
-
-a:hover {
-color: #BE4925;
-text-decoration: underline;
-text-decoration: none;
-}
-
-
-#main {
-margin: 0 0 0 150px;
-background: #ddd;
-}
-
-#content {
-background: #fff;
-padding: 2em;
-margin: 1em 1em 2em 1em;
-margin: 0;
-}
-
-#sidebar { width: 150px; float: left; }
-
-#sidebar h2 {
-color: #777;
-border: none;
-font-size: 20px;
-line-height: 50px;
-text-align: center;
-}
-
-#sidebar ul {
-margin: 2em 0;
-padding: 0;
-list-style: none;
-}
-
-#sidebar ul li {margin: 0;padding: 0;}
-
-#sidebar ul li a {
-display: block;
-line-height: 2.5em;
-padding: 0 1em;
-border-bottom: 1px solid #333;
-color: #fff;
-font-size: 14px;
-font-weight: bold;
-text-shadow:0 1px 2px #000000;
-}
-
-/*
-#sidebar ul li a.selected,
-#sidebar ul li a:hover {
-background: #ddd;
-color: #000;
-text-shadow:0 1px 2px #eee;
-}
-*/
-
-#sidebar ul li a.selected,
-#sidebar ul li a:hover {
-background: #111;
-text-shadow:0 1px 1px #777;
-}
-
-/* Sub levels */
-#sidebar ul li ul { padding: 0; margin: 0; }
-#sidebar ul li li a { color: #ccc; padding: 0 1em 0 3em; }
-
-
-table thead a { color: #333;white-space:nowrap;}
-table tbody tr:hover {background: #f1f1f1;}
-
-
-/*
- * Header
- */
-#header {
-background: #eee;
-height: 30px;
-line-height: 30px;
-margin: 0;
-border-bottom: 0px solid #ddd;
-}
-
-/*
- * Footer
- */
-
-#footer {
-background: #eee;
-height: 30px;
-line-height: 30px;
-margin: 0;
-border-top: 1px solid #ddd;
-color: #777;
-}
-
-
-/*
- * Horizontal menu UL
- */
-ul.horizontal_menu,
-ul.horizontal_menu li {
-margin: 0;
-padding: 0;
-list-style: none;
-}
-ul.horizontal_menu li { float: left; padding: 0 1em; }
-ul.horizontal_menu li.right {float: right;}
-
-
-.box {
-	padding: 1em;
-	margin: 1em 0;
-	background: #eee;
-
-	border: 1px solid #fff;
-	-moz-box-shadow: 0px 1px 4px #bbb;
-	-webkit-box-shadow: 0px 1px 4px #bbb;
-  	box-shadow: 0px 1px 4px #bbb;
-
-  	background: #F7F7F7; /* old browsers */
-	background: -moz-linear-gradient(top, #F7F7F7 0%, #EAEAEA 100%); /* firefox */
-	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F7F7F7), color-stop(100%,#EAEAEA)); /* webkit */
-	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F7F7F7', endColorstr='#EAEAEA',GradientType=0 ); /* ie */
-}
-
-
-/* Create New link */
-.create_new { float: right; }
-
-.create_new a.button {
-	border-top: 1px solid #6ee653;
-	background: #57c246;
-	background: -webkit-gradient(linear, left top, left bottom, from(#57c246), to(#0c9427));
-	background: -moz-linear-gradient(top,  #57c246,#0c9427);
-	padding: 7px 15px;
-	-webkit-border-radius: 6px;
-	-moz-border-radius: 6px;
-	border-radius: 6px;
-	-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-	-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
-	box-shadow: rgba(0,0,0,1) 0 1px 0;
-	text-shadow: rgba(0,0,0,.4) 0 1px 0;
-	color: white;
-	text-decoration: none;
-	vertical-align: middle;
-	font-weight: bold;
-}
-.create_new a.button:hover {
-	background: #57c246;
-	background: -webkit-gradient(linear, left top, left bottom, from(#0c9427), to(#57c246));
-	background: -moz-linear-gradient(top, #0c9427, #57c246);
-	color: #ffffff;
-}
-.create_new a.button:active {
-	border-top-color: #1b435e;
-	background: #264d07;
-}
-
-
-/* Pagination links */
-.pagination a { padding: 5px 10px; border: 1px solid #ddd; background: #f8f8f8; border-radius: 4px; }
-.pagination a.current { color: #aaa; }
-
-
-
-/* Messages Boxes use the great Silk icons from http://famfamfam.com/ */
-.message, .warning, .error, .success
-{
-	margin: 1em auto;
-	display: block;
-	padding: .8em 50px;
-	border: 1px solid #fff;
-}
-.message
-{
-	background: #F8FAFC url(../images/message.png) 20px center no-repeat;
-	border-color: #B5D4FE;
-}
-.warning
-{
-	background: #fff6bf url(../images/warning.png) 20px center no-repeat;
-	border-color: #ffd324;
-}
-.error
-{
-	background: #fde6e9 url(../images/error.png) 20px center no-repeat;
-	border-color: #fb939f;
-}
-.success
-{
-	background: #EBFCE1 url(../images/success.png) 20px center no-repeat;
-	border-color: #B9DAA6;
-}

+ 0 - 90
frameworks/PHP/micromvc/Public/Admin/CSS/base.css

@@ -1,90 +0,0 @@
-/*
-A CSS framework by David Pennington
-Copyright 2011, MIT License
-http://xeoncross.com
-*/
-
-/* Master Reset */
-*{vertical-align:baseline}
-html,body,div,form,fieldset,input,textarea,th,td,h1,h2,h3,h4,h5,h6{margin:0;padding:0}
-article,aside,figure,figcaption,hgroup,footer,header,nav,section,video,object{display:block}
-th,td{text-align:left;vertical-align:top;padding:.5em;border:1px solid}
-table{border-collapse:collapse;border-spacing:0;width:100%}
-abbr,acronym{cursor:help;border-bottom:1px dotted}
-fieldset,img{border:0}
-pre{width:100%;white-space:pre;overflow:auto}
-.reset,.reset *{font-weight:inherit;font-family:inherit;font-style:inherit;font-size:1em;border:0;outline:0;padding:0;margin:0}
-
-/* Form Reset (IE7+) */
-input[type=text],input[type=email],input[type=password],input[type=url],input[type=tel],html>body textarea 
-{
-	width:100%;
-	padding:.5em;
-	margin:0 0 1.5em 0;
-	-webkit-box-sizing:border-box; /* Safari/Chrome, other WebKit */
-	-moz-box-sizing:border-box;    /* Firefox, other Gecko */
-	box-sizing:border-box;         /* Opera/IE 8+ */
-}
-
-/* 12 Column Grid System */
-
-/* 1024px, 1152px, & 1280 screens */
-.grid_1{width:50px}
-.grid_2{width:130px}
-.grid_3{width:210px}
-.grid_4{width:290px}
-.grid_5{width:370px}
-.grid_6{width:450px}
-.grid_7{width:530px}
-.grid_8{width:610px}
-.grid_9{width:690px}
-.grid_10{width:770px}
-.grid_11{width:850px}
-.grid_12{width:930px}
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{margin-left:30px;float:left;display:inline;/*overflow:hidden;*/}
-.container{width:930px;margin:0 auto;/*overflow:hidden;*/}
-.container .first, .container .grid_12{margin-left:0;clear:left}
-
-/* +1400px screens */
-@media only screen and (min-width:1400px){
-.grid_1{width:70px}
-.grid_2{width:170px}
-.grid_3{width:270px}
-.grid_4{width:370px}
-.grid_5{width:470px}
-.grid_6{width:570px}
-.grid_7{width:670px}
-.grid_8{width:770px}
-.grid_9{width:870px}
-.grid_10{width:970px}
-.grid_11{width:1070px}
-.grid_12{width:1170px}
-.container{width:1170px}
-}
-
-/* Mobile Devices */
-@media only screen and (max-width:700px){
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{width:100%;margin-left:0px}
-.container{width:auto;margin:0 2em}
-}
-
-/* Vertical Rhythm - Auto-ajusting Font/Line-Height Ratio */
-body{font-size:100%;line-height:1.5em;font-family:Georgia,serif;}/*IE*/
-html>body{font-size:1em}
-p{margin:0 0 1.5em 0;padding:0}
-h1,h2,h3,h4{font-weight:normal;line-height:1.5em}
-h1{font-size:4em}
-h2{font-size:3em}
-h3{font-size:1.5em;line-height:2em}
-h4{font-size:1em;font-weight:bold}
-table{margin:1em 0}
-th,td{border:1px solid;padding:.5em}
-blockquote{margin:1.5em;font-style:italic}
-ul,ol,dl{margin:1.5em;padding:0}
-ul ul,ol ol{margin:0 2em}
-pre{margin:1.5em 0;line-height:1.5em}
-input,select{font-family:inherit;font-size:1em;/*line-height:1.5em;height:1.5em;*/}
-textarea{margin:0 0 1.5em 0;height:9em;font-family:inherit;font-size:1em;}
-

+ 0 - 37
frameworks/PHP/micromvc/Public/Admin/CSS/style.css

@@ -1,37 +0,0 @@
-table thead tr
-{
-	border-bottom: 1px solid #fff;
-	-moz-box-shadow: 0px 1px 2px #ddd;
-  	-webkit-box-shadow: 0px 1px 2px #ddd;
- 	box-shadow: 0px 1px 2px #ddd;
-}
-
-table th
-{
-	background: #F7F7F7; /* old browsers */
-	background: -moz-linear-gradient(top, #F7F7F7 0%, #EAEAEA 100%); /* firefox */
-	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F7F7F7), color-stop(100%,#EAEAEA)); /* webkit */
-	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F7F7F7', endColorstr='#EAEAEA',GradientType=0 ); /* ie */
-}
-
-table tr {  border: 1px solid #eee;}
-table td, table th { border: 0; }
-tr:nth-of-type(odd) { background-color:#f8f8f8; }
-
-table tr.header { border-bottom: 1px solid #ddd; }
-table tr.header td { background: #eee; }
-
-/* Column Sorting Table Headers */
-table th a.sort_by {padding-right: 20px;}
-table th a.down {background: url(../images/bullet_arrow_down.png) right no-repeat;}
-table th a.up {background: url(../images/bullet_arrow_up.png) right no-repeat;}
-
-/* Special Links */
-a.delete, a.edit {margin: 0 .5em;}
-
-/* Form Reset (IE7+) */
-input[type=text],input[type=email],input[type=password],input[type=url],input[type=tel],html>body textarea
-{
-	border: 1px solid;
-	border-color: #888 #bbb #e2e2e2;
-}

BIN
frameworks/PHP/micromvc/Public/Admin/Images/bullet_arrow_down.png


BIN
frameworks/PHP/micromvc/Public/Admin/Images/bullet_arrow_up.png


BIN
frameworks/PHP/micromvc/Public/Admin/Images/error.png


+ 0 - 1
frameworks/PHP/micromvc/Public/Admin/Images/famfamfam.com

@@ -1 +0,0 @@
-Images from: http://famfamfam.com

BIN
frameworks/PHP/micromvc/Public/Admin/Images/message.png


BIN
frameworks/PHP/micromvc/Public/Admin/Images/success.png


BIN
frameworks/PHP/micromvc/Public/Admin/Images/warning.png


+ 0 - 89
frameworks/PHP/micromvc/Public/CSS/base.css

@@ -1,89 +0,0 @@
-/*
-A CSS framework by David Pennington
-Copyright 2011, MIT License
-http://xeoncross.com
-*/
-
-/* Master Reset */
-*{vertical-align:baseline}
-html,body,div,form,fieldset,input,textarea,th,td,h1,h2,h3,h4,h5,h6{margin:0;padding:0}
-article,aside,figure,figcaption,hgroup,footer,header,nav,section,video,object{display:block}
-th,td{text-align:left;vertical-align:top;padding:.5em;border:1px solid}
-table{border-collapse:collapse;border-spacing:0;width:100%}
-abbr,acronym{cursor:help;border-bottom:1px dotted}
-fieldset,img{border:0}
-pre{width:100%;white-space:pre;overflow:auto}
-.reset,.reset *{font-weight:inherit;font-family:inherit;font-style:inherit;font-size:1em;border:0;outline:0;padding:0;margin:0}
-
-/* Form Reset (IE7+) */
-input[type=text],input[type=email],input[type=password],input[type=url],input[type=tel],html>body textarea 
-{
-	width:100%;
-	padding:.5em;
-	-webkit-box-sizing:border-box; /* Safari/Chrome, other WebKit */
-	-moz-box-sizing:border-box;    /* Firefox, other Gecko */
-	box-sizing:border-box;         /* Opera/IE 8+ */
-}
-
-/* 12 Column Grid System */
-
-/* 1024px, 1152px, & 1280 screens */
-.grid_1{width:50px}
-.grid_2{width:130px}
-.grid_3{width:210px}
-.grid_4{width:290px}
-.grid_5{width:370px}
-.grid_6{width:450px}
-.grid_7{width:530px}
-.grid_8{width:610px}
-.grid_9{width:690px}
-.grid_10{width:770px}
-.grid_11{width:850px}
-.grid_12{width:930px}
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{margin-left:30px;float:left;display:inline;/*overflow:hidden;*/}
-.container{width:930px;margin:0 auto;/*overflow:hidden;*/}
-.container .first, .container .grid_12{margin-left:0;clear:left}
-
-/* +1400px screens */
-@media only screen and (min-width:1400px){
-.grid_1{width:70px}
-.grid_2{width:170px}
-.grid_3{width:270px}
-.grid_4{width:370px}
-.grid_5{width:470px}
-.grid_6{width:570px}
-.grid_7{width:670px}
-.grid_8{width:770px}
-.grid_9{width:870px}
-.grid_10{width:970px}
-.grid_11{width:1070px}
-.grid_12{width:1170px}
-.container{width:1170px}
-}
-
-/* Mobile Devices */
-@media only screen and (max-width:700px){
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{width:100%;margin-left:0px}
-.container{width:auto;margin:0 2em}
-}
-
-/* Vertical Rhythm - Auto-ajusting Font/Line-Height Ratio */
-body{font-size:100%;line-height:1.5em;font-family:Georgia,serif;}/*IE*/
-html>body{font-size:1em}
-p{margin:0 0 1.5em 0;padding:0}
-h1,h2,h3,h4{font-weight:normal;line-height:1.5em}
-h1{font-size:4em}
-h2{font-size:3em}
-h3{font-size:1.5em;line-height:2em}
-h4{font-size:1em;font-weight:bold}
-table{margin:1em 0}
-th,td{border:1px solid;padding:.5em}
-blockquote{margin:1.5em;font-style:italic}
-ul,ol,dl{margin:1.5em;padding:0}
-ul ul,ol ol{margin:0 2em}
-pre{margin:1.5em 0;line-height:1.5em}
-input,select{margin:0 0 1.5em 0;font-family:inherit;font-size:1em;/*line-height:1.5em;height:1.5em;*/}
-textarea{margin:0 0 1.5em 0;height:9em;font-family:inherit;font-size:1em;}
-

+ 0 - 86
frameworks/PHP/micromvc/Public/CSS/style.css

@@ -1,86 +0,0 @@
-/* Typography - Choose your font and size (base.css default is 16px) */
-body
-{
-	font-size:80%;
-	line-height:1.5em;
-	font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;
-} /*IE*/
-html>body{font-size:13px}
-pre,code
-{
-	font-family:"DejaVu Sans Mono","Bitstream Vera Sans Mono",Monaco,"Courier New",monospace;
-}
-
-header, #main, footer { float: left; width: 100%; }
-#main { margin: 2em 0; }
-a { text-decoration: none; color: #4B6E89;font-weight: bold; }
-a:hover { color: #000; }
-
-header { border-bottom: 1px solid #ddd; }
-header h1 { color: #ddd; margin: 0;line-height: 100px; }
-
-nav ul{ list-style: none;margin: 0;padding: 0;}
-nav ul li { float: right;margin: 0 2em 0 0;line-height: 100px; }
-
-#sidebar h3 { margin-bottom: 5px; }
-#sidebar ul { margin: 0; }
-#sidebar ul li {list-style: none;border-bottom: 1px solid #eee;line-height: 2.4em;}
-#sidebar ul li:hover { background: #f8f8f8; }
-
-footer { border-top: 1px solid #ddd; padding: 1em 0;color: #999;font-size: 12px; }
-footer .stats { text-align:right; }
-
-/* Form element label */
-form.formstyle label
-{
-	margin: 0px;
-	display: inline;
-	line-height: 2em;
-	float: left;
-	width: 100%;
-}
-form.formstyle label b { float: left; }
-form.formstyle label span
-{
-	color: #999;
-	display: block;
-	font-size: 12px;
-	float: right;
-	text-align: right;
-}
-form.formstyle .form_error
-{
-	color: #E83D1B;
-	font-weight: bold;
-	margin: -1.5em 0 1.5em 0;
-}
-
-/* Messages Boxes use the great Silk icons from http://famfamfam.com/ */
-.message, .warning, .error, .success
-{
-    margin: 1em auto;
-    display: block;
-    clear: both;
-    padding: .8em 50px;
-	border: 1px solid #fff;
-}
-.message
-{
-    background: #F8FAFC url(../Images/message.png) 20px center no-repeat;
-    border-color: #B5D4FE;
-}
-.warning
-{
-    background: #fff6bf url(../Images/warning.png) 20px center no-repeat;
-    border-color: #ffd324;
-}
-.error
-{
-    background: #fde6e9 url(../Images/error.png) 20px center no-repeat;
-    border-color: #fb939f;
-}
-.success
-{
-    background: #EBFCE1 url(../Images/success.png) 20px center no-repeat;
-    border-color: #B9DAA6;
-}

BIN
frameworks/PHP/micromvc/Public/Images/error.png


+ 0 - 1
frameworks/PHP/micromvc/Public/Images/famfamfam.com.txt

@@ -1 +0,0 @@
-http://famfamfam.com

BIN
frameworks/PHP/micromvc/Public/Images/message.png


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است