Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standalone build for 3.4 series #562

Merged
merged 113 commits into from
Oct 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
ca8c0ac
Merge branch '3.2/develop' into 3.2/release/3.2.1
zombor Aug 24, 2012
4c554da
bump version to 3.2.1
zombor Aug 24, 2012
f31beb7
Merge branch '3.2/release/3.2.1' into 3.2/master
zombor Aug 24, 2012
97ccdec
Add Windows 8 support
tbbuck Aug 27, 2012
92fe9b0
Merge pull request #289 from tbbuck/3.2/master
Aug 27, 2012
7da9089
Revert "Add Windows 8 support"
Aug 27, 2012
24a6d0b
Merge branch '3.2/release/3.2.2' into 3.2/master
zombor Aug 30, 2012
92a1724
stdout and stderr now use file log writer's format to display readabl…
michal-m Oct 22, 2012
0e52dfc
Use the current exception handler during shutdown
evanpurkhiser Nov 4, 2012
4cf9392
Update the license url, fixes #4778
Sep 7, 2013
f7a4f36
Don't set empty body on external curl requests [Fixes #4791]
acoulton Sep 26, 2013
3be2d3d
#4201 - Issue with validation labels
JackEllis Jan 11, 2014
fb52a03
#4079 - Route::uri() Should encode parameters
JackEllis Jan 11, 2014
ce4ab50
Fixed the typo with additional braclet
JackEllis Jan 11, 2014
57f928e
Merge pull request #426 from JackEllis/bugfix-4201
zeelot Jan 11, 2014
91202dd
#4482 - Array to string conversion in deep Arr::merge
JackEllis Jan 11, 2014
00df092
Added strict in in_array
JackEllis Jan 11, 2014
796e68f
Merge pull request #428 from JackEllis/bugfix-4482
zeelot Jan 11, 2014
7ca1fe6
the third parameter is the one you are matching, not the second
zeelot Oct 1, 2012
29073be
refs #3896 - fix unit tests for proper matches validation
zeelot Jan 11, 2014
8f99de4
refs #4287 - fix memory leak in validation class
zeelot Jan 12, 2014
0e9eb8c
Merge pull request #403 from acoulton/3.2/bug/4791-curl-sets-content-…
zeelot Jan 12, 2014
14342a5
Avoid division by zero
enov Jan 12, 2014
1ad289c
Follow up to 3bc535eb536e54451b722da9699d052c863ac1b4, determine the …
zeelot Jan 13, 2014
89b038f
Merge branch '3.2/develop' of https://github.com/kohana/core into 3.2…
zeelot Jan 13, 2014
49654bc
Merge pull request #320 from EvanPurkhiser/fixup/4627-shudown-handler
zeelot Jan 13, 2014
db3e91f
Replaced empty string with zero
enov Jan 13, 2014
ca8c14f
Merge pull request #429 from enov/3.2/bug/3373-profiler-division-by-zero
zeelot Jan 13, 2014
4e7ed5b
Merge pull request #399 from bonzai/3.2/bugfix/4778-update_license_url
zeelot Jan 13, 2014
d93caff
replaced occurances of kohanaphp.com with kohanaframework.org
enov Jan 13, 2014
4fc1eab
replaced occurances of kohanaphp.com with kohanaframework.org
enov Jan 13, 2014
b6e753a
Merge pull request #430 from enov/3.2/bug/4778-phpdoc-license-url
zeelot Jan 13, 2014
6f73da3
Removed pointless array check and moved uri's key & value to provider
JackEllis Jan 13, 2014
02251fc
Merge pull request #427 from JackEllis/bugfix-4079
zeelot Jan 14, 2014
6fb0eff
Internal routing must ignore external routes, fixes #4235
biakaveron Jan 13, 2014
2d78b1b
Merge pull request #310 from michal-m/3.2/feature/stdout_stderr_levels
zeelot Jan 22, 2014
3f3cfdc
Merge pull request #437 from biakaveron/bug-4235-exclude-external-rou…
zeelot Jan 22, 2014
83f8f78
created failing test
enov Jan 23, 2014
c0cc9a9
fixed with regex courtesy of the Typogrify project
enov Jan 23, 2014
faf21da
Merge pull request #442 from enov/bug/3499/widont-with-html-tags
zeelot Jan 23, 2014
8d7b304
fixed phpdoc for Request::url function params
enov Jan 24, 2014
89d0d99
fixed phpdoc for test_url function
enov Jan 24, 2014
27f3f75
add the failing test
enov Jan 24, 2014
c14bbbd
add a condition to test if the url is external
enov Jan 24, 2014
1f86402
Use Kohana_UTF8 from version 3.3 to apply all the patches
enov Jan 24, 2014
eba1b22
Set and reset mb_substitute_character
enov Jan 25, 2014
3fb562f
replaced iconv with mb_convert_encoding in comments
enov Jan 25, 2014
3a8443e
default to original ini setting if Cookie::$domain not set
enov Jan 28, 2014
84ebc36
Adjusted ternary operator to comply with coding standards
enov Jan 29, 2014
071fab9
Make it more readable, as suggested by @WinterSilence
enov Jan 29, 2014
51b1eba
Merge pull request #443 from enov/bug/4241/request-url-external
zombor Jan 29, 2014
e55bffd
commented comments to a multi line comment block
enov Jan 29, 2014
e719fd2
Merge pull request #447 from enov/bugfix/3604/Session_Native-Cookie-d…
zeelot Jan 29, 2014
4d13bfb
Properly close multi-line comment (remove space)
enov Feb 3, 2014
7cc375b
Merge pull request #451 from enov/bugfix/3604/Session_Native-Cookie-d…
zeelot Feb 3, 2014
516c56c
Merge pull request #1 from kohana/3.2/develop
enov Feb 4, 2014
e722128
Added a bunch of tests from the Typogrify project
enov Feb 5, 2014
9f21e22
re-bugfix use '%' as delimiter and 'x' as modifier
enov Feb 5, 2014
1660b2a
Merge pull request #452 from enov/re-bugfix/3499/widont-with-html-tags
zeelot Feb 6, 2014
001eeb0
Merge pull request #444 from enov/bug/4813/Kohana_UTF8
zeelot Feb 6, 2014
07e3986
Fix documentation mention of Request::instance
Asenar Feb 11, 2014
a8b2fe8
inject routes to avoid conflict with application's routes
enov Feb 13, 2014
f698da1
allow Kohana shutdown properly, exit(1) in case of exception
enov Feb 14, 2014
e72b0ca
fix typo
enov Feb 14, 2014
7ed5c65
some cleanup
enov Feb 17, 2014
72c0a82
Merge pull request #460 from enov/bugfix/3931/exit-with-error-code/take2
zeelot Feb 20, 2014
49c8c46
fixed a brace according to the coding standard
enov Feb 24, 2014
116c492
Merge pull request #463 from enov/bugfix/3931/exit-with-error-code/take2
zeelot Feb 25, 2014
4329475
Merge pull request #458 from enov/bugfix/3967/inject-route-in-request…
zeelot Feb 25, 2014
481e0c0
Merge pull request #455 from Asenar/3.2/develop
zeelot Feb 25, 2014
4eeacd4
replace preg_replace /e with preg_replace_callback
enov Feb 26, 2014
f0c3dbf
Merge pull request #465 from enov/4819/preg_replace-e-preg_replace_ca…
zeelot Feb 27, 2014
5c5aac1
Decode slashes back after rawurlencode
enov Mar 5, 2014
c011806
add generating URIs section to the upgrade doc
enov Mar 5, 2014
9082a38
Merge pull request #468 from enov/fix/4651/upgrade_docs_generating_uris
zeelot Mar 5, 2014
76ed4c5
Merge pull request #467 from enov/refix/4079/Route_uri_encode_parameters
zeelot Mar 5, 2014
9e192d7
Bump version
May 7, 2014
04b3c36
Merge develop for new release
May 7, 2014
e472ecf
Update Text.php
zogame Sep 5, 2014
3df459a
Merge pull request #541 from Zogame/patch-2
enov Sep 5, 2014
b8ba46b
Configure standalone travis build for kohana/core
acoulton Sep 17, 2014
58e842d
Remove physical path dependency in Kohana::module tests
acoulton Sep 17, 2014
b880a3e
Added failing test for urls starting with // in HTML
Sep 17, 2014
9bfb502
Support urls starting with // in HTML::script and HTML::style
Sep 17, 2014
621b898
Added failing test to provider_style for urls starting with //
Sep 17, 2014
12516f0
incorrect mention of the missing method Request::instance
enov Sep 18, 2014
22dd37e
Merge pull request #550 from kohana/3.3/docfix/R4820/incorrect-mentio…
acoulton Sep 18, 2014
9c37705
related to R4813, removes redundant notice disabling lines
enov Sep 18, 2014
dd5306c
Merge pull request #551 from kohana/3.3/bugfix/R4813/remove-error_rep…
acoulton Sep 18, 2014
4729770
Merge pull request #549 from Sakto/3.3/develop
enov Sep 19, 2014
a0d06fd
Xdebug returns dynamic and static instead of using -> and ::
enov Sep 22, 2014
1d2b0ad
Merge pull request #555 from kohana/3.3/bug/arrow-double-column-inste…
kemo Sep 22, 2014
2faa4dc
Specify the COMPOSER_ROOT_VERSION for travis installation
acoulton Sep 22, 2014
a9db554
Remove IRC notifications from travis
acoulton Sep 22, 2014
c5839ac
Merge pull request #548 from kohana/3.3/feat/travis-module-builds
enov Sep 23, 2014
526fe4d
Update .gitignore for consistency with other modules
acoulton Sep 23, 2014
f6aee42
Rewrite Cookie tests to be runnable and cover current behaviour
acoulton Sep 18, 2014
200a25c
Reinstate skipped Security::csrf tests
acoulton Sep 18, 2014
fe41689
Reinstate one skipped test for File::mime
acoulton Sep 18, 2014
5a24c6e
Fix mocking for incomplete Session test
acoulton Sep 18, 2014
c7bc251
Rewrite Kohana::message tests for fragility and coverage
acoulton Sep 18, 2014
e9cd5ed
Reinstate and improve Feed::parse tests
acoulton Sep 18, 2014
1631e0b
Remove invalid skipped test - Response does send headers in CLI
acoulton Sep 18, 2014
67295df
Merge pull request #552 from kohana/3.3/bug/reinstate-skipped-tests
enov Sep 23, 2014
67da593
Text: provide tests for user_agent method
Ikke Sep 24, 2014
0699cbf
user_agents: add new windows platform
Ikke Sep 24, 2014
30d16cd
Merge pull request #556 from kohana/feature/tests-user-agent
enov Sep 25, 2014
d10ee63
Merge branch '3.2/master'
enov Sep 25, 2014
bb5e93b
Merge pull request #558 from kohana/3.3/merge/3.2-master-with-mb_subs…
acoulton Sep 26, 2014
7bbc0d2
Force Debug::dump marker to alpha for type safety [Fixes #559]
acoulton Sep 26, 2014
26e83a4
Add travis build badges
acoulton Oct 10, 2014
78bccef
Merge branch '3.3/develop' into 3.4/feat/travis-module-builds
acoulton Oct 10, 2014
eb55e8d
Update travis configuration and composer dependencies for 3.4 series
acoulton Oct 10, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*~
*.swp
/composer.lock
/vendor/*
/koharness_bootstrap.php
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- COMPOSER_ROOT_VERSION=3.4.x-dev composer install --prefer-dist
- vendor/bin/koharness

script:
- cd /tmp/koharness && ./vendor/bin/phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php

notifications:
email: false
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Kohana PHP Framework - core

| ver | Stable | Develop |
|-------|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| 3.3.x | [![Build Status - 3.3/master](https://travis-ci.org/kohana/core.svg?branch=3.3%2Fmaster)](https://travis-ci.org/kohana/core) | [![Build Status - 3.3/develop](https://travis-ci.org/kohana/core.svg?branch=3.3%2Fdevelop)](https://travis-ci.org/kohana/core) |
| 3.4.x | [![Build Status - 3.4/master](https://travis-ci.org/kohana/core.svg?branch=3.4%2Fmaster)](https://travis-ci.org/kohana/core) | [![Build Status - 3.4/develop](https://travis-ci.org/kohana/core.svg?branch=3.4%2Fdevelop)](https://travis-ci.org/kohana/core) |

This is the core package for the [Kohana](http://kohanaframework.org/) object oriented HMVC framework built using PHP5.
It aims to be swift, secure, and small.

Released under a [BSD license](http://kohanaframework.org/license), Kohana can be used legally for any open source,
commercial, or personal project.

## Documentation and installation

See the [sample application repository](https://github.com/kohana/kohana) for full readme and contributing information.
You will usually add `kohana/core` as a dependency in your own project's composer.json to install and work with this
pacakge.

## Installation for development

To work on this package, you'll want to install it with composer to get the required dependencies. Note that there are
currently circular dependencies between this module and kohana/unittest. These may cause you problems if you are working
on a feature branch, because composer may not be able to figure out which version of kohana core you have.

To work around this, run composer like: `COMPOSER_ROOT_VERSION=3.3.x-dev composer install`. This tells composer that the
current checkout is a 3.3.* development version. Obviously change the argument if your branch is based on a different
version.

After installing the dependencies, you'll need a skeleton Kohana application before you can run the unit tests etc. The
simplest way to do this is to use kohana/koharness to build a bare project in `/tmp/koharness`.

If in doubt, check the install and test steps in the [.travis.yml](.travis.yml) file.
60 changes: 49 additions & 11 deletions classes/Kohana/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function get($key, $default = NULL)
}

// The cookie signature is invalid, delete it
Cookie::delete($key);
static::delete($key);
}

return $default;
Expand All @@ -88,33 +88,38 @@ public static function get($key, $default = NULL)
* Sets a signed cookie. Note that all cookie values must be strings and no
* automatic serialization will be performed!
*
* [!!] By default, Cookie::$expiration is 0 - if you skip/pass NULL for the optional
* lifetime argument your cookies will expire immediately unless you have separately
* configured Cookie::$expiration.
*
*
* // Set the "theme" cookie
* Cookie::set('theme', 'red');
*
* @param string $name name of cookie
* @param string $value value of cookie
* @param integer $expiration lifetime in seconds
* @param integer $lifetime lifetime in seconds
* @return boolean
* @uses Cookie::salt
*/
public static function set($name, $value, $expiration = NULL)
public static function set($name, $value, $lifetime = NULL)
{
if ($expiration === NULL)
if ($lifetime === NULL)
{
// Use the default expiration
$expiration = Cookie::$expiration;
$lifetime = Cookie::$expiration;
}

if ($expiration !== 0)
if ($lifetime !== 0)
{
// The expiration is expected to be a UNIX timestamp
$expiration += time();
$lifetime += static::_time();
}

// Add the salt to the cookie value
$value = Cookie::salt($name, $value).'~'.$value;

return setcookie($name, $value, $expiration, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);
return static::_setcookie($name, $value, $lifetime, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);
}

/**
Expand All @@ -131,16 +136,18 @@ public static function delete($name)
unset($_COOKIE[$name]);

// Nullify the cookie and make it expire
return setcookie($name, NULL, -86400, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);
return static::_setcookie($name, NULL, -86400, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);
}

/**
* Generates a salt string for a cookie based on the name and value.
*
* $salt = Cookie::salt('theme', 'red');
*
* @param string $name name of cookie
* @param string $value value of cookie
* @param string $name name of cookie
* @param string $value value of cookie
*
* @throws Kohana_Exception if Cookie::$salt is not configured
* @return string
*/
public static function salt($name, $value)
Expand All @@ -157,4 +164,35 @@ public static function salt($name, $value)
return sha1($agent.$name.$value.Cookie::$salt);
}

