[ErrorSystem-devel] Re: ErrorSystem-devel digest, Vol 1 #9 - 4 msgs
Status: Planning
Brought to you by:
sonicmctails
From: nw <bi...@ra...> - 2003-12-19 11:07:20
|
Maybe we can reach compatibility with different databases by using OOP STEP 1) Write classess for every needed database (for example - mysql_class.php, mssql_class.php, anydatabase_class.php...). Methods (functions) in these classes we have to name equal (for example, method db_connect() must be in every class). In these classes we may write methods: a) db_connect() - method to connect and login db, select database b) db_make_recordset() - method to execute an sql query. c) db_close() - to close connection Actually we have to set $dataset class variable which will store our result of sql query (its like '$dataset = mysql_query("select * from tbl")'). This variable we have to set in db_make_recordset() method. STEP 2) Use classes. We only write code: for mysql - include(mysql_class.php); $page = new page(); $page->db_connect(host,user,password); $page->db_make_recordset(sqlquery); while ($row = mysql_fetch_array($page->dataset, MYSQL_ASSOC)) { printf ("ID: %s Name: %s", $row["id"], $row["name"]); } $page->close(); for anydatabase - include(ANYDATABASE_class.php); // WE HAVE TO CHANGE ONLY THIS $page = new page_class(); $page->db_connect(host,user,password); $page->db_make_recordset(sqlquery); while ($row = mysql_fetch_array($page->dataset, MYSQL_ASSOC)) { printf ("ID: %s Name: %s", $row["id"], $row["name"]); } $page->close(); That's all of my proposition. Best Regards. nw. On Thu, 18 Dec 2003 20:07:20 -0800 err...@li... wrote: >Send ErrorSystem-devel mailing list submissions to > err...@li... > >To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/errorsystem-devel >or, via email, send a message with subject or body 'help' to > err...@li... > >You can reach the person managing the list at > err...@li... > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of ErrorSystem-devel digest..." > > >Today's Topics: > > 1. RE: RE: ErrorSystem - proposal (BrokenClock) > 2. Re: RE: RE: ErrorSystem - proposal (son...@ss...) > 3. RE: TR: RE: [ErrorSystem-devel] home page little update >(BrokenClock) > 4. RE: TR: RE: [ErrorSystem-devel] home page little update >(son...@ss...) > >--__--__-- > >Message: 1 >Reply-To: <bro...@fr...> >From: "BrokenClock" <bro...@fr...> >To: "Jacek Olszak" <e-k...@wp...> >Cc: "ES-devel" <err...@li...> >Date: Thu, 18 Dec 2003 15:40:20 +0100 >Subject: [ErrorSystem-devel] RE: RE: ErrorSystem - proposal > >Ok. Could you planned when this db layer should work for MySQL? >I think we can developp ES with it if it supports MySQL, and waiting >for = >the >support of the ohers databases. >Maybe should you use a prefix for your functions, something like udbl >(Universal DataBase Layer), so you should have udbl_connect and so >on? or >usql (Universal SQL Layer)? >I think this particular feature should interessed other people, so >maybe = >you >should find a way to published it more largely. >About that, I may be able to test on Microsoft SQL Server soon (not >my >choice, you bet). > >Have fun, guys, > >Stephane > >> -----Message d'origine----- >> De : Jacek Olszak [mailto:e-k...@wp...] >> Envoy=E9 : jeudi 18 d=E9cembre 2003 13:07 >> A : bro...@fr... >> Objet : RE: RE: ErrorSystem - proposal >> >> >> Dnia 17-12-2003 o godz. 14:07 BrokenClock napisal(a): >> > I think it could be a very good idea. But I don't know how to >> do it, and , >> > in particular, how to test it. >> I decide to write this class. It's very simple. It has methods >> like connect(), executeQuery(), getResultsObject() etc. These >> methods are similar to mysql_connect, mysql_query etc. but they >> work on all databases. The class read from some.ini file the type >> of database and when some of class method is invoke the class >> decide what function to use (for example mysql_connect or >>mssql_connect= >). >> >> >> -------------------------------------------------- >> 'Z=B3e zachowanie' wyrazem buntu m=B3odego pokolenia. >> Widowisko muzyczne ju=BF do obejrzenia! >> http://muzyka.wp.pl/imprezy.html?idn=3D799 >> >> >> >> >> > > > >--__--__-- > >Message: 2 >Date: Thu, 18 Dec 2003 08:53:48 -0600 (CST) >Subject: Re: [ErrorSystem-devel] RE: RE: ErrorSystem - proposal >From: son...@ss... >To: bro...@fr... >Cc: "Jacek Olszak" <e-k...@wp...>, > "ES-devel" <err...@li...> > >Actaully, this is what I've been coding as a class. I'm not sure if >you >are familer with classes (the PHP documentation isn't very clear on >them >either), but basically, it's a list of functions. So this class could >have >function a(), and function b(). Now to access it I would do something >liek >this: > ><?php >class db { > function a() { > echo "test" >} >function b(){ echo test }; >} > >$db = new db >$db->a // function a >$db->b // function b >} >?> > >In other words, classes let someone make a function list, then it >gets >automatically prefixed. I don't like the idea of using MS-SQL, as >it's >syntax is not very compatiable with MySQL, and I don't have a PC I >could >use to help develop it. If we need to support both without goes >through >preg_replace hell to make them compatiable, we need to store the >querys >for each database in seperate files and then every time we need to >use a >query, we'll load it from the query file. That way, we can make it >work >with almost any database as all the queries could easily be changed, >but >it will make coding alot harder. > >> Ok. Could you planned when this db layer should work for MySQL? >> I think we can developp ES with it if it supports MySQL, and waiting >>for >> the >> support of the ohers databases. >> Maybe should you use a prefix for your functions, something like >>udbl >> (Universal DataBase Layer), so you should have udbl_connect and so >>on? or >> usql (Universal SQL Layer)? >> I think this particular feature should interessed other people, so >>maybe >> you >> should find a way to published it more largely. >> About that, I may be able to test on Microsoft SQL Server soon (not >>my >> choice, you bet). >> >> Have fun, guys, >> >> Stephane >> >>> -----Message d'origine----- >>> De : Jacek Olszak [mailto:e-k...@wp...] >>> Envoyй : jeudi 18 dйcembre 2003 13:07 >>> A : bro...@fr... >>> Objet : RE: RE: ErrorSystem - proposal >>> >>> >>> Dnia 17-12-2003 o godz. 14:07 BrokenClock napisal(a): >>> > I think it could be a very good idea. But I don't know how to >>> do it, and , >>> > in particular, how to test it. >>> I decide to write this class. It's very simple. It has methods >>> like connect(), executeQuery(), getResultsObject() etc. These >>> methods are similar to mysql_connect, mysql_query etc. but they >>> work on all databases. The class read from some.ini file the type >>> of database and when some of class method is invoke the class >>> decide what function to use (for example mysql_connect or >>> mssql_connect). >>> >>> >>> -------------------------------------------------- >>> 'Zіe zachowanie' wyrazem buntu mіodego pokolenia. >>> Widowisko muzyczne juї do obejrzenia! >>> http://muzyka.wp.pl/imprezy.html?idn=799 >>> >>> >>> >>> >>> >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: IBM Linux Tutorials. >> Become an expert in LINUX or just sharpen your skills. Sign up for >>IBM's >> Free Linux Tutorials. Learn everything from the bash shell to sys >>admin. >> Click now! http://ads.osdn.com/?ad_id78&alloc_id371&opїick >> _______________________________________________ >> ErrorSystem-devel mailing list >> Err...@li... >> https://lists.sourceforge.net/lists/listinfo/errorsystem-devel >> > > > >--__--__-- > >Message: 3 >Reply-To: <bro...@fr...> >From: "BrokenClock" <bro...@fr...> >To: <son...@ss...> >Cc: "ES-devel" <err...@li...> >Subject: RE: TR: RE: [ErrorSystem-devel] home page little update >Date: Thu, 18 Dec 2003 17:29:00 +0100 > >About cvs : well, I had no time to test it again, but, I've check >this pa= >ge >: http://cvs.sourceforge.net/viewcvs.py/errorsystem/ErrorSystem/ and >I ca= >n >see now the files I have upload using TortoiseCVS feww weeks ago. So >it >seems working, but the page may take some time to update. And I can't >understand why McTails haven't seen them when he browsed the tree. >About my work : well, when I was hired here, we had a critical >process, >mixing VB and DOS batch files. It was a Mess! One day, we had another >client. So we had to upgrade the process. So I put away this mess and >wri= >tte >some PHP. This proccess is so critical for us that we need a very >good er= >ror >management. So came the idear of ES. Thinking about, I found it was a >goo= >d >idear, and may be useful for other people. And I thought that they >could >help me to make it better. So, I published on SourceForge. You know >then = >the >history. > >I think I have now endly answer to most part of your mail. I hope I >haven= >'t >forgot something. > >Have fun, guys, > >Stephane > >> -----Message d'origine----- >> De : son...@ss... [mailto:son...@ss...] >> Envoy=E9 : vendredi 12 d=E9cembre 2003 22:00 >> =C0 : bro...@fr... >> Cc : ES-devel >> Objet : Re: TR: RE: [ErrorSystem-devel] home page little update >> >> >> Mostly right, but I was infering as MySQL as the default as it >>supports >> republiation, and has tools to make altering tables alot easier then >> SQLite. I think that what should be done is that a crontab event >>(the >> crontab is a way to run programs at a certian time on *NIXs). That >>cron= >tab >> would do a data-only dump of the MySQL tables, backup the current >>SQLit= >e >> database, and then recreate it using CREATE TABLE statements and the >> INSERT data. Also, you can use SQLite with PHP 4, it's available as >>a P= >ECL >> module, and I have it running on my local copy of PHP. Anyway, as >>now I >> have some desgin, I'm going to write the Database API, so it will be >>ea= >sy >> to use the rollover. As an additional option, maybe we should add it >>so= > it >> can rollover to something else before SQLite, like a backup server ? >>Al= >so, >> what should the file layout for this problem be ?. I was going to >>put t= >he >> database layer in, as well as the default schema: >> >> errorsystem/include/db/db-mysql.php >> errorsystem/include/db/schema/base-mysql.sql >> >> Also, what does this mean for this project now that you can do it at >>yo= >ur >> workplace ? Will they adapt it once we get a working version ?. >>Stephan= >e, >> can you please send me what code you have so I can get it into CVS. >> >> Also, here is some information about using WinCVS with SSH. >> http://minimal.cx/wincvsssh.php >> >> However, once you run this part: >> --- >> Now log into the remote machine, and add this ID to the trusted >>hosts f= >ile >> [1]: >> >> ssh -l <user> <remote_host> >> cat id_dsa.pub >> .ssh/authorized_keys >> rm id_dsa.pub >> -- >> >> Do this: >> While still at the command prompt, type cat id_dsa.pub and copy the >>lin= >es >> it generates (it should start with ssh-dss), and then copy that into >>yo= >ur >> Public Key Management on the SourceForge User page. Once it syncs >>itsel= >f >> back to the CVS/Shell server, you should be able to get into CVS. >>Then >> follow the rest of the directions starting with wincvs setup. >> >> Two notes: >> I'm loading this project into XCode (The Mac OS X Coder IDE), so >>it's >> going to put some additional files into the directory, but they >>won't >> interfer with anything (though we would have to remove them before >>maki= >ng >> a release). Second, I'm going to write a Linux shell script that >>will >> strip out the .DS_Store files Mac OS X likes to leave behind, but >>they >> will be there, floating in the CVS files but you can safely ingore >>them. >> > >> > Hi McTails, >> > >> >> -----Message d'origine----- >> >> De : err...@li... >> >> [mailto:err...@li...]De la part >>de >> >> son...@ss... >> >> Envoy=E9 : vendredi 5 d=E9cembre 2003 21:32 >> >> =C0 : bro...@fr... >> >> Cc : son...@ss...; ES-devel >> >> Objet : RE: [ErrorSystem-devel] home page little update >> >> >> >> >> >> It's McTails, sorry if I mispelt it :-P. >> > >> > Sorry, I have misunderstood... >> > >> >> I never figured that ES would be >> >> used as a way to report MySQL errors as it already has a good >> >> errorsystem. >> > >> > So do I. But I was thinking about ES should be used for advanced >>erro= >r >> > reporting when a system uses MySQL. Imagine a PHP script, run >>regular= >y >> > with >> > the commandline (every 10 minutes for exemple), using MySQL to >>store >> > datas. >> > The db server is down, so the query fails. PHP will prompt the >> error, and >> > it >> > should be log with a redirection. And this error should run for a >>lon= >g >> > time, >> > since someone looks in the log file. I think ES should be used to >>sen= >d a >> > mail to the admin on the first the error appends. In fact, it >>exactel= >y a >> > feature I require. I should do that in the original script, but I >>cou= >ld >> > also >> > do everything I need in the script, but it should so better to do >>thi= >s >> > with >> > ES >> > >> >> Anyway, the CVS respiorty is empty and I find that a bunch of >>Window= >s >> >> CVS >> >> clients just don't report errors when using SSH. >> > Shit! >> >>WinCVS doesn't report >> >> that it can't find putty, and it seems to appear working with >> >> everything. >> >> Remember that you must have your public key(s) upload to SF.net. >> > How can I do that? >> >> Also the >> >> CVS script is not part of SF itself, it's a seperate one called >>cvsw= >eb >> >> (this I know because I run a private local SF.net server). >> > Nice! >> > >> >>What a >> >> possiabile solution to do is to wait for PHP5, as it will be >>includi= >ng >> >> SQLite, a file based SQL system that doesn't require a server. >> > I don't know much about SQLite, but one of the soft I use (bacula >>: >> > www.bacula.org, a nice backup soft!), uses it, and it seems to >> works well. >> >>What could >> >> be done is a. Data from MySQL is copied to SQLite at various >> times b. We >> >> use SQLite be default unless the user chooses otherwise c. We use >>it >> >> seperate as a manual failback. >> > So, if I understood well : SQLite as default, MySQL as an option, >>wit= >h a >> > backup on SQLite. And we should begin with MySQL only, waiting >> for PHP5. I >> > think I can agreed that. >> >> Regrads, >> >> McTails >> >> Regrads, >> >> Sonic McTails >> > >> > Regards, >> > >> > Stephane >> > >> > >> > >> > ------------------------------------------------------- >> > This SF.net email is sponsored by: IBM Linux Tutorials. >> > Become an expert in LINUX or just sharpen your skills. Sign up >> for IBM's >> > Free Linux Tutorials. Learn everything from the bash shell to >> sys admin. >> > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id371&op=BFick >> > _______________________________________________ >> > ErrorSystem-devel mailing list >> > Err...@li... >> > https://lists.sourceforge.net/lists/listinfo/errorsystem-devel >> > >> >> > > > >--__--__-- > >Message: 4 >Date: Thu, 18 Dec 2003 14:15:26 -0600 (CST) >Subject: RE: TR: RE: [ErrorSystem-devel] home page little update >From: son...@ss... >To: bro...@fr... >Cc: son...@ss..., > "ES-devel" <err...@li...> > >I need to move those files into folders, so once i get home today, >I'll >download them, and remove them from there, and put them in there >proper >place (unforanilty, CVS doesn't allow you to move files :( so it's a >real >pain). I should have the DB class done. One note: I was doing reading >on >proper file nameing, and it's recommend that all things are in >lowercase >for filenames, folders, and tables unless you have a good release as >it >appears to be a cheap marketing ploy if we did. Anyway, thats how I >do my >coding usually but I'll do it however you want it. Also, congras. on >getting CVS to work :). I have no idea why I couldn't see it when I >browsed the CVS repositry, but now my computer can see them and I've >checked out the errorsystem project. Very important note when using >CVS: >leave good logs, other developers will love you for it. Anyway, since >I >will have so much free time, I might actually write enough code to >get the >backend working somewhat that we would primative system, but aleast >we >could prove it works. I don't think there would be any interface, but >it >would work :). I think that would be the first goal: getting a >working >system. THen we need to get a decent adminestrative database system, >and >from there, make it skinable so it can be enbeeded, etc. >SMT > >> About cvs : well, I had no time to test it again, but, I've check >>this >> page >> : http://cvs.sourceforge.net/viewcvs.py/errorsystem/ErrorSystem/ and >>I can >> see now the files I have upload using TortoiseCVS feww weeks ago. So >>it >> seems working, but the page may take some time to update. And I >>can't >> understand why McTails haven't seen them when he browsed the tree. >> About my work : well, when I was hired here, we had a critical >>process, >> mixing VB and DOS batch files. It was a Mess! One day, we had >>another >> client. So we had to upgrade the process. So I put away this mess >>and >> writte >> some PHP. This proccess is so critical for us that we need a very >>good >> error >> management. So came the idear of ES. Thinking about, I found it was >>a good >> idear, and may be useful for other people. And I thought that they >>could >> help me to make it better. So, I published on SourceForge. You know >>then >> the >> history. >> >> I think I have now endly answer to most part of your mail. I hope I >> haven't >> forgot something. >> >> Have fun, guys, >> >> Stephane >> >>> -----Message d'origine----- >>> De : son...@ss... [mailto:son...@ss...] >>> Envoyй : vendredi 12 dйcembre 2003 22:00 >>> А : bro...@fr... >>> Cc : ES-devel >>> Objet : Re: TR: RE: [ErrorSystem-devel] home page little update >>> >>> >>> Mostly right, but I was infering as MySQL as the default as it >>>supports >>> republiation, and has tools to make altering tables alot easier then >>> SQLite. I think that what should be done is that a crontab event >>>(the >>> crontab is a way to run programs at a certian time on *NIXs). That >>> crontab >>> would do a data-only dump of the MySQL tables, backup the current >>>SQLite >>> database, and then recreate it using CREATE TABLE statements and the >>> INSERT data. Also, you can use SQLite with PHP 4, it's available as >>>a >>> PECL >>> module, and I have it running on my local copy of PHP. Anyway, as >>>now I >>> have some desgin, I'm going to write the Database API, so it will be >>> easy >>> to use the rollover. As an additional option, maybe we should add it >>>so >>> it >>> can rollover to something else before SQLite, like a backup server ? >>> Also, >>> what should the file layout for this problem be ?. I was going to >>>put >>> the >>> database layer in, as well as the default schema: >>> >>> errorsystem/include/db/db-mysql.php >>> errorsystem/include/db/schema/base-mysql.sql >>> >>> Also, what does this mean for this project now that you can do it at >>> your >>> workplace ? Will they adapt it once we get a working version ?. >>> Stephane, >>> can you please send me what code you have so I can get it into CVS. >>> >>> Also, here is some information about using WinCVS with SSH. >>> http://minimal.cx/wincvsssh.php >>> >>> However, once you run this part: >>> --- >>> Now log into the remote machine, and add this ID to the trusted >>>hosts >>> file >>> [1]: >>> >>> ssh -l <user> <remote_host> >>> cat id_dsa.pub >> .ssh/authorized_keys >>> rm id_dsa.pub >>> -- >>> >>> Do this: >>> While still at the command prompt, type cat id_dsa.pub and copy the >>> lines >>> it generates (it should start with ssh-dss), and then copy that into >>> your >>> Public Key Management on the SourceForge User page. Once it syncs >>>itself >>> back to the CVS/Shell server, you should be able to get into CVS. >>>Then >>> follow the rest of the directions starting with wincvs setup. >>> >>> Two notes: >>> I'm loading this project into XCode (The Mac OS X Coder IDE), so >>>it's >>> going to put some additional files into the directory, but they >>>won't >>> interfer with anything (though we would have to remove them before >>> making >>> a release). Second, I'm going to write a Linux shell script that >>>will >>> strip out the .DS_Store files Mac OS X likes to leave behind, but >>>they >>> will be there, floating in the CVS files but you can safely ingore >>>them. >>> > >>> > Hi McTails, >>> > >>> >> -----Message d'origine----- >>> >> De : err...@li... >>> >> [mailto:err...@li...]De la part >>>de >>> >> son...@ss... >>> >> Envoyй : vendredi 5 dйcembre 2003 21:32 >>> >> А : bro...@fr... >>> >> Cc : son...@ss...; ES-devel >>> >> Objet : RE: [ErrorSystem-devel] home page little update >>> >> >>> >> >>> >> It's McTails, sorry if I mispelt it :-P. >>> > >>> > Sorry, I have misunderstood... >>> > >>> >> I never figured that ES would be >>> >> used as a way to report MySQL errors as it already has a good >>> >> errorsystem. >>> > >>> > So do I. But I was thinking about ES should be used for advanced >>>error >>> > reporting when a system uses MySQL. Imagine a PHP script, run >>>regulary >>> > with >>> > the commandline (every 10 minutes for exemple), using MySQL to >>>store >>> > datas. >>> > The db server is down, so the query fails. PHP will prompt the >>> error, and >>> > it >>> > should be log with a redirection. And this error should run for a >>>long >>> > time, >>> > since someone looks in the log file. I think ES should be used to >>>send >>> a >>> > mail to the admin on the first the error appends. In fact, it >>>exactely >>> a >>> > feature I require. I should do that in the original script, but I >>> could >>> > also >>> > do everything I need in the script, but it should so better to do >>>this >>> > with >>> > ES >>> > >>> >> Anyway, the CVS respiorty is empty and I find that a bunch of >>>Windows >>> >> CVS >>> >> clients just don't report errors when using SSH. >>> > Shit! >>> >>WinCVS doesn't report >>> >> that it can't find putty, and it seems to appear working with >>> >> everything. >>> >> Remember that you must have your public key(s) upload to SF.net. >>> > How can I do that? >>> >> Also the >>> >> CVS script is not part of SF itself, it's a seperate one called >>> cvsweb >>> >> (this I know because I run a private local SF.net server). >>> > Nice! >>> > >>> >>What a >>> >> possiabile solution to do is to wait for PHP5, as it will be >>> including >>> >> SQLite, a file based SQL system that doesn't require a server. >>> > I don't know much about SQLite, but one of the soft I use (bacula >>>: >>> > www.bacula.org, a nice backup soft!), uses it, and it seems to >>> works well. >>> >>What could >>> >> be done is a. Data from MySQL is copied to SQLite at various >>> times b. We >>> >> use SQLite be default unless the user chooses otherwise c. We use >>>it >>> >> seperate as a manual failback. >>> > So, if I understood well : SQLite as default, MySQL as an option, >>>with >>> a >>> > backup on SQLite. And we should begin with MySQL only, waiting >>> for PHP5. I >>> > think I can agreed that. >>> >> Regrads, >>> >> McTails >>> >> Regrads, >>> >> Sonic McTails >>> > >>> > Regards, >>> > >>> > Stephane >>> > >>> > >>> > >>> > ------------------------------------------------------- >>> > This SF.net email is sponsored by: IBM Linux Tutorials. >>> > Become an expert in LINUX or just sharpen your skills. Sign up >>> for IBM's >>> > Free Linux Tutorials. Learn everything from the bash shell to >>> sys admin. >>> > Click now! http://ads.osdn.com/?ad_id78&alloc_id371&opїick >>> > _______________________________________________ >>> > ErrorSystem-devel mailing list >>> > Err...@li... >>> > https://lists.sourceforge.net/lists/listinfo/errorsystem-devel >>> > >>> >>> >> >> > > > > >--__--__-- > >_______________________________________________ >ErrorSystem-devel mailing list >Err...@li... >https://lists.sourceforge.net/lists/listinfo/errorsystem-devel > > >End of ErrorSystem-devel Digest |