Ticket #2121 (closed defect: wontfix)

Opened 7 months ago

Last modified 1 month ago

Allow TEMP_FOLDER to be set from _config.php

Reported by: mpeel Assigned to: sminnee
Type: defect Priority: critical
Milestone: Component: Sapphire Framework
Version: 2.2.0 Severity: medium effort / impact
Keywords: Cc: simon_w, mpeel
Due date: Harvest Task: (Unknown)
Invoice sent to client: 0 Hours:

Description

Currently if you want to put the TEMP_FOLDER anywhere except in /tmp or the webroot, you need to hack sapphire/core/Core.php, and change the define() of TEMP_FOLDER.

It would be cool if you could instead set this in _config.php. The problem at the moment is that Core.php is loaded before _config.php is, and this can't be easily fixed because we need the TEMP_FOLDER directive to be defined before the class/template manifest is loaded/created. You also can't simple define TEMP_FOLDER in _config.php because apparently PHP doesn't let you re-define constants (according to aoneil), and by the time _config.php is loaded, it's already been defined by Core.php

If this can't be accomplished because it's a chicken and egg scenario, it's probably not a big deal.

Attachments

Core.php.diff (1.7 kB) - added by simon_w 7 months ago.

Change History

Changed 7 months ago by simon_w

Changed 7 months ago by simon_w

  • cc set to simon_w

After talking to Matt about this in IRC, I have created a patch to getTempFolder() that allows the user to define TEMP_FOLDER by providing a path in either mysite/TEMP_FOLDER or tutorial/TEMP_FOLDER.

Changed 7 months ago by smagnusson

  • priority changed from medium to critical
  • type changed from defect to patch

Changed 6 months ago by sminnee

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

Instead of this patch, define temp folder in _ss_environment.php.

Changed 6 months ago by simon_w

  • status changed from closed to reopened
  • resolution deleted

However, sapphire/core/Core.php is include before any of the _ss_environment.php files, thus TEMP_FOLDER is defined to getTempFolder(), and can't be set in _ss_environment.php.

I just tested using _ss_environment.php, and it throw a warning, but TEMP_FOLDER wasn't defined to what I had in _ss_environment.php.

Changed 6 months ago by ischommer

  • status changed from reopened to closed
  • resolution set to wontfix

Changed 2 months ago by mpeel

  • cc changed from simon_w to simon_w, mpeel
  • status changed from closed to reopened
  • resolution deleted

Uh, why was this closed as wontfix when the posted solution doesn't work? If it works now, can you at least say so? :P

If not, how are we supposed to set this?

Changed 2 months ago by mpeel

  • type changed from patch to defect

Changed 1 month ago by sminnee

  • status changed from reopened to closed
  • resolution set to wontfix

You would be able to define TEMP_FOLDER in your _ss_environment.php file. Use that instead.

I cancelled this ticket because it's not good to have 100 random ways of setting the TEMP_FOLDER. It just gets confusing.

Note: See TracTickets for help on using tickets.