@bwoebi We should discuss the issue with yield in closed generator with @BenjaminGruenbaum and @MadaraUchiha, I remember they had some thoughts about that wrt handling in JS
Manual checks for (EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0 && (zend_get_running_generator(execute_data)->flags & ZEND_GENERATOR_FORCED_CLOSE would work too, but dummy exception is better I think
I just wonder whether it will become accessible via $ex->getPrevious() …
On getmxxr( .. ) the third arg is a array which is filled with the results "weight" ... on valid hosts it returns a array of numbers.. like 10, 20 ... what is that?
@MadaraUchiha Hey. We were talking about how generators that have been destroyed without being fully consumed should behave wrt finally blocks. Basically the interesting case is what happens if you destroy a generator, thus trigger execution of a finally block inside it, but that finally block performs a yield again.
@Andrew the first question mark in a request marks the end of the path, and the start of the query params. Routes are based off the path, not off the query params usuaully.
@NikiC Under what circumstances would I want to put a yield in a finally{} block of a generator? My mental model tells me that regardless, the generator was already done by the time the finally block has been reached
@MadaraUchiha What we were considering is to treat those yields essentially as throwing statements. I.e. if we encounter a yield in a currently-destroying generator, we we'll go up to the next higher finally block.
Is there a way to set FPMs document root without relying on the webserver? Seems pretty insecure to me that the upstream http server can tell FPM where to look on the file system
If possible I'd like to get away with sending only REQUEST_METHOD and REQUEST_URI from http -> fastcgi
@zaq178miami I'm trying to figure out how to use the keepalive/heartbeats in php-amqplib with no luck .. $connection = new AMQPSSLConnection($host, $port, $user, $pass, "/", array('verify_peer' => false), "AMQPLAIN", null, "en_US", 3, 5, null, true, 30); .. am I doing it wrong ?!
If you want to link a table with two or more other tables (e.g. something like a notes or logger table), is it a legitimate practice to have something like type + id columns, or is there a better way?
@PeeHaa Just a use-case. There's going to be a new part of our system which affects more than one type of entity (think users, user groups and permissions. Permissions can be set for groups, but overridden for specific users)
@BenjaminGruenbaum The interesting question is what happens if you do not explicitly .return, but it is rather triggered by GC of an unreferenced generator
> One report was about a male attendee offering 2 separate female attendees a private sampling of relaxation techniques in his room. And when the women refused the man did not continue or push. When the incidences was brought to the man as being inappropriate he apologized and said he meant well, and he would not do it again.
Re-write, attempted to flirt slightly, failed, was reprimanded for it
@Leigh Default script is default......you can just use a better one.....and generating config files dynamically at deploy time is the correct thing to do for Nginx + PHP-FPM. cough oh hey, I have a library to do that
@bwoebi I get the merit of resource management, trust me. I just think users would not really expect finally blocks to automatically run. Especially if it's just a generator and not always a coroutine.
@BenjaminGruenbaum not running finally blocks at all would be detrimental though … especially if you create a lock in try code and then the unlock is not run in finally…
Part that starts at: "he addition of the close() method has one side effect that isn't obvious. close() is called when a generator is garbage-collected"
JavaScript is terrible at resource management, JS users are terrible at it. The only good thing is that they didn't add silly stuff to the language because of it.
I never use destructors in anything but C++. Well, I do, but only to log me being an idiot to the log and never to actually do anything but catch my mistakes.
Hello! :) Maybe someone could help me with my question? I found a code here in stackoverflow which displays a weekly calendar from Monday to Sunday. I only want it to display up to Saturday only though. Here's the link to my question :) http://stackoverflow.com/questions/35426365/weekly-calendar-minus-sunday
@NikiC generally I find that Python is too exception-oriented, but I guess in this specific case Python is doing it right and we should throw an Error too inside PHP... (and not just a fake)
All, can I ballpark an idea for a migration from a legacy framework to Symfony? Idea: Two different domains, all requests go through first framework, if not exist, go through with an API key for the currently logged in user to Symfony (via cURL) (which can automatically handle authentication via an API token) - so user is reconstructed in Symfony for the route that does exist there
Only addition: an API key table and join on the user in the legacy framework
@Leigh I want to do that, in fact I have that working using stackphp (you stack middlewares and I converted original framework to use HttpFoundation (Request / Response) for this purpose. But the problem is authentication. Sign into first application needs to allow signing into Symfony too
Hi all, When I execute the a script using command line "php myFile.php" all go right.. When I try this on the server the server execute the script using cgi-fcgi. How can I force CLI?
but don't say anything bad about C ... or I'll cut your face ... because I am a C programmer ... I have a deep and abiding knowledge of void pointers, and triple indirection ...
@Leigh you've got to think of it like this, s/hardcode/resolve at deploy time/. Generating a config file when the deployment happens, with the directory that the app is being installed into, is definitely the sane approach compared to either hard-coding in config files, or trying to do magic.gif to resolve it dynamically.
fyi - this is how the root dir is found in my apps, and from that the fpm/nginx conf files are generated 'blog_root_directory' => dirname(DIR), - so there's no need for external deploy info. (for that bit at least).
The answer is no, it does not run finally blocks, I was just testing with a foreach constructs and generators are automatically disposable and run finally blocks @NikiC @bwoebi
github.com/icicleio/http/blob/v0.3.x/src/Server/Internal/… … is yielding a Generator (writeResponse returns a Generator) which isn't being finished due to connection aborting and then when doing cleanup, the Generator never had been resolved and so this yield also never will be…
@PaulCrovella traits are really useful development tool - whenever you find a reason to use a trait, it is a clear indication, that you have fucked up something in your architecture