> Beauty is in the eye of the beholder, which is a pity because this week the National Association of Beholders wrote to tell me that I've got a face like a rucksack full of dented bells.
an easy answer is, the constructor should ask for the actual objects the class needs, so if the constructor does stuff like unwrapping, grabbing inner stuff, chances are that it's wrong
but that's clearly a too easy rule that doesn't work in the real world :P
i actually spend a lot of time thinking about these things
I have like a navigation menu on my website and this menu is the same on different pages, how can I reference this block of html elments (I'm using bootstrap also) to use it in different pages? because I don't want to repeat the same entire code multiple times
I searched a lot on stackoverflow and google but can't find a solution
The php include 'nav.php' will take whatever is written inside the nav.php and place it at the same place where this line is written it does not matter whether it is inside col-md-4 or col-md-12
Are you extending or doing something different at the class definition part at the top?
Try passing in the security context as a service (you shouldn't be using a "base controller anyway") - as in, Dependency inject it. That'll always give you the correct one
i tried both ``` class ManageSignupController extends FOSRestController class ManageSignupController extends Symfony\Bundle\FrameworkBundle\Controller\Controller```
It appears that the MAKEFLAGS environment variable can pass flags that are part of every make run (at least for GNU make). I haven't had much luck with this myself, but it might be possible to use -l rather than -j to automatically run as many jobs as are appropriate for the number of cores you ...
hrmm, have I missed something obvious? /home/james/workspace/php-src/ext/spl/php_spl.c:749: undefined reference to php_mt_rand'` (lots of this) trying to compile php 7.1.0RC1 branch
@Danack yeah, tried that; if it helps for context: ./configure --prefix=/home/james/workspace/php-src-build --enable-debug --enable-maintainer-zts --without-pear is my configure params
@Asgrim try adding some stuff to debug it - like in php_mt_rand.h, just before the line PHPAPI uint32_t php_mt_rand(void); put something like #error Well it got here
btw, before i start bashing my head against a brick wall probably for a few weeks, i'm assuming no-one has attempted to create a patch for the Generics RFC yet? I'm interested in having a go at it, but I may fail miserably... but if someone else was already working on it, naturally there's not much point (aside from being a learning exercise for me)
People have looked....it's "a little bit" difficult. If you are serious about wanting to attempt it, you could have a chat with @JoeWatkins about the hurdles he found when trying to implement it.
If you're looking for something far more manageable - I was thinking of doing this next: markmail.org/message/…
I'm trying to reference this code: jsfiddle.net/zpggwxz3 (menu.html) in multiple pages, so I used "w3-include-html" like this: jsfiddle.net/uoj9bhkg . I want to maintain bootstrap design in dividing the page into 3 "col-md-4" like this: imgur.com/a/VagIW
but unfortunately this design doesn't remain the same after the reference: imgur.com/a/Eyyux
more than once, I don't have any of that work left unless there happens to be a generics branch on my fork, but I doubt it ... this is a thing we keep discussing ...
the work I had done was easy every time whatever, making the parser do what is required and whatever is not so tricky, it's the details of the implementation that are difficult to model ...
@JoeWatkins okay; Well I'll see if I can do this patch for \Throwable @Danack suggested first to dip my toes in a little first, then see if I can make it work & discover all the issues :)
I wish I could give you specific problems ... my memory doesn't work like that, it could have been a year ago ... I just remember it being a real shit when we got into how it was actually going to work ...
@Asgrim we're all here to help whatever, and we will :)
is there any way to skip the doctrine cache for a one off lookup?
for some reason i save a entity with a bunch of related children but when i call getChildren it returns null, if i re fetch it from the db it works fine though, but on the next save call it says A new entity was found through the relationship
@Petah I doubt that's cache, that's the EM's managed entities; you can either add the new children to the parent (probably the better solution) or clear the EM
@Petah are you operating on the same reference after you cleared the EM? the clear solution isn't ideal, as you have to re-fetch the entity (&relationships)
it's better to just populate the child relationships when adding them ;)
hrmm, my breakpoint in gdb isn't working; done: gdb --args make test TESTS=Zend/tests/exception_suppressed.phpt then b Zend/zend_exceptions.c:762 but when I r it just runs all the way through (trying to debug a segfault, yay)
@JoeWatkins Well, this is less a technical issue, but rather a language problem… I doubt I or Nikita are one of the only sources to listen to here ;o)
@Danack wait … what exactly is a suppressed exception?
yep, the backtrace of the previous exception (i.e. the one happening in the catch block) will anyway point to where it happened then
@Danack I feel to demonstrate utility of this feature you need to engineer an overly complex and artificial code example, not reflecting needs in real code…
@nikita2206 What I means is that you use "suppressed" for an exception that occurs at a later point in time, while you use "previous" for one which occurred earlier
@NikiC Use previous for when you've caught an exception, and are just converting it's type before rethrowing. Use suppressed for when multiple individual exceptional things have occurred.
@bwoebi there are reasons to use it....and yes, some pieces of code are inherently complex. If the RFC fails, then it could also be done as a FIG thing:
namespace Psr\Exception;
interface Suppressed {
public function getSuppressed();
}
And then in the app runner:
...
try {
// run application
}
catch (\Throwable $t) {
if (class_implements('Suppressed') === true) {
$suppressedExeptions = $t->getSuppressed();
//blah blah
}
//Normal fatal exception handling.
}
@NikiC however people wanted to have them represented? But for something where the network is being flaky:
FileUpload exeption "Could not upload foo.jpg", suppressed DNSException "Could not resolve s3.amazon.com", suppressed ConnectionTimeoutException "Could not connect to s3.amazon.com", suppressed TransferTimeoutException "Transferring data took too long"
The upload was attempted 3 times...each time a different exception occurred....rather than it being the same previous all three times.