Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.phedhistory file names changed #68

Open
liberatorcnx opened this issue Apr 5, 2023 · 4 comments
Open

.phedhistory file names changed #68

liberatorcnx opened this issue Apr 5, 2023 · 4 comments

Comments

@liberatorcnx
Copy link

Every time I save a file, the file names in .phedhistory folder ALL change to the filename that I just saved. For example, I save file1.php - now all files in .phedhistory folder are called file1.php.(0 thru 4). This happens even if I sequentially save file1.php, file2.php etc... They all end up with the name of the last file saved. The files that are saved are correct - just the name is wrong.

I assume that the intention is to save the last 5 files saved BEFORE changes which is really useful, but not preserving the file name is not useful...

@liberatorcnx
Copy link
Author

I seem to have resolved the problem by commenting out
'rename($file_history_dir . DS . $history_file, $file_history_dir . DS . $file_name . '.' . ($key - 1));'
around line 613 in pheditor.php. It's not prefect because I end up with 2 <filename.php.x> where x = ('MAX_HISTORY_FILES' -1).

@hamidsamak
Copy link
Collaborator

Hi @liberatorcnx
The history directory is used to keep last revisions of edited files for history and diff purposes. It is not completed and implemented yet and just keep files in that directory. The file names from 0 to 4 is due to configuration when MAX_HISTORY_FILES is set to 5. It means keeping five last revisions of file1.php with naming zero to 4.

@liberatorcnx
Copy link
Author

Hi @hamidsamak
I understand the reason for keeping the last revisions - it makes sense! The problem was that the file names for the (old) files was being changed. So if I edited 1.php then edited 2.php all of my previous revisions would be named 2.php despite the fact that the previous file edited was actually 1.php. Anyway, I can live with the workaround I mentioned.

@hamidsamak
Copy link
Collaborator

You're right, saving a history of renamed files is not implemented in the script. I'll keep this feature in the development list.
Thanks for report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants