Menu

Porting to PostGreSQL

2000-05-17
2000-05-21
  • David McNelis

    David McNelis - 2000-05-17

    I'm in the process of setting this up to run in PostGreSQL as well as MySql and having it configurable in the db_config.php3 file.  Could anyone help me out by setting up the tables for this and then posting them here, don't need the php for it, just the column names, datatype, and size if applicable.  I don't really want to install MySql on my system along with PGSQL just for simplicities sake.

    David

     
    • Joseph Hoot

      Joseph Hoot - 2000-05-17

      Dave,

      the info is in the root directory in a file named phphelpdesk.tables.mysql.  I've never worked with Postgres, but if you wouldn't mind helpding out and contributing your knowledge of postgres, I would love to make this program available for postres users as well as other SQL servers.

       
      • Paul Ingendorf

        Paul Ingendorf - 2000-05-18

        Why not create an abstraction layer for database interaction.  You could create a simple onfig file where dbtype=x and then use that statement to include the abtraction file from libs so you can have include('libs/db.$dbtype.lib');

        in here you would simple translate calls for one db into another so instead of using mysql_query you would use db_query and then abstract that into the mysql_query.  Now this would be a little complicated for the simplicity of your current app but I would be able to help and I've written much larger apps than this for helpdesk related projects.

         
        • Joseph Hoot

          Joseph Hoot - 2000-05-19

          sounds great... it sounds like the next few steps will be to create exactly what you are talking about, add better security through sessions instead of cookies, and to rearrange the way managers, staff, administrators are handled.

           
          • Paul Ingendorf

            Paul Ingendorf - 2000-05-19

            I'll sit down and see if I can't chart out some kind of class that will do just this sometime this weekend.  This is how I think it would look in a config file.  We could also add some sort of trigger that if this is the first time the App has been initialized we can ask for the config info ALA the horde project an create the properly formated config file from within the script.

            Something like this for the db portion of the config file

            $dbtype="mysql";
            $dbuser="root";
            $dbpass="";
            $dbname="dbname";

            Much like what phpMyAdmin does with the exception of the first line.

             
            • Dan Kuykendall

              Dan Kuykendall - 2000-05-19

              Correct in design. I will be interested to see what you put together htis weekend.
              There are already some classes that do this, which we may want to use, such as phplib, which includes database abstraction. Im sure we could snag the couple of files involved from phplib and put them in our package, since phplib is GPL'd.
              Anyways, you may want to look into some exsisting code before re-inventing the wheel.

               
              • Paul Ingendorf

                Paul Ingendorf - 2000-05-21

                I have messed with phplib before and it is very good I would rather give this project a little more than just someone elses code.  I have already broken down the major databases to determine which ones can be supported with little effort. They are Mysql msql mssql oracle Postgres ODBC.  Theese all seem to share more than a few similarities and should be able to give use the greatest flexibility.  I will start coding as soon as possible I have to review each funtion individualy so it wil take me a bit longer than I thought but I should be posting code by the end of the week.

                 
                • Dan Kuykendall

                  Dan Kuykendall - 2000-05-21

                  Just a warning. You may want to join the devel mailing list so that you are in the loop on development discussions.

                  Right now we are looking at using a bit of code, or at least some of the design of the Bug Tracking part of SourceForge. It is very similair to what phpHelpdesk is doing, and since SourceForge is all PHP/MySQL, we should be able to use some well thought and well written code for peices of this.

                  I agree that it needs to be more than someone elses code, packaged for a helpdesk app, but we should also not waste time duplicating re-usable work. This will give us time to work on the specialty functions of a helpdesk app, and not re-write exsisting re-usable code.

                   
                • Joseph Hoot

                  Joseph Hoot - 2000-05-21

                  It really doesn't matter if we create our own code or use someone elses.  The main thing is that we know how it works!  I have written all the code, although very simple so far, for this program.  I mainly did it because I enjoy coding and many times, I find it easier and quicker to write everything myself.  This way I know what's going on and what problems I ran into trying to code it.  Sometimes this helps for more secure and stable code.  Pauldy, I have added you the members list.  Seek3r and I have joined the devel mailing list and will be using that.  I feel confident that you, and Seeker (if you're interested), will be able to write an abstraction layer for database interaction.  I would like to get some of the core things finished before we work on future additions.  For example, A few of the big things that need to be done are to implement sessions, do the abstraction layer, and change the schema around a little bit so that we have Anonymous, Staff, Managers, and Administrators.  I will work on the final portion of this when I have time.  I am in the middle of trying to get myself together to move to California in about a month and putting together a secure server for my old school, so I will have limited time to work with this project over the next month and a half.

                   

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.