[vhffs-dev] [478] Added warning for some deprecated methods.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 478
Author:   beuss
Date:     2007-02-17 23:36:59 +0000 (Sat, 17 Feb 2007)

Log Message:
-----------
Added warning for some deprecated methods. Watch the log young padawan.

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm	2007-02-17 22:08:12 UTC (rev 477)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Object.pm	2007-02-17 23:36:59 UTC (rev 478)
@@ -172,7 +172,11 @@
 =cut
 
 sub create {
-    return old_create(@_) if($_[0]->isa('Vhffs::Object'));
+    if($_[0]->isa('Vhffs::Object')) {
+        my ($package, $file, $line) = caller();
+        warn "Using deprecated form of Vhffs::Object::create from $package ($file:$line).\n";
+        return old_create(@_);
+    }
     my ($vhffs, $owner_uid, $description, $state, $type) = @_;
     $description = '' unless (defined $description);
     $state = ($vhffs->get_config->get_moderation ? Vhffs::Constants::WAITING_FOR_VALIDATION : Vhffs::Constants::WAITING_FOR_CREATION) unless defined $state;
@@ -220,6 +224,9 @@
 
 sub fetch
 {
+    my ($package, $file, $line) = caller();
+    warn "Using deprecated method Vhffs::Object::fetch from $package ($file:$line).\n";
+
     my $self;
     my $request;
     my $result;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/