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

Upstream updates #6

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3074c38
Corrected casing
LukeXF Feb 4, 2016
930ffe8
Merge pull request #4014 from LukeXF/patch-1
klimov-paul Feb 4, 2016
711ab48
inherit "disabled" attribute in internally rendered hidden fields in …
rob006 Feb 13, 2016
c485d33
Merge pull request #4015 from rob006/disabled-checkbox-fix
cebe Feb 14, 2016
9e53285
Fixes #4020: Fixed PHP 7 related bug in CCacheHttpSession when destro…
dirx Mar 5, 2016
5bce819
Fix a typo in CModule.
foomango Mar 11, 2016
083d361
Merge pull request #4024 from foomango/fixtypo
SilverFire Mar 11, 2016
73e44b9
Updated PHPUnit Fixtures documentation link
joshijitendra Mar 14, 2016
402fab3
Merge pull request #4025 from joshijitendra/patch-1
samdark Mar 14, 2016
6384bc3
Fix typo for "as early as possible".
foomango Mar 19, 2016
8a2be12
Merge pull request #4029 from foomango/fixtypo
SilverFire Mar 19, 2016
3d028df
Fixes #4033: Updated Pear/Text used by Gii so it's PHP 7 compatible
samdark Apr 11, 2016
886a2ec
More fixes for #4033
samdark Apr 19, 2016
f2054c0
More PHP 7 compatibility fixes #4033
samdark Apr 19, 2016
c752c6a
Fixes #4002: Documented change in regex handling in URL rules
samdark May 4, 2016
33af13b
Fixes #4034 `CHttpSession::getIsStarted()` PHP 7 compatibility
cb-sugita Apr 21, 2016
cf33114
Allow absolute URLs to start with '//' instead of just 'http' - e.g. …
ksowa Jun 6, 2016
2835069
remove unnecessary spaces in french text translation
guber007 Jul 20, 2015
9ffe1da
Fixes #4061: Fixed "Fatal Error: Nesting level too deep - recursive d…
kf99916 Jun 29, 2016
208d115
phpdoc fixes
armano2 Jun 7, 2016
e2699f3
Merge remote-tracking branch 'original/master' into upstream-updates
Jul 7, 2016
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
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
Version 1.1.18 under development
--------------------------------

- no changes have been made yet.
- Enh #4049: Added '//' as a proper beginning of absolute URL in createAbsoluteUrl() method (ksowa)
- Bug #4015: Fixed bug with missing "disabled" attribute in internally rendered hidden fields (rob006)
- Bug #4020: Fixed PHP 7 related bug in CCacheHttpSession when destroying not cached sessions (dirx)
- Chg #4033: Updated Pear/Text used by Gii so it's PHP 7 compatible (samdark)
- Bug #4034: Fixed `CHttpSession::getIsStarted()` PHP 7 compatibility (tomotomo)
- Bug #4061: Fixed "Fatal Error: Nesting level too deep - recursive dependency" error in `CArrayDataProvider` (kf99916, andrewnester)

Version 1.1.17 January 13, 2016
------------------------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can access it with the following URL:
http://hostname/YiiPath/testdrive/index.php


WHAT's NEXT
WHAT'S NEXT
-----------

Please visit the project website for tutorials, class reference
Expand Down
2 changes: 2 additions & 0 deletions UPGRADE
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Upgrading from v1.1.16
----------------------

