mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Updating for PHP5.4
- Fixing strict errors. - Fixing call time pass by reference as its been removed in PHP5.4 - Fix assign new as a reference, which has been removed.
This commit is contained in:
parent
0c0bb60486
commit
0a0a09920b
15 changed files with 30 additions and 50 deletions
|
@ -81,7 +81,8 @@ class CommandListShell extends Shell {
|
||||||
protected function _getShellList() {
|
protected function _getShellList() {
|
||||||
$shellList = array();
|
$shellList = array();
|
||||||
|
|
||||||
$shells = App::objects('file', App::core('Console/Command'));
|
$corePath = App::core('Console/Command');
|
||||||
|
$shells = App::objects('file', $corePath[0]);
|
||||||
$shellList = $this->_appendShells('CORE', $shells, $shellList);
|
$shellList = $this->_appendShells('CORE', $shells, $shellList);
|
||||||
|
|
||||||
$appShells = App::objects('Console/Command', null, false);
|
$appShells = App::objects('Console/Command', null, false);
|
||||||
|
|
|
@ -546,9 +546,10 @@ class CakeSchema extends Object {
|
||||||
$difference[$key] = $value;
|
$difference[$key] = $value;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$compare = strval($value);
|
if (is_array($value) && is_array($correspondingValue)) {
|
||||||
$correspondingValue = strval($correspondingValue);
|
continue;
|
||||||
if ($compare === $correspondingValue) {
|
}
|
||||||
|
if ($value === $correspondingValue) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$difference[$key] = $value;
|
$difference[$key] = $value;
|
||||||
|
|
|
@ -40,23 +40,6 @@ class ParamTestComponent extends Component {
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $components = array('Banana' => array('config' => 'value'));
|
public $components = array('Banana' => array('config' => 'value'));
|
||||||
|
|
||||||
/**
|
|
||||||
* initialize method
|
|
||||||
*
|
|
||||||
* @param mixed $controller
|
|
||||||
* @param mixed $settings
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function initialize(&$controller, $settings) {
|
|
||||||
foreach ($settings as $key => $value) {
|
|
||||||
if (is_numeric($key)) {
|
|
||||||
$this->{$value} = true;
|
|
||||||
} else {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -109,7 +92,7 @@ class AppleComponent extends Component {
|
||||||
* @param mixed $controller
|
* @param mixed $controller
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function startup(&$controller) {
|
public function startup($controller) {
|
||||||
$this->testName = $controller->name;
|
$this->testName = $controller->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +117,7 @@ class OrangeComponent extends Component {
|
||||||
* @param mixed $controller
|
* @param mixed $controller
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function initialize(&$controller) {
|
public function initialize($controller) {
|
||||||
$this->Controller = $controller;
|
$this->Controller = $controller;
|
||||||
$this->Banana->testField = 'OrangeField';
|
$this->Banana->testField = 'OrangeField';
|
||||||
}
|
}
|
||||||
|
@ -145,7 +128,7 @@ class OrangeComponent extends Component {
|
||||||
* @param Controller $controller
|
* @param Controller $controller
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function startup(&$controller) {
|
public function startup($controller) {
|
||||||
$controller->foo = 'pass';
|
$controller->foo = 'pass';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +153,7 @@ class BananaComponent extends Component {
|
||||||
* @param Controller $controller
|
* @param Controller $controller
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function startup(&$controller) {
|
public function startup($controller) {
|
||||||
$controller->bar = 'fail';
|
$controller->bar = 'fail';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ class ControllerPost extends CakeTestModel {
|
||||||
* @param array $options
|
* @param array $options
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function find($type, $options = array()) {
|
public function find($type = 'first', $options = array()) {
|
||||||
if ($type == 'popular') {
|
if ($type == 'popular') {
|
||||||
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
|
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
|
||||||
$options = Set::merge($options, compact('conditions'));
|
$options = Set::merge($options, compact('conditions'));
|
||||||
|
|
|
@ -26,15 +26,6 @@ App::uses('PagesController', 'Controller');
|
||||||
*/
|
*/
|
||||||
class PagesControllerTest extends CakeTestCase {
|
class PagesControllerTest extends CakeTestCase {
|
||||||
|
|
||||||
/**
|
|
||||||
* endTest method
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function endTest() {
|
|
||||||
App::build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDisplay method
|
* testDisplay method
|
||||||
*
|
*
|
||||||
|
|
|
@ -87,12 +87,12 @@ class ScaffoldMockControllerWithFields extends Controller {
|
||||||
class TestScaffoldMock extends Scaffold {
|
class TestScaffoldMock extends Scaffold {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overload __scaffold
|
* Overload _scaffold
|
||||||
*
|
*
|
||||||
* @param unknown_type $params
|
* @param unknown_type $params
|
||||||
*/
|
*/
|
||||||
function _scaffold($params) {
|
function _scaffold(CakeRequest $request) {
|
||||||
$this->_params = $params;
|
$this->_params = $request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,7 +64,7 @@ class BlueberryComponent extends Component {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function initialize(&$controller) {
|
public function initialize($controller) {
|
||||||
$this->testName = 'BlueberryComponent';
|
$this->testName = 'BlueberryComponent';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3305,9 +3305,9 @@ class ContainableBehaviorTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertTrue(empty($this->Article->hasMany['ArticlesTag']));
|
$this->assertTrue(empty($this->Article->hasMany['ArticlesTag']));
|
||||||
|
|
||||||
$this->JoinA =& ClassRegistry::init('JoinA');
|
$this->JoinA = ClassRegistry::init('JoinA');
|
||||||
$this->JoinB =& ClassRegistry::init('JoinB');
|
$this->JoinB = ClassRegistry::init('JoinB');
|
||||||
$this->JoinC =& ClassRegistry::init('JoinC');
|
$this->JoinC = ClassRegistry::init('JoinC');
|
||||||
|
|
||||||
$this->JoinA->Behaviors->attach('Containable');
|
$this->JoinA->Behaviors->attach('Containable');
|
||||||
$this->JoinB->Behaviors->attach('Containable');
|
$this->JoinB->Behaviors->attach('Containable');
|
||||||
|
|
|
@ -955,7 +955,7 @@ class CakeSchemaTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->assertEqual($compare, $expected);
|
$this->assertEquals($expected, $compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,7 +43,7 @@ class DboPostgresTestDb extends Postgres {
|
||||||
* @param mixed $sql
|
* @param mixed $sql
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _execute($sql, $params = array()) {
|
function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||||
$this->simulated[] = $sql;
|
$this->simulated[] = $sql;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ class DboSqliteTestDb extends Sqlite {
|
||||||
* @param mixed $sql
|
* @param mixed $sql
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _execute($sql, $params = array()) {
|
function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||||
$this->simulated[] = $sql;
|
$this->simulated[] = $sql;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,11 @@ class SqlserverTestDb extends Sqlserver {
|
||||||
* execute method
|
* execute method
|
||||||
*
|
*
|
||||||
* @param mixed $sql
|
* @param mixed $sql
|
||||||
|
* @param mixed $params
|
||||||
|
* @param mixed $prepareOptions
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function _execute($sql) {
|
protected function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||||
$this->simulated[] = $sql;
|
$this->simulated[] = $sql;
|
||||||
return empty($this->executeResultsStack) ? null : array_pop($this->executeResultsStack);
|
return empty($this->executeResultsStack) ? null : array_pop($this->executeResultsStack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,10 @@ class DboTestSource extends DboSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function mergeAssociation(&$data, &$merge, $association, $type, $selfJoin = false) {
|
public function mergeAssociation(&$data, &$merge, $association, $type, $selfJoin = false) {
|
||||||
return parent::_mergeAssociation(&$data, &$merge, $association, $type, $selfJoin);
|
return parent::_mergeAssociation($data, $merge, $association, $type, $selfJoin);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setConfig($config) {
|
public function setConfig($config = array()) {
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class DigestHttpSocket extends HttpSocket {
|
||||||
* @param mixed $request
|
* @param mixed $request
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function request($request) {
|
public function request($request = array()) {
|
||||||
if ($request === false) {
|
if ($request === false) {
|
||||||
if (isset($this->response['header']['WWW-Authenticate'])) {
|
if (isset($this->response['header']['WWW-Authenticate'])) {
|
||||||
unset($this->response['header']['WWW-Authenticate']);
|
unset($this->response['header']['WWW-Authenticate']);
|
||||||
|
@ -192,4 +192,4 @@ class DigestAuthenticationTest extends CakeTestCase {
|
||||||
$this->assertFalse(isset($this->HttpSocket->request['header']['Authorization']));
|
$this->assertFalse(isset($this->HttpSocket->request['header']['Authorization']));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ class SessionHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
if (!CakeSession::started()) {
|
if (!CakeSession::started()) {
|
||||||
CakeSession::start();
|
CakeSession::start();
|
||||||
|
var_dump('session was not started');
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION = array(
|
$_SESSION = array(
|
||||||
|
@ -70,6 +71,7 @@ class SessionHelperTest extends CakeTestCase {
|
||||||
),
|
),
|
||||||
'Deeply' => array('nested' => array('key' => 'value')),
|
'Deeply' => array('nested' => array('key' => 'value')),
|
||||||
);
|
);
|
||||||
|
var_dump($_SESSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue