mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Removing Overloadable and Overloadable2 they are not needed in PHP5.
Removing inheritance and test cases related to Overloadable.
This commit is contained in:
parent
92289e59f7
commit
9046083dc8
5 changed files with 3 additions and 159 deletions
|
@ -1060,9 +1060,7 @@ class App extends Object {
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private function __overload($type, $name, $parent) {
|
private function __overload($type, $name, $parent) {
|
||||||
if (($type === 'Model' || $type === 'Helper') && $parent !== false) {
|
|
||||||
Overloadable::overload($name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,10 +27,6 @@ App::import('Core', array('ClassRegistry', 'Validation', 'Set', 'String'));
|
||||||
App::import('Model', 'ModelBehavior', false);
|
App::import('Model', 'ModelBehavior', false);
|
||||||
App::import('Model', 'ConnectionManager', false);
|
App::import('Model', 'ConnectionManager', false);
|
||||||
|
|
||||||
if (!class_exists('Overloadable')) {
|
|
||||||
require LIBS . 'overloadable.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object-relational mapper.
|
* Object-relational mapper.
|
||||||
*
|
*
|
||||||
|
@ -43,7 +39,7 @@ if (!class_exists('Overloadable')) {
|
||||||
* @subpackage cake.cake.libs.model
|
* @subpackage cake.cake.libs.model
|
||||||
* @link http://book.cakephp.org/view/1000/Models
|
* @link http://book.cakephp.org/view/1000/Models
|
||||||
*/
|
*/
|
||||||
class Model extends Overloadable {
|
class Model extends Object {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the DataSource connection that this Model uses
|
* The name of the DataSource connection that this Model uses
|
||||||
|
@ -2997,7 +2993,5 @@ class Model extends Overloadable {
|
||||||
function __wakeup() {
|
function __wakeup() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
|
|
||||||
Overloadable::overload('Model');
|
|
||||||
}
|
|
||||||
?>
|
?>
|
|
@ -1,107 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Overload abstraction interface. Merges differences between PHP4 and 5.
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
|
||||||
*
|
|
||||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
|
||||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The MIT License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
* @link http://cakephp.org CakePHP(tm) Project
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.cake.libs
|
|
||||||
* @since CakePHP(tm) v 1.2
|
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overloadable class selector
|
|
||||||
*
|
|
||||||
* Load the interface class based on the version of PHP.
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.cake.libs
|
|
||||||
*/
|
|
||||||
class Overloadable extends Object {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overload implementation. No need for implementation in PHP5.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function overload() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Magic method handler.
|
|
||||||
*
|
|
||||||
* @param string $method Method name
|
|
||||||
* @param array $params Parameters to send to method
|
|
||||||
* @return mixed Return value from method
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __call($method, $params) {
|
|
||||||
if (!method_exists($this, 'call__')) {
|
|
||||||
trigger_error(sprintf(__('Magic method handler call__ not defined in %s'), get_class($this)), E_USER_ERROR);
|
|
||||||
}
|
|
||||||
return $this->call__($method, $params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overloadable2 class selector
|
|
||||||
*
|
|
||||||
* Load the interface class based on the version of PHP.
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
*/
|
|
||||||
class Overloadable2 extends Object {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overload implementation. No need for implementation in PHP5.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function overload() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Magic method handler.
|
|
||||||
*
|
|
||||||
* @param string $method Method name
|
|
||||||
* @param array $params Parameters to send to method
|
|
||||||
* @return mixed Return value from method
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __call($method, $params) {
|
|
||||||
if (!method_exists($this, 'call__')) {
|
|
||||||
trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR);
|
|
||||||
}
|
|
||||||
return $this->call__($method, $params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Getter.
|
|
||||||
*
|
|
||||||
* @param mixed $name What to get
|
|
||||||
* @param mixed $value Where to store returned value
|
|
||||||
* @return boolean Success
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __get($name) {
|
|
||||||
return $this->get__($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setter.
|
|
||||||
*
|
|
||||||
* @param mixed $name What to set
|
|
||||||
* @param mixed $value Value to set
|
|
||||||
* @return boolean Success
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function __set($name, $value) {
|
|
||||||
return $this->set__($name, $value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* OverloadableTest file
|
|
||||||
*
|
|
||||||
* PHP versions 4 and 5
|
|
||||||
*
|
|
||||||
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
|
||||||
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
*
|
|
||||||
* Licensed under The Open Group Test Suite License
|
|
||||||
* Redistributions of files must retain the above copyright notice.
|
|
||||||
*
|
|
||||||
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
||||||
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.cases.libs
|
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
|
||||||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
|
||||||
*/
|
|
||||||
App::import('Core', 'Overloadable');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OverloadableTest class
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.cases.libs
|
|
||||||
*/
|
|
||||||
class OverloadableTest extends CakeTestCase {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* skip method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function skip() {
|
|
||||||
$this->skipIf(true, ' %s OverloadableTest not implemented');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
|
@ -53,7 +53,6 @@ class LibGroupTest extends TestSuite {
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cake_log');
|
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cake_log');
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'log' . DS . 'file_log');
|
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'log' . DS . 'file_log');
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'class_registry');
|
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'class_registry');
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'overloadable');
|
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'sanitize');
|
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'sanitize');
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'security');
|
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'security');
|
||||||
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'set');
|
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'set');
|
||||||
|
|
Loading…
Reference in a new issue