Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit e94ec84d1754a30e912bc6542406111584c5dd5c @seedifferently committed Feb 19, 2012
Showing with 5,573 additions and 0 deletions.
  1. +14 −0 CHANGELOG.rst
  2. +142 −0 README.rst
  3. +18 −0 bottle/README.rst
  4. +29 −0 bottle/bottle_app.py
  5. BIN bottle/hello.db
  6. +10 −0 bottle/templates/db.tpl
  7. +12 −0 bottle/templates/hello.tpl
  8. +9 −0 bottle/templates/master.tpl
  9. +38 −0 bottle/wsgi.wsgi
  10. +18 −0 cakephp/README.rst
  11. +303 −0 cakephp/app/config/core.php
  12. +82 −0 cakephp/app/config/database.php
  13. +22 −0 cakephp/app/controllers/hellos_controller.php
  14. BIN cakephp/app/hello.db
  15. +762 −0 cakephp/app/models/datasources/dbo/dbo_sqlite3.php
  16. +8 −0 cakephp/app/models/hello.php
  17. +7 −0 cakephp/app/views/hellos/hellodb.ctp
  18. +2 −0 cakephp/app/views/hellos/hellos.ctp
  19. +12 −0 cakephp/app/views/layouts/default.ctp
  20. +18 −0 codeigniter/README.rst
  21. +362 −0 codeigniter/application/config/config.php
  22. +69 −0 codeigniter/application/config/database.php
  23. +46 −0 codeigniter/application/config/routes.php
  24. +21 −0 codeigniter/application/controllers/hello.php
  25. +10 −0 codeigniter/application/controllers/index.html
  26. BIN codeigniter/application/hello.db
  27. +10 −0 codeigniter/application/index.html
  28. +10 −0 codeigniter/application/models/index.html
  29. +18 −0 codeigniter/application/views/hellodb.php
  30. +13 −0 codeigniter/application/views/hellos.php
  31. +10 −0 codeigniter/application/views/index.html
  32. 0 django/HelloWorld/__init__.py
  33. BIN django/HelloWorld/hello.db
  34. +14 −0 django/HelloWorld/manage.py
  35. +1 −0 django/HelloWorld/models/__init__.py
  36. +11 −0 django/HelloWorld/models/hello.py
  37. +149 −0 django/HelloWorld/settings.py
  38. +9 −0 django/HelloWorld/templates/base.html
  39. +9 −0 django/HelloWorld/templates/hellodb.html
  40. +4 −0 django/HelloWorld/templates/hellos.html
  41. 0 django/HelloWorld/templates/index.html
  42. +21 −0 django/HelloWorld/urls.py
  43. +13 −0 django/HelloWorld/views.py
  44. +18 −0 django/README.rst
  45. +36 −0 django/wsgi.wsgi
  46. +18 −0 flask/README.rst
  47. +26 −0 flask/flask_app.py
  48. BIN flask/hello.db
  49. +10 −0 flask/templates/db.html
  50. +12 −0 flask/templates/hello.html
  51. +9 −0 flask/templates/master.html
  52. +34 −0 flask/wsgi.wsgi
  53. +18 −0 kohana/README.rst
  54. +120 −0 kohana/application/bootstrap.php
  55. +10 −0 kohana/application/classes/controller/hello.php
  56. +15 −0 kohana/application/classes/controller/hellodb.php
  57. +17 −0 kohana/application/classes/controller/helloorm.php
  58. +13 −0 kohana/application/classes/controller/hellos.php
  59. +14 −0 kohana/application/classes/model/hello.php
  60. +16 −0 kohana/application/config/database.php
  61. BIN kohana/application/hello.db
  62. +7 −0 kohana/application/views/hellodb.php
  63. +7 −0 kohana/application/views/helloorm.php
  64. +1 −0 kohana/application/views/hellos.php
  65. +22 −0 kohana/application/views/master.php
  66. +3 −0 pyramid/HelloWorld/CHANGES.txt
  67. +4 −0 pyramid/HelloWorld/README.txt
  68. BIN pyramid/HelloWorld/hello.db
  69. +25 −0 pyramid/HelloWorld/helloworld/__init__.py
  70. +82 −0 pyramid/HelloWorld/helloworld/models.py
  71. +10 −0 pyramid/HelloWorld/helloworld/templates/db.jinja2
  72. +12 −0 pyramid/HelloWorld/helloworld/templates/hello.jinja2
  73. +9 −0 pyramid/HelloWorld/helloworld/templates/master.jinja2
  74. +22 −0 pyramid/HelloWorld/helloworld/views.py
  75. +22 −0 pyramid/HelloWorld/production.ini
  76. +44 −0 pyramid/HelloWorld/setup.py
  77. +18 −0 pyramid/README.rst
  78. +35 −0 pyramid/wsgi.wsgi
  79. +33 −0 rails/Gemfile
  80. +18 −0 rails/README.rst
  81. +10 −0 rails/app/controllers/hello_controller.rb
  82. +2 −0 rails/app/models/hello.rb
  83. +7 −0 rails/app/views/hello/hellodb.html.erb
  84. +1 −0 rails/app/views/hello/hellos.html.erb
  85. +11 −0 rails/app/views/layouts/application.html.erb
  86. +25 −0 rails/config/database.yml
  87. +62 −0 rails/config/routes.rb
  88. BIN rails/db/production.sqlite3
  89. +7 −0 rails/db/seeds.rb
  90. +18 −0 sinatra/README.rst
  91. +6 −0 sinatra/config.ru
  92. BIN sinatra/hello.db
  93. +17 −0 sinatra/sinatra_app.rb
  94. +7 −0 sinatra/views/hellodb.erb
  95. +1 −0 sinatra/views/hellos.erb
  96. +11 −0 sinatra/views/layout.erb
  97. +18 −0 symfony/README.rst
  98. +12 −0 symfony/app/Resources/views/base.html.twig
  99. +48 −0 symfony/app/autoload.php
  100. +60 −0 symfony/app/config/config.yml
  101. +13 −0 symfony/app/config/parameters.ini
  102. +8 −0 symfony/app/config/routing.yml
  103. BIN symfony/hello.db
  104. +9 −0 symfony/src/Acme/HelloBundle/AcmeHelloBundle.php
  105. +20 −0 symfony/src/Acme/HelloBundle/Controller/DefaultController.php
  106. +15 −0 symfony/src/Acme/HelloBundle/Controller/HelloController.php
  107. +16 −0 symfony/src/Acme/HelloBundle/Controller/HellodbController.php
  108. +28 −0 symfony/src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php
  109. +29 −0 symfony/src/Acme/HelloBundle/DependencyInjection/Configuration.php
  110. +25 −0 symfony/src/Acme/HelloBundle/Entity/Hello.php
  111. +11 −0 symfony/src/Acme/HelloBundle/Resources/config/routing.yml
  112. +7 −0 symfony/src/Acme/HelloBundle/Resources/config/services.yml
  113. 0 symfony/src/Acme/HelloBundle/Resources/doc/index.rst
  114. +11 −0 symfony/src/Acme/HelloBundle/Resources/translations/messages.fr.xliff
  115. +5 −0 symfony/src/Acme/HelloBundle/Resources/views/Default/hello.html.twig
  116. +10 −0 symfony/src/Acme/HelloBundle/Resources/views/Default/hellodb.html.twig
  117. 0 symfony/src/Acme/HelloBundle/Resources/views/Default/index.html.twig
  118. +17 −0 symfony/src/Acme/HelloBundle/Tests/Controller/DefaultControllerTest.php
  119. +10 −0 turbogears/HelloWorld/HelloWorld.egg-info/PKG-INFO
  120. +47 −0 turbogears/HelloWorld/HelloWorld.egg-info/SOURCES.txt
  121. +1 −0 turbogears/HelloWorld/HelloWorld.egg-info/dependency_links.txt
  122. +7 −0 turbogears/HelloWorld/HelloWorld.egg-info/entry_points.txt
  123. +4 −0 turbogears/HelloWorld/HelloWorld.egg-info/paster_plugins.txt
  124. +5 −0 turbogears/HelloWorld/HelloWorld.egg-info/requires.txt
  125. +1 −0 turbogears/HelloWorld/HelloWorld.egg-info/top_level.txt
  126. +4 −0 turbogears/HelloWorld/MANIFEST.in
  127. +24 −0 turbogears/HelloWorld/README.txt
  128. +122 −0 turbogears/HelloWorld/development.ini
  129. +14 −0 turbogears/HelloWorld/ez_setup/README.txt
  130. +229 −0 turbogears/HelloWorld/ez_setup/__init__.py
  131. BIN turbogears/HelloWorld/hello.db
  132. +2 −0 turbogears/HelloWorld/helloworld/__init__.py
  133. +2 −0 turbogears/HelloWorld/helloworld/config/__init__.py
  134. +40 −0 turbogears/HelloWorld/helloworld/config/app_cfg.py
  135. +88 −0 turbogears/HelloWorld/helloworld/config/deployment.ini
  136. +9 −0 turbogears/HelloWorld/helloworld/config/environment.py
  137. +39 −0 turbogears/HelloWorld/helloworld/config/middleware.py
  138. +2 −0 turbogears/HelloWorld/helloworld/controllers/__init__.py
  139. +21 −0 turbogears/HelloWorld/helloworld/controllers/controller.template
  140. +30 −0 turbogears/HelloWorld/helloworld/controllers/error.py
  141. +61 −0 turbogears/HelloWorld/helloworld/controllers/root.py
  142. +5 −0 turbogears/HelloWorld/helloworld/controllers/secure.py
  143. +35 −0 turbogears/HelloWorld/helloworld/controllers/template.py
  144. +24 −0 turbogears/HelloWorld/helloworld/i18n/ru/LC_MESSAGES/helloworld.po
  145. +2 −0 turbogears/HelloWorld/helloworld/lib/__init__.py
  146. +18 −0 turbogears/HelloWorld/helloworld/lib/app_globals.py
  147. +29 −0 turbogears/HelloWorld/helloworld/lib/base.py
  148. +5 −0 turbogears/HelloWorld/helloworld/lib/helpers.py
  149. +62 −0 turbogears/HelloWorld/helloworld/model/__init__.py
  150. +25 −0 turbogears/HelloWorld/helloworld/model/hello.py
  151. +22 −0 turbogears/HelloWorld/helloworld/model/model.template
  152. +2 −0 turbogears/HelloWorld/helloworld/templates/__init__.py
  153. +16 −0 turbogears/HelloWorld/helloworld/templates/db.html
  154. +10 −0 turbogears/HelloWorld/helloworld/templates/db.jinja
  155. +10 −0 turbogears/HelloWorld/helloworld/templates/db.mak
  156. +18 −0 turbogears/HelloWorld/helloworld/templates/hello.html
  157. +12 −0 turbogears/HelloWorld/helloworld/templates/hello.jinja
  158. +10 −0 turbogears/HelloWorld/helloworld/templates/hello.mak
  159. +13 −0 turbogears/HelloWorld/helloworld/templates/master.html
  160. +9 −0 turbogears/HelloWorld/helloworld/templates/master.jinja
  161. +10 −0 turbogears/HelloWorld/helloworld/templates/master.mak
  162. +64 −0 turbogears/HelloWorld/helloworld/tests/__init__.py
  163. +2 −0 turbogears/HelloWorld/helloworld/tests/functional/__init__.py
  164. +1 −0 turbogears/HelloWorld/helloworld/tests/functional/test_authentication.py
  165. +58 −0 turbogears/HelloWorld/helloworld/tests/functional/test_root.py
  166. +52 −0 turbogears/HelloWorld/helloworld/tests/models/__init__.py
  167. +7 −0 turbogears/HelloWorld/helloworld/tests/models/test_auth.py
  168. +19 −0 turbogears/HelloWorld/helloworld/websetup/__init__.py
  169. +16 −0 turbogears/HelloWorld/helloworld/websetup/bootstrap.py
  170. +21 −0 turbogears/HelloWorld/helloworld/websetup/schema.py
  171. +90 −0 turbogears/HelloWorld/production.ini
  172. +32 −0 turbogears/HelloWorld/setup.cfg
  173. +45 −0 turbogears/HelloWorld/setup.py
  174. +25 −0 turbogears/HelloWorld/test.ini
  175. +18 −0 turbogears/README.rst
  176. +35 −0 turbogears/wsgi.wsgi
  177. +18 −0 webgo/README.rst
  178. BIN webgo/hello.db
  179. +26 −0 webgo/hello.go
  180. +9 −0 webgo/tmpl/db.mustache
  181. +11 −0 webgo/tmpl/hellodb.mustache
  182. +11 −0 webgo/tmpl/hellos.mustache
  183. +1 −0 webgo/tmpl/lipsum.mustache
  184. +18 −0 yii/README.rst
  185. +90 −0 yii/protected/config/main.php
  186. +9 −0 yii/protected/controllers/HelloController.php
  187. +10 −0 yii/protected/controllers/HellodbController.php
  188. +9 −0 yii/protected/controllers/HellosController.php
  189. BIN yii/protected/data/hello.db
  190. +28 −0 yii/protected/data/schema.mysql.sql
  191. +28 −0 yii/protected/data/schema.sqlite.sql
  192. BIN yii/protected/data/testdrive.db
  193. +84 −0 yii/protected/models/Hello.php
  194. +9 −0 yii/protected/views/hellodb/index.php
  195. +3 −0 yii/protected/views/hellos/index.php
  196. +12 −0 yii/protected/views/layouts/main.php
