-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added functionality and small fixes #2
Conversation
Hi Bsevere, I've been trying to run your project (and the master project) for hours now and I can't make it work. I'm using IIS 7 and PHP 5.3.13. What environment are you successfully able to run this code on? The zip file is empty after I hit Generate; and the error log says the following: PHP Warning: mkdir() [function.mkdir]: No such file or directory in C:\inetpub\wwwroot\bsevere\includes\generate.php on line 63 PHP Warning: file_put_contents(/tmp/451668edcbf94d76691b9d3ed988a313/digitalstrategy.json) [function.file-put-contents]: failed to open stream: No such file or directory in C:\inetpub\wwwroot\bsevere\includes\generate.php on line 69 PHP Warning: file_put_contents(/tmp/451668edcbf94d76691b9d3ed988a313/digitalstrategy.xml) [function.file-put-contents]: failed to open stream: No such file or directory in C:\inetpub\wwwroot\bsevere\includes\generate.php on line 74 C:\inetpub\wwwroot\bsevere\includes\generate.php on line 77 PHP Warning: readfile(/tmp/451668edcbf94d76691b9d3ed988a313/DOL-report.zip) [function.readfile]: failed to open stream: No such file or directory in C:\inetpub\wwwroot\bsevere\includes\generate.php on line 89 PHP Warning: rmdir(/tmp/451668edcbf94d76691b9d3ed988a313) [function.rmdir]: No such file or directory in C:\inetpub\wwwroot\bsevere\includes\functions.php on line 116 Thanks for any help! |
The script is trying to mkdir but it does not have the proper permissions. Look at includes/generation.php:line 54. If that line reads: Also make sure that you set world write permissions on /tmp as per the readme. (chmod 0777 /tmp/) Bill |
Thanks Bill, I'm running windows 7, I had set the permissions for that folder to be Full Control for the groups using IIS. The first error message I saw said that DGS_BASE_DIR was an undefined constant in generator.php I'm not familiar at all with php so I don't know if it's a configuration issue on IIS or if it's a problem with the version of php I am using. What version of php are u running? Thanks so much for your time, On Aug 10, 2012, at 6:52 PM, bsevere notifications@github.com wrote:
|
Sorry, I should have picked up that you are running Windows. I am running an older version of PHP (5.2.13). That should not matter as I think your issues are mostly permissions. There may also be an issue with the paths (the code is written for a *nix filesystem). Check the contents of the data folder. If there are no contents then you will need to allow Everyone read/write/execute access to that folder. That is the Windows equivalent to chmod 0777. Do the same for C:\tmp. If that folder does not exist you can point it to C:\temp, or whatever your temp directory is. |
The data folder has files in it. When I create a folder called 'tmp' at the same level as index.php the script runs but the zip folder is still empty. Generate.php throws errors about DGS_BASE_DIR being an unknown constant. At this point I'm going to try just hard coding the XML and json files since the deliverable is Thursday. And then try to figure out why it won't generate. Would you mind sending me an example JSON file and XML file? Thanks so much for your help Bill. Rodyna Sent from my iPhone On Aug 10, 2012, at 7:32 PM, bsevere notifications@github.com wrote:
|
The zip folder is emptied after the zip is created and the download headers are sent. The issue with DGS_BASE_DIR is most likely coming from line 54 of includes/generation.php as I mentioned earlier. To fix you will need to open that file and make the change below. $dir = DGS_BASE_DIR . '/tmp/' . md5( time() ); The JSON and XML files are available here: https://github.com/GSA/digital-strategy. Bill |
Merged the pull request. @bsevere thanks for taking the time to put this together. Resolved @ro281815's windows compatibility issue by changing the temp. directory to use PHP's default temp directory, rather than assuming Also tweaked the way the script loads configs (making it easier to customize outside of Git, which should resolve the undefined constant issue. Per the Readme, you'll need to copy All the changes should be in the "master" branch, and labeled generator version 1.1. Will go back and tag the 1.0 for history sake. Thanks again to both for the feedback and for the code. Truly a model of what government should be doing. -Ben (cc @gbinal) |
Hi,
I am preparing the digital strategy implementation for the Dept. of Commerce and we are using your report generator. Thank you for the tool as it has accelerated our deployment.
I have forked your code and have added a few enhancements that were requested by our DS POC and fixed a couple small issues. These are the changes I have made:
Changed output filenames from ‘digital-strategy’ to digitalstrategy’ (removed hyphen).
Added constant for reports directory.
Added functionality to write to reports directory if it is defined.
Read in existing JSON file from reports directory if present.
Remove “/” from $local_path variable in dgs_zip() to fix “Cannot use absolute pathnames for this command” error.
Fixed unordered HTML report items.
Fixed generate.php to write to /tmp instead of DGS_BASE_DIR/tmp.
This code still points to the Digital-Strategy repo to create the agency and item lists. I have sent a pull request for that as well to fix the missing agency IDs.
I would very much like to combine our efforts on this for the benefit of the entire FED community. Please let me know if you have any questions about the changes made.
Thanks,
Bill Severe