mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
removing deprecated code
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7401 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
cf8ddbada0
commit
4a94397b43
5 changed files with 6 additions and 315 deletions
253
cake/basics.php
253
cake/basics.php
|
@ -525,12 +525,12 @@ if (!function_exists('clone')) {
|
|||
$files = glob($cache);
|
||||
|
||||
$cache = CACHE . $type . DS . '*' . $params . '_*' . $ext;
|
||||
|
||||
|
||||
if ($files === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$files = array_merge($files, glob($cache));
|
||||
|
||||
$files = array_merge($files, glob($cache));
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (is_file($file)) {
|
||||
|
@ -916,251 +916,4 @@ if (!function_exists('clone')) {
|
|||
}
|
||||
return $val2;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('View', 'ViewName');
|
||||
*/
|
||||
function loadView($name) {
|
||||
trigger_error('loadView is deprecated see App::import(\'View\', \'ViewName\');', E_USER_WARNING);
|
||||
return App::import('View', $name);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Model', 'ModelName');
|
||||
*/
|
||||
function loadModel($name = null) {
|
||||
trigger_error('loadModel is deprecated see App::import(\'Model\', \'ModelName\');', E_USER_WARNING);
|
||||
return App::import('Model', $name);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Controller', 'ControllerName');
|
||||
*/
|
||||
function loadController($name) {
|
||||
trigger_error('loadController is deprecated see App::import(\'Controller\', \'ControllerName\');', E_USER_WARNING);
|
||||
return App::import('Controller', $name);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Helper', 'HelperName');
|
||||
*/
|
||||
function loadHelper($name) {
|
||||
trigger_error('loadHelper is deprecated see App::import(\'Helper\', \'PluginName.HelperName\');', E_USER_WARNING);
|
||||
return App::import('Helper', $name);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Helper', 'PluginName.HelperName');
|
||||
*/
|
||||
function loadPluginHelper($plugin, $helper) {
|
||||
trigger_error('loadPluginHelper is deprecated see App::import(\'Helper\', \'PluginName.HelperName\');', E_USER_WARNING);
|
||||
return App::import('Helper', $plugin . '.' . $helper);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Component', 'ComponentName');
|
||||
*/
|
||||
function loadComponent($name) {
|
||||
trigger_error('loadComponent is deprecated see App::import(\'Component\', \'ComponentName\');', E_USER_WARNING);
|
||||
return App::import('Component', $name);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Component', 'PluginName.ComponentName');
|
||||
*/
|
||||
function loadPluginComponent($plugin, $component) {
|
||||
trigger_error('loadPluginComponent is deprecated see App::import(\'Component\', \'PluginName.ComponentName\');', E_USER_WARNING);
|
||||
return App::import('Component', $plugin . '.' . $component);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Behavior', 'BehaviorrName');
|
||||
*/
|
||||
function loadBehavior($name) {
|
||||
trigger_error('loadBehavior is deprecated see App::import(\'Behavior\', $name);', E_USER_WARNING);
|
||||
return App::import('Behavior', $name);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see $model = Configure::listObjects('model'); and App::import('Model', $models);
|
||||
* or App::import('Model', array(List of Models));
|
||||
*/
|
||||
function loadModels() {
|
||||
$loadModels = array();
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
foreach($args as $arg) {
|
||||
if (is_array($arg)) {
|
||||
$loadModels = am($loadModels, $arg);
|
||||
} else {
|
||||
$loadModels[] = $arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($loadModels)) {
|
||||
$loadModels = Configure::listObjects('model');
|
||||
}
|
||||
App::import('Model', $loadModels);
|
||||
trigger_error('loadModels is deprecated see $model = Configure::listObjects(\'model\'); and App::import(\'Model\', $models);', E_USER_WARNING);
|
||||
return $loadModels;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see App::import('Model', 'PluginName.PluginModel');
|
||||
*/
|
||||
function loadPluginModels($plugin) {
|
||||
if (!class_exists('AppModel')) {
|
||||
loadModel();
|
||||
}
|
||||
$plugin = Inflector::underscore($plugin);
|
||||
$pluginAppModel = Inflector::camelize($plugin . '_app_model');
|
||||
$pluginAppModelFile = APP . 'plugins' . DS . $plugin . DS . $plugin . '_app_model.php';
|
||||
|
||||
if (!class_exists($pluginAppModel)) {
|
||||
if (file_exists($pluginAppModelFile)) {
|
||||
require($pluginAppModelFile);
|
||||
Overloadable::overload($pluginAppModel);
|
||||
}
|
||||
}
|
||||
|
||||
$pluginModelDir = APP . 'plugins' . DS . $plugin . DS . 'models' . DS;
|
||||
if (is_dir($pluginModelDir)) {
|
||||
foreach (listClasses($pluginModelDir)as $modelFileName) {
|
||||
list($name) = explode('.', $modelFileName);
|
||||
$className = Inflector::camelize($name);
|
||||
|
||||
if (!class_exists($className)) {
|
||||
require($pluginModelDir . $modelFileName);
|
||||
Overloadable::overload($className);
|
||||
}
|
||||
}
|
||||
}
|
||||
trigger_error('loadPluginModels is deprecated see App::import(\'Model\', \'PluginName.PluginModel\');', E_USER_WARNING);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see $controllers = Configure::listObjects('controller'); and App::import('Controller', $controllers);
|
||||
* or App::import('Controller', array(List of Controllers);
|
||||
*/
|
||||
function loadControllers() {
|
||||
$loadControllers = array();
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
foreach($args as $arg) {
|
||||
if (is_array($arg)) {
|
||||
$loadControllers = am($loadControllers, $arg);
|
||||
} else {
|
||||
$loadControllers[] = $arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($loadControllers)) {
|
||||
$loadControllers = Configure::listObjects('controller');
|
||||
}
|
||||
App::import('Controller', $loadControllers);
|
||||
trigger_error('loadControllers is deprecated see $controllers = Configure::listObjects(\'controller\'); and App::import(\'Controller\', $controllers);', E_USER_WARNING);
|
||||
return $loadControllers;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see Configure::listObjects('file', $path);
|
||||
*/
|
||||
function listClasses($path ) {
|
||||
trigger_error('listClasses is deprecated see Configure::listObjects(\'file\', $path);', E_USER_WARNING);
|
||||
return Configure::listObjects('file', $path);
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see Configure::corePaths();
|
||||
*/
|
||||
function paths() {
|
||||
$directories = Configure::getInstance();
|
||||
$paths = array();
|
||||
|
||||
foreach ($directories->modelPaths as $path) {
|
||||
$paths['Models'][] = $path;
|
||||
}
|
||||
foreach ($directories->behaviorPaths as $path) {
|
||||
$paths['Behaviors'][] = $path;
|
||||
}
|
||||
foreach ($directories->controllerPaths as $path) {
|
||||
$paths['Controllers'][] = $path;
|
||||
}
|
||||
foreach ($directories->componentPaths as $path) {
|
||||
$paths['Components'][] = $path;
|
||||
}
|
||||
foreach ($directories->helperPaths as $path) {
|
||||
$paths['Helpers'][] = $path;
|
||||
}
|
||||
|
||||
if (!class_exists('Folder')) {
|
||||
App::import('Core', 'Folder');
|
||||
}
|
||||
|
||||
$folder =& new Folder(APP.'plugins'.DS);
|
||||
$plugins = $folder->ls();
|
||||
$classPaths = array('models', 'models'.DS.'behaviors', 'controllers', 'controllers'.DS.'components', 'views'.DS.'helpers');
|
||||
|
||||
foreach ($plugins[0] as $plugin) {
|
||||
foreach ($classPaths as $path) {
|
||||
if (strpos($path, DS) !== false) {
|
||||
$key = explode(DS, $path);
|
||||
$key = $key[1];
|
||||
} else {
|
||||
$key = $path;
|
||||
}
|
||||
$folder->path = APP.'plugins'.DS.$plugin.DS.$path;
|
||||
$paths[Inflector::camelize($plugin)][Inflector::camelize($key)][] = $folder->path;
|
||||
}
|
||||
}
|
||||
return $paths;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
function vendor() {
|
||||
trigger_error('(vendor) Deprecated, see App::import(\'Vendor\', \'...\');', E_USER_WARNING);
|
||||
$args = func_get_args();
|
||||
$c = func_num_args();
|
||||
|
||||
for ($i = 0; $i < $c; $i++) {
|
||||
$arg = $args[$i];
|
||||
|
||||
if (strpos($arg, '.') !== false) {
|
||||
$file = explode('.', $arg);
|
||||
$plugin = Inflector::underscore($file[0]);
|
||||
unset($file[0]);
|
||||
$file = implode('.', $file);
|
||||
if (file_exists(APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . $file . '.php')) {
|
||||
require_once(APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . $file . '.php');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists(APP . 'vendors' . DS . $arg . '.php')) {
|
||||
require_once(APP . 'vendors' . DS . $arg . '.php');
|
||||
} elseif (file_exists(VENDORS . $arg . '.php')) {
|
||||
require_once(VENDORS . $arg . '.php');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see Dispatcher::uri();
|
||||
*/
|
||||
function setUri() {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
* @see Dispatcher::getUrl();
|
||||
*/
|
||||
function setUrl() {
|
||||
return null;
|
||||
}
|
||||
?>
|
|
@ -298,16 +298,6 @@ class Controller extends Object {
|
|||
$this->Component =& new Component();
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Starts the components linked to this controller.
|
||||
*
|
||||
* @deprecated 1.2.0.7070
|
||||
* @see Component::init()
|
||||
*/
|
||||
function _initComponents() {
|
||||
trigger_error(__('Controller::_initComponents(); deprecated, use $this->Component->init($this);', true), E_USER_WARNING);
|
||||
$this->Component->init($this);
|
||||
}
|
||||
/**
|
||||
* Merge components, helpers, and uses vars from AppController and PluginAppController
|
||||
*
|
||||
|
@ -554,7 +544,7 @@ class Controller extends Object {
|
|||
if (is_numeric($status)) {
|
||||
$code = $status;
|
||||
}
|
||||
if (is_string($status)) {
|
||||
if (is_string($status)) {
|
||||
$msg = $status;
|
||||
}
|
||||
$status = "HTTP/1.1 {$code} {$msg}";
|
||||
|
|
|
@ -57,16 +57,6 @@ class TreeBehavior extends ModelBehavior {
|
|||
}
|
||||
$this->settings[$model->alias] = $settings;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
function setScope(&$model, $scope) {
|
||||
trigger_error(__('(TreeBehavior::setScope) Deprecated - Use BehaviorCollection::attach() to re-attach with new settings', true), E_USER_WARNING);
|
||||
$this->settings[$model->alias]['scope'] = $scope;
|
||||
if ($this->settings[$model->alias]['recursive'] < 0) {
|
||||
$this->settings[$model->alias]['recursive'] = 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* After save method. Called after all saves
|
||||
*
|
||||
|
@ -700,29 +690,6 @@ class TreeBehavior extends ModelBehavior {
|
|||
);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Backward compatible method
|
||||
*
|
||||
* Returns true if the change is successful.
|
||||
*
|
||||
* @param AppModel $model
|
||||
* @param mixed $parentId The ID to set as the parent of the current node.
|
||||
* @return true on success
|
||||
* @access public
|
||||
* @deprecated
|
||||
*/
|
||||
function setparent(&$model, $parentId = null , $created = null) {
|
||||
trigger_error(
|
||||
__('(TreeBehavior::setParent) Deprecated - save the record with a parent ID instead', true),
|
||||
E_USER_ERROR
|
||||
);
|
||||
extract($this->settings[$model->alias]);
|
||||
|
||||
if ($created === false && $parentId == $model->field($parent)) {
|
||||
return true;
|
||||
}
|
||||
return $model->saveField($parent, $parentId, array('callbacks' => false));
|
||||
}
|
||||
/**
|
||||
* Check if the current tree is valid.
|
||||
*
|
||||
|
|
|
@ -885,7 +885,7 @@ class DboSource extends DataSource {
|
|||
* @param string $association Name of Model being Merged
|
||||
* @param object $model Model being merged onto
|
||||
* @param object $linkModel Model being merged
|
||||
* @return void
|
||||
* @return void
|
||||
**/
|
||||
function __mergeHasMany(&$resultSet, $merge, $association, &$model, &$linkModel) {
|
||||
foreach ($resultSet as $i => $value) {
|
||||
|
@ -1814,9 +1814,6 @@ class DboSource extends DataSource {
|
|||
$columnType = $model->getColumnType($key);
|
||||
}
|
||||
$data .= join(', ', $this->value($value, $columnType));
|
||||
} elseif (strpos($value[0], '-!') === 0) {
|
||||
trigger_error(__('Escape flag (-!) deprecated, use Model::query()', true), E_USER_WARNING);
|
||||
$data .= $this->value(str_replace('-!', '', $value[0]));
|
||||
}
|
||||
$data .= ')';
|
||||
} else {
|
||||
|
@ -1872,15 +1869,7 @@ class DboSource extends DataSource {
|
|||
$operator .= ' =';
|
||||
}
|
||||
|
||||
if (
|
||||
(is_array($value) && !empty($value) && is_string($value[0]) && strpos($value[0], '-!') === 0) ||
|
||||
(is_string($value) && strpos($value, '-!') === 0)
|
||||
) {
|
||||
trigger_error(__('Escape flag (-!) deprecated, use Model::query()', true), E_USER_WARNING);
|
||||
$value = str_replace('-!', '', $value);
|
||||
} else {
|
||||
$value = $this->value($value, $type);
|
||||
}
|
||||
$value = $this->value($value, $type);
|
||||
$operator = trim($operator);
|
||||
|
||||
$key = (strpos($key, '(') !== false || strpos($key, ')') !== false) ?
|
||||
|
|
|
@ -756,13 +756,5 @@ class Helper extends Overloadable {
|
|||
$this->__cleaned = preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i',"",$this->__cleaned);
|
||||
} while ($oldstring != $this->__cleaned);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
function setFormTag($tagValue, $setScope = false) {
|
||||
trigger_error(__('Helper::setFormTag() Deprecated, use Helper::setEntity()', true), E_USER_WARNING);
|
||||
return $this->setEntity($tagValue, $setScope);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue