HOOKS being overwritten

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

HOOKS being overwritten

Post by buck1942 » 2016-08-04 02:57

Files in my Hook folder keep getting overwritten...

I modify, for example "_global.php", online, with an online editor. The program works fine.

For whatever reason, I need to recompile my Appgini program, and upload it to my website. The files get overwritten.

The manual clearly says these files, in the Hooks folder, are created only once and will not be overwritten...

I must be doing something wrong... I am using version: 5.50...

Buck

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: HOOKS being overwritten

Post by DevGiu » 2016-08-06 07:08

Just curious, you "recompile" on an empty folder? And then upload all?
/Giuseppe
Professional Outsourcing Services

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: HOOKS being overwritten

Post by grimblefritz » 2016-08-07 12:04

The manual is referring to the hooks files in the output directory when generating. It knows nothing of, and has nothing to do with, the directory where you copy everything to - that's up to you to manage. If you were to change a file in the local directory, where generation occurs, you would find it is not overwritten when you generate.

I suspect you are generating and then uploading everything - including the hooks folder. This would overwrite the online hooks files (ie, your hard work) with the empty files originally generated by AppGini.

You must either:

A) do not re-upload the hooks folder after it is uploaded once, or

B) modify your hooks files (__global.php, for instance) locally and then upload, which I think is the safest approach as you avoid your original issue and have a backup copy, or

C) copy your online hooks modifications back to your local hooks folder, before regenerating and uploading, which is a good idea as it gives you a backup, or

D) if you have shell access to your web host, you might consider something like sshfs or WebDrive.

I have WebDrive and am able to map my web host to a local drive letter. This lets me deal with everything on my Windows system as if it were on a local drive, or natively on the linux web host. There's a penalty in speed. Generating the app over such a connection is much slower than generating to a physical local drive. However, I don't have to think about things like: Did I copy that file over? Is my local copy up-to-date? and so forth. If I edit a hooks file from Windows, or on the web host using vi, or from cpanel's file editor - it's all the same.

buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

Re: HOOKS being overwritten

Post by buck1942 » 2016-08-08 20:03

grimble... that is EXACTLY what I was doing... kinda looking over the obvious overwrite...

I have begun using your option "c".

Thanks,

Buck

Post Reply