allow missing tmp directories to be autocreated in debug mode #615

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Member

dereuromark commented Apr 20, 2012

allow creating of missing tmp directories in debug (development) mode for cache and log to avoid unnecessary errors thrown

@see http://cakephp.lighthouseapp.com/projects/42648/tickets/885-tmp-cache-folders-autocreation

@dereuromark dereuromark allow creating of missing tmp directories in debug (development) mode…
… for cache and log to avoid unnecessary errors thrown
d03e409
Owner

lorenzo commented Dec 22, 2012

I actually like this idea now :P Not user about the default permissions being applied maybe 664 ?

@ADmad ADmad commented on the diff Dec 22, 2012

lib/Cake/Log/Engine/FileLog.php
@@ -66,6 +66,11 @@ public function write($type, $message) {
$filename = $this->_path . $type . '.log';
}
$output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message . "\n";
+ if (Configure::read('debug') && !is_dir($dir = dirname($filename))) {
@ADmad

ADmad Dec 22, 2012

Member

Couldn't this check be moved into constructor instead of checking on each write?

Member

dereuromark commented Dec 22, 2012

664 sounds good to me - I will modify.

Member

dereuromark commented Dec 24, 2012

Closing in favor of 2.3 branch: #1047

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment