Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Cvs P5ee > [svn:p5ee] r104...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 641 of 694
Post > Topic >>

[svn:p5ee] r10474 - in p5ee/trunk/App-Repository/lib/App: . Repository

by spadkins@[EMAIL PROTECTED] Jan 4, 2008 at 11:09 AM

Author: spadkins
Date: Fri Jan  4 11:09:48 2008
New Revision: 10474

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository.pm
   p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
   p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm

Log:
_read_timer(), _get_timer() move, and add newlines on the end of
import_rows()/export_rows() SQL

Modified: p5ee/trunk/App-Repository/lib/App/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository.pm	Fri Jan  4 11:09:48
2008
@[EMAIL PROTECTED]
 -15,6 +15,7 @[EMAIL PROTECTED]
 use Date::Format;
 use App::RepositoryObject;
 use App::Reference;
+use Time::HiRes qw(gettimeofday);
 
 =head1 NAME
 
@[EMAIL PROTECTED]
 -4356,6 +4357,48 @[EMAIL PROTECTED]
 }
 

#############################################################################
+# _get_timer()
+#############################################################################
+
+sub _get_timer {
+    my ($self) = @[EMAIL PROTECTED]
    my ($seconds_start, $microseconds_start) = gettimeofday;
+    my $timer = { seconds_start => $seconds_start, microseconds_start =>
$microseconds_start };
+    return($timer);
+}
+
+#############################################################################
+# _read_timer()
+#############################################################################
+
+sub _read_timer {
+    my ($self, $timer, $reset) = @[EMAIL PROTECTED]
    my ($seconds_finish, $microseconds_finish) = gettimeofday;
+    my $seconds_elapsed           = $seconds_finish      -
$timer->{seconds_start};
+    my $microseconds_elapsed      = $microseconds_finish -
$timer->{microseconds_start};
+    if ($microseconds_elapsed < 0) {
+        $microseconds_elapsed += 1000000;
+        $seconds_elapsed      -= 1;
+    }
+    my $time_elapsed = sprintf("%d.%06d", $seconds_elapsed,
$microseconds_elapsed);
+    if (defined $reset) {
+        # store values. don't reset the timer.
+        if ($reset == 0) {
+            $timer->{seconds_start}      = $seconds_finish;
+            $timer->{microseconds_start} = $microseconds_finish;
+            delete $timer->{time_elapsed};
+        }
+        # reset the timer to be ready for another reading.
+        elsif ($reset) {
+            $timer->{seconds_finish}      = $seconds_finish;
+            $timer->{microseconds_finish} = $microseconds_finish;
+            $timer->{time_elapsed}        = $time_elapsed;
+        }
+    }
+    return($time_elapsed);
+}
+
+#############################################################################
 # DESTROY()

#############################################################################
 

Modified: p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	Fri Jan  4
11:09:48 2008
@[EMAIL PROTECTED]
 -12,7 +12,6 @[EMAIL PROTECTED]
 @[EMAIL PROTECTED]
 = ( "App::Repository" );
 
 use Data::Dumper;
-use Time::HiRes qw(gettimeofday);
 
 use strict;
 
@[EMAIL PROTECTED]
 -689,6 +688,9 @[EMAIL PROTECTED]
         "<"  => "lt",
         ">=" => "ge",
         ">"  => "gt",
+        "=/" => "regexp",
+        "/"  => "regexp",
+        "!/" => "not_regexp",
     );
 
     $where = "";
@[EMAIL PROTECTED]
 -2788,40 +2790,6 @[EMAIL PROTECTED]
     &App::sub_exit() if ($App::trace);
 }
 
-sub _get_timer {
-    my ($self) = @[EMAIL PROTECTED]
    my ($seconds_start, $microseconds_start) = gettimeofday;
-    my $timer = { seconds_start => $seconds_start, microseconds_start =>
$microseconds_start };
-    return($timer);
-}
-
-sub _read_timer {
-    my ($self, $timer, $reset) = @[EMAIL PROTECTED]
    my ($seconds_finish, $microseconds_finish) = gettimeofday;
-    my $seconds_elapsed           = $seconds_finish      -
$timer->{seconds_start};
-    my $microseconds_elapsed      = $microseconds_finish -
$timer->{microseconds_start};
-    if ($microseconds_elapsed < 0) {
-        $microseconds_elapsed += 1000000;
-        $seconds_elapsed      -= 1;
-    }
-    my $time_elapsed = sprintf("%d.%06d", $seconds_elapsed,
$microseconds_elapsed);
-    if (defined $reset) {
-        # store values. don't reset the timer.
-        if ($reset == 0) {
-            $timer->{seconds_start}      = $seconds_finish;
-            $timer->{microseconds_start} = $microseconds_finish;
-            delete $timer->{time_elapsed};
-        }
-        # reset the timer to be ready for another reading.
-        elsif ($reset) {
-            $timer->{seconds_finish}      = $seconds_finish;
-            $timer->{microseconds_finish} = $microseconds_finish;
-            $timer->{time_elapsed}        = $time_elapsed;
-        }
-    }
-    return($time_elapsed);
-}
-
 ######################################################################
 # METADATA REPOSITORY METHODS (implements methods from App::Repository)
 ######################################################################

Modified: p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/MySQL.pm	Fri Jan  4
11:09:48 2008
@[EMAIL PROTECTED]
 -644,7 +644,7 @[EMAIL PROTECTED]
             $sql .= "\n   optionally enclosed by
'$options->{field_quote}'" if ($options->{field_quote});
             $sql .= "\n   escaped by '$options->{field_escape}'" if
($options->{field_escape});
         }
-        $sql .= "\n(" . join(",", @[EMAIL PROTECTED]
) . ")";
+        $sql .= "\n(" . join(",", @[EMAIL PROTECTED]
) . ")\n";
         my $context_options = $self->{context}{options};
         my $debug_sql = $context_options->{debug_sql};
         my ($timer, $elapsed_time);
@[EMAIL PROTECTED]
 -743,6 +743,7 @[EMAIL PROTECTED]
             $sql .= "\n   optionally enclosed by
'$options->{field_quote}'" if ($options->{field_quote});
             $sql .= "\n   escaped by '$options->{field_escape}'" if
($options->{field_escape});
         }
+        $sql .= "\n";
         my $context_options = $self->{context}{options};
         my $debug_sql = $context_options->{debug_sql};
         my ($timer, $elapsed_time);




 1 Posts in Topic:
[svn:p5ee] r10474 - in p5ee/trunk/App-Repository/lib/App: . Repo
spadkins@[EMAIL PROTECTED  2008-01-04 11:09:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:14:15 CDT 2008.