/**
* Proxy for the native setcookie function - to allow mocking in unit tests so that they do not fail when headers
* have been sent.
*
* @param string $name
* @param string $value
* @param integer $expire
* @param string $path
* @param string $domain
* @param boolean $secure
* @param boolean $httponly
*
* @return bool
* @see setcookie
*/
protected static function _setcookie($name, $value, $expire, $path, $domain, $secure, $httponly)
{
return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
}

/**
* Proxy for the native time function - to allow mocking of time-related logic in unit tests
*
* @return int
* @see time
*/
protected static function _time()
{
return time();
}

}
4 changes: 2 additions & 2 deletions classes/Kohana/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ protected static function _dump( & $var, $length = 128, $limit = 10, $level = 0)

if ($marker === NULL)
{
// Make a unique marker
$marker = uniqid("\x00");
// Make a unique marker - force it to be alphanumeric so that it is always treated as a string array key
$marker = uniqid("\x00")."x";
}

if (empty($var))
Expand Down
2 changes: 1 addition & 1 deletion classes/Kohana/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Kohana_Form {
* @param mixed $action form action, defaults to the current request URI, or [Request] class to use
* @param array $attributes html attributes
* @return string
* @uses Request::instance
* @uses Request
* @uses URL::site
* @uses HTML::attributes
*/
Expand Down
4 changes: 2 additions & 2 deletions classes/Kohana/HTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static function mailto($email, $title = NULL, array $attributes = NULL)
*/
public static function style($file, array $attributes = NULL, $protocol = NULL, $index = FALSE)
{
if (strpos($file, '://') === FALSE)
if (strpos($file, '://') === FALSE AND strpos($file, '//') !== 0)
{
// Add the base URL
$file = URL::site($file, $protocol, $index);
Expand Down Expand Up @@ -240,7 +240,7 @@ public static function style($file, array $attributes = NULL, $protocol = NULL,
*/
public static function script($file, array $attributes = NULL, $protocol = NULL, $index = FALSE)
{
if (strpos($file, '://') === FALSE)
if (strpos($file, '://') === FALSE AND strpos($file, '//') !== 0)
{
// Add the base URL
$file = URL::site($file, $protocol, $index);
Expand Down
10 changes: 10 additions & 0 deletions classes/Kohana/Kohana/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ public static function response(Exception $e)
$frame['type'] = '??';
}

// Xdebug returns the words 'dynamic' and 'static' instead of using '->' and '::' symbols
if ('dynamic' === $frame['type'])
{
$frame['type'] = '->';
}
elseif ('static' === $frame['type'])
{
$frame['type'] = '::';
}

// XDebug also has a different name for the parameters array
if (isset($frame['params']) AND ! isset($frame['args']))
{
Expand Down
18 changes: 15 additions & 3 deletions classes/Kohana/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Kohana_Request implements HTTP_Request {

/**
* Creates a new request object for the given URI. New requests should be
* created using the [Request::instance] or [Request::factory] methods.
* Created using the [Request::factory] method.
*
* $request = Request::factory($uri);
*
Expand Down Expand Up @@ -462,6 +462,12 @@ public static function process(Request $request, $routes = NULL)

foreach ($routes as $name => $route)
{
// Use external routes for reverse routing only
if ($route->is_external())
{
continue;
}

// We found something suitable
if ($params = $route->matches($request))
{
Expand Down Expand Up @@ -631,7 +637,7 @@ protected static function _parse_accept( & $header, array $accepts = NULL)

/**
* Creates a new request object for the given URI. New requests should be
* created using the [Request::instance] or [Request::factory] methods.
* Created using the [Request::factory] method.
*
* $request = new Request($uri);
*
Expand Down Expand Up @@ -747,7 +753,13 @@ public function uri($uri = NULL)
*/
public function url($protocol = NULL)
{
// Create a URI with the current route and convert it to a URL
if ($this->is_external())
{
// If it's an external request return the URI
return $this->uri();
}

// Create a URI with the current route, convert to a URL and returns
return URL::site($this->uri(), $protocol);
}

Expand Down
5 changes: 4 additions & 1 deletion classes/Kohana/Request/Client/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ public function _send_message(Request $request, Response $response)
// if using a request other than POST. PUT does support this method
// and DOES NOT require writing data to disk before putting it, if
// reading the PHP docs you may have got that impression. SdF
$options[CURLOPT_POSTFIELDS] = $request->body();
// This will also add a Content-Type: application/x-www-form-urlencoded header unless you override it
if ($body = $request->body()) {
$options[CURLOPT_POSTFIELDS] = $body;
}

// Process headers
if ($headers = $request->headers())
Expand Down
8 changes: 8 additions & 0 deletions classes/Kohana/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,14 @@ public function is_external()
*/
public function uri(array $params = NULL)
{
if ($params)
{
// @issue #4079 rawurlencode parameters
$params = array_map('rawurlencode', $params);
// decode slashes back, see Apache docs about AllowEncodedSlashes and AcceptPathInfo
$params = str_replace(array('%2F', '%5C'), array('/', '\\'), $params);
}

$defaults = $this->_defaults;

/**
Expand Down
25 changes: 24 additions & 1 deletion classes/Kohana/Session/Native.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,31 @@ public function id()
*/
protected function _read($id = NULL)
{
/**
* session_set_cookie_params will override php ini settings
* If Cookie::$domain is NULL or empty and is passed, PHP
* will override ini and sent cookies with the host name
* of the server which generated the cookie
*
* see issue #3604
*
* see http://www.php.net/manual/en/function.session-set-cookie-params.php
* see http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-domain
*
* set to Cookie::$domain if available, otherwise default to ini setting
*/
$session_cookie_domain = empty(Cookie::$domain)
? ini_get('session.cookie_domain')
: Cookie::$domain;

// Sync up the session cookie with Cookie parameters
session_set_cookie_params($this->_lifetime, Cookie::$path, Cookie::$domain, Cookie::$secure, Cookie::$httponly);
session_set_cookie_params(
$this->_lifetime,
Cookie::$path,
$session_cookie_domain,
Cookie::$secure,
Cookie::$httponly
);

// Do not allow PHP to send Cache-Control headers
session_cache_limiter(FALSE);
Expand Down
Loading