Ticket #100 (closed defect: fixed)

Opened 3 years ago

Last modified 5 months ago

Prefix internal Plogger folders with "plog-"

Reported by: mike Owned by: sidtheduck
Priority: normal Milestone: 1.0
Component: General Version: 1.0b3
Severity: normal Keywords:
Cc:

Description

We need to rename the folders inside the Plogger directory so people can name their collection "lib", "graphics", "images", or "css" etc..

With mod_rewrite on there is a path name collision between collections with these internal names and the actual physical directories.

Change History

Changed 8 months ago by sidtheduck

I'm willing to move forward with this.

Along these same lines, do we want to "clean up" the Plogger folder some more too? (I'm thinking maybe similar to Wordpress?).

We could have 3 (or 4?) main level subfolders: /plog-admin

  • /js
  • [admin php files]
  • move _install.php and _upgrade.php to admin folder?

/plog-content

  • themes
  • images
  • thumbs
  • upload

/plog-includes

  • css
  • graphics
  • lib
  • js? (for slideshow.js and dynamics.js?)
  • (plog-translations?)

(/plog-translations?)

Will putting them in plog_ prefixed subfolders fix the mod_rewrite problem, or will the problems still exist?

As a final thought, should we rename 'gallery.php' to 'plogger.php' to keep with the naming convention? We could include a 'gallery.php' with a PHP include() function pulling in the code from the new 'plogger.php' (or create one during _upgrade.php?) so people's current installs can still use 'gallery.php', but we could change the documentation to use 'plogger.php' for new installs instead of 'gallery.php'

Thoughts?

Changed 8 months ago by ryan

One thought on this is that CSS and anything related to the template (including any distributed with plogger) should be in the theme folder under plog-content. Likewise, anything related to the admin portion of the site (CSS, images, etc) should be housed within the plog-admin folder.

Changed 8 months ago by sidtheduck

Agreed. My question now is regarding the slideshow for the plogger galleries (the generate_slideshow_js() function). Should this be a plog-function at all or should this be called via each individual theme in the head.php file? Not everyone uses the slideshow function for every theme, and it's only used in slideshow.php (even though the script currently is included in the head of every page).

Do we want this function to still remain throughout all themes (and have a common location for it and the associated graphics in the plog-content/theme folder?) or should this be pulled out into a theme-by-theme basis and included in the standard downloadable themes? The plogger_slideshow_link() function will still remain, etc.

Changed 7 months ago by sidtheduck

  • owner changed from mike to sidtheduck

Changed 7 months ago by sidtheduck

Okay, here are my updated thoughts on the file/folder structure:

plogger/

  • plogger.php(instead of gallery.php)
  • plog-admin/
    • js/(associated with admin)
    • css/(associated with admin)
    • graphics/(associated with admin)
    • _install.php
    • _upgrade.php
  • plog-content/
    • images/
    • themes/
    • thumbs/
    • translations/
  • plog-lib/
    • exifer/
    • gettext/
    • pclzip/
    • phpthumb/
    • plogger/
      • js/(for slideshow.js and dynamics.js)
      • graphics/(for slideshow graphics)
      • css/(for default gallery css if all themes are deleted?)
      • captcha/(for font file(s))

This would clean up the paths for mod_rewrite URLs as well as clean all files out of the base Plogger folder besides .php files. Am I overthinking this? Should I just prepend the folders with "plog-" as the original ticket suggests since it would be easier and not as much of a structure change? Please let me know.

Also, along these same lines, should we be re-naming ALL functions within the 'plog-functions.php' to have the prefix "plog_" or "plogger_"? Some have already been updated, but others have not. I don't think 'plog-admin-functions.php' needs to have this same prefix since it shouldn't be included in any embedded files that would cause collisions between filenames, but there may be collisions for filenames in the regular 'plog-functions.php'.

While I'm updating the functions for the new "plog-" paths, I could be updating function names as well. That would just leave function names within the themes that would have to be updated. Is this something I should move forward with?

Please let me know your feedback as I would like to get started on applying these changes since it would be nice to have the new path structure in place for other contributors as they are adding / fixing things.

Changed 7 months ago by Mike

I think a structure change would be fine although I would be careful taking that route as you may open up a lot more work for yourself than you originally thought. Moving files within SVN can be a pain sometimes, you have to make sure to do an SVN delete and a corresponding SVN add/commit for each moved file.

I would be very cautious renaming functions, especially functions used in templates as changing the names of these will cause old themes to break completely.

I'm not sure how I feel about _install.php and _upgrade.php in the plog-admin folder. On one hand they probably belong there, on the other, the URL should be as short and simple as possible as this is typed in manually by the person installing or upgrading the software. Technically, they should be deleted by the user as well after they perform their respective functions.

Renaming gallery.php to plogger.php makes sense semantically but I'm not sure it is worth all of the problems it may open up. Like you mentioned, those upgrading their software would also have to update their websites to change the integration code. If we do go this route, including another php file called gallery.php which just included plogger.php would probably prove very confusing and do nothing to clean up the file mess problem we started off to solve in the first place. A symlink would make more sense but this would probably not be allowed on most systems.

In summary, proceed at your own risk. Overall I really like the new proposed structure though and if you feel up to it, I would go for it.

Changed 7 months ago by sidtheduck

Thanks for the reply, Mike!

I do understand it will be a lot of work to restructure and was thinking that maybe for now I could just prefix the folders per the original ticket to clear up any path conflict bugs. Perhaps in the near future we could split out a branch for reworking the structure so the trunk remains stable while overhauling the structure and testing it for bugs? I don't necessarily mind how it works now, I was just thinking the new structure would be easier for upgrading (i.e. the user would update everything except the plog-content folder unless they were updating a theme).

Regarding functions, I'm fine with how they are named now. I was just wondering if you foresee any conflicts in the future (i.e. with Wordpress, future plugins, etc.) and while I was pulling things apart for restructuring, it could be (not easier . . . but) more straightforward to take care of it all at once. I'll leave them be.

Addressing _install.php and _upgrade.php it's a hard call. _install is easier to deal with as we can change the generated link from the main page if Plogger determines it needs to run the install. _upgrade.php is different, on the other hand as the user has to manually navigate to it. As an example, however, Wordpress uses it's install and upgrade functions through the wp-admin folder.

Thanks again for your feedback. I'll work on just prepending for the time being and I'll continue to work on a restructure for a later date (and possible future branch of development).

Changed 7 months ago by sidtheduck

  • milestone set to 1.0

Changed 5 months ago by sidtheduck

  • status changed from new to closed
  • resolution set to fixed

New restructure as of r550 should take care of any mod_rewrite folder naming issues.

Note: See TracTickets for help on using tickets.