-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WIP] remove tempname usage #9442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@stof i know this is probably wrong and stupid, but i was just experimenting and wanted to know if travis throws us some green by chance |
@stof is travis build of symfony broken on master? |
@@ -471,4 +471,34 @@ private function toIterator($files) | |||
|
|||
return $files; | |||
} | |||
|
|||
/** source: http://www.deltascripts.com/board/viewtopic.php?id=7843 */ | |||
private static function tempnam2($dir, $prefix, $postfix='') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use tempnam
when available, it must be more performant than your implementation.
@cordoval no they are not. See the error: Filesystem::tempnam2 is private but you are calling it outside Filesystem |
@@ -20,7 +20,8 @@ | |||
}, | |||
"require-dev": { | |||
"symfony/config": "~2.0", | |||
"symfony/yaml": "~2.2" | |||
"symfony/yaml": "~2.2", | |||
"symfony/filesystem": "~2.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same constraint issue here
@stof also i am thinking we should add a session handler (custom) for Google Cloud SQL since that is what Google recommends. From then on we can forget about memcache current supported handler |
@stof i think more is a question of whether or not the files under app/cache have absolute paths to files and work on them. I think for instance the files under: /Users/cordoval/Sites/project/app/cache/prod/templates.php has:
which is totally dependent on my FS, it needs to have the path from the GAE FS. Do you see other problems? I think the tempnam and all those usages are fine since they are done back in the development system. The problem that i see is perhaps making the development system think that the filesystem starts at the root directory of the project somehow. The other thing is sessions, sessions can be handled via Memcache however GAE says it can be flushed at anytime. ? |
@cordoval you should not copy your local cache to AppEngine. The cache is tied to the platform. |
@stof i have resolved most of the problems but now this. I am thinking if you said that the cache/prod/classes.php gets regenerated even if uploaded i wonder how to avoid that. I guess putting it into the memcache also?
it is a bit tricky, that class gets generated after i actually use/test the site on the browser on local. Then i move to other problems that i am solving |
@cordoval Remove the call to |
@stof yeah but i found other issues, we need to load twig templates paths from Memcache, so we need another implementation of TemplatePathsCacheWarmer and also another implementation of the locator injected into 8000 TemplateLocator's method locate. If you agree we can start working on this. 👶 |
|
||
do { | ||
$seed = substr(md5(microtime().posix_getpid()), 0, 8); | ||
$filename = $dir . $trailing_slash . $prefix . $seed . $postfix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not spaces around dots.
} | ||
|
||
do { | ||
$seed = substr(md5(microtime().posix_getpid()), 0, 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
posix_getpid()
requires posix extension that is not available on Windows platform. You can use getmypid
instead
@cordoval Can this be used in a production environment? I'm interested in running Symfony on GAE. |
} | ||
|
||
/* The PHP function is_dir returns true on files that have no extension. | ||
The file type function will tell you correctly what the file is */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong (at least in modern PHP versions). is_dir()
always behave correctly, even when a file has no extension.
Closing this PR as I've talked with the GAE guys and they are going to implement |
oh nice to know this is good news! |
Any news on this? tempnam is still listed under "permanently disabled functions". |
Will be available in App Engine release 1.9.18. |
@sjlangley Thanks for the head up, that's a great news. Combined with the work we've done to make Symfony work on other Cloud platform like Heroku, it should be much easier to host a Symfony website on Google App Engine. |
from the list: