/[libdata]/trunk/my2pg/insert-no_next_id.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/my2pg/insert-no_next_id.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73 - (hide annotations)
Thu Mar 18 21:27:37 2004 UTC (20 years, 1 month ago) by dpavlin
File MIME type: text/plain
File size: 423 byte(s)
sync trunk to HEAD of pear-db (without changes specific to PEAR which will be dropped)

1 dpavlin 55 #!/usr/bin/perl -w
2    
3    
4     my $php;
5    
6     while(<STDIN>) {
7     next if (/textInmySQL/);
8     $php .= $_;
9     }
10    
11     sub fix_php {
12     my ($sql,$filler,$query) = @_;
13    
14     my @vars;
15     while ($sql =~ s/'*"\s*\.\s*(\$\w+)\s*\.\s*"'*/ ? /s) {
16     push @vars, $1;
17     }
18    
19     return $sql . $filler . 'xx_prepare_execute($sql, '.join(", ",@vars).')';
20     }
21    
22     my $fixed = 0;
23    
24     $php =~ s/(\$sql\s*=\s*"[^;]+?;)(.+?)(xx_query\s*\(\$sql[^\)]+\))/fix_php($1,$2,$3)/seg;
25    
26     print $php;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26