XP is just a number | |
PerlMonks |
psql splitter for phpby TheloniusMonk (Sexton) |
on Jan 22, 2021 at 12:13 UTC ( [id://11127266]=perlquestion: print w/replies, xml ) | Need Help?? |
TheloniusMonk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I am working on a migration project, where there will be parallel run for all the migrated servers for a period of time. One of these servers is a LAPP stack with cron jobs written in bash and php. During the parallel run, it is necessary to be able to turn off production scripts in the old environment as soon as the migrated versions are tested because there are as yet unmigrated shared storage devices in the landscape. So, although the storage will be updated by the new servers, instead of the old, for such scripts, a psql splitter is needed in the case of psql. For bash, I have a working solution: In the bash scripts I alias psql to ~/bin/psql.pl, and this script contacts two databases instead of one, transparently to the bash script (see below).
My challenge for today is to do the same for php scripts. I.E., create a similar Perl script as the below, but find a way to alias calls like $link = pg_connect('host=localhost dbname=DBNAME user=USERNAME password=XYZ'); Many thanks in advance! T.M.
Back to
Seekers of Perl Wisdom
|
|