- If you're using CApcCache with APCu, set `useApcu` to `true` in the component config.
- Undocumented usage of regular expressions outside parameters in URL rules was considered a bug (#3348). Regular
expressions are now escaped properly so if you rely on previous behavior, please update your code.

Upgrading from v1.1.15
----------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/test.fixture.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Defining Fixtures
=================

Automated tests need to be executed many times. To ensure the testing process is repeatable, we would like to run the tests in some known state called *fixture*. For example, to test the post creation feature in a blog application, each time when we run the tests, the tables storing relevant data about posts (e.g. the `Post` table, the `Comment` table) should be restored to some fixed state. The [PHPUnit documentation](http://phpunit.de/manual/3.8/en/fixtures.html) has described well about generic fixture setup. In this section, we mainly describe how to set up database fixtures, as we just described in the example.
Automated tests need to be executed many times. To ensure the testing process is repeatable, we would like to run the tests in some known state called *fixture*. For example, to test the post creation feature in a blog application, each time when we run the tests, the tables storing relevant data about posts (e.g. the `Post` table, the `Comment` table) should be restored to some fixed state. The [PHPUnit documentation](https://phpunit.de/manual/current/en/fixtures.html) has described well about generic fixture setup. In this section, we mainly describe how to set up database fixtures, as we just described in the example.

Setting up database fixtures is perhaps one of the most time-consuming parts in testing database-backed Web applications. Yii introduces the [CDbFixtureManager] application component to alleviate this problem. It basically does the following things when running a set of tests:

Expand Down
6 changes: 3 additions & 3 deletions framework/base/CApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function __construct($config=null)
{
Yii::setApplication($this);

// set basePath at early as possible to avoid trouble
// set basePath as early as possible to avoid trouble
if(is_string($config))
$config=require($config);
if(isset($config['basePath']))
Expand Down Expand Up @@ -400,7 +400,7 @@ public function findLocalizedFile($srcFile,$srcLanguage=null,$language=null)
/**
* Returns the locale instance.
* @param string $localeID the locale ID (e.g. en_US). If null, the {@link getLanguage application language ID} will be used.
* @return an instance of CLocale
* @return CLocale an instance of CLocale
*/
public function getLocale($localeID=null)
{
Expand Down Expand Up @@ -572,7 +572,7 @@ public function createUrl($route,$params=array(),$ampersand='&')
public function createAbsoluteUrl($route,$params=array(),$schema='',$ampersand='&')
{
$url=$this->createUrl($route,$params,$ampersand);
if(strpos($url,'http')===0)
if(strpos($url,'http')===0 || strpos($url,'//')===0)
return $url;
else
return $this->getRequest()->getHostInfo($schema).$url;
Expand Down
2 changes: 1 addition & 1 deletion framework/base/CModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct($id,$parent,$config=null)
$this->_id=$id;
$this->_parentModule=$parent;

// set basePath at early as possible to avoid trouble
// set basePath as early as possible to avoid trouble
if(is_string($config))
$config=require($config);
if(isset($config['basePath']))
Expand Down
20 changes: 10 additions & 10 deletions framework/gii/components/Pear/Text/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* The original PHP version of this code was written by Geoffrey T. Dairiki
* <dairiki@dairiki.org>, and is used/adapted with his permission.
*
* $Horde: framework/Text_Diff/Diff.php,v 1.11.2.11 2008/02/24 10:57:46 jan Exp $
* $Horde: framework/Text_Diff/Diff.php,v 1.11.2.12 2009/01/06 15:23:41 jan Exp $
*
* Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org>
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand All @@ -35,7 +35,7 @@ class Text_Diff {
* Normally an array of two arrays, each
* containing the lines from a file.
*/
function Text_Diff($engine, $params)
function __construct($engine, $params)
{
// Backward compatibility workaround.
if (!is_string($engine)) {
Expand Down Expand Up @@ -294,7 +294,7 @@ class Text_MappedDiff extends Text_Diff {
/**
* Computes a diff between sequences of strings.
*
* This can be used to compute things like case-insensitive diffs, or diffs
* This can be used to compute things like case-insensitve diffs, or diffs
* which ignore changes in white-space.
*
* @param array $from_lines An array of strings.
Expand All @@ -307,13 +307,13 @@ class Text_MappedDiff extends Text_Diff {
* @param array $mapped_to_lines This array should have the same number
* of elements as $to_lines.
*/
function Text_MappedDiff($from_lines, $to_lines,
function __construct($from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines)
{
assert(count($from_lines) == count($mapped_from_lines));
assert(count($to_lines) == count($mapped_to_lines));

parent::Text_Diff($mapped_from_lines, $mapped_to_lines);
parent::__construct($mapped_from_lines, $mapped_to_lines);

$xi = $yi = 0;
for ($i = 0; $i < count($this->_edits); $i++) {
Expand Down Expand Up @@ -369,7 +369,7 @@ function nfinal()
*/
class Text_Diff_Op_copy extends Text_Diff_Op {

function Text_Diff_Op_copy($orig, $final = false)
function __construct($orig, $final = false)
{
if (!is_array($final)) {
$final = $orig;
Expand All @@ -394,7 +394,7 @@ function &reverse()
*/
class Text_Diff_Op_delete extends Text_Diff_Op {

function Text_Diff_Op_delete($lines)
function __construct($lines)
{
$this->orig = $lines;
$this->final = false;
Expand All @@ -416,7 +416,7 @@ function &reverse()
*/
class Text_Diff_Op_add extends Text_Diff_Op {

function Text_Diff_Op_add($lines)
function __construct($lines)
{
$this->final = $lines;
$this->orig = false;
Expand All @@ -438,7 +438,7 @@ function &reverse()
*/
class Text_Diff_Op_change extends Text_Diff_Op {

function Text_Diff_Op_change($orig, $final)
function __construct($orig, $final)
{
$this->orig = $orig;
$this->final = $final;
Expand Down
4 changes: 2 additions & 2 deletions framework/gii/components/Pear/Text/Diff/Engine/native.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
* code was written by him, and is used/adapted with his permission.
*
* $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.7.2.4 2008/01/04 10:38:10 jan Exp $
* $Horde: framework/Text_Diff/Diff/Engine/native.php,v 1.7.2.5 2009/01/06 15:23:41 jan Exp $
*
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down
10 changes: 6 additions & 4 deletions framework/gii/components/Pear/Text/Diff/Engine/shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* This class uses the Unix `diff` program via shell_exec to compute the
* differences between the two input arrays.
*
* $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.6.2.3 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.6.2.4 2009/01/06 15:23:41 jan Exp $
*
* Copyright 2007-2008 The Horde Project (http://www.horde.org/)
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down Expand Up @@ -138,8 +138,10 @@ function diff($from_lines, $to_lines)
* @access private
*
* @param array &$text_lines Either $from_lines or $to_lines
* @param integer &$line_no Current line number
* @param integer $end Optional end line, when we want to chop more than one line.
* @param int &$line_no Current line number
* @param int $end Optional end line, when we want to chop more
* than one line.
*
* @return array The chopped lines
*/
function _getLines(&$text_lines, &$line_no, $end = false)
Expand Down
19 changes: 16 additions & 3 deletions framework/gii/components/Pear/Text/Diff/Engine/string.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* echo $renderer->render($diff);
* </code>
*
* $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.5.2.5 2008/09/10 08:31:58 jan Exp $
* $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.5.2.7 2009/07/24 13:04:43 jan Exp $
*
* Copyright 2005 �rjan Persson <o@42mm.org>
* Copyright 2005-2008 The Horde Project (http://www.horde.org/)
* Copyright 2005-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand All @@ -39,6 +39,19 @@ class Text_Diff_Engine_string {
*/
function diff($diff, $mode = 'autodetect')
{
// Detect line breaks.
$lnbr = "\n";
if (strpos($diff, "\r\n") !== false) {
$lnbr = "\r\n";
} elseif (strpos($diff, "\r") !== false) {
$lnbr = "\r";
}

// Make sure we have a line break at the EOF.
if (substr($diff, -strlen($lnbr)) != $lnbr) {
$diff .= $lnbr;
}

if ($mode != 'autodetect' && $mode != 'context' && $mode != 'unified') {
return PEAR::raiseError('Type of diff is unsupported');
}
Expand All @@ -56,7 +69,7 @@ function diff($diff, $mode = 'autodetect')
}

// Split by new line and remove the diff header, if there is one.
$diff = explode("\n", $diff);
$diff = explode($lnbr, $diff);
if (($mode == 'context' && strpos($diff[0], '***') === 0) ||
($mode == 'unified' && strpos($diff[0], '---') === 0)) {
array_shift($diff);
Expand Down
7 changes: 5 additions & 2 deletions framework/gii/components/Pear/Text/Diff/Engine/xdiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff)
* to compute the differences between the two input arrays.
*
* $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.4.2.3 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.4.2.5 2009/07/24 13:06:24 jan Exp $
*
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down Expand Up @@ -42,6 +42,9 @@ function diff($from_lines, $to_lines)
* valid, albeit a little less descriptive and efficient. */
$edits = array();
foreach ($diff as $line) {
if (!strlen($line)) {
continue;
}
switch ($line[0]) {
case ' ':
$edits[] = new Text_Diff_Op_copy(array(substr($line, 1)));
Expand Down
8 changes: 4 additions & 4 deletions framework/gii/components/Pear/Text/Diff/Mapped.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* $Horde: framework/Text_Diff/Diff/Mapped.php,v 1.3.2.3 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Mapped.php,v 1.3.2.4 2009/01/06 15:23:41 jan Exp $
*
* Copyright 2007-2008 The Horde Project (http://www.horde.org/)
* Copyright 2007-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand All @@ -15,7 +15,7 @@ class Text_Diff_Mapped extends Text_Diff {
/**
* Computes a diff between sequences of strings.
*
* This can be used to compute things like case-insensitive diffs, or diffs
* This can be used to compute things like case-insensitve diffs, or diffs
* which ignore changes in white-space.
*
* @param array $from_lines An array of strings.
Expand All @@ -28,7 +28,7 @@ class Text_Diff_Mapped extends Text_Diff {
* @param array $mapped_to_lines This array should have the same number
* of elements as $to_lines.
*/
function Text_Diff_Mapped($from_lines, $to_lines,
function __construct($from_lines, $to_lines,
$mapped_from_lines, $mapped_to_lines)
{
assert(count($from_lines) == count($mapped_from_lines));
Expand Down
6 changes: 3 additions & 3 deletions framework/gii/components/Pear/Text/Diff/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* This class renders the diff in classic diff format. It is intended that
* this class be customized via inheritance, to obtain fancier outputs.
*
* $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.10 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.5.10.12 2009/07/24 13:26:40 jan Exp $
*
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down Expand Up @@ -35,7 +35,7 @@ class Text_Diff_Renderer {
/**
* Constructor.
*/
function Text_Diff_Renderer($params = array())
function __construct($params = array())
{
foreach ($params as $param => $value) {
$v = '_' . $param;
Expand Down
4 changes: 2 additions & 2 deletions framework/gii/components/Pear/Text/Diff/Renderer/context.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*
* This class renders the diff in classic "context diff" format.
*
* $Horde: framework/Text_Diff/Diff/Renderer/context.php,v 1.3.2.3 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Renderer/context.php,v 1.3.2.4 2009/01/06 15:23:42 jan Exp $
*
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down
14 changes: 8 additions & 6 deletions framework/gii/components/Pear/Text/Diff/Renderer/inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/**
* "Inline" diff renderer.
*
* $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.4.10.14 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.4.10.16 2009/07/24 13:25:29 jan Exp $
*
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down Expand Up @@ -131,12 +131,14 @@ function _changed($orig, $final)
/* We want to split on word boundaries, but we need to
* preserve whitespace as well. Therefore we split on words,
* but include all blocks of whitespace in the wordlist. */
$diff = new Text_Diff($this->_splitOnWords($text1, $nl),
$this->_splitOnWords($text2, $nl));
$diff = new Text_Diff('native',
array($this->_splitOnWords($text1, $nl),
$this->_splitOnWords($text2, $nl)));

/* Get the diff in inline format. */
$renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(),
array('split_level' => 'words')));
$renderer = new Text_Diff_Renderer_inline
(array_merge($this->getParams(),
array('split_level' => 'words')));

/* Run the diff and get the output. */
return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
Expand Down
4 changes: 2 additions & 2 deletions framework/gii/components/Pear/Text/Diff/Renderer/unified.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*
* This class renders the diff in classic "unified diff" format.
*
* $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.3.10.6 2008/01/04 10:37:27 jan Exp $
* $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.3.10.7 2009/01/06 15:23:42 jan Exp $
*
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
* Copyright 2004-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see http://opensource.org/licenses/lgpl-license.php.
Expand Down
Loading