14 CHANGELOG.rst
@@ -0,0 +1,14 @@
+================================================================================
+Changelog
+================================================================================
+
+
+09/12/2011
+================================================================================
+
+* Updated Ubuntu LTS AMI (ami-fbbf7892 ubuntu-images-us/ubuntu-lucid-10.04-
+ amd64-server-20110719.manifest.xml)
+* Rails 2.x and 3.0 were dropped in favor of Rails 3.1.
+* CakePHP 1.2 was dropped in favor of 1.3, but Symfony and Yii were added as
+ they seem to have considerable market share.
+* Corrected faulty configuration of CakePHP's caching engine.
142 README.rst
@@ -0,0 +1,142 @@
+================================================================================
+The Great Web Framework Shootout
+================================================================================
+
+| Copyright: (c) 2012 Seth Davis
+| http://blog.curiasolutions.com/the-great-web-framework-shootout/
+
+
+Synopsis
+================================================================================
+
+Welcome to the great web framework shootout. Here you will find test code and
+benchmark results comparing the performance of a few of the most popular F/OSS
+web frameworks in use today.
+
+Please see the `Great Web Framework Shootout`_ website for more information.
+
+.. _Great Web Framework Shootout:
+ http://blog.curiasolutions.com/the-great-web-framework-shootout/
+
+
+Benchmark Results
+================================================================================
+
+Three basic tests were set up for each framework up to run. Below are the
+results of each test in requests per second from highest (best performance) to
+lowest (worst performance).
+
+
+The "Hello World" String Test
+--------------------------------------------------------------------------------
+
+This test simply spits out a string response. There's no template or DB calls
+involved, so the level of processing should be minimal.
+
+================= ========
+Framework Reqs/sec
+================= ========
+web.go (Go r59) 3346
+Pyramid 1.2 3026
+Bottle 0.9.6 2825
+Django 1.3.1 2159
+Flask 0.7.2 2054
+Sinatra 1.2.6 1583
+CodeIgniter 2.0.3 929
+TG 2.1.2 839
+Yii 1.1.8 726
+Kohana 3.2.0 714
+Rails 3.1 711
+Symfony 2.0.1 273
+CakePHP 1.3.11 254
+================= ========
+
+
+The "Hello World" Template Test
+--------------------------------------------------------------------------------
+
+This test prints out Lorem Ipsum via a template (thus engaging the framework's
+templating systems).
+
+================= ========
+Framework Reqs/sec
+================= ========
+Bottle 0.9.6 2417
+web.go (Go r59) 1959
+Flask 0.7.2 1918
+Pyramid 1.2 1650
+Sinatra 1.2.6 1329
+Django 1.3.1 1005
+CodeIgniter 2.0.3 884
+Kohana 3.2.0 675
+TG 2.1.2 663
+Rails 3.1 625
+Yii 1.1.8 548
+CakePHP 1.3.11 203
+Symfony 2.0.1 171
+================= ========
+
+
+The "Hello World" Template Test With DB Query
+--------------------------------------------------------------------------------
+
+This test loads 5 rows of Lorem Ipsum from a SQLite DB (via the default ORM or
+a sqlite3 driver) and then prints them out through a template (thus engaging
+both the framework’s ORM/DB driver and the templating system).
+
+================= ========
+Framework Reqs/sec
+================= ========
+Bottle 0.9.6 1562
+Flask 0.7.2 1191
+Sinatra 1.2.6 982
+web.go (Go r59) 741
+Pyramid 1.2 555
+CodeIgniter 2.0.3 542
+Django 1.3.1 465
+Rails 3.1 463
+Kohana 3.2.0 423
+TG 2.1.2 298
+Yii 1.1.8 201
+CakePHP 1.3.11 193
+Symfony 2.0.1 113
+================= ========
+
+
+Test Platform Setup
+================================================================================
+
+All tests were performed on Amazon's EC2 with the following configuration:
+
+* ami-fbbf7892 m1.large ubuntu-images-us/ubuntu-lucid-10.04-amd64-server-
+ 20110719.manifest.xml
+* As a "Large" instance, Amazon describes the resources as: 7.5 GB of memory, 4
+ EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of
+ local instance storage, 64-bit platform.
+* Apache 2.2.14 was used. (Yes, I know there are other options, but with
+ Apache's market share I figured it would be a good baseline.)
+* Python 2.6.5 and mod_wsgi 2.8 (embedded mode) were used for the Python based
+ tests.
+* Ruby 1.9.2p290 and Phusion Passenger 3.0.9 were used for the Ruby based tests.
+* PHP 5.3.2 (with APC enabled) was used for the PHP based tests.
+* ApacheBench was run with -n 10000 and -c 10 about 5-10 times each, and the
+ "best guess average" was chosen.
+
+
+Most Recent Changes
+================================================================================
+
+09/12/2011
+--------------------------------------------------------------------------------
+
+* Updated Ubuntu LTS AMI (ami-fbbf7892 ubuntu-images-us/ubuntu-lucid-10.04-
+ amd64-server-20110719.manifest.xml)
+* Rails 2.x and 3.0 were dropped in favor of Rails 3.1.
+* CakePHP 1.2 was dropped in favor of 1.3, but Symfony and Yii were added as
+ they seem to have considerable market share.
+* Corrected faulty configuration of CakePHP's caching engine.
+
+See `CHANGELOG.rst`_ for more.
+
+.. _CHANGELOG.rst: http://github.com/seedifferently/the-great-web-framework-
+ shootout/blob/master/CHANGELOG.rst
18 bottle/README.rst
@@ -0,0 +1,18 @@
+================================================================================
+Bottle test code for The Great Web Framework Shootout
+================================================================================
+
+| Copyright: (c) 2012 Seth Davis
+| http://blog.curiasolutions.com/the-great-web-framework-shootout/
+
+
+Synopsis
+================================================================================
+
+This code was last tested using Bottle **v0.9.6** and will likely perform
+differently when using a different version.
+
+Please see `The Great Web Framework Shootout`_ for more information.
+
+.. _The Great Web Framework Shootout:
+ http://blog.curiasolutions.com/the-great-web-framework-shootout/
29 bottle/bottle_app.py
@@ -0,0 +1,29 @@
+import os
+import sqlite3
+#from bottle import run
+from bottle import route
+from bottle import jinja2_template as template
+
+
+@route('/')
+def index():
+ return 'Hello World!'
+
+@route('/jinja_hello')
+def hello():
+ return template('templates/hello')
+
+@route('/jinja_sql')
+def hellodb():
+ db = sqlite3.connect(os.path.join(os.path.dirname(os.path.realpath(__file__))) + '/hello.db')
+
+ rows = db.execute('select id, data from hello order by id asc')
+ lipsum = [dict(id=row[0], data=row[1]) for row in rows.fetchall()]
+
+ return template('templates/db', hello=lipsum)
+
+
+#if __name__ == '__main__':
+# from bottle import debug
+# debug(True)
+# run(host='localhost', port=8080)
BIN bottle/hello.db
Binary file not shown.
10 bottle/templates/db.tpl
@@ -0,0 +1,10 @@
+{% extends "templates/master.tpl" %}
+{% block content %}
+ <p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
+
+ <table border="1">
+ {% for row in hello %}
+ <tr><td>{{ row['id'] }}</td><td>{{ row['data'] }}</td></tr>
+ {% endfor %}
+ </table>
+{% endblock %}
12 bottle/templates/hello.tpl
@@ -0,0 +1,12 @@
+{% extends "templates/master.tpl" %}
+{% block content %}
+ <p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
+
+ {#
+ <table border="1">
+ {% for k, v in request.environ.iteritems() %}
+ <tr><td>{{ k | escape }}</td><td>{{ v | escape }}</td></tr>
+ {% endfor %}
+ </table>
+ #}
+{% endblock %}
9 bottle/templates/master.tpl
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>Hello World</title>
+</head>
+<body>
+ {% block content %}{% endblock %}
+</body>
+</html>
38 bottle/wsgi.wsgi
@@ -0,0 +1,38 @@
+import os, sys
+
+# override stdout
+sys.stdout = sys.stderr
+
+# import site directives for virtualenv
+import site
+
+ALLDIRS = ['/var/www/venv_bottle/lib/python2.6/site-packages']
+
+# Remember original sys.path.
+prev_sys_path = list(sys.path)
+
+# Add each new site-packages directory.
+for directory in ALLDIRS:
+ site.addsitedir(directory)
+
+# Reorder sys.path so new directories at the front.
+new_sys_path = []
+for item in list(sys.path):
+ if item not in prev_sys_path:
+ new_sys_path.append(item)
+ sys.path.remove(item)
+sys.path[:0] = new_sys_path
+
+# append project root directory path
+path = '/var/www/bottle_096'
+if path not in sys.path:
+ sys.path.append(path)
+
+os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'
+
+os.chdir(os.path.dirname(__file__))
+
+import bottle
+import bottle_app
+application = bottle.default_app()
+
18 cakephp/README.rst
@@ -0,0 +1,18 @@
+================================================================================
+CakePHP test code for The Great Web Framework Shootout
+================================================================================
+
+| Copyright: (c) 2012 Seth Davis
+| http://blog.curiasolutions.com/the-great-web-framework-shootout/
+
+
+Synopsis
+================================================================================
+
+This code was last tested using CakePHP **v1.3.11** and will likely perform
+differently when using a different version.
+
+Please see `The Great Web Framework Shootout`_ for more information.
+
+.. _The Great Web Framework Shootout:
+ http://blog.curiasolutions.com/the-great-web-framework-shootout/
303 cakephp/app/config/core.php
@@ -0,0 +1,303 @@
+<?php
+/**
+ * This is core configuration file.
+ *
+ * Use it to configure core behavior of Cake.
+ *
+ * PHP versions 4 and 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
+ * @package cake
+ * @subpackage cake.app.config
+ * @since CakePHP(tm) v 0.2.9
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+
+/**
+ * CakePHP Debug Level:
+ *
+ * Production Mode:
+ * 0: No error messages, errors, or warnings shown. Flash messages redirect.
+ *
+ * Development Mode:
+ * 1: Errors and warnings shown, model caches refreshed, flash messages halted.
+ * 2: As in 1, but also with full debug messages and SQL output.
+ *
+ * In production mode, flash messages redirect after a time interval.
+ * In development mode, you need to click the flash message to continue.
+ */
+ Configure::write('debug', 0);
+
+/**
+ * CakePHP Log Level:
+ *
+ * In case of Production Mode CakePHP gives you the possibility to continue logging errors.
+ *
+ * The following parameters can be used:
+ * Boolean: Set true/false to activate/deactivate logging
+ * Configure::write('log', true);
+ *
+ * Integer: Use built-in PHP constants to set the error level (see error_reporting)
+ * Configure::write('log', E_ERROR | E_WARNING);
+ * Configure::write('log', E_ALL ^ E_NOTICE);
+ */
+ Configure::write('log', true);
+
+/**
+ * Application wide charset encoding
+ */
+ Configure::write('App.encoding', 'UTF-8');
+
+/**
+ * To configure CakePHP *not* to use mod_rewrite and to
+ * use CakePHP pretty URLs, remove these .htaccess
+ * files:
+ *
+ * /.htaccess
+ * /app/.htaccess
+ * /app/webroot/.htaccess
+ *
+ * And uncomment the App.baseUrl below:
+ */
+ //Configure::write('App.baseUrl', env('SCRIPT_NAME'));
+
+/**
+ * Uncomment the define below to use CakePHP prefix routes.
+ *
+ * The value of the define determines the names of the routes
+ * and their associated controller actions:
+ *
+ * Set to an array of prefixes you want to use in your application. Use for
+ * admin or other prefixed routes.
+ *
+ * Routing.prefixes = array('admin', 'manager');
+ *
+ * Enables:
+ * `admin_index()` and `/admin/controller/index`
+ * `manager_index()` and `/manager/controller/index`
+ *
+ * [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead]
+ */
+ //Configure::write('Routing.prefixes', array('admin'));
+
+/**
+ * Turn off all caching application-wide.
+ *
+ */
+ //Configure::write('Cache.disable', true);
+
+/**
+ * Enable cache checking.
+ *
+ * If set to true, for view caching you must still use the controller
+ * var $cacheAction inside your controllers to define caching settings.
+ * You can either set it controller-wide by setting var $cacheAction = true,
+ * or in each action using $this->cacheAction = true.
+ *
+ */
+ //Configure::write('Cache.check', true);
+
+/**
+ * Defines the default error type when using the log() function. Used for
+ * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
+ */
+ define('LOG_ERROR', 2);
+
+/**
+ * The preferred session handling method. Valid values:
+ *
+ * 'php' Uses settings defined in your php.ini.
+ * 'cake' Saves session files in CakePHP's /tmp directory.
+ * 'database' Uses CakePHP's database sessions.
+ *
+ * To define a custom session handler, save it at /app/config/<name>.php.
+ * Set the value of 'Session.save' to <name> to utilize it in CakePHP.
+ *
+ * To use database sessions, run the app/config/schema/sessions.php schema using
+ * the cake shell command: cake schema create Sessions
+ *
+ */
+ Configure::write('Session.save', 'php');
+
+/**
+ * The model name to be used for the session model.
+ *
+ * 'Session.save' must be set to 'database' in order to utilize this constant.
+ *
+ * The model name set here should *not* be used elsewhere in your application.
+ */
+ //Configure::write('Session.model', 'Session');
+
+/**
+ * The name of the table used to store CakePHP database sessions.
+ *
+ * 'Session.save' must be set to 'database' in order to utilize this constant.
+ *
+ * The table name set here should *not* include any table prefix defined elsewhere.
+ *
+ * Please note that if you set a value for Session.model (above), any value set for
+ * Session.table will be ignored.
+ *
+ * [Note: Session.table is deprecated as of CakePHP 1.3]
+ */
+ //Configure::write('Session.table', 'cake_sessions');
+
+/**
+ * The DATABASE_CONFIG::$var to use for database session handling.
+ *
+ * 'Session.save' must be set to 'database' in order to utilize this constant.
+ */
+ //Configure::write('Session.database', 'default');
+
+/**
+ * The name of CakePHP's session cookie.
+ *
+ * Note the guidelines for Session names states: "The session name references
+ * the session id in cookies and URLs. It should contain only alphanumeric
+ * characters."
+ * @link http://php.net/session_name
+ */
+ Configure::write('Session.cookie', 'CAKEPHP');
+
+/**
+ * Session time out time (in seconds).
+ * Actual value depends on 'Security.level' setting.
+ */
+ Configure::write('Session.timeout', '120');
+
+/**
+ * If set to false, sessions are not automatically started.
+ */
+ Configure::write('Session.start', true);
+
+/**
+ * When set to false, HTTP_USER_AGENT will not be checked
+ * in the session. You might want to set the value to false, when dealing with
+ * older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
+ */
+ Configure::write('Session.checkAgent', true);
+
+/**
+ * The level of CakePHP security. The session timeout time defined
+ * in 'Session.timeout' is multiplied according to the settings here.
+ * Valid values:
+ *
+ * 'high' Session timeout in 'Session.timeout' x 10
+ * 'medium' Session timeout in 'Session.timeout' x 100
+ * 'low' Session timeout in 'Session.timeout' x 300
+ *
+ * CakePHP session IDs are also regenerated between requests if
+ * 'Security.level' is set to 'high'.
+ */
+ Configure::write('Security.level', 'medium');
+
+/**
+ * A random string used in security hashing methods.
+ */
+ Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2gawftf2G0FgaC9mi');
+
+/**
+ * A random numeric string (digits only) used to encrypt/decrypt strings.
+ */
+ Configure::write('Security.cipherSeed', '76859309657453542496749683645');
+
+/**
+ * Apply timestamps with the last modified time to static assets (js, css, images).
+ * Will append a querystring parameter containing the time the file was modified. This is
+ * useful for invalidating browser caches.
+ *
+ * Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable
+ * timestamping.
+ */
+ //Configure::write('Asset.timestamp', true);
+/**
+ * Compress CSS output by removing comments, whitespace, repeating tags, etc.
+ * This requires a/var/cache directory to be writable by the web server for caching.
+ * and /vendors/csspp/csspp.php
+ *
+ * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
+ */
+ //Configure::write('Asset.filter.css', 'css.php');
+
+/**
+ * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
+ * output, and setting the config below to the name of the script.
+ *
+ * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
+ */
+ //Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
+
+/**
+ * The classname and database used in CakePHP's
+ * access control lists.
+ */
+ Configure::write('Acl.classname', 'DbAcl');
+ Configure::write('Acl.database', 'default');
+
+/**
+ * If you are on PHP 5.3 uncomment this line and correct your server timezone
+ * to fix the date & time related errors.
+ */
+ //date_default_timezone_set('UTC');
+
+/**
+ *
+ * Cache Engine Configuration
+ * Default settings provided below
+ *
+ * File storage engine.
+ *
+ * Cache::config('default', array(
+ * 'engine' => 'File', //[required]
+ * 'duration'=> 3600, //[optional]
+ * 'probability'=> 100, //[optional]
+ * 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
+ * 'prefix' => 'cake_', //[optional] prefix every cache file with this string
+ * 'lock' => false, //[optional] use file locking
+ * 'serialize' => true, [optional]
+ * ));
+ *
+ *
+ * APC (http://pecl.php.net/package/APC)
+ */
+ Cache::config('default', array(
+ 'engine' => 'Apc', //[required]
+ 'duration'=> 3600, //[optional]
+ 'probability'=> 100, //[optional]
+ 'prefix' => Inflector::slug(APP_DIR) . 'cp13_', //[optional] prefix every cache file with this string
+ ));
+ /*
+ * Xcache (http://xcache.lighttpd.net/)
+ *
+ * Cache::config('default', array(
+ * 'engine' => 'Xcache', //[required]
+ * 'duration'=> 3600, //[optional]
+ * 'probability'=> 100, //[optional]
+ * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
+ * 'user' => 'user', //user from xcache.admin.user settings
+ * 'password' => 'password', //plaintext password (xcache.admin.pass)
+ * ));
+ *
+ *
+ * Memcache (http://www.danga.com/memcached/)
+ *
+ * Cache::config('default', array(
+ * 'engine' => 'Memcache', //[required]
+ * 'duration'=> 3600, //[optional]
+ * 'probability'=> 100, //[optional]
+ * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
+ * 'servers' => array(
+ * '127.0.0.1:11211' // localhost, default port 11211
+ * ), //[optional]
+ * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
+ * ));
+ *
+ */
+ //Cache::config('default', array('engine' => 'File'));
82 cakephp/app/config/database.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * This is core configuration file.
+ *
+ * Use it to configure core behaviour ofCake.
+ *
+ * PHP versions 4 and 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
+ * @package cake
+ * @subpackage cake.app.config
+ * @since CakePHP(tm) v 0.2.9
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+/**
+ * In this file you set up your database connection details.
+ *
+ * @package cake
+ * @subpackage cake.config
+ */
+/**
+ * Database configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * driver => The name of a supported driver; valid options are as follows:
+ * mysql - MySQL 4 & 5,
+ * mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
+ * sqlite - SQLite (PHP5 only),
+ * postgres - PostgreSQL 7 and higher,
+ * mssql - Microsoft SQL Server 2000 and higher,
+ * db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2)
+ * oracle - Oracle 8 and higher
+ * firebird - Firebird/Interbase
+ * sybase - Sybase ASE
+ * adodb-[drivername] - ADOdb interface wrapper (see below),
+ * odbc - ODBC DBO driver
+ *
+ * You can add custom database drivers (or override existing drivers) by adding the
+ * appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
+ * where 'x' is the name of the database.
+ *
+ * persistent => true / false
+ * Determines whether or not the database should use a persistent connection
+ *
+ * connect =>
+ * ADOdb set the connect to one of these
+ * (http://phplens.com/adodb/supported.databases.html) and
+ * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
+ * For all other databases, this setting is deprecated.
+ *
+ * host =>
+ * the host you connect to the database. To add a socket or port number, use 'port' => #
+ *
+ * prefix =>
+ * Uses the given prefix for all the tables in this database. This setting can be overridden
+ * on a per-table basis with the Model::$tablePrefix property.
+ *
+ * schema =>
+ * For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to
+ * 'public', DB2 defaults to empty.
+ *
+ * encoding =>
+ * For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the
+ * database. Uses database default.
+ *
+ */
+class DATABASE_CONFIG {
+
+ var $default = array(
+ 'driver' => 'sqlite3',
+ 'persistent' => false,
+ 'database' => '/var/www/cakephp_13/app/hello.db',
+ 'connect' => 'sqlite'
+ );
+}
22 cakephp/app/controllers/hellos_controller.php
@@ -0,0 +1,22 @@
+<?php
+class HellosController extends AppController {
+
+ var $name = 'Hellos';
+ var $uses = 'Hello';
+
+ // index action: default view
+ function index() {
+ echo "Hello World!";
+ exit;
+ }
+
+ function hellos() {
+ #
+ }
+
+ function hellodb() {
+ $this->set('data', $this->Hello->find('all'));
+ }
+}
+?>
+
BIN cakephp/app/hello.db
Binary file not shown.
762 cakephp/app/models/datasources/dbo/dbo_sqlite3.php
@@ -0,0 +1,762 @@
+<?php
+/**
+ * SQLite layer for DBO.
+ *
+ * PHP versions 4 and 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
+ * @package datasources
+ * @subpackage datasources.models.datasources.dbo
+ * @since CakePHP Datasources v 0.1
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+
+App::import('Datasource','DboSource');
+
+/**
+ * DBO implementation for the SQLite3 DBMS.
+ *
+ * A DboSource adapter for SQLite 3 using PDO
+ *
+ * @package datasources
+ * @subpackage datasources.models.datasources.dbo
+ */
+class DboSqlite3 extends DboSource {
+
+/**
+ * Datasource Description
+ *
+ * @var string
+ * @access public
+ */
+ var $description = "SQLite3 DBO Driver";
+
+/**
+ * Quote Start
+ *
+ * @var string
+ * @access public
+ */
+ var $startQuote = '"';
+
+/**
+ * Quote End
+ *
+ * @var string
+ * @access public
+ */
+ var $endQuote = '"';
+
+/**
+ * Base configuration settings for SQLite3 driver
+ *
+ * @var array
+ * @access public
+ */
+ var $_baseConfig = array(
+ 'persistent' => false,
+ 'database' => null,
+ 'connect' => 'sqlite' //sqlite3 in pdo_sqlite is sqlite. sqlite2 is sqlite2
+ );
+
+/**
+ * SQLite3 column definition
+ *
+ * @var array
+ * @access public
+ */
+ var $columns = array(
+ 'primary_key' => array('name' => 'integer primary key autoincrement'),
+ 'string' => array('name' => 'varchar', 'limit' => '255'),
+ 'text' => array('name' => 'text'),
+ 'integer' => array('name' => 'integer', 'limit' => null, 'formatter' => 'intval'),
+ 'float' => array('name' => 'float', 'formatter' => 'floatval'),
+ 'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
+ 'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'),
+ 'time' => array('name' => 'time', 'format' => 'H:i:s', 'formatter' => 'date'),
+ 'date' => array('name' => 'date', 'format' => 'Y-m-d', 'formatter' => 'date'),
+ 'binary' => array('name' => 'blob'),
+ 'boolean' => array('name' => 'boolean')
+ );
+
+/**
+ * List of engine specific additional field parameters used on table creating
+ *
+ * @var array
+ * @access public
+ */
+ var $fieldParameters = array(
+ 'collate' => array(
+ 'value' => 'COLLATE',
+ 'quote' => false,
+ 'join' => ' ',
+ 'column' => 'Collate',
+ 'position' => 'afterDefault',
+ 'options' => array(
+ 'BINARY', 'NOCASE', 'RTRIM'
+ )
+ ),
+ );
+
+/**
+ * Last Error
+ *
+ * @var string
+ * @access public
+ */
+ var $last_error = NULL;
+
+/**
+ * PDO Statement
+ *
+ * @var string
+ * @access public
+ */
+ var $pdo_statement = NULL;
+
+/**
+ * Rows
+ *
+ * @var mixed
+ * @access public
+ */
+ var $rows = NULL;
+
+/**
+ * Row Count
+ *
+ * @var integer
+ * @access public
+ */
+ var $row_count = NULL;
+
+/**
+ * Transaction Started
+ *
+ * @var boolean
+ * @access protected
+ */
+ var $_transactionStarted = false;
+
+/**
+ * Transaction Nesting
+ *
+ * @var integer
+ * @access protected
+ */
+ var $_transactionNesting = 0;
+
+/**
+ * Connects to the database using config['database'] as a filename.
+ *
+ * @param array $config Configuration array for connecting
+ * @return mixed
+ * @access public
+ */
+ function connect() {
+ $this->last_error = null;
+ $config = $this->config;
+ try {
+ $this->connection = new PDO($config['connect'].':'.$config['database'],null,null,array(PDO::ATTR_PERSISTENT => $config['persistent']));
+ $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+ $this->connected = is_object($this->connection);
+ }
+ catch(PDOException $e) {
+ $this->last_error = array('Error connecting to database.',$e->getMessage());
+ }
+ return $this->connected;
+ }
+
+/**
+ * Disconnects from database.
+ *
+ * @return boolean True if the database could be disconnected, else false
+ * @access public
+ */
+ function disconnect() {
+ $this->connection = NULL;
+ $this->connected = false;
+ return $this->connected;
+ }
+
+/**
+ * Executes given SQL statement.
+ *
+ * @param string $sql SQL statement
+ * @return resource Result resource identifier
+ * @access protected
+ */
+ function _execute($sql) {
+ if (strncmp($sql,"CREATE",6) === 0) {
+ $statements = explode(";",$sql);
+ if (count($statements) > 1) {
+ foreach($statements as $st) {
+ $this->_execute($st);
+ }
+ return false;
+ }
+ }
+ for ($i = 0; $i < 2; $i++) {
+ try {
+ $this->last_error = NULL;
+ $this->pdo_statement = $this->connection->query($sql);
+ if (is_object($this->pdo_statement)) {
+ $this->rows = $this->pdo_statement->fetchAll(PDO::FETCH_NUM);
+ $this->row_count = count($this->rows);
+ return $this->pdo_statement;
+ }
+ }
+ catch(PDOException $e) {
+ // Schema change; re-run query
+ if ($e->errorInfo[1] === 17) {
+ $this->last_error = $e->getMessage();
+ }
+ continue;
+ }
+ }
+ return false;
+ }
+
+/**
+ * Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.
+ *
+ * @return array Array of tablenames in the database
+ * @access public
+ */
+ function listSources() {
+ $db = $this->config['database'];
+ $this->config['database'] = basename($this->config['database']);
+
+ $cache = parent::listSources();
+ if ($cache != null) {
+ return $cache;
+ }
+
+ $result = $this->fetchAll("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;", false);
+
+ if (!$result || empty($result)) {
+ return array();
+ } else {
+ $tables = array();
+ foreach ($result as $table) {
+ $tables[] = $table[0]['name'];
+ }
+ parent::listSources($tables);
+
+ $this->config['database'] = $db;
+ return $tables;
+ }
+ $this->config['database'] = $db;
+ return array();
+ }
+
+/**
+ * Returns an array of the fields in given table name.
+ *
+ * @param string $tableName Name of database table to inspect
+ * @return array Fields in table. Keys are name and type
+ * @access public
+ */
+ function describe(&$model) {
+ $cache = parent::describe($model);
+ if ($cache != null) {
+ return $cache;
+ }
+ $fields = array();
+ $result = $this->fetchAll('PRAGMA table_info(' . $model->tablePrefix . $model->table . ')');
+
+ foreach ($result as $column) {
+ $fields[$column[0]['name']] = array(
+ 'type' => $this->column($column[0]['type']),
+ 'null' => !$column[0]['notnull'],
+ 'default' => $column[0]['dflt_value'],
+ 'length' => $this->length($column[0]['type'])
+ );
+ if($column[0]['pk'] == 1) {
+ $fields[$column[0]['name']] = array(
+ 'type' => $fields[$column[0]['name']]['type'],
+ 'null' => false,
+ 'default' => $column[0]['dflt_value'],
+ 'key' => $this->index['PRI'],
+ 'length' => 11
+ );
+ }
+ }
+
+ $this->__cacheDescription($model->tablePrefix . $model->table, $fields);
+ return $fields;
+ }
+
+/**
+ * Returns a quoted and escaped string of $data for use in an SQL statement.
+ *
+ * @param string $data String to be prepared for use in an SQL statement
+ * @return string Quoted and escaped
+ * @access public
+ */
+ function value($data, $column = null, $safe = false) {
+ $parent = parent::value($data, $column, $safe);
+
+ if ($parent != null) {
+ return $parent;
+ }
+ if ($data === null || (is_array($data) && empty($data))) {
+ return 'NULL';
+ }
+ if ($data === '') {
+ return "''";
+ }
+ switch ($column) {
+ case 'boolean':
+ $data = $this->boolean((bool)$data);
+ break;
+ default:
+ $data = $this->connection->quote($data);
+ return $data;
+ break;
+ }
+ return "'" . $data . "'";
+ }
+
+/**
+ * Generates and executes an SQL UPDATE statement for given model, fields, and values.
+ *
+ * @param Model $model
+ * @param array $fields
+ * @param array $values
+ * @param mixed $conditions
+ * @return array
+ * @access public
+ */
+ function update(&$model, $fields = array(), $values = null, $conditions = null) {
+ if (empty($values) && !empty($fields)) {
+ foreach ($fields as $field => $value) {
+ if (strpos($field, $model->alias . '.') !== false) {
+ unset($fields[$field]);
+ $field = str_replace($model->alias . '.', "", $field);
+ $field = str_replace($model->alias . '.', "", $field);
+ $fields[$field] = $value;
+ }
+ }
+ }
+ return parent::update($model, $fields, $values, $conditions);
+ }
+
+/**
+ * Begin a transaction
+ *
+ * @param unknown_type $model
+ * @return boolean True on success, false on fail
+ * (i.e. if the database/model does not support transactions).
+ * @access public
+ */
+ function begin(&$model) {
+ if ($this->_transactionStarted || $this->connection->beginTransaction()) {
+ $this->_transactionStarted = true;
+ $this->_transactionNesting++;
+ return true;
+ }
+ return false;
+ }
+
+/**
+ * Commit a transaction
+ *
+ * @param unknown_type $model
+ * @return boolean True on success, false on fail
+ * (i.e. if the database/model does not support transactions,
+ * or a transaction has not started).
+ * @access public
+ */
+ function commit(&$model) {
+ if ($this->_transactionStarted) {
+ $this->_transactionNesting--;
+ if ($this->_transactionNesting <= 0) {
+ $this->_transactionStarted = false;
+ $this->_transactionNesting = 0;
+ return $this->connection->commit();
+ }
+ return true;
+ }
+ return false;
+ }
+
+/**
+ * Rollback a transaction
+ *
+ * @param unknown_type $model
+ * @return boolean True on success, false on fail
+ * (i.e. if the database/model does not support transactions,
+ * or a transaction has not started).
+ * @access public
+ */
+ function rollback(&$model) {
+ if ($this->_transactionStarted && $this->connection->rollBack()) {
+ $this->_transactionStarted = false;
+ $this->_transactionNesting = 0;
+ return true;
+ }
+ return false;
+ }
+
+/**
+ * Deletes all the records in a table and resets the count of the auto-incrementing
+ * primary key, where applicable.
+ *
+ * @param mixed $table A string or model class representing the table to be truncated
+ * @return boolean SQL TRUNCATE TABLE statement, false if not applicable.
+ * @access public
+ */
+ function truncate($table) {
+ return $this->execute('DELETE From ' . $this->fullTableName($table));
+ }
+
+/**
+ * Returns a formatted error message from previous database operation.
+ *
+ * @return string Error message
+ * @access public
+ */
+ function lastError() {
+ return $this->last_error;
+ }
+
+/**
+ * Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.
+ *
+ * @return integer Number of affected rows
+ * @access public
+ */
+ function lastAffected() {
+ if ($this->_result) {
+ return $this->pdo_statement->rowCount();
+ }
+ return false;
+ }
+
+/**
+ * Returns number of rows in previous resultset. If no previous resultset exists,
+ * this returns false.
+ *
+ * @return mixed Number of rows in resultset, or false on error
+ * @access public
+ */
+ function lastNumRows() {
+ if ($this->pdo_statement) {
+ // pdo_statement->rowCount() doesn't work for this case
+ return $this->row_count;
+ }
+ return false;
+ }
+
+/**
+ * Returns the ID generated from the previous INSERT operation.
+ *
+ * @return mixed Last insert ID
+ * @access public
+ */
+ function lastInsertId() {
+ return $this->connection->lastInsertId();
+ }
+
+/**
+ * Converts database-layer column types to basic types
+ *
+ * @param string $real Real database-layer column type (i.e. "varchar(255)")
+ * @return string Abstract column type (i.e. "string")
+ * @access public
+ */
+ function column($real) {
+ if (is_array($real)) {
+ $col = $real['name'];
+ if (isset($real['limit'])) {
+ $col .= '('.$real['limit'].')';
+ }
+ return $col;
+ }
+
+ $col = strtolower(str_replace(')', '', $real));
+ $limit = null;
+ @list($col, $limit) = explode('(', $col);
+
+ if (in_array($col, array('text', 'integer', 'float', 'boolean', 'timestamp', 'date', 'datetime', 'time'))) {
+ return $col;
+ }
+ if (strpos($col, 'varchar') !== false) {
+ return 'string';
+ }
+ if (in_array($col, array('blob', 'clob'))) {
+ return 'binary';
+ }
+ if (strpos($col, 'numeric') !== false || strpos($col, 'decimal') !== false) {
+ return 'float';
+ }
+ return 'text';
+ }
+
+/**
+ * Generate ResultSet
+ *
+ * @param mixed $results
+ * @access public
+ */
+ function resultSet(&$results) {
+ $this->results =& $results;
+ $this->map = array();
+ $num_fields = $results->columnCount();
+ $index = 0;
+ $j = 0;
+
+ //PDO::getColumnMeta is experimental and does not work with sqlite3,
+ // so try to figure it out based on the querystring
+ $querystring = $results->queryString;
+ if (stripos($querystring, 'SELECT') === 0) {
+ $last = stripos($querystring, 'FROM');
+ if ($last !== false) {
+ $selectpart = substr($querystring, 7, $last - 8);
+ $selects = explode(',', $selectpart);
+ }
+ } elseif (strpos($querystring, 'PRAGMA table_info') === 0) {
+ $selects = array('cid', 'name', 'type', 'notnull', 'dflt_value', 'pk');
+ } elseif(strpos($querystring, 'PRAGMA index_list') === 0) {
+ $selects = array('seq', 'name', 'unique');
+ } elseif(strpos($querystring, 'PRAGMA index_info') === 0) {
+ $selects = array('seqno', 'cid', 'name');
+ }
+ while ($j < $num_fields) {
+ if (preg_match('/.*AS (.*).*/i', $selects[$j], $matches)) {
+ $columnName = trim($matches[1],'"');
+ } else {
+ $columnName = trim(str_replace('"', '', $selects[$j]));
+ }
+
+ if (strpos($selects[$j], 'DISTINCT') === 0) {
+ $columnName = str_ireplace('DISTINCT', '', $columnName);
+ }
+
+ if (strpos($columnName, '.')) {
+ $parts = explode('.', $columnName);
+ $this->map[$index++] = array(trim($parts[0]), trim($parts[1]));
+ } else {
+ $this->map[$index++] = array(0, $columnName);
+ }
+ $j++;
+ }
+ }
+
+/**
+ * Fetches the next row from the current result set
+ *
+ * @return mixed
+ * @access public
+ */
+ function fetchResult() {
+ if (count($this->rows)) {
+ $row = array_shift($this->rows);
+ $resultRow = array();
+ $i = 0;
+
+ foreach ($row as $index => $field) {
+ if (isset($this->map[$index]) and $this->map[$index] != "") {
+ list($table, $column) = $this->map[$index];
+ $resultRow[$table][$column] = $row[$index];
+ } else {
+ $resultRow[0][str_replace('"', '', $index)] = $row[$index];
+ }
+ $i++;
+ }
+ return $resultRow;
+ }
+ return false;
+ }
+
+/**
+ * Returns a limit statement in the correct format for the particular database.
+ *
+ * @param integer $limit Limit of results returned
+ * @param integer $offset Offset from which to start results
+ * @return string SQL limit/offset statement
+ * @access public
+ */
+ function limit ($limit, $offset = null) {
+ if ($limit) {
+ $rt = '';
+ if (!strpos(strtolower($limit), 'limit') || strpos(strtolower($limit), 'limit') === 0) {
+ $rt = ' LIMIT';
+ }
+ $rt .= ' ' . $limit;
+ if ($offset) {
+ $rt .= ' OFFSET ' . $offset;
+ }
+ return $rt;
+ }
+ return null;
+ }
+
+/**
+ * Generate a database-native column schema string
+ *
+ * @param array $column An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]),
+ * where options can be 'default', 'length', or 'key'.
+ * @return string
+ * @access public
+ */
+ function buildColumn($column) {
+ $name = $type = null;
+ $column = array_merge(array('null' => true), $column);
+ extract($column);
+
+ if (empty($name) || empty($type)) {
+ trigger_error('Column name or type not defined in schema', E_USER_WARNING);
+ return null;
+ }
+
+ if (!isset($this->columns[$type])) {
+ trigger_error("Column type {$type} does not exist", E_USER_WARNING);
+ return null;
+ }
+
+ $real = $this->columns[$type];
+ $out = $this->name($name) . ' ' . $real['name'];
+ if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') {
+ return $this->name($name) . ' ' . $this->columns['primary_key']['name'];
+ }
+ return parent::buildColumn($column);
+ }
+
+/**
+ * Sets the database encoding
+ *
+ * @param string $enc Database encoding
+ * @access public
+ */
+ function setEncoding($enc) {
+ if (!in_array($enc, array("UTF-8", "UTF-16", "UTF-16le", "UTF-16be"))) {
+ return false;
+ }
+ return $this->_execute("PRAGMA encoding = \"{$enc}\"") !== false;
+ }
+
+/**
+ * Gets the database encoding
+ *
+ * @return string The database encoding
+ * @access public
+ */
+ function getEncoding() {
+ return $this->fetchRow('PRAGMA encoding');
+ }
+
+/**
+ * Removes redundant primary key indexes, as they are handled in the column def of the key.
+ *
+ * @param array $indexes
+ * @param string $table
+ * @return string
+ * @access public
+ */
+ function buildIndex($indexes, $table = null) {
+ $join = array();
+
+ foreach ($indexes as $name => $value) {
+
+ if ($name == 'PRIMARY') {
+ continue;
+ }
+ $out = 'CREATE ';
+
+ if (!empty($value['unique'])) {
+ $out .= 'UNIQUE ';
+ }
+ if (is_array($value['column'])) {
+ $value['column'] = join(', ', array_map(array(&$this, 'name'), $value['column']));
+ } else {
+ $value['column'] = $this->name($value['column']);
+ }
+ $out .= "INDEX {$name} ON {$table}({$value['column']});";
+ $join[] = $out;
+ }
+ return $join;
+ }
+
+/**
+ * Overrides DboSource::index to handle SQLite indexe introspection
+ * Returns an array of the indexes in given table name.
+ *
+ * @param string $model Name of model to inspect
+ * @return array Fields in table. Keys are column and unique
+ * @access public
+ */
+ function index(&$model) {
+ $index = array();
+ $table = $this->fullTableName($model);
+ if ($table) {
+ $indexes = $this->query('PRAGMA index_list(' . $table . ')');
+ $tableInfo = $this->query('PRAGMA table_info(' . $table . ')');
+ foreach ($indexes as $i => $info) {
+ $key = array_pop($info);
+ $keyInfo = $this->query('PRAGMA index_info("' . $key['name'] . '")');
+ foreach ($keyInfo as $keyCol) {
+ if (!isset($index[$key['name']])) {
+ $col = array();
+ if (preg_match('/autoindex/', $key['name'])) {
+ $key['name'] = 'PRIMARY';
+ }
+ $index[$key['name']]['column'] = $keyCol[0]['name'];
+ $index[$key['name']]['unique'] = intval($key['unique'] == 1);
+ } else {
+ if (!is_array($index[$key['name']]['column'])) {
+ $col[] = $index[$key['name']]['column'];
+ }
+ $col[] = $keyCol[0]['name'];
+ $index[$key['name']]['column'] = $col;
+ }
+ }
+ }
+ }
+ return $index;
+ }
+
+/**
+ * Overrides DboSource::renderStatement to handle schema generation with SQLite-style indexes
+ *
+ * @param string $type
+ * @param array $data
+ * @return string
+ * @access public
+ */
+ function renderStatement($type, $data) {
+ switch (strtolower($type)) {
+ case 'schema':
+ extract($data);
+
+ foreach (array('columns', 'indexes') as $var) {
+ if (is_array(${$var})) {
+ ${$var} = "\t" . join(",\n\t", array_filter(${$var}));
+ }
+ }
+ return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}";
+ break;
+ default:
+ return parent::renderStatement($type, $data);
+ break;
+ }
+ }
+
+/**
+ * PDO deals in objects, not resources, so overload accordingly.
+ *
+ * @return boolean
+ * @access public
+ */
+ function hasResult() {
+ return is_object($this->_result);
+ }
+}
8 cakephp/app/models/hello.php
@@ -0,0 +1,8 @@
+<?php
+class Hello extends AppModel {
+
+ var $name = 'Hello';
+ var $useTable = 'hello';
+
+}
+?>
7 cakephp/app/views/hellos/hellodb.ctp
@@ -0,0 +1,7 @@
+ <p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
+
+ <table border="1">
+ <?php foreach ($data as $row): ?>
+ <tr><td><?php echo $row['Hello']['id']; ?></td><td><?php echo $row['Hello']['data']; ?></td></tr>
+ <?php endforeach; ?>
+ </table>
2 cakephp/app/views/hellos/hellos.ctp
@@ -0,0 +1,2 @@
+ <p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
+
12 cakephp/app/views/layouts/default.ctp
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <title>Hello World</title>
+ </head>
+
+ <body>
+ <?php echo $content_for_layout; ?>
+ </body>
+
+</html>
18 codeigniter/README.rst
@@ -0,0 +1,18 @@
+================================================================================
+CodeIgniter test code for The Great Web Framework Shootout
+================================================================================
+
+| Copyright: (c) 2012 Seth Davis
+| http://blog.curiasolutions.com/the-great-web-framework-shootout/
+
+
+Synopsis
+================================================================================
+
+This code was last tested using CodeIgniter **v2.0.3** and will likely perform
+differently when using a different version.
+
+Please see `The Great Web Framework Shootout`_ for more information.
+
+.. _The Great Web Framework Shootout:
+ http://blog.curiasolutions.com/the-great-web-framework-shootout/
362 codeigniter/application/config/config.php
@@ -0,0 +1,362 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/*
+|--------------------------------------------------------------------------
+| Base Site URL
+|--------------------------------------------------------------------------
+|
+| URL to your CodeIgniter root. Typically this will be your base URL,
+| WITH a trailing slash:
+|
+| http://example.com/
+|
+| If this is not set then CodeIgniter will guess the protocol, domain and
+| path to your installation.
+|
+*/
+$config['base_url'] = "http://localhost/codeigniter_20/";
+
+/*
+|--------------------------------------------------------------------------
+| Index File
+|--------------------------------------------------------------------------
+|
+| Typically this will be your index.php file, unless you've renamed it to
+| something else. If you are using mod_rewrite to remove the page set this
+| variable so that it is blank.
+|
+*/
+$config['index_page'] = 'index.php';
+
+/*
+|--------------------------------------------------------------------------
+| URI PROTOCOL
+|--------------------------------------------------------------------------
+|
+| This item determines which server global should be used to retrieve the
+| URI string. The default setting of 'AUTO' works for most servers.
+| If your links do not seem to work, try one of the other delicious flavors:
+|
+| 'AUTO' Default - auto detects
+| 'PATH_INFO' Uses the PATH_INFO
+| 'QUERY_STRING' Uses the QUERY_STRING
+| 'REQUEST_URI' Uses the REQUEST_URI
+| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
+|
+*/
+$config['uri_protocol'] = 'AUTO';
+
+/*
+|--------------------------------------------------------------------------
+| URL suffix
+|--------------------------------------------------------------------------
+|
+| This option allows you to add a suffix to all URLs generated by CodeIgniter.
+| For more information please see the user guide:
+|
+| http://codeigniter.com/user_guide/general/urls.html
+*/
+
+$config['url_suffix'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Default Language
+|--------------------------------------------------------------------------
+|
+| This determines which set of language files should be used. Make sure
+| there is an available translation if you intend to use something other
+| than english.
+|
+*/
+$config['language'] = 'english';
+
+/*
+|--------------------------------------------------------------------------
+| Default Character Set
+|--------------------------------------------------------------------------
+|
+| This determines which character set is used by default in various methods
+| that require a character set to be provided.
+|
+*/
+$config['charset'] = 'UTF-8';
+
+/*
+|--------------------------------------------------------------------------
+| Enable/Disable System Hooks
+|--------------------------------------------------------------------------
+|
+| If you would like to use the 'hooks' feature you must enable it by
+| setting this variable to TRUE (boolean). See the user guide for details.
+|
+*/
+$config['enable_hooks'] = FALSE;
+
+
+/*
+|--------------------------------------------------------------------------
+| Class Extension Prefix
+|--------------------------------------------------------------------------
+|
+| This item allows you to set the filename/classname prefix when extending
+| native libraries. For more information please see the user guide:
+|
+| http://codeigniter.com/user_guide/general/core_classes.html
+| http://codeigniter.com/user_guide/general/creating_libraries.html
+|
+*/
+$config['subclass_prefix'] = 'MY_';
+
+
+/*
+|--------------------------------------------------------------------------
+| Allowed URL Characters
+|--------------------------------------------------------------------------
+|
+| This lets you specify with a regular expression which characters are permitted
+| within your URLs. When someone tries to submit a URL with disallowed
+| characters they will get a warning message.
+|
+| As a security measure you are STRONGLY encouraged to restrict URLs to
+| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
+|
+| Leave blank to allow all characters -- but only if you are insane.
+|
+| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
+|
+*/
+$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
+
+
+/*
+|--------------------------------------------------------------------------
+| Enable Query Strings
+|--------------------------------------------------------------------------
+|
+| By default CodeIgniter uses search-engine friendly segment based URLs:
+| example.com/who/what/where/
+|
+| By default CodeIgniter enables access to the $_GET array. If for some
+| reason you would like to disable it, set 'allow_get_array' to FALSE.
+|
+| You can optionally enable standard query string based URLs:
+| example.com?who=me&what=something&where=here
+|
+| Options are: TRUE or FALSE (boolean)
+|
+| The other items let you set the query string 'words' that will
+| invoke your controllers and its functions:
+| example.com/index.php?c=controller&m=function
+|
+| Please note that some of the helpers won't work as expected when
+| this feature is enabled, since CodeIgniter is designed primarily to
+| use segment based URLs.
+|
+*/
+$config['allow_get_array'] = TRUE;
+$config['enable_query_strings'] = FALSE;
+$config['controller_trigger'] = 'c';
+$config['function_trigger'] = 'm';
+$config['directory_trigger'] = 'd'; // experimental not currently in use
+
+/*
+|--------------------------------------------------------------------------
+| Error Logging Threshold
+|--------------------------------------------------------------------------
+|
+| If you have enabled error logging, you can set an error threshold to
+| determine what gets logged. Threshold options are:
+| You can enable error logging by setting a threshold over zero. The
+| threshold determines what gets logged. Threshold options are:
+|
+| 0 = Disables logging, Error logging TURNED OFF
+| 1 = Error Messages (including PHP errors)
+| 2 = Debug Messages
+| 3 = Informational Messages
+| 4 = All Messages
+|
+| For a live site you'll usually only enable Errors (1) to be logged otherwise
+| your log files will fill up very fast.
+|
+*/
+$config['log_threshold'] = 0;
+
+/*
+|--------------------------------------------------------------------------
+| Error Logging Directory Path
+|--------------------------------------------------------------------------
+|
+| Leave this BLANK unless you would like to set something other than the default
+| application/logs/ folder. Use a full server path with trailing slash.
+|
+*/
+$config['log_path'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Date Format for Logs
+|--------------------------------------------------------------------------
+|
+| Each item that is logged has an associated date. You can use PHP date
+| codes to set your own date formatting
+|
+*/
+$config['log_date_format'] = 'Y-m-d H:i:s';
+
+/*
+|--------------------------------------------------------------------------
+| Cache Directory Path
+|--------------------------------------------------------------------------
+|
+| Leave this BLANK unless you would like to set something other than the default
+| system/cache/ folder. Use a full server path with trailing slash.
+|
+*/
+$config['cache_path'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Encryption Key
+|--------------------------------------------------------------------------
+|
+| If you use the Encryption class or the Session class you
+| MUST set an encryption key. See the user guide for info.
+|
+*/
+$config['encryption_key'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Session Variables
+|--------------------------------------------------------------------------
+|
+| 'sess_cookie_name' = the name you want for the cookie
+| 'sess_expiration' = the number of SECONDS you want the session to last.
+| by default sessions last 7200 seconds (two hours). Set to zero for no expiration.
+| 'sess_expire_on_close' = Whether to cause the session to expire automatically
+| when the browser window is closed
+| 'sess_encrypt_cookie' = Whether to encrypt the cookie
+| 'sess_use_database' = Whether to save the session data to a database
+| 'sess_table_name' = The name of the session database table
+| 'sess_match_ip' = Whether to match the user's IP address when reading the session data
+| 'sess_match_useragent' = Whether to match the User Agent when reading the session data
+| 'sess_time_to_update' = how many seconds between CI refreshing Session Information
+|
+*/
+$config['sess_cookie_name'] = 'ci_session';
+$config['sess_expiration'] = 7200;
+$config['sess_expire_on_close'] = FALSE;
+$config['sess_encrypt_cookie'] = FALSE;
+$config['sess_use_database'] = FALSE;
+$config['sess_table_name'] = 'ci_sessions';
+$config['sess_match_ip'] = FALSE;
+$config['sess_match_useragent'] = TRUE;
+$config['sess_time_to_update'] = 300;
+
+/*
+|--------------------------------------------------------------------------
+| Cookie Related Variables
+|--------------------------------------------------------------------------
+|
+| 'cookie_prefix' = Set a prefix if you need to avoid collisions
+| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
+| 'cookie_path' = Typically will be a forward slash
+| 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists.
+|
+*/
+$config['cookie_prefix'] = "";
+$config['cookie_domain'] = "";
+$config['cookie_path'] = "/";
+$config['cookie_secure'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Global XSS Filtering
+|--------------------------------------------------------------------------
+|
+| Determines whether the XSS filter is always active when GET, POST or
+| COOKIE data is encountered
+|
+*/
+$config['global_xss_filtering'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Cross Site Request Forgery
+|--------------------------------------------------------------------------
+| Enables a CSRF cookie token to be set. When set to TRUE, token will be
+| checked on a submitted form. If you are accepting user data, it is strongly
+| recommended CSRF protection be enabled.
+|
+| 'csrf_token_name' = The token name
+| 'csrf_cookie_name' = The cookie name
+| 'csrf_expire' = The number in seconds the token should expire.
+*/
+$config['csrf_protection'] = FALSE;
+$config['csrf_token_name'] = 'csrf_test_name';
+$config['csrf_cookie_name'] = 'csrf_cookie_name';
+$config['csrf_expire'] = 7200;
+
+/*
+|--------------------------------------------------------------------------
+| Output Compression
+|--------------------------------------------------------------------------
+|
+| Enables Gzip output compression for faster page loads. When enabled,
+| the output class will test whether your server supports Gzip.
+| Even if it does, however, not all browsers support compression
+| so enable only if you are reasonably sure your visitors can handle it.
+|
+| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
+| means you are prematurely outputting something to your browser. It could
+| even be a line of whitespace at the end of one of your scripts. For
+| compression to work, nothing can be sent before the output buffer is called
+| by the output class. Do not 'echo' any values with compression enabled.
+|
+*/
+$config['compress_output'] = FALSE;
+
+/*
+|--------------------------------------------------------------------