However, when I come up in the generation page the listing has a list of tables under "DatabaseRoot", there is no database selection posible so there is no way to use the "Simple PHP Code Generator" to generate a PHP application.
Any Sugestions?
Thanks In Advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It shows up as DatabaseRoot.. because according to adodb documentation --> "MetaDatabases() -Returns a list of databases available on the server as an array. You have to connect to the server first. Only available for ODBC, MySQL and ADO"... so for other Databases apart from the 3 specified above, I have coded it to show database Root and then it makes a call to MetaTables to get all tables in the schema. I have never worked with Firebird.. so dont know much how it functions. Does it have 'database' containing 'tables'.. as in Mysql or does it have 'schemas' as in Oracle?
What you can do to see if it can help things.. edit the app/common/database/databaseQuery.class.php file and then look for the getDatabases() method and add "|| ($this->getDatabaseType()=="firebird")" to the if clause and see if it makes any difference...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Found the following in LeftBar.php: //if ($currentDatabase=="") { $currentDatabase = "DatabaseRoot"; }
After uncommenting this line the "DatabaseRoot" was indeed clickable and selectable as a database and the generator did go into the "Simple" generation. However, none of the tables from the left side made it into the table checkbox list.
Any assistance or sugestions will be appreciated.
Thanks In Advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have made changes in LeftBar.PHP, chooseWhatToGenerate.PHP, and processWhatToGenerate.PHP until I get to the point that I can do a "Simple" generation to the directory "DatabaseRoot".
However, all of the database SQL code (connection, etc) is being generated for MySQL rather than Firebird.
What do I have to change to correctly generate for Firebird?
Thanks In Advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The general code that can connect to any database is available only for the advanced generation... In the advanced generated code it, all communications to the database is done thru a db abstraction layer.. thus being able to use the same code to talk to any db.
Thanks,
Nilesh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes the simple generation does not have a db abstraction layer.. if it had it would not have been called simple :)
The idea I had for the simple generation is to use the native calls for each database.. I have not yet finished with a template for all databases.. its only for mysql so far.. I am still thinking how to templatize the genertated simple code.. ideas welcomed :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made the appropiate changes to frameworkChooseWhatToGenerate.php and frameworkProcessWhatToGenerate.php and I now seem to be generating code.
However, the generated code is not functional yet. I get incorrect page references when I try to add. And the list and crud matrix do not seem to display anything.
I am out of time for today. I will investigate further at a latter time.
Thank you for your assistance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) In "frameworkChooseWhatToGenerate.php" I changed the configuration default to "Database.conf.php". When I press the generate all button, I display the configuration file name on the screen before the message saying the directory that this is generating to and it is showing the same name. I go through the generation process and display the same name at the end of the generation process. However, when I look at the project/include directory the name is ".conf.php". Originally, I tried typing the "Database.conf.php" in the box and it too wound up generating ".conf.php". What have I missed?
2) Inside the ".config.php" the SITE_PATH has only one "\" after the "framework" so the item looks like "...\\generatedCode\\framework\project_DatabaseRoot". So there is something about the Windows file separator that is not quite right.
3) I added a generating configuration file name echo message just before the actual generation and a "Generation complete" message at the end of the loop. The last few (about six) tables names and these two additional messages did not seem to be displaying on the results page until I changed the "Generating Code for table ... <br><br>" in "frameworkProcessWhatToGenerate.php" from "<br><br>" at the end to "<br>". Then all the missing messages and the "Generation Complete" message started showing up. This also seem to fix the problem I noticed with the "index.php" page not having all the tables showing up. I do not understand everything I have observed, but changing to one "<br>" fixed the problem.
4) In the generated "index.php" page it contains:
4a) include_once("Database.conf.php") but as reported in 1) that does not exist.
4b) include_once(CONFIG_FILE). Which should be adding some code to the generated page before the listing of
table but the codde does not get added.
4c) include_once(PAGE_HEADER). No page header code exists.
4d) include_once(PAGE_FOOTER). No page footer code exists.
So I believe that the "include_once" is not picking up the where the different pieces of code are becouse something is not set correctly.
5) Since the above inclusion is not occuring and the "database.config.php" file is not being generated no connection to the database is occuring and none of the links in "index.php" are working.
Any assistance in correcting these items will be appreciated.
Regards.
Roberto Artigas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings:
I managed to connect to a Firebird database.
However, when I come up in the generation page the listing has a list of tables under "DatabaseRoot", there is no database selection posible so there is no way to use the "Simple PHP Code Generator" to generate a PHP application.
Any Sugestions?
Thanks In Advance.
It shows up as DatabaseRoot.. because according to adodb documentation --> "MetaDatabases() -Returns a list of databases available on the server as an array. You have to connect to the server first. Only available for ODBC, MySQL and ADO"... so for other Databases apart from the 3 specified above, I have coded it to show database Root and then it makes a call to MetaTables to get all tables in the schema. I have never worked with Firebird.. so dont know much how it functions. Does it have 'database' containing 'tables'.. as in Mysql or does it have 'schemas' as in Oracle?
What you can do to see if it can help things.. edit the app/common/database/databaseQuery.class.php file and then look for the getDatabases() method and add "|| ($this->getDatabaseType()=="firebird")" to the if clause and see if it makes any difference...
Greetings - Thank you for your response.
Your sugestion did not make a difference since as far as I can determine firebird seems to handle the connection one database at the time.
For example: The connection string for the database that I am testing with is "localhost:D:\DATA\__PHA0TEST\PHA0TEST.FDB".
Would it be posible to make "DatabaseRoot" selectable as a database name as to be able to access the "Simple" generation?
And if it is possible, where would I need to go, and what would I need to change to make this work?
Any assistance would be appreciated.
Thanks In Advance.
Greetings -
Found the following in LeftBar.php: //if ($currentDatabase=="") { $currentDatabase = "DatabaseRoot"; }
After uncommenting this line the "DatabaseRoot" was indeed clickable and selectable as a database and the generator did go into the "Simple" generation. However, none of the tables from the left side made it into the table checkbox list.
Any assistance or sugestions will be appreciated.
Thanks In Advance.
Greetings -
I have made changes in LeftBar.PHP, chooseWhatToGenerate.PHP, and processWhatToGenerate.PHP until I get to the point that I can do a "Simple" generation to the directory "DatabaseRoot".
However, all of the database SQL code (connection, etc) is being generated for MySQL rather than Firebird.
What do I have to change to correctly generate for Firebird?
Thanks In Advance.
The general code that can connect to any database is available only for the advanced generation... In the advanced generated code it, all communications to the database is done thru a db abstraction layer.. thus being able to use the same code to talk to any db.
Thanks,
Nilesh
Greetings -
Are you stating that the "Simple" generation does not go through a DB abstraction layer?
Thanks In Advance.
yes the simple generation does not have a db abstraction layer.. if it had it would not have been called simple :)
The idea I had for the simple generation is to use the native calls for each database.. I have not yet finished with a template for all databases.. its only for mysql so far.. I am still thinking how to templatize the genertated simple code.. ideas welcomed :)
Greetings -
I made the appropiate changes to frameworkChooseWhatToGenerate.php and frameworkProcessWhatToGenerate.php and I now seem to be generating code.
However, the generated code is not functional yet. I get incorrect page references when I try to add. And the list and crud matrix do not seem to display anything.
I am out of time for today. I will investigate further at a latter time.
Thank you for your assistance.
Greetings -
Where is the "Simple" template code generated for the specific MySQL database?
Thanks In Advance.
reetings -
Have some new items to report.
1) In "frameworkChooseWhatToGenerate.php" I changed the configuration default to "Database.conf.php". When I press the generate all button, I display the configuration file name on the screen before the message saying the directory that this is generating to and it is showing the same name. I go through the generation process and display the same name at the end of the generation process. However, when I look at the project/include directory the name is ".conf.php". Originally, I tried typing the "Database.conf.php" in the box and it too wound up generating ".conf.php". What have I missed?
2) Inside the ".config.php" the SITE_PATH has only one "\" after the "framework" so the item looks like "...\\generatedCode\\framework\project_DatabaseRoot". So there is something about the Windows file separator that is not quite right.
3) I added a generating configuration file name echo message just before the actual generation and a "Generation complete" message at the end of the loop. The last few (about six) tables names and these two additional messages did not seem to be displaying on the results page until I changed the "Generating Code for table ... <br><br>" in "frameworkProcessWhatToGenerate.php" from "<br><br>" at the end to "<br>". Then all the missing messages and the "Generation Complete" message started showing up. This also seem to fix the problem I noticed with the "index.php" page not having all the tables showing up. I do not understand everything I have observed, but changing to one "<br>" fixed the problem.
4) In the generated "index.php" page it contains:
4a) include_once("Database.conf.php") but as reported in 1) that does not exist.
4b) include_once(CONFIG_FILE). Which should be adding some code to the generated page before the listing of
table but the codde does not get added.
4c) include_once(PAGE_HEADER). No page header code exists.
4d) include_once(PAGE_FOOTER). No page footer code exists.
So I believe that the "include_once" is not picking up the where the different pieces of code are becouse something is not set correctly.
5) Since the above inclusion is not occuring and the "database.config.php" file is not being generated no connection to the database is occuring and none of the links in "index.php" are working.
Any assistance in correcting these items will be appreciated.
Regards.
Roberto Artigas
Greetings -
It has been a month since I posted these comments.
Any chance of getting a reply? Or a hint? Or an I can not get to this now?
Has the forum gone dead?
Regards,
Roberto Artigas