Skip to content

Commit

Permalink
preliminares de #1 e #2
Browse files Browse the repository at this point in the history
  • Loading branch information
ppKrauss committed Sep 12, 2016
1 parent 852b1cf commit 5227b80
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/rgxGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
}
}

$xx = array_combine($prefExtra2UF,$prefExtra2pref); // new for changed scripts
$yy = array_flip($prefMain2uf); // new for changed scripts


// RESULTS:
$prefMain_rgx = "/^($prefMain_rgx)/";
$prefExtra_rgx = '/^'. join('|',$prefExtra_rgx) .'/';
Expand All @@ -58,21 +62,39 @@
$php_prefMain2uf = php_encode($prefMain2uf);
$js_prefMain2uf = json_encode($prefMain2uf);

$php_xx = php_encode($xx);
$js_xx = json_encode($xx);

$php_yy = php_encode($yy);
$js_yy = json_encode($yy);

$preLens = []; // new for SQL direc to_char(int,format) convertions of crc_int.
foreach(array_merge($xx,$yy) as $uf=>$pref)
$preLens[$uf] = 'fm'.str_pad('0-000', 9-strlen($pref), "0", STR_PAD_LEFT);
ksort($preLens);

$php_preLens = php_encode($preLens);
$js_preLens = json_encode($preLens);

print <<<scripts
JAVSCRIPT:
this.prefMain_rgx = $prefMain_rgx;
this.prefExtra_rgx= $prefExtra_rgx;
this.prefExtra2UF = $js_prefExtra2UF;
this.UF2prefExtra = $js_xx;
this.prefExtra2pref = $js_prefExt;
this.prefMain2uf = $js_prefMain2uf;
this.uf2prefMain = $js_yy;
this.preLens = $js_preLens;
PHP:
\$this->prefMain_rgx = '$prefMain_rgx';
\$this->prefExtra_rgx= '$prefExtra_rgx';
\$this->prefExtra2UF = $php_prefExtra2UF;
\$this->UF2prefExtra = $php_xx;
\$this->prefExtra2pref = $php_prefExt;
\$this->prefMain2uf = $php_prefMain2uf;
\$this->uf2prefMain = $php_yy;
scripts;

Expand Down

0 comments on commit 5227b80

Please sign in to comment.