From ff2370c368f7723b410ef4cff5bb2ffbab0af906 Mon Sep 17 00:00:00 2001
From: Deon George
Date: Mon, 16 May 2011 22:47:16 +1000
Subject: [PATCH] Update Kohana to 3.1.3.1
---
application/bootstrap.php | 77 +-
includes/kohana/README.md | 4 +-
includes/kohana/application/bootstrap.php | 118 +
.../classes/controller/welcome.php | 10 +
includes/kohana/build.xml | 233 --
includes/kohana/example.htaccess | 21 -
includes/kohana/install.php | 36 +-
includes/kohana/modules/auth/README.md | 13 +
.../modules/auth/classes/kohana/auth.php | 102 +-
.../modules/auth/classes/model/auth/role.php | 27 -
.../modules/auth/classes/model/auth/user.php | 244 ---
includes/kohana/modules/auth/config/auth.php | 14 +-
.../kohana/modules/auth/config/userguide.php | 23 -
.../modules/cache/classes/kohana/cache.php | 2 +-
.../cache/classes/kohana/cache/apc.php | 4 +-
.../cache/classes/kohana/cache/file.php | 2 +-
.../codebench/classes/bench/datespan.php | 4 +-
.../classes/controller/codebench.php | 2 +
.../guide/codebench/codebench_screenshot1.png | Bin
.../guide/codebench/codebench_screenshot2.png | Bin
.../modules/codebench/views/codebench.php | 8 +-
.../classes/config/database.php} | 2 +-
.../classes/kohana/config/database.php | 2 +-
.../database/classes/kohana/database.php | 319 ++-
.../classes/kohana/database/mysql.php | 63 +-
.../classes/kohana/database/mysql/result.php | 2 +-
.../database/classes/kohana/database/pdo.php | 40 +-
.../classes/kohana/database/query.php | 8 +-
.../classes/kohana/database/query/builder.php | 38 +-
.../kohana/database/query/builder/delete.php | 6 +-
.../kohana/database/query/builder/insert.php | 18 +-
.../kohana/database/query/builder/join.php | 65 +-
.../kohana/database/query/builder/select.php | 69 +-
.../kohana/database/query/builder/update.php | 6 +-
.../classes/kohana/database/result/cached.php | 2 +-
.../classes/kohana/model/database.php | 58 +
.../database/classes/model/database.php | 3 +
.../modules/image/classes/kohana/image.php | 23 +-
.../modules/image/classes/kohana/image/gd.php | 8 +-
includes/kohana/modules/oauth/README.md | 5 -
.../modules/oauth/classes/kohana/oauth.php | 217 --
.../oauth/classes/kohana/oauth/consumer.php | 99 -
.../oauth/classes/kohana/oauth/exception.php | 12 -
.../oauth/classes/kohana/oauth/provider.php | 215 --
.../classes/kohana/oauth/provider/google.php | 55 -
.../classes/kohana/oauth/provider/twitter.php | 39 -
.../oauth/classes/kohana/oauth/request.php | 509 -----
.../classes/kohana/oauth/request/access.php | 32 -
.../kohana/oauth/request/authorize.php | 26 -
.../kohana/oauth/request/credentials.php | 16 -
.../classes/kohana/oauth/request/resource.php | 27 -
.../classes/kohana/oauth/request/token.php | 32 -
.../oauth/classes/kohana/oauth/response.php | 51 -
.../oauth/classes/kohana/oauth/server.php | 14 -
.../oauth/classes/kohana/oauth/signature.php | 77 -
.../kohana/oauth/signature/hmac/sha1.php | 68 -
.../kohana/oauth/signature/plaintext.php | 57 -
.../oauth/classes/kohana/oauth/token.php | 94 -
.../classes/kohana/oauth/token/access.php | 16 -
.../classes/kohana/oauth/token/request.php | 36 -
.../modules/oauth/classes/oauth/provider.php | 3 -
.../oauth/classes/oauth/provider/google.php | 3 -
.../oauth/classes/oauth/provider/twitter.php | 3 -
.../modules/oauth/classes/oauth/request.php | 3 -
.../oauth/classes/oauth/request/access.php | 3 -
.../oauth/classes/oauth/request/authorize.php | 3 -
.../classes/oauth/request/credentials.php | 3 -
.../oauth/classes/oauth/request/resource.php | 3 -
.../modules/oauth/classes/oauth/signature.php | 3 -
.../classes/oauth/signature/hmac/sha1.php | 3 -
.../classes/oauth/signature/plaintext.php | 3 -
.../oauth/classes/oauth/token/access.php | 3 -
.../oauth/classes/oauth/token/request.php | 3 -
.../kohana/modules/oauth/config/oauth.php | 15 -
.../kohana/modules/oauth/config/userguide.php | 23 -
.../modules/oauth/guide/oauth/config.md | 24 -
.../kohana/modules/oauth/guide/oauth/index.md | 14 -
.../kohana/modules/oauth/guide/oauth/menu.md | 3 -
.../kohana/modules/oauth/guide/oauth/usage.md | 3 -
.../oauth/views/oauth/twitter/tweet.php | 15 -
.../mysql.sql => orm/auth-schema-mysql.sql} | 7 +-
.../auth-schema-postgresql.sql} | 4 +-
.../{auth => orm}/classes/auth/orm.php | 0
.../{auth => orm}/classes/kohana/auth/orm.php | 153 +-
.../kohana/modules/orm/classes/kohana/orm.php | 1950 +++++++++--------
.../kohana/orm/validation/exception.php | 182 ++
.../modules/orm/classes/model/auth/role.php | 29 +
.../modules/orm/classes/model/auth/user.php | 240 ++
.../classes/model/auth/user/token.php | 65 +-
.../{auth => orm}/classes/model/role.php | 0
.../{auth => orm}/classes/model/user.php | 0
.../classes/model/user/token.php | 0
includes/kohana/modules/orm/classes/orm.php | 2 +-
.../orm/classes/orm/validation/exception.php | 10 +
.../kohana/modules/orm/config/userguide.php | 6 +-
.../kohana/modules/orm/guide/orm/examples.md | 13 +-
.../modules/orm/guide/orm/examples/simple.md | 115 +-
.../orm/guide/orm/examples/validation.md | 137 ++
.../kohana/modules/orm/guide/orm/filters.md | 22 +
.../kohana/modules/orm/guide/orm/index.md | 10 +-
includes/kohana/modules/orm/guide/orm/menu.md | 4 +-
.../kohana/modules/orm/guide/orm/models.md | 16 +-
.../modules/orm/guide/orm/relationships.md | 74 +-
.../kohana/modules/orm/guide/orm/using.md | 31 +-
.../modules/orm/guide/orm/validation.md | 111 +
.../pagination/classes/kohana/pagination.php | 285 ---
.../modules/pagination/config/pagination.php | 15 -
.../modules/pagination/config/userguide.php | 23 -
.../pagination/guide/pagination/config.md | 94 -
.../pagination/guide/pagination/examples.md | 0
.../pagination/guide/pagination/index.md | 0
.../pagination/guide/pagination/menu.md | 4 -
.../pagination/guide/pagination/usage.md | 0
.../pagination/views/pagination/basic.php | 37 -
.../pagination/views/pagination/floating.php | 94 -
.../kohana/modules/unittest/README.markdown | 44 +-
.../kohana/modules/unittest/bootstrap.php | 23 +-
.../unittest/classes/controller/unittest.php | 53 +-
.../kohana/unittest/database/testcase.php | 62 +-
.../classes/kohana/unittest/helpers.php | 13 +-
.../classes/kohana/unittest/runner.php | 31 +-
.../classes/kohana/unittest/testcase.php | 61 +-
.../classes/kohana/{ => unittest}/tests.php | 27 +-
.../unittest/classes/unittest/helpers.php | 3 +
.../classes/unittest/runner.php} | 2 +-
.../unittest/classes/unittest/testcase.php | 3 +
.../unittest/classes/unittest/tests.php | 3 +
.../modules/unittest/config/unittest.php | 2 +-
.../modules/unittest/config/userguide.php | 2 +-
.../modules/unittest/guide/unittest/index.md | 13 +-
.../unittest/guide/unittest/installing.md | 41 -
.../modules/unittest/guide/unittest/menu.md | 3 +-
.../unittest/guide/unittest/testing.md | 18 +-
.../{workflows.md => testing_workflows.md} | 12 +-
.../guide/unittest/troubleshooting.md | 6 +-
includes/kohana/modules/unittest/init.php | 2 +-
includes/kohana/modules/unittest/tests.php | 4 +-
.../unittest/views/unittest/results.php | 2 +-
includes/kohana/modules/userguide/README.md | 33 +-
.../classes/controller/userguide.php | 93 +-
.../userguide/classes/kohana/kodoc.php | 2 +-
.../userguide/classes/kohana/kodoc/class.php | 2 +-
.../classes/kohana/kodoc/markdown.php | 4 +-
.../classes/kohana/kodoc/method/param.php | 2 +-
.../classes/kohana/kodoc/property.php | 2 +-
.../modules/userguide/config/userguide.php | 2 +-
.../userguide/guide/developers.md} | 15 +-
.../userguide/guide/userguide/adding.md | 2 +-
.../userguide/guide/userguide/contributing.md | 33 +-
.../modules/userguide/media/guide/css/api.css | 6 +-
.../userguide/media/guide/css/kodoc.css | 11 +-
.../userguide/media/guide/css/screen.css | 2 +-
.../userguide/media/guide/img/arrows.png | Bin
.../userguide/media/guide/js/jquery.min.js | 291 +--
.../guide/userguide/contrib-github-edit.png | Bin
.../guide/userguide/contrib-github-fork.png | Bin
.../guide/userguide/contrib-github-pull.png | Bin
.../userguide/vendor/markdown/License.text | 0
.../userguide/vendor/markdown/markdown.php | 0
.../userguide/views/userguide/api/class.php | 6 +-
.../userguide/views/userguide/api/method.php | 2 +-
.../userguide/views/userguide/api/toc.php | 4 +-
.../userguide/views/userguide/index.php | 2 +-
.../userguide/views/userguide/menu.php | 2 +-
.../userguide/views/userguide/page-toc.php | 2 +-
.../userguide/views/userguide/template.php | 10 +-
includes/kohana/system/base.php | 50 -
.../oauth.php => system/classes/config.php} | 2 +-
.../kohana/system/classes/config/file.php | 3 +
.../kohana/system/classes/config/reader.php | 3 +
.../system/classes/{remote.php => debug.php} | 2 +-
.../classes/http.php} | 2 +-
.../kohana/system/classes/http/exception.php | 3 +
.../system/classes/http/exception/400.php | 3 +
.../system/classes/http/exception/401.php | 3 +
.../system/classes/http/exception/402.php | 3 +
.../system/classes/http/exception/403.php | 3 +
.../system/classes/http/exception/404.php | 3 +
.../system/classes/http/exception/405.php | 3 +
.../system/classes/http/exception/406.php | 3 +
.../system/classes/http/exception/407.php | 3 +
.../system/classes/http/exception/408.php | 3 +
.../system/classes/http/exception/409.php | 3 +
.../system/classes/http/exception/410.php | 3 +
.../system/classes/http/exception/411.php | 3 +
.../system/classes/http/exception/412.php | 3 +
.../system/classes/http/exception/413.php | 3 +
.../system/classes/http/exception/414.php | 3 +
.../system/classes/http/exception/415.php | 3 +
.../system/classes/http/exception/416.php | 3 +
.../system/classes/http/exception/417.php | 3 +
.../system/classes/http/exception/500.php | 3 +
.../system/classes/http/exception/501.php | 3 +
.../system/classes/http/exception/502.php | 3 +
.../system/classes/http/exception/503.php | 3 +
.../system/classes/http/exception/504.php | 3 +
.../system/classes/http/exception/505.php | 3 +
.../kohana/system/classes/http/header.php | 3 +
.../classes/http/header/value.php} | 2 +-
.../system/classes/http/interaction.php | 3 +
.../kohana/system/classes/http/request.php | 3 +
.../kohana/system/classes/http/response.php | 3 +
includes/kohana/system/classes/kohana/arr.php | 67 +-
includes/kohana/system/classes/kohana/cli.php | 2 +-
.../kohana/system/classes/kohana/config.php | 24 +-
.../system/classes/kohana/config/file.php | 8 +-
.../system/classes/kohana/config/reader.php | 2 +-
.../system/classes/kohana/controller.php | 17 +-
.../system/classes/kohana/controller/rest.php | 38 +-
.../classes/kohana/controller/template.php | 4 +-
.../kohana/system/classes/kohana/cookie.php | 12 +-
.../kohana/system/classes/kohana/core.php | 691 +-----
.../kohana/system/classes/kohana/date.php | 42 +-
.../kohana/system/classes/kohana/debug.php | 468 ++++
.../kohana/system/classes/kohana/encrypt.php | 4 +-
.../system/classes/kohana/exception.php | 47 +-
.../kohana/system/classes/kohana/feed.php | 6 +-
.../kohana/system/classes/kohana/file.php | 68 +-
.../kohana/system/classes/kohana/form.php | 12 +-
.../kohana/system/classes/kohana/fragment.php | 2 +-
.../kohana/system/classes/kohana/html.php | 46 +-
.../kohana/system/classes/kohana/http.php | 160 ++
.../system/classes/kohana/http/exception.php | 34 +
.../classes/kohana/http/exception/400.php | 10 +
.../classes/kohana/http/exception/401.php | 10 +
.../classes/kohana/http/exception/402.php | 10 +
.../classes/kohana/http/exception/403.php | 10 +
.../classes/kohana/http/exception/404.php | 10 +
.../classes/kohana/http/exception/405.php | 10 +
.../classes/kohana/http/exception/406.php | 10 +
.../classes/kohana/http/exception/407.php | 10 +
.../classes/kohana/http/exception/408.php | 10 +
.../classes/kohana/http/exception/409.php | 10 +
.../classes/kohana/http/exception/410.php | 10 +
.../classes/kohana/http/exception/411.php | 10 +
.../classes/kohana/http/exception/412.php | 10 +
.../classes/kohana/http/exception/413.php | 10 +
.../classes/kohana/http/exception/414.php | 10 +
.../classes/kohana/http/exception/415.php | 10 +
.../classes/kohana/http/exception/416.php | 10 +
.../classes/kohana/http/exception/417.php | 10 +
.../classes/kohana/http/exception/500.php | 10 +
.../classes/kohana/http/exception/501.php | 10 +
.../classes/kohana/http/exception/502.php | 10 +
.../classes/kohana/http/exception/503.php | 10 +
.../classes/kohana/http/exception/504.php | 10 +
.../classes/kohana/http/exception/505.php | 10 +
.../system/classes/kohana/http/header.php | 310 +++
.../classes/kohana/http/header/value.php | 219 ++
.../classes/kohana/http/interaction.php | 56 +
.../system/classes/kohana/http/request.php | 64 +
.../system/classes/kohana/http/response.php | 31 +
.../kohana/system/classes/kohana/i18n.php | 33 +-
.../system/classes/kohana/inflector.php | 4 +-
.../classes/kohana/kohana/exception.php | 206 ++
includes/kohana/system/classes/kohana/log.php | 76 +-
.../kohana/system/classes/kohana/log/file.php | 14 +-
.../system/classes/kohana/log/stderr.php | 2 +-
.../system/classes/kohana/log/stdout.php | 2 +-
.../system/classes/kohana/log/syslog.php | 6 +-
.../system/classes/kohana/log/writer.php | 18 +-
.../kohana/system/classes/kohana/model.php | 44 +-
includes/kohana/system/classes/kohana/num.php | 155 +-
.../kohana/system/classes/kohana/profiler.php | 2 +-
.../kohana/system/classes/kohana/remote.php | 154 --
.../kohana/system/classes/kohana/request.php | 1412 +++++++-----
.../system/classes/kohana/request/client.php | 328 +++
.../kohana/request/client/external.php | 427 ++++
.../kohana/request/client/internal.php | 179 ++
.../classes/kohana/request/exception.php | 4 +-
.../kohana/system/classes/kohana/response.php | 933 ++++++++
.../kohana/system/classes/kohana/route.php | 295 ++-
.../kohana/system/classes/kohana/security.php | 98 +-
.../kohana/system/classes/kohana/session.php | 21 +-
.../system/classes/kohana/session/cookie.php | 2 +-
.../system/classes/kohana/session/native.php | 2 +-
.../kohana/system/classes/kohana/text.php | 4 +-
.../kohana/system/classes/kohana/upload.php | 59 +-
includes/kohana/system/classes/kohana/url.php | 60 +-
.../kohana/system/classes/kohana/utf8.php | 2 +-
.../kohana/system/classes/kohana/valid.php | 518 +++++
.../kohana/system/classes/kohana/validate.php | 1190 ----------
.../system/classes/kohana/validation.php | 518 +++++
.../{validate => validation}/exception.php | 10 +-
.../kohana/system/classes/kohana/view.php | 8 +-
.../system/classes/kohana/view/exception.php | 2 +-
.../system/classes/{validate.php => log.php} | 2 +-
includes/kohana/system/classes/log/file.php | 3 +
includes/kohana/system/classes/log/stderr.php | 3 +
includes/kohana/system/classes/log/stdout.php | 3 +
includes/kohana/system/classes/log/syslog.php | 3 +
includes/kohana/system/classes/log/writer.php | 3 +
.../kohana/system/classes/request/client.php | 3 +
.../classes/request/client/external.php | 3 +
.../classes/request/client/internal.php | 3 +
includes/kohana/system/classes/response.php | 3 +
includes/kohana/system/classes/valid.php | 3 +
.../system/classes/validate/exception.php | 3 -
includes/kohana/system/classes/validation.php | 3 +
.../classes/validation/exception.php} | 2 +-
.../kohana/system/config/credit_cards.php | 2 +-
includes/kohana/system/config/curl.php | 9 +
includes/kohana/system/config/inflector.php | 8 +-
includes/kohana/system/config/mimes.php | 3 +-
includes/kohana/system/config/user_agents.php | 4 +-
.../kohana/system/guide/kohana/bootstrap.md | 55 +-
.../kohana/system/guide/kohana/conventions.md | 139 +-
.../kohana/system/guide/kohana/cookies.md | 13 +-
.../kohana/system/guide/kohana/debugging.md | 12 +-
includes/kohana/system/guide/kohana/errors.md | 73 +-
.../kohana/system/guide/kohana/extension.md | 6 +-
includes/kohana/system/guide/kohana/files.md | 4 +-
.../system/guide/kohana/files/classes.md | 2 +-
.../system/guide/kohana/files/config.md | 31 +-
.../kohana/system/guide/kohana/files/i18n.md | 68 +-
.../system/guide/kohana/files/messages.md | 37 +-
includes/kohana/system/guide/kohana/flow.md | 1 +
.../kohana/system/guide/kohana/helpers.md | 2 +-
includes/kohana/system/guide/kohana/index.md | 2 +-
.../kohana/system/guide/kohana/install.md | 13 +-
includes/kohana/system/guide/kohana/menu.md | 3 +-
includes/kohana/system/guide/kohana/models.md | 1 -
.../kohana/system/guide/kohana/modules.md | 2 +
.../system/guide/kohana/mvc/controllers.md | 101 +-
.../kohana/system/guide/kohana/mvc/models.md | 36 +-
.../kohana/system/guide/kohana/mvc/views.md | 20 +-
.../kohana/system/guide/kohana/requests.md | 64 +-
.../kohana/system/guide/kohana/routing.md | 57 +-
.../system/guide/kohana/security/deploying.md | 30 +-
.../guide/kohana/security/validation.md | 189 +-
.../system/guide/kohana/security/xss.md | 2 +-
.../guide/kohana/tutorials/error-pages.md | 180 +-
.../system/guide/kohana/tutorials/git.md | 46 +-
.../kohana/tutorials/routes-and-links.md | 3 -
.../kohana/system/guide/kohana/upgrading.md | 299 +--
.../system/media/guide/kohana/welcome.png | Bin
.../messages/{validate.php => validation.php} | 16 +-
.../kohana/system/tests/kohana/ArrTest.php | 110 +-
.../kohana/system/tests/kohana/CLITest.php | 7 +-
.../kohana/system/tests/kohana/ConfigTest.php | 93 +-
.../kohana/system/tests/kohana/CookieTest.php | 38 +-
.../kohana/system/tests/kohana/CoreTest.php | 212 +-
.../kohana/system/tests/kohana/DateTest.php | 182 +-
.../kohana/system/tests/kohana/DebugTest.php | 113 +
.../system/tests/kohana/ExceptionTest.php | 92 +
.../kohana/system/tests/kohana/FeedTest.php | 12 +-
.../kohana/system/tests/kohana/FileTest.php | 16 +-
.../kohana/system/tests/kohana/FormTest.php | 81 +-
.../kohana/system/tests/kohana/HTMLTest.php | 111 +-
.../tests/kohana/Http/Header/ValueTest.php | 164 ++
.../system/tests/kohana/Http/HeaderTest.php | 129 ++
.../kohana/system/tests/kohana/I18nTest.php | 7 +-
.../system/tests/kohana/InflectorTest.php | 10 +-
.../kohana/system/tests/kohana/LogTest.php | 53 +-
.../kohana/system/tests/kohana/ModelTest.php | 23 +-
.../kohana/system/tests/kohana/NumTest.php | 111 +-
.../kohana/system/tests/kohana/RemoteTest.php | 77 -
.../system/tests/kohana/RequestTest.php | 818 ++++++-
.../system/tests/kohana/ResponseTest.php | 244 +++
.../kohana/system/tests/kohana/RouteTest.php | 439 +++-
.../system/tests/kohana/SecurityTest.php | 22 +-
.../system/tests/kohana/SessionTest.php | 40 +-
.../kohana/system/tests/kohana/TextTest.php | 92 +-
.../kohana/system/tests/kohana/URLTest.php | 87 +-
.../kohana/system/tests/kohana/UTF8Test.php | 27 +-
.../kohana/system/tests/kohana/UploadTest.php | 7 +-
.../{ValidateTest.php => ValidTest.php} | 611 +-----
.../system/tests/kohana/ValidationTest.php | 495 +++++
.../kohana/system/tests/kohana/ViewTest.php | 78 +
.../tests/kohana/request/client/internal.php | 89 +
.../tests/test_data/callback_routes.php | 78 +
.../system/tests/test_data/views/test.css.php | 1 +
includes/kohana/system/utf8/from_unicode.php | 2 +-
includes/kohana/system/utf8/ltrim.php | 2 +-
includes/kohana/system/utf8/ord.php | 2 +-
includes/kohana/system/utf8/rtrim.php | 2 +-
includes/kohana/system/utf8/str_ireplace.php | 2 +-
includes/kohana/system/utf8/str_pad.php | 2 +-
includes/kohana/system/utf8/str_split.php | 2 +-
includes/kohana/system/utf8/strcasecmp.php | 2 +-
includes/kohana/system/utf8/strcspn.php | 2 +-
includes/kohana/system/utf8/stristr.php | 2 +-
includes/kohana/system/utf8/strlen.php | 2 +-
includes/kohana/system/utf8/strpos.php | 2 +-
includes/kohana/system/utf8/strrev.php | 2 +-
includes/kohana/system/utf8/strrpos.php | 2 +-
includes/kohana/system/utf8/strspn.php | 2 +-
includes/kohana/system/utf8/strtolower.php | 2 +-
includes/kohana/system/utf8/strtoupper.php | 2 +-
includes/kohana/system/utf8/substr.php | 2 +-
.../kohana/system/utf8/substr_replace.php | 2 +-
includes/kohana/system/utf8/to_unicode.php | 2 +-
.../system/utf8/transliterate_to_ascii.php | 2 +-
includes/kohana/system/utf8/trim.php | 2 +-
includes/kohana/system/utf8/ucfirst.php | 2 +-
includes/kohana/system/utf8/ucwords.php | 2 +-
includes/kohana/system/views/kohana/error.php | 18 +-
.../system/views/kohana/generate_logo.php | 2 +-
includes/kohana/system/views/kohana/logo.php | 2 +-
.../kohana/system/views/profiler/stats.php | 0
kh.php | 58 +-
401 files changed, 14070 insertions(+), 10213 deletions(-)
create mode 100644 includes/kohana/application/bootstrap.php
create mode 100644 includes/kohana/application/classes/controller/welcome.php
delete mode 100644 includes/kohana/build.xml
delete mode 100644 includes/kohana/example.htaccess
create mode 100644 includes/kohana/modules/auth/README.md
delete mode 100644 includes/kohana/modules/auth/classes/model/auth/role.php
delete mode 100644 includes/kohana/modules/auth/classes/model/auth/user.php
delete mode 100644 includes/kohana/modules/auth/config/userguide.php
mode change 100755 => 100644 includes/kohana/modules/codebench/media/guide/codebench/codebench_screenshot1.png
mode change 100755 => 100644 includes/kohana/modules/codebench/media/guide/codebench/codebench_screenshot2.png
rename includes/kohana/modules/{oauth/classes/oauth/consumer.php => database/classes/config/database.php} (52%)
create mode 100644 includes/kohana/modules/database/classes/kohana/model/database.php
create mode 100644 includes/kohana/modules/database/classes/model/database.php
delete mode 100755 includes/kohana/modules/oauth/README.md
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/consumer.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/exception.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/provider.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/provider/google.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/provider/twitter.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/request.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/request/access.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/request/authorize.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/request/credentials.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/request/resource.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/request/token.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/response.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/server.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/signature.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/signature/hmac/sha1.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/signature/plaintext.php
delete mode 100755 includes/kohana/modules/oauth/classes/kohana/oauth/token.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/token/access.php
delete mode 100644 includes/kohana/modules/oauth/classes/kohana/oauth/token/request.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/provider.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/provider/google.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/provider/twitter.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/request.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/request/access.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/request/authorize.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/request/credentials.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/request/resource.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/signature.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/signature/hmac/sha1.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/signature/plaintext.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/token/access.php
delete mode 100644 includes/kohana/modules/oauth/classes/oauth/token/request.php
delete mode 100644 includes/kohana/modules/oauth/config/oauth.php
delete mode 100644 includes/kohana/modules/oauth/config/userguide.php
delete mode 100644 includes/kohana/modules/oauth/guide/oauth/config.md
delete mode 100644 includes/kohana/modules/oauth/guide/oauth/index.md
delete mode 100644 includes/kohana/modules/oauth/guide/oauth/menu.md
delete mode 100644 includes/kohana/modules/oauth/guide/oauth/usage.md
delete mode 100644 includes/kohana/modules/oauth/views/oauth/twitter/tweet.php
rename includes/kohana/modules/{auth/mysql.sql => orm/auth-schema-mysql.sql} (92%)
rename includes/kohana/modules/{auth/postgresql.sql => orm/auth-schema-postgresql.sql} (95%)
rename includes/kohana/modules/{auth => orm}/classes/auth/orm.php (100%)
rename includes/kohana/modules/{auth => orm}/classes/kohana/auth/orm.php (63%)
create mode 100644 includes/kohana/modules/orm/classes/kohana/orm/validation/exception.php
create mode 100644 includes/kohana/modules/orm/classes/model/auth/role.php
create mode 100644 includes/kohana/modules/orm/classes/model/auth/user.php
rename includes/kohana/modules/{auth => orm}/classes/model/auth/user/token.php (50%)
rename includes/kohana/modules/{auth => orm}/classes/model/role.php (100%)
rename includes/kohana/modules/{auth => orm}/classes/model/user.php (100%)
rename includes/kohana/modules/{auth => orm}/classes/model/user/token.php (100%)
create mode 100644 includes/kohana/modules/orm/classes/orm/validation/exception.php
create mode 100644 includes/kohana/modules/orm/guide/orm/examples/validation.md
create mode 100644 includes/kohana/modules/orm/guide/orm/filters.md
delete mode 100644 includes/kohana/modules/pagination/classes/kohana/pagination.php
delete mode 100644 includes/kohana/modules/pagination/config/pagination.php
delete mode 100644 includes/kohana/modules/pagination/config/userguide.php
delete mode 100644 includes/kohana/modules/pagination/guide/pagination/config.md
delete mode 100644 includes/kohana/modules/pagination/guide/pagination/examples.md
delete mode 100644 includes/kohana/modules/pagination/guide/pagination/index.md
delete mode 100644 includes/kohana/modules/pagination/guide/pagination/menu.md
delete mode 100644 includes/kohana/modules/pagination/guide/pagination/usage.md
delete mode 100644 includes/kohana/modules/pagination/views/pagination/basic.php
delete mode 100644 includes/kohana/modules/pagination/views/pagination/floating.php
rename includes/kohana/modules/unittest/classes/kohana/{ => unittest}/tests.php (92%)
create mode 100644 includes/kohana/modules/unittest/classes/unittest/helpers.php
rename includes/kohana/modules/{oauth/classes/oauth/response.php => unittest/classes/unittest/runner.php} (52%)
create mode 100644 includes/kohana/modules/unittest/classes/unittest/testcase.php
create mode 100644 includes/kohana/modules/unittest/classes/unittest/tests.php
delete mode 100644 includes/kohana/modules/unittest/guide/unittest/installing.md
rename includes/kohana/modules/unittest/guide/unittest/{workflows.md => testing_workflows.md} (78%)
rename includes/kohana/{DEVELOPERS.md => modules/userguide/guide/developers.md} (95%)
mode change 100755 => 100644 includes/kohana/modules/userguide/media/guide/img/arrows.png
mode change 100755 => 100644 includes/kohana/modules/userguide/media/guide/userguide/contrib-github-edit.png
mode change 100755 => 100644 includes/kohana/modules/userguide/media/guide/userguide/contrib-github-fork.png
mode change 100755 => 100644 includes/kohana/modules/userguide/media/guide/userguide/contrib-github-pull.png
mode change 100755 => 100644 includes/kohana/modules/userguide/vendor/markdown/License.text
mode change 100755 => 100644 includes/kohana/modules/userguide/vendor/markdown/markdown.php
delete mode 100644 includes/kohana/system/base.php
rename includes/kohana/{modules/oauth/classes/oauth.php => system/classes/config.php} (62%)
create mode 100644 includes/kohana/system/classes/config/file.php
create mode 100644 includes/kohana/system/classes/config/reader.php
rename includes/kohana/system/classes/{remote.php => debug.php} (62%)
rename includes/kohana/{modules/pagination/classes/pagination.php => system/classes/http.php} (57%)
create mode 100644 includes/kohana/system/classes/http/exception.php
create mode 100644 includes/kohana/system/classes/http/exception/400.php
create mode 100644 includes/kohana/system/classes/http/exception/401.php
create mode 100644 includes/kohana/system/classes/http/exception/402.php
create mode 100644 includes/kohana/system/classes/http/exception/403.php
create mode 100644 includes/kohana/system/classes/http/exception/404.php
create mode 100644 includes/kohana/system/classes/http/exception/405.php
create mode 100644 includes/kohana/system/classes/http/exception/406.php
create mode 100644 includes/kohana/system/classes/http/exception/407.php
create mode 100644 includes/kohana/system/classes/http/exception/408.php
create mode 100644 includes/kohana/system/classes/http/exception/409.php
create mode 100644 includes/kohana/system/classes/http/exception/410.php
create mode 100644 includes/kohana/system/classes/http/exception/411.php
create mode 100644 includes/kohana/system/classes/http/exception/412.php
create mode 100644 includes/kohana/system/classes/http/exception/413.php
create mode 100644 includes/kohana/system/classes/http/exception/414.php
create mode 100644 includes/kohana/system/classes/http/exception/415.php
create mode 100644 includes/kohana/system/classes/http/exception/416.php
create mode 100644 includes/kohana/system/classes/http/exception/417.php
create mode 100644 includes/kohana/system/classes/http/exception/500.php
create mode 100644 includes/kohana/system/classes/http/exception/501.php
create mode 100644 includes/kohana/system/classes/http/exception/502.php
create mode 100644 includes/kohana/system/classes/http/exception/503.php
create mode 100644 includes/kohana/system/classes/http/exception/504.php
create mode 100644 includes/kohana/system/classes/http/exception/505.php
create mode 100644 includes/kohana/system/classes/http/header.php
rename includes/kohana/{modules/oauth/classes/oauth/token.php => system/classes/http/header/value.php} (51%)
create mode 100644 includes/kohana/system/classes/http/interaction.php
create mode 100644 includes/kohana/system/classes/http/request.php
create mode 100644 includes/kohana/system/classes/http/response.php
create mode 100644 includes/kohana/system/classes/kohana/debug.php
create mode 100644 includes/kohana/system/classes/kohana/http.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/400.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/401.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/402.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/403.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/404.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/405.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/406.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/407.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/408.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/409.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/410.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/411.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/412.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/413.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/414.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/415.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/416.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/417.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/500.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/501.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/502.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/503.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/504.php
create mode 100644 includes/kohana/system/classes/kohana/http/exception/505.php
create mode 100644 includes/kohana/system/classes/kohana/http/header.php
create mode 100644 includes/kohana/system/classes/kohana/http/header/value.php
create mode 100644 includes/kohana/system/classes/kohana/http/interaction.php
create mode 100644 includes/kohana/system/classes/kohana/http/request.php
create mode 100644 includes/kohana/system/classes/kohana/http/response.php
create mode 100644 includes/kohana/system/classes/kohana/kohana/exception.php
delete mode 100644 includes/kohana/system/classes/kohana/remote.php
create mode 100644 includes/kohana/system/classes/kohana/request/client.php
create mode 100644 includes/kohana/system/classes/kohana/request/client/external.php
create mode 100644 includes/kohana/system/classes/kohana/request/client/internal.php
create mode 100644 includes/kohana/system/classes/kohana/response.php
create mode 100644 includes/kohana/system/classes/kohana/valid.php
delete mode 100644 includes/kohana/system/classes/kohana/validate.php
create mode 100644 includes/kohana/system/classes/kohana/validation.php
rename includes/kohana/system/classes/kohana/{validate => validation}/exception.php (61%)
rename includes/kohana/system/classes/{validate.php => log.php} (60%)
create mode 100644 includes/kohana/system/classes/log/file.php
create mode 100644 includes/kohana/system/classes/log/stderr.php
create mode 100644 includes/kohana/system/classes/log/stdout.php
create mode 100644 includes/kohana/system/classes/log/syslog.php
create mode 100644 includes/kohana/system/classes/log/writer.php
create mode 100644 includes/kohana/system/classes/request/client.php
create mode 100644 includes/kohana/system/classes/request/client/external.php
create mode 100644 includes/kohana/system/classes/request/client/internal.php
create mode 100644 includes/kohana/system/classes/response.php
create mode 100644 includes/kohana/system/classes/valid.php
delete mode 100644 includes/kohana/system/classes/validate/exception.php
create mode 100644 includes/kohana/system/classes/validation.php
rename includes/kohana/{modules/oauth/classes/oauth/request/token.php => system/classes/validation/exception.php} (50%)
create mode 100644 includes/kohana/system/config/curl.php
delete mode 100644 includes/kohana/system/guide/kohana/models.md
delete mode 100644 includes/kohana/system/guide/kohana/tutorials/routes-and-links.md
mode change 100755 => 100644 includes/kohana/system/media/guide/kohana/welcome.png
rename includes/kohana/system/messages/{validate.php => validation.php} (68%)
create mode 100644 includes/kohana/system/tests/kohana/DebugTest.php
create mode 100644 includes/kohana/system/tests/kohana/ExceptionTest.php
create mode 100644 includes/kohana/system/tests/kohana/Http/Header/ValueTest.php
create mode 100644 includes/kohana/system/tests/kohana/Http/HeaderTest.php
delete mode 100644 includes/kohana/system/tests/kohana/RemoteTest.php
create mode 100644 includes/kohana/system/tests/kohana/ResponseTest.php
rename includes/kohana/system/tests/kohana/{ValidateTest.php => ValidTest.php} (54%)
create mode 100644 includes/kohana/system/tests/kohana/ValidationTest.php
create mode 100644 includes/kohana/system/tests/kohana/ViewTest.php
create mode 100644 includes/kohana/system/tests/kohana/request/client/internal.php
create mode 100644 includes/kohana/system/tests/test_data/callback_routes.php
create mode 100644 includes/kohana/system/tests/test_data/views/test.css.php
mode change 100755 => 100644 includes/kohana/system/views/profiler/stats.php
diff --git a/application/bootstrap.php b/application/bootstrap.php
index 0f4adad..f93f414 100644
--- a/application/bootstrap.php
+++ b/application/bootstrap.php
@@ -1,6 +1,20 @@
"
+ */
+if (isset($_SERVER['KOHANA_ENV']))
+{
+ Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
+}
/**
* Initialize Kohana, setting the default options.
@@ -57,27 +87,33 @@ Kohana::init(array(
/**
* Attach the file write to logging. Multiple writers are supported.
*/
-Kohana::$log->attach(new Kohana_Log_File(APPPATH.'logs'));
+Kohana::$log->attach(new Log_File(APPPATH.'logs'));
/**
* Attach a file reader to config. Multiple readers are supported.
*/
-Kohana::$config->attach(new Kohana_Config_File);
+Kohana::$config->attach(new Config_File);
/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
Kohana::modules(array(
- 'auth' => MODPATH.'auth', // Basic authentication
- // 'cache' => MODPATH.'cache', // Caching with multiple backends
- // 'codebench' => MODPATH.'codebench', // Benchmarking tool
- 'database' => MODPATH.'database', // Database access
- // 'image' => MODPATH.'image', // Image manipulation
- 'orm' => MODPATH.'orm', // Object Relationship Mapping
- // 'oauth' => MODPATH.'oauth', // OAuth authentication
- // 'pagination' => MODPATH.'pagination', // Paging of results
- // 'unittest' => MODPATH.'unittest', // Unit testing
- 'userguide' => MODPATH.'userguide', // User guide and API documentation
+ 'auth' => SMDPATH.'auth', // Basic authentication
+ 'cache' => SMDPATH.'cache', // Caching with multiple backends
+ // 'codebench' => SMDPATH.'codebench', // Benchmarking tool
+ 'database' => SMDPATH.'database', // Database access
+ // 'image' => SMDPATH.'image', // Image manipulation
+ 'orm' => SMDPATH.'orm', // Object Relationship Mapping
+ // 'unittest' => SMDPATH.'unittest', // Unit testing
+ // 'userguide' => SMDPATH.'userguide', // User guide and API documentation
+ ));
+
+/**
+ * Enable specalised interfaces
+ */
+Route::set('sections', '/(/(/(/)))',
+ array(
+ 'directory' => '('.implode('|',Kohana::config('config.method_directory')).')'
));
/**
@@ -97,15 +133,4 @@ Route::set('default/media', 'media(/)', array('file' => '.+'))
'action' => 'media',
'file' => NULL,
));
-
-if ( ! defined('SUPPRESS_REQUEST'))
-{
- /**
- * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
- * If no source is specified, the URI will be automatically detected.
- */
- echo Request::instance()
- ->execute()
- ->send_headers()
- ->response;
-}
+?>
diff --git a/includes/kohana/README.md b/includes/kohana/README.md
index 97e31dc..e19aba8 100644
--- a/includes/kohana/README.md
+++ b/includes/kohana/README.md
@@ -1,3 +1,3 @@
-# Kohana PHP Framework, version 3.0 (dev)
+# Kohana PHP Framework, version 3.1 (release)
-This is the current development version of [Kohana](http://kohanaframework.org/).
+This is the current release version of [Kohana](http://kohanaframework.org/).
diff --git a/includes/kohana/application/bootstrap.php b/includes/kohana/application/bootstrap.php
new file mode 100644
index 0000000..d6081cd
--- /dev/null
+++ b/includes/kohana/application/bootstrap.php
@@ -0,0 +1,118 @@
+"
+ */
+if (isset($_SERVER['KOHANA_ENV']))
+{
+ Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
+}
+
+/**
+ * Initialize Kohana, setting the default options.
+ *
+ * The following options are available:
+ *
+ * - string base_url path, and optionally domain, of your application NULL
+ * - string index_file name of your index file, usually "index.php" index.php
+ * - string charset internal character set used for input and output utf-8
+ * - string cache_dir set the internal cache directory APPPATH/cache
+ * - boolean errors enable or disable error handling TRUE
+ * - boolean profile enable or disable internal profiling TRUE
+ * - boolean caching enable or disable internal caching FALSE
+ */
+Kohana::init(array(
+ 'base_url' => '/',
+));
+
+/**
+ * Attach the file write to logging. Multiple writers are supported.
+ */
+Kohana::$log->attach(new Log_File(APPPATH.'logs'));
+
+/**
+ * Attach a file reader to config. Multiple readers are supported.
+ */
+Kohana::$config->attach(new Config_File);
+
+/**
+ * Enable modules. Modules are referenced by a relative or absolute path.
+ */
+Kohana::modules(array(
+ // 'auth' => MODPATH.'auth', // Basic authentication
+ // 'cache' => MODPATH.'cache', // Caching with multiple backends
+ // 'codebench' => MODPATH.'codebench', // Benchmarking tool
+ // 'database' => MODPATH.'database', // Database access
+ // 'image' => MODPATH.'image', // Image manipulation
+ // 'orm' => MODPATH.'orm', // Object Relationship Mapping
+ // 'unittest' => MODPATH.'unittest', // Unit testing
+ // 'userguide' => MODPATH.'userguide', // User guide and API documentation
+ ));
+
+/**
+ * Set the routes. Each route must have a minimum of a name, a URI and a set of
+ * defaults for the URI.
+ */
+Route::set('default', '((/(/)))')
+ ->defaults(array(
+ 'controller' => 'welcome',
+ 'action' => 'index',
+ ));
diff --git a/includes/kohana/application/classes/controller/welcome.php b/includes/kohana/application/classes/controller/welcome.php
new file mode 100644
index 0000000..0984eff
--- /dev/null
+++ b/includes/kohana/application/classes/controller/welcome.php
@@ -0,0 +1,10 @@
+response->body('hello, world!');
+ }
+
+} // End Welcome
diff --git a/includes/kohana/build.xml b/includes/kohana/build.xml
deleted file mode 100644
index daea9ed..0000000
--- a/includes/kohana/build.xml
+++ /dev/null
@@ -1,233 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/includes/kohana/example.htaccess b/includes/kohana/example.htaccess
deleted file mode 100644
index 53b8ccb..0000000
--- a/includes/kohana/example.htaccess
+++ /dev/null
@@ -1,21 +0,0 @@
-# Turn on URL rewriting
-RewriteEngine On
-
-# Installation directory
-RewriteBase /
-
-# Protect hidden files from being viewed
-
- Order Deny,Allow
- Deny From All
-
-
-# Protect application and system files from being viewed
-RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
-
-# Allow any files or directories that exist to be displayed directly
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-
-# Rewrite all other URLs to index.php/URL
-RewriteRule .* index.php/$0 [PT]
diff --git a/includes/kohana/install.php b/includes/kohana/install.php
index a522c2f..cbb0a4c 100644
--- a/includes/kohana/install.php
+++ b/includes/kohana/install.php
@@ -1,20 +1,4 @@
-
+
@@ -179,12 +163,20 @@ else
+
+ PECL HTTP Enabled |
+
+ Pass |
+
+ Kohana can use the http extension for the Request_Client_External class. |
+
+
cURL Enabled |
Pass |
- Kohana requires cURL for the Remote class. |
+ Kohana can use the cURL extension for the Request_Client_External class. |
@@ -203,6 +195,14 @@ else
Kohana requires GD v2 for the Image class. |
+
+ MySQL Enabled |
+
+ Pass |
+
+ Kohana can use the MySQL extension to support MySQL databases. |
+
+
PDO Enabled |
diff --git a/includes/kohana/modules/auth/README.md b/includes/kohana/modules/auth/README.md
new file mode 100644
index 0000000..27ac9cd
--- /dev/null
+++ b/includes/kohana/modules/auth/README.md
@@ -0,0 +1,13 @@
+New Age Auth
+---
+
+I've forked the main Auth module because there were some fundamental flaws with it:
+
+ 1. It's trivial to [bruteforce](http://dev.kohanaframework.org/issues/3163) publicly hidden salt hashes.
+ - I've fixed this by switching the password hashing algorithm to the more secure secret-key based hash_hmac method.
+ 2. ORM drivers were included.
+ - I've fixed this by simply removing them. They cause confusion with new users because they think that Auth requires ORM. The only driver currently provided by default is the file driver.
+ 3. Auth::get_user()'s api is inconsistent because it returns different data types.
+ - I've fixed this by returning an empty user model by default. You can override what gets returned (if you've changed your user model class name for instance) by overloading the get_user() method in your application.
+
+These changes should be merged into the mainline branch eventually, but they completely break the API, so likely won't be done until 3.1.
\ No newline at end of file
diff --git a/includes/kohana/modules/auth/classes/kohana/auth.php b/includes/kohana/modules/auth/classes/kohana/auth.php
index 51128f6..c5030e8 100644
--- a/includes/kohana/modules/auth/classes/kohana/auth.php
+++ b/includes/kohana/modules/auth/classes/kohana/auth.php
@@ -27,7 +27,7 @@ abstract class Kohana_Auth {
if ( ! $type = $config->get('driver'))
{
- $type = 'ORM';
+ $type = 'file';
}
// Set the session class name
@@ -40,16 +40,6 @@ abstract class Kohana_Auth {
return Auth::$_instance;
}
- /**
- * Create an instance of Auth.
- *
- * @return Auth
- */
- public static function factory($config = array())
- {
- return new Auth($config);
- }
-
protected $_session;
protected $_config;
@@ -61,9 +51,6 @@ abstract class Kohana_Auth {
*/
public function __construct($config = array())
{
- // Clean up the salt pattern and split it into an array
- $config['salt_pattern'] = preg_split('/,\s*/', Kohana::config('auth')->get('salt_pattern'));
-
// Save the config in the object
$this->_config = $config;
@@ -78,13 +65,13 @@ abstract class Kohana_Auth {
/**
* Gets the currently logged in user from the session.
- * Returns FALSE if no user is currently logged in.
+ * Returns NULL if no user is currently logged in.
*
* @return mixed
*/
- public function get_user()
+ public function get_user($default = NULL)
{
- return $this->_session->get($this->_config['session_key'], FALSE);
+ return $this->_session->get($this->_config['session_key'], $default);
}
/**
@@ -102,11 +89,8 @@ abstract class Kohana_Auth {
if (is_string($password))
{
- // Get the salt from the stored password
- $salt = $this->find_salt($this->password($username));
-
- // Create a hashed password using the salt from the stored password
- $password = $this->hash_password($password, $salt);
+ // Create a hashed password
+ $password = $this->hash($password);
}
return $this->_login($username, $password, $remember);
@@ -141,90 +125,40 @@ abstract class Kohana_Auth {
/**
* Check if there is an active session. Optionally allows checking for a
- * specific role.
+ * specific role.
*
* @param string role name
* @return mixed
*/
public function logged_in($role = NULL)
{
- return FALSE !== $this->get_user();
+ return ($this->get_user() !== NULL);
}
/**
- * Creates a hashed password from a plaintext password, inserting salt
- * based on the configured salt pattern.
+ * Creates a hashed hmac password from a plaintext password. This
+ * method is deprecated, [Auth::hash] should be used instead.
*
+ * @deprecated
* @param string plaintext password
- * @return string hashed password string
*/
- public function hash_password($password, $salt = FALSE)
+ public function hash_password($password)
{
- if ($salt === FALSE)
- {
- // Create a salt seed, same length as the number of offsets in the pattern
- $salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->_config['salt_pattern']));
- }
-
- // Password hash that the salt will be inserted into
- $hash = $this->hash($salt.$password);
-
- // Change salt to an array
- $salt = str_split($salt, 1);
-
- // Returned password
- $password = '';
-
- // Used to calculate the length of splits
- $last_offset = 0;
-
- foreach ($this->_config['salt_pattern'] as $offset)
- {
- // Split a new part of the hash off
- $part = substr($hash, 0, $offset - $last_offset);
-
- // Cut the current part out of the hash
- $hash = substr($hash, $offset - $last_offset);
-
- // Add the part to the password, appending the salt character
- $password .= $part.array_shift($salt);
-
- // Set the last offset to the current offset
- $last_offset = $offset;
- }
-
- // Return the password, with the remaining hash appended
- return $password.$hash;
+ return $this->hash($password);
}
/**
- * Perform a hash, using the configured method.
+ * Perform a hmac hash, using the configured method.
*
* @param string string to hash
* @return string
*/
public function hash($str)
{
- return hash($this->_config['hash_method'], $str);
- }
+ if ( ! $this->_config['hash_key'])
+ throw new Kohana_Exception('A valid hash key must be set in your auth config.');
- /**
- * Finds the salt from a password, based on the configured salt pattern.
- *
- * @param string hashed password
- * @return string
- */
- public function find_salt($password)
- {
- $salt = '';
-
- foreach ($this->_config['salt_pattern'] as $i => $offset)
- {
- // Find salt characters, take a good long look...
- $salt .= substr($password, $offset + $i, 1);
- }
-
- return $salt;
+ return hash_hmac($this->_config['hash_method'], $str, $this->_config['hash_key']);
}
protected function complete_login($user)
@@ -238,4 +172,4 @@ abstract class Kohana_Auth {
return TRUE;
}
-} // End Auth
\ No newline at end of file
+} // End Auth
diff --git a/includes/kohana/modules/auth/classes/model/auth/role.php b/includes/kohana/modules/auth/classes/model/auth/role.php
deleted file mode 100644
index 565c4f0..0000000
--- a/includes/kohana/modules/auth/classes/model/auth/role.php
+++ /dev/null
@@ -1,27 +0,0 @@
- array('through' => 'roles_users'));
-
- // Validation rules
- protected $_rules = array(
- 'name' => array(
- 'not_empty' => NULL,
- 'min_length' => array(4),
- 'max_length' => array(32),
- ),
- 'description' => array(
- 'max_length' => array(255),
- ),
- );
-
-} // End Auth Role Model
\ No newline at end of file
diff --git a/includes/kohana/modules/auth/classes/model/auth/user.php b/includes/kohana/modules/auth/classes/model/auth/user.php
deleted file mode 100644
index 35a512d..0000000
--- a/includes/kohana/modules/auth/classes/model/auth/user.php
+++ /dev/null
@@ -1,244 +0,0 @@
- array('model' => 'user_token'),
- 'roles' => array('model' => 'role', 'through' => 'roles_users'),
- );
-
- // Validation rules
- protected $_rules = array(
- 'username' => array(
- 'not_empty' => NULL,
- 'min_length' => array(4),
- 'max_length' => array(32),
- 'regex' => array('/^[-\pL\pN_.]++$/uD'),
- ),
- 'password' => array(
- 'not_empty' => NULL,
- 'min_length' => array(5),
- 'max_length' => array(42),
- ),
- 'password_confirm' => array(
- 'matches' => array('password'),
- ),
- 'email' => array(
- 'not_empty' => NULL,
- 'min_length' => array(4),
- 'max_length' => array(127),
- 'email' => NULL,
- ),
- );
-
- // Validation callbacks
- protected $_callbacks = array(
- 'username' => array('username_available'),
- 'email' => array('email_available'),
- );
-
- // Field labels
- protected $_labels = array(
- 'username' => 'username',
- 'email' => 'email address',
- 'password' => 'password',
- 'password_confirm' => 'password confirmation',
- );
-
- // Columns to ignore
- protected $_ignored_columns = array('password_confirm');
-
- /**
- * Validates login information from an array, and optionally redirects
- * after a successful login.
- *
- * @param array values to check
- * @param string URI or URL to redirect to
- * @return boolean
- */
- public function login(array & $array, $redirect = FALSE)
- {
- $fieldname = $this->unique_key($array['username']);
- $array = Validate::factory($array)
- ->label('username', $this->_labels[$fieldname])
- ->label('password', $this->_labels['password'])
- ->filter(TRUE, 'trim')
- ->rules('username', $this->_rules[$fieldname])
- ->rules('password', $this->_rules['password']);
-
- // Get the remember login option
- $remember = isset($array['remember']);
-
- // Login starts out invalid
- $status = FALSE;
-
- if ($array->check())
- {
- // Attempt to load the user
- $this->where($fieldname, '=', $array['username'])->find();
-
- if ($this->loaded() AND Auth::instance()->login($this, $array['password'], $remember))
- {
- if (is_string($redirect))
- {
- // Redirect after a successful login
- Request::instance()->redirect($redirect);
- }
-
- // Login is successful
- $status = TRUE;
- }
- else
- {
- $array->error('username', 'invalid');
- }
- }
-
- return $status;
- }
-
- /**
- * Validates an array for a matching password and password_confirm field,
- * and optionally redirects after a successful save.
- *
- * @param array values to check
- * @param string URI or URL to redirect to
- * @return boolean
- */
- public function change_password(array & $array, $redirect = FALSE)
- {
- $array = Validate::factory($array)
- ->label('password', $this->_labels['password'])
- ->label('password_confirm', $this->_labels['password_confirm'])
- ->filter(TRUE, 'trim')
- ->rules('password', $this->_rules['password'])
- ->rules('password_confirm', $this->_rules['password_confirm']);
-
- if ($status = $array->check())
- {
- // Change the password
- $this->password = $array['password'];
-
- if ($status = $this->save() AND is_string($redirect))
- {
- // Redirect to the success page
- Request::instance()->redirect($redirect);
- }
- }
-
- return $status;
- }
-
- /**
- * Complete the login for a user by incrementing the logins and saving login timestamp
- *
- * @return void
- */
- public function complete_login()
- {
- if ( ! $this->_loaded)
- {
- // nothing to do
- return;
- }
-
- // Update the number of logins
- $this->logins = new Database_Expression('logins + 1');
-
- // Set the last login date
- $this->last_login = time();
-
- // Save the user
- $this->save();
- }
-
- /**
- * Does the reverse of unique_key_exists() by triggering error if username exists.
- * Validation callback.
- *
- * @param Validate Validate object
- * @param string field name
- * @return void
- */
- public function username_available(Validate $array, $field)
- {
- if ($this->unique_key_exists($array[$field], 'username'))
- {
- $array->error($field, 'username_available', array($array[$field]));
- }
- }
-
- /**
- * Does the reverse of unique_key_exists() by triggering error if email exists.
- * Validation callback.
- *
- * @param Validate Validate object
- * @param string field name
- * @return void
- */
- public function email_available(Validate $array, $field)
- {
- if ($this->unique_key_exists($array[$field], 'email'))
- {
- $array->error($field, 'email_available', array($array[$field]));
- }
- }
-
- /**
- * Tests if a unique key value exists in the database.
- *
- * @param mixed the value to test
- * @param string field name
- * @return boolean
- */
- public function unique_key_exists($value, $field = NULL)
- {
- if ($field === NULL)
- {
- // Automatically determine field by looking at the value
- $field = $this->unique_key($value);
- }
-
- return (bool) DB::select(array('COUNT("*")', 'total_count'))
- ->from($this->_table_name)
- ->where($field, '=', $value)
- ->where($this->_primary_key, '!=', $this->pk())
- ->execute($this->_db)
- ->get('total_count');
- }
-
- /**
- * Allows a model use both email and username as unique identifiers for login
- *
- * @param string unique value
- * @return string field name
- */
- public function unique_key($value)
- {
- return Validate::email($value) ? 'email' : 'username';
- }
-
- /**
- * Saves the current object. Will hash password if it was changed.
- *
- * @return ORM
- */
- public function save()
- {
- if (array_key_exists('password', $this->_changed))
- {
- $this->_object['password'] = Auth::instance()->hash_password($this->_object['password']);
- }
-
- return parent::save();
- }
-
-} // End Auth User Model
\ No newline at end of file
diff --git a/includes/kohana/modules/auth/config/auth.php b/includes/kohana/modules/auth/config/auth.php
index c009819..0d80208 100644
--- a/includes/kohana/modules/auth/config/auth.php
+++ b/includes/kohana/modules/auth/config/auth.php
@@ -2,17 +2,15 @@
return array(
- 'driver' => 'ORM',
- 'hash_method' => 'sha1',
- 'salt_pattern' => '1, 3, 5, 9, 14, 15, 20, 21, 28, 30',
- 'lifetime' => 1209600,
- 'session_key' => 'auth_user',
- 'autologin_key' => 'auth_autologin',
- 'forced_key' => 'auth_forced',
+ 'driver' => 'file',
+ 'hash_method' => 'sha256',
+ 'hash_key' => NULL,
+ 'lifetime' => 1209600,
+ 'session_key' => 'auth_user',
// Username/password combinations for the Auth File driver
'users' => array(
// 'admin' => 'b3154acf3a344170077d11bdb5fff31532f679a1919e716a02',
),
-);
\ No newline at end of file
+);
diff --git a/includes/kohana/modules/auth/config/userguide.php b/includes/kohana/modules/auth/config/userguide.php
deleted file mode 100644
index b5606e8..0000000
--- a/includes/kohana/modules/auth/config/userguide.php
+++ /dev/null
@@ -1,23 +0,0 @@
- array(
-
- // This should be the path to this modules userguide pages, without the 'guide/'. Ex: '/guide/modulename/' would be 'modulename'
- 'auth' => array(
-
- // Whether this modules userguide pages should be shown
- 'enabled' => TRUE,
-
- // The name that should show up on the userguide index page
- 'name' => 'Auth',
-
- // A short description of this module, shown on the index page
- 'description' => 'User authentication and authorization.',
-
- // Copyright message, shown in the footer for this module
- 'copyright' => '© 2008–2010 Kohana Team',
- )
- )
-);
\ No newline at end of file
diff --git a/includes/kohana/modules/cache/classes/kohana/cache.php b/includes/kohana/modules/cache/classes/kohana/cache.php
index 5c9ac4a..cdef449 100644
--- a/includes/kohana/modules/cache/classes/kohana/cache.php
+++ b/includes/kohana/modules/cache/classes/kohana/cache.php
@@ -138,7 +138,7 @@ abstract class Kohana_Cache {
}
/**
- * @var Kohana_Config
+ * @var Config
*/
protected $_config;
diff --git a/includes/kohana/modules/cache/classes/kohana/cache/apc.php b/includes/kohana/modules/cache/classes/kohana/cache/apc.php
index 64ffe82..78765fe 100644
--- a/includes/kohana/modules/cache/classes/kohana/cache/apc.php
+++ b/includes/kohana/modules/cache/classes/kohana/cache/apc.php
@@ -71,7 +71,9 @@ class Kohana_Cache_Apc extends Cache {
*/
public function get($id, $default = NULL)
{
- return (($data = apc_fetch($this->_sanitize_id($id))) === FALSE) ? $default : $data;
+ $data = apc_fetch($this->_sanitize_id($id), $success);
+
+ return $success ? $data : $default;
}
/**
diff --git a/includes/kohana/modules/cache/classes/kohana/cache/file.php b/includes/kohana/modules/cache/classes/kohana/cache/file.php
index 096ba36..0ace205 100644
--- a/includes/kohana/modules/cache/classes/kohana/cache/file.php
+++ b/includes/kohana/modules/cache/classes/kohana/cache/file.php
@@ -373,7 +373,7 @@ class Kohana_Cache_File extends Cache implements Kohana_Cache_GarbageCollect {
$name = $files->getFilename();
// If the name is not a dot
- if ($name != '.' and $name != '..')
+ if ($name != '.' AND $name != '..' AND substr($file->getFilename(), 0, 1) == '.')
{
// Create new file resource
$fp = new SplFileInfo($files->getRealPath());
diff --git a/includes/kohana/modules/codebench/classes/bench/datespan.php b/includes/kohana/modules/codebench/classes/bench/datespan.php
index 6ea1f50..ff35479 100644
--- a/includes/kohana/modules/codebench/classes/bench/datespan.php
+++ b/includes/kohana/modules/codebench/classes/bench/datespan.php
@@ -29,7 +29,7 @@ class Bench_DateSpan extends Codebench {
public static function bench_span_original($remote, $local = NULL, $output = 'years,months,weeks,days,hours,minutes,seconds')
{
// Array with the output formats
- $output = preg_split('/[^a-z]+/', strtolower((string) $output));
+ $output = preg_split('/[^a-z]+/', strtolower( (string) $output));
// Invalid output
if (empty($output))
@@ -116,7 +116,7 @@ class Bench_DateSpan extends Codebench {
public static function bench_span_use_array($remote, $local = NULL, $output = 'years,months,weeks,days,hours,minutes,seconds')
{
// Array with the output formats
- $output = preg_split('/[^a-z]+/', strtolower((string) $output));
+ $output = preg_split('/[^a-z]+/', strtolower( (string) $output));
// Invalid output
if (empty($output))
diff --git a/includes/kohana/modules/codebench/classes/controller/codebench.php b/includes/kohana/modules/codebench/classes/controller/codebench.php
index 52e8404..cdd9a70 100644
--- a/includes/kohana/modules/codebench/classes/controller/codebench.php
+++ b/includes/kohana/modules/codebench/classes/controller/codebench.php
@@ -17,7 +17,9 @@ class Controller_Codebench extends Kohana_Controller_Template {
{
// Convert submitted class name to URI segment
if (isset($_POST['class']))
+ {
$this->request->redirect('codebench/'.trim($_POST['class']));
+ }
// Pass the class name on to the view
$this->template->class = (string) $class;
diff --git a/includes/kohana/modules/codebench/media/guide/codebench/codebench_screenshot1.png b/includes/kohana/modules/codebench/media/guide/codebench/codebench_screenshot1.png
old mode 100755
new mode 100644
diff --git a/includes/kohana/modules/codebench/media/guide/codebench/codebench_screenshot2.png b/includes/kohana/modules/codebench/media/guide/codebench/codebench_screenshot2.png
old mode 100755
new mode 100644
diff --git a/includes/kohana/modules/codebench/views/codebench.php b/includes/kohana/modules/codebench/views/codebench.php
index 1961950..7b6ef2a 100644
--- a/includes/kohana/modules/codebench/views/codebench.php
+++ b/includes/kohana/modules/codebench/views/codebench.php
@@ -2,7 +2,7 @@
/**
* Codebench — A benchmarking module.
*
- * @package Kohana
+ * @package Kohana/Codebench
* @author Kohana Team
* @copyright (c) 2009 Kohana Team
* @license http://kohanaphp.com/license.html
@@ -14,7 +14,9 @@
- Codebench
+
+
+ Codebench