Easier way to update .csv file

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Easier way to update .csv file

Post by shasta59 » 2013-06-21 16:59

Actually it eliminates the .csv file

I am currently testing the following option in my admin/user setting file concept. See http://forums.appgini.com/phpbb/viewtopic.php?f=8&t=704 for precursor to this post. Felt better addressed in another post/topic area. What I am doing is having a variable being set which is also written into my setting table concept which contains all the lookup options list for field in a table rather than creating a csv file to hold the values. This way I am not needed to change the values and regenerate or update the csv file as seen in this method from the AppGini site.

http://www.bigprof.com/appgini/help/adv ... agic-files

While this file does not need to be updated that often it does from time to time. Very annoying. So I am currently testing doing this through my settings page as accessed by the admin or those with correct privileges. There is a field in my settings table which holds these values and then can be updated very easily and I do not have to change the csv file then upload it etc. The end user/application admin can do it for themselves. Then in the appropriate your_tablename_dml.php file I have it read the value(s) from the variable and load those instead of the csv file. As a backup I am leaving the csv file in place in case the variable gets blanked by accident so some data will still be there. (Done using an if statement). My code also writes the csv file and places it in the hooks folder as a backup. I also am having it check the variable and if empty it will not write a new csv file. This way it insures the choices are still there and usable and I do not get that, 'Oh, my goodness' look what I did phone call.

This is all towards my goal of having a walk away and leave it application that I do not have touch. Makes clients happier as I am then not needed and they are not beholding to me to update or change little things which they could easily do. I prefer to not have a client have to come to me because they have to but because they wish to.

When it is fully tested and working properly I will get around to posting it but it is a multistep type process and requires a lot of additions/changes to Ahmad's base code so he may wish think about adding this as a feature because it is not that hard to implement but need to make sure all the correct places are changed in the base code/files.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

Post Reply