Flattening databases hierarchy into a single root folder

Flattening databases hierarchy into a single root folder

shawngibsonshawngibson Posts: 32Questions: 9Answers: 0

Hi again, happy weekend:)

I still use Generator for the initial creation of all my personal databases, and I always choose the same options every time (I check everything and choose all the jquery-ui items).

As a result, I currently have a separate folder for each of my databases on my server, with all the folders duplicated, i.e. the sql, php, js, images and css folders which are in the downloaded Generator zip are duplicated for every database.

Is it possible to have only one root folder with the above folders within it, and just ensure all of my tables have a unique name so that the html files can all sit at the root level, and also ensure each table is similarly named uniquely so that all the table._name_.php and table._name_.js files can sit in the singular root-level js or php folder?

That part seems doable to me (please tell me if I am wrong) but I'm not sure how to deal with all the config.php files in the php/lib folder, since each table references a different root database in MySql..

If I left the "db" => "", line blank, and used the same type, user, pass, host, port and dsn universally, would that work?

I'm speaking here of personal databases on a local XAMPP install, so professional principles and security are not a huge burden for me here...

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    Could you not just merge them together? They all have unique names so for each new table you create you'd add its files into the existing structure, thus ending up with something like:

    js \
        table.1.js
        table.2.js
        table.3.js
    php \
        table.1.php
        table.2.php
        table.3.php
    table.1.html
    table.2.html
    table.3.html
    

    That would do what you are looking for would it not?

    Allan

  • shawngibsonshawngibson Posts: 32Questions: 9Answers: 0

    Hi Allan, and thanks very much. Yes, that is exactly what I'm hoping to do. After a bit of experimenting, I've seemingly been able to use the following structure for all of my tables:

            <link rel='stylesheet' type='text/css' href='../../../style/jqui/base/jquery-ui.css'/>
            <link rel="stylesheet" type="text/css" href="../../../css/datatables.min.css">
            <link rel="stylesheet" type="text/css" href="../../../css/generator-base.css">
            <link rel="stylesheet" type="text/css" href="../../../css/editor.jqueryui.min.css">
    
            <script type="text/javascript" charset="utf-8" src="../../../js/datatables.min.js"></script>
            <script type='text/javascript' src='../../../style/jqui/base/jquery-ui.js'></script>
            <script type="text/javascript" charset="utf-8" src="../../../js/dataTables.editor.min.js"></script>
            <script type="text/javascript" charset="utf-8" src="../../../js/editor.jqueryui.min.js"></script>
            <script type="text/javascript" charset="utf-8" src="js/table.tutorials.js"></script>
    

    This flattens everything. I know the last entry for "js/table.tutorials.php" is still deep into the hierarchy, but I've tested and in fact I can move it to the same "../../../etc." flat-root folder with all of my tables.

    But I'm still left with old structure remnants to deal with the config.php file in the Generator-created file/folder hierarchy. I'll do a deep search to see where these config.php files are referenced, and if I can find the files(s), I can just rename config.php to "config.name.php " and put these files in a similarly-flat folder...

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    You only need one config.js. If you just copy the table files from your second Generator output to the first, all the references will still be correct, since they all use the same structure. Then you can simply throw away the second Generator output.

    Allan

Sign In or Register to comment.