Navigation Menu

Skip to content

Commit

Permalink
Adding warnings to newly deprecated methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 1, 2009
1 parent bd350e9 commit 046d7c7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions cake/libs/controller/components/cookie.php
Expand Up @@ -280,6 +280,7 @@ function read($key = null) {
* @deprecated use delete()
**/
function del($key) {
trigger_error('Deprecated method, use CookieComponent::delete instead', E_USER_WARNING);
return $this->delete($key);
}

Expand Down
1 change: 1 addition & 0 deletions cake/libs/controller/components/session.php
Expand Up @@ -170,6 +170,7 @@ function read($name = null) {
* @deprecated use delete
*/
function del($name) {
trigger_error('Deprecated method, use SessionComponent::delete instead', E_USER_WARNING);
if ($this->__active === true) {
$this->__start();
return parent::del($name);
Expand Down
5 changes: 5 additions & 0 deletions cake/libs/folder.php
Expand Up @@ -729,6 +729,7 @@ function errors() {
* @access public
*/
function ls($sort = true, $exceptions = false) {
trigger_error('Deprecated method, use Folder::read instead', E_USER_WARNING);
return $this->read($sort, $exceptions);
}

Expand All @@ -740,6 +741,7 @@ function ls($sort = true, $exceptions = false) {
* @access public
*/
function mkdir($pathname, $mode = 0755) {
trigger_error('Deprecated method, use Folder::create instead', E_USER_WARNING);
return $this->create($pathname, $mode);
}

Expand All @@ -751,6 +753,7 @@ function mkdir($pathname, $mode = 0755) {
* @access public
*/
function cp($options) {
trigger_error('Deprecated method, use Folder::copy instead', E_USER_WARNING);
return $this->copy($options);
}

Expand All @@ -762,6 +765,7 @@ function cp($options) {
* @access public
*/
function mv($options) {
trigger_error('Deprecated method, use Folder::move instead', E_USER_WARNING);
return $this->move($options);
}

Expand All @@ -773,6 +777,7 @@ function mv($options) {
* @access public
*/
function rm($path) {
trigger_error('Deprecated method, use Folder::delete instead', E_USER_WARNING);
return $this->delete($path);
}

Expand Down
4 changes: 4 additions & 0 deletions cake/libs/model/model.php
Expand Up @@ -502,6 +502,7 @@ function call__($method, $params) {
* @deprecated Use Model::bindModel() instead.
*/
function bind($model, $options = array(), $permanent = true) {
trigger_error('Deprecated method, use Model::bindModel instead', E_USER_WARNING);
if (!is_array($model)) {
$model = array($model => $options);
}
Expand Down Expand Up @@ -1745,6 +1746,7 @@ function updateAll($fields, $conditions = true) {
* @link http://book.cakephp.org/view/691/remove
*/
function remove($id = null, $cascade = true) {
trigger_error('Deprecated method, use Model::delete instead', E_USER_WARNING);
return $this->delete($id, $cascade);
}

Expand Down Expand Up @@ -1798,6 +1800,7 @@ function delete($id = null, $cascade = true) {
* @deprecated
*/
function del($id = null, $cascade = true) {
trigger_error('Deprecated method, use Model::delete instead', E_USER_WARNING);
return $this->delete($id, $cascade);
}

Expand Down Expand Up @@ -2613,6 +2616,7 @@ function isForeignKey($field) {
* @deprecated
*/
function getDisplayField() {
trigger_error('Deprecated method, use Model::$displayField instead', E_USER_WARNING);
return $this->displayField;
}

Expand Down

0 comments on commit 046d7c7

Please sign in to comment.