0.4.20 (Stable)
General Framework

There are no votes for this issue.

reported: thursday, april 28, 2011, 9:50 am pdt  |  by: Shannon Pekary  |  messages: 5 messages  |  last: about 8 years ago

#1  |  Shannon Pekary (East Palo Alto, CA) United States of America Qcodo Core Contributor
Thursday, April 28, 2011, 9:50 AM PDT

If you move the www directory, the drafts will not work because the path to the file is hard coded. The file was added to PHP_ASSETS, but it is not used by the drafts.

#2  |  ‹‹ Qcodo System Message ››
Thursday, April 28, 2011, 9:52 AM PDT

A fix to this issue was posted by Shannon Pekary at

Pull request to fix this. This is my first time doing this. Hope it is correct.

The following changes were made to this issue:

  • Status changed from New Issue to Fixed
#3  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Thursday, June 30, 2011, 9:49 AM PDT

Thanks for the post... but unfortunately, that's not the intention of the file that's in PHP Assets.  The one in PHP Assets was specifically intended for the PHP Assets themselves (which are “top-level” PHP files called by the webserver directly) to be able to have one place to get to the prepend file.  Note that all the PHP Assets call the file through a relative path call.  Unfortunately, since qcodo hasn't been loaded yet, we do not have access to any of the directory constants like _PHP_ASSETS_, _DOCROOT_, etc.

That being said, I think you bring up a good idea on having the form drafts be able to go to a single “require prepend” file that can be easily found with a relative path call.  I think the fix for this would be to have another file that exists in the form drafts directory... and then update the templates to simply do a single require line like this:

    require(dirname(__FILE__) . '/');

And that way, you can move around the includes path to wherever, and only need to update a single file to reflect then new location of the file.  However, the only caveat is that if you copy/move your form draft file somewhere else, you must make sure to include the a copy of the file as well -- an added burden to the developer to need to remember this.

I'm okay with it either way... I'd be curious to here others' thoughts.

#4  |  ‹‹ Qcodo System Message ››
Thursday, June 30, 2011, 9:49 AM PDT

Mike Ho made edits to the issue, including:

  • Status changed from Fixed to Open
#5  |  Fernando Lordán (Barcelona, CAT, Spain) Spain
Friday, July 1, 2011, 7:55 AM PDT

I'm sorry to disagree, but I think the solution is not to start a “PHP inclusions inferno”, with extra include files that must be maintained all around (that's a thing to be avoided, in my opinion).

I really see no advantage in updating the framework path in a “prepend” file specific for the drafts. The framework path can be updated in the draft templates themselves (as it is now) and then regenerate the drafts, thus avoiding the extra cost of maintaining another inclusion file.

Copyright © 2005 - 2019, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.