xtopolis Posted June 22, 2008 Share Posted June 22, 2008 Hi, I am writing a site where users can login and are given access to files based on their credentials. These files are placed in their separate subdirectories by a unique name in order to allow regular FTP access to these files should the user prefer not to use the site. I am writing an admin option to allow creation of new directories for when we bring on new customers. The structure of each unique directory is: [uniqueName] [files] +uniquefile I can create these fine in PHP, my issue is however, is there an easy way to roll back changes should any of these steps fail. Say it didn't successfully create the unique file, I would want it to display an error, and have to retry the whole operation. Is there any easier way to do this besides checking at the end that everything exists, and if not, attempting to delete it? Another question is, if I use a try/catch blow and throw an exception, does the execution of that code stop and return to outside the try/catch statement and continue? example: Layout code try/catch make a folder more layout If an exception is raised, would it continue to display the rest of the layout even though it would be after the statement that would raise a (fatal possibly) error? Link to comment https://forums.phpfreaks.com/topic/111299-rollback-executed-code-exception-handling/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.