Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

2.1 file fixes #560

Closed
wants to merge 10 commits into from

4 participants

@dereuromark
Collaborator
@markstory
Owner

What are all the extra commits for?

@dereuromark
Collaborator

good question!
I updated my 2.1 to the current cake head and then created a new branch from it and applied the changes (78d8c70) before sending the pull request...

@ADmad
Collaborator

Update your origin/2.1 and then rebase your branch on top of that.

@dereuromark
Collaborator

closed in favor of the correct one

@augusto-cdxs

Was this commit made effective in any master branch? Looks like FileEngine still lacks this enhancement in 2.3.0...

No it has not made into any branch that I have in my clone.

Collaborator

It was force-closed due to the 2.3/master branch switch. I would need to reopen it against 2.4.

That'd be great, go ahead.

Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
3  lib/Cake/Cache/Engine/FileEngine.php
@@ -315,6 +315,9 @@ protected function _setKey($key, $createKey = false) {
*/
protected function _active() {
$dir = new SplFileInfo($this->settings['path']);
+ if (Configure::read('debug') && !is_dir($path = $dir->getPathname())) {
+ mkdir($path, 0755, true);
+ }
if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
$this->_init = false;
trigger_error(__d('cake_dev', '%s is not writable', $this->settings['path']), E_USER_WARNING);
View
5 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))) {
+ if (!mkdir($dir, 0755, true)) {
+ return false;
+ }
+ }
return file_put_contents($filename, $output, FILE_APPEND);
}
Something went wrong with that request. Please try again.