these are view objects @bwoebi. but a single instance of the controller would use many of them, in a loop, to produce a single output. I guess I'll need to inject a factory
foreach ($this->getActiveIds() as $id) {
$output.= $this->renderer->render('template',new viewObject($id));
}
vs
foreach ($this->getActiveIds() as $id) {
$output.= $this->renderer->render('template',$this->viewObjectFactory->create($id));
}
oh, now I understand @bwoebi. What is the problem with naked new()s. Well, not hiding dependencies is the general problem I've lately associated with them
well... why not? should I rather use output buffering and return the output at the end of the function @Abe?
my current understanding and usage of a view is a data structure passed to a template. if that holds, you mean the view would actually know of the model, and ask things like getPersonsByIds() ?
@forX just document above the constant that it's part of the private API and shouldn't be relied on to not change value. And then point and laugh at anyone who complain about it changing, as they ignored the documentation.
hrmmm... do I really have to answer? @Abe :p the app is a huge procedural code base which I try to refactor while not throwing everything away. So the front controller is in fact a long index, with a lot of switch cases, calling different objects. Mixed with that are routes calling specific controllers. So... no real front controller, I'd say.
@NikiC i have a huge mysql db with work stuff on it i don't really trust running in a vm considering my lack of linux knowledge... do you think it would be easy to configure the vm to use the mysql that runs in the host os?
@Abe Yes......it's not that it's better, it's that it's automated, you can share VMs with other people easily (so they can share your exact config), and it makes the provisioning be a lot easier, rather than having to fiddle with each of those things.
@Abe And anyway, MySQL should 'just work', or at least it did for me. Just inside the VM connect to the host machines IP (which is probably 10.0.2.2) on the MySQL port, and it should just connect to the MySQL instance running on the host.
I don't have much experience, but Centos if you want stuff to work, maybe Fedora if you want stuff to mostly work, but have more up to date stuff, or Unbuntu if you want to be fixing stuff constantly....
i think i would prefer starting to learn with the simplest distro possible... because my ocd will force me to understand everything bundled and running in the os. and the fewer the better... :P
server distros afaik are tiny, but there are differences, no? i imagine like ubuntu having a larger bundle...
so, I've got this .txt file, which contains json, but it has about 50k lines (fyi, its items_csgo file in the game CSGO) and the thing is, I can read the file but to be able to read it as json hierarchy, I have to create a class to deserialize it to?
moving on, is there a formal name for classes, namespaces, constants, etc? like "\A\B\C" not strictly being a class but either a ns, class, function, constant...?
@FélixGagnon-Grenier @Danack still here? I'm working on laravel, I've placed the json_decode($file) and it shows blank (also tried json_last_error() and its blank). with file_get_contents I can see the content of the file but can't organize it with json_decode
@abr This is a great opportunity to either use a debugger, or look in the log files to examine the exact error, rather than trying to guess the problem.
@Ocramius that json stuff you were doing; isn't there already a package out there that replaces json_decode with one that doesn't fail silently already?
'just' - I really don't like that word........yes it's not difficult to do, but it would still be better to use a library that had been tested, rather than to just re-inimplement everything....
@DaveyShafik Would it be terrible if I asked you to do the copy_handle move in a separate diff (one not needing an RFC vote) so that your patch to add push support is more readable?
php.net denizens - can anybody tell me who I need to contact to get help trying to create an account on wiki.php.net so that I can create an RFC there? I've tried registering via wiki.php.net/rfc?do=register but consistently get a "That wasn't the answer we were expecting"
@MarkBaker I think choose "doc group" and then explain who you are, and that you also need wiki privileges. Though it may be easier to get an account first, and then add wiki karma.
@ircmaxell there's two options, CURLMOPT_PUSHFUNCTION, and CURLMOPT_PUSHDATA, the latter is a pointer that is passed in as the last argument to the CURLMOPT_PUSHFUNCTION callback
Does anyone else use the latest EAP of PhpStorm? Is this a stupid update or did I just configure a weird color that's now used instead of another color class for parameters?
@kelunik It is frequent that the PhpStorm's EAPs have parsing/highlighting glitches and bugs. Since I've understood that, I stay on the latest stable version.
@DaveRandom @I'm sure my house is haunted - every time I look in the mirror, there's this gaunt, haggard old man looking back at me, blocking my view of myself
@kelunik Well I suppose that these bugs are quite unpredictable. But I'm surprized that you say that usually you don't have problems. For example, when I tried the 9.5 EAP, the IDE was so broken (including static code analysis) that I had to downgrade.
@Florian Don't tempt me, but she's sitting quietly at the moment playing computer games and watching vet programs on TV (with the cats lounging over her) leaving me free to work on my RFC
@DaveyShafik Yes, as Niki and I said at the time. That's an implementation detail that PHP doesn't need to know about. If there's any side data to capture, then the closure itself can do so.