Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up3.1 Session => ['defaults' => 'cake'] should try to auto-create tmp/sessions if not existing #7987
Comments
ionas
changed the title from
3.1 Session => ['defaults' => 'cake'] should try to auto-create tmp/sessions if not existing (maybe in catch?)
to
3.1 Session => ['defaults' => 'cake'] should try to auto-create tmp/sessions if not existing
Jan 7, 2016
markstory
added this to the 3.1.7 milestone
Jan 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
markstory
Jan 8, 2016
Member
I am not so sure we want to try and create directories that don't exist. Unless we did some special casing, we'd be trying to ensure that session.save_path existed if it wasn't defined and we could run into issues around filesystem permissions or open_basedir limitations.
|
I am not so sure we want to try and create directories that don't exist. Unless we did some special casing, we'd be trying to ensure that |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
htstudios
Jan 8, 2016
Contributor
Within ROOT/tmp/ it should be okay?
Don't we do the same for cache, models, persistent etc?
|
Within ROOT/tmp/ it should be okay? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ADmad
Jan 8, 2016
Member
tmp/sessions is already created at install time along with other tmp directories. We should definitely not try to create directories at runtime.
|
tmp/sessions is already created at install time along with other tmp directories. We should definitely not try to create directories at runtime. |
ADmad
closed this
Jan 8, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ionas
Jan 8, 2016
Contributor
The gap that surprises is, following directories get setup on install time:
ROOT/logs
ROOT/tmp
ROOT/tmp/cache
ROOT/tmp/cache/models
ROOT/tmp/cache/persistent
ROOT/tmp/cache/views
ROOT/tmp/sessions
"We should definitely not try to create directories at runtime" (@ADmad)
Following directories are created at runtime.
Thus they will be re-created (tested just now) if they got deleted:
ROOT/logs
ROOT/tmp
ROOT/tmp/cache
ROOT/tmp/cache/models
ROOT/tmp/cache/persistent
ROOT/tmp/cache/views
ROOT/tmp/sessions
Did not test for ROOT/tmp/tests, e.g. if it gets recreated on demand.
p.s.: I'd have preferred to discuss this in short on IRC.
|
The gap that surprises is, following directories get setup on install time:
Following directories are created at runtime. Did not test for p.s.: I'd have preferred to discuss this in short on IRC. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dereuromark
Jan 8, 2016
Member
@ionas Folders are only created in debug mode, not production.
Also, tmp, logs, cache and tmp/sessions for CakePHP itself is fine , but another outside is not OK and should be done automatically.
See https://github.com/cakephp/cakephp/blob/master/src/Log/Engine/FileLog.php#L90-L95
The same for debug mode only should be applied to all the tmp stuff inside the APP.
|
@ionas Folders are only created in debug mode, not production. See https://github.com/cakephp/cakephp/blob/master/src/Log/Engine/FileLog.php#L90-L95 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ionas
Jan 8, 2016
Contributor
In case there is a will for consistency let me know and I will try to fix it ASAP.
|
In case there is a will for consistency let me know and I will try to fix it ASAP. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dereuromark
Jan 8, 2016
Member
Please make a PR. I think that will make the discussion easier as it will be more code hands-on and less theoretical.
|
Please make a PR. I think that will make the discussion easier as it will be more code hands-on and less theoretical. |
ionas commentedJan 7, 2016
When switching from A:
to B:
... because of the existence of an application cluster, the session path in tmp was not found and resulted in an error:
Should switching from A to B try to auto-create tmp/sessions path if not existing?