« first day (3334 days earlier)      last day (1839 days later) » 

00:11
guys please what is the smtp password and username when using php mailer. is it constant ? if not please how do i get it
 
2 hours later…
01:44
@NobMusic it is constantly yours of the smtp server you tell phpmailer to use.
if the smtp thinks oauth is at the brink, I must admit, I have no clue (my Phpmailer knowledge is a bit outdated)
02:17
If my class extends another, and in child I have a constructor, when I call the parent::__construct it wants me to pass in the args that the parent uses, but is there any way to have parent call things that the child uses without the child having to pass them in? This seems annoying in a world of autowiring and DI
02:40
@James can you give an example? I'm trying to visualize how this would look, but I'm drawing a blank on "have parent call things that the child uses"
The parent is a Symfony base class that is only used in a small section of 5 controllers. It would be handy to have the base controller set up a few dependencies and a method that the 5 children could re-use. I know this is generally frowned upon, dependencies should be in the right place, but versus DRY etc? again it's a specific part of the app with just 5 isolated controllers so "could" be tidy.
so basically, parent constructor DIs a few things, one of which used by a method in parent. Children extend anyway, then they could use the things from parent, but when I do the parent::__construct() it expects me to pass them in, so both parent and child would be DI-ing the same things
I'm way past my bedtime, and I'm inexperienced, but I feel like there's a better way to do it, but I dunno how
I'm thinking through two schools of thought, one is... well at least my interpretation of polymorphism from Clean Code, but also DRY.
If you have five children that need to use a parent's methods but are having complications, are you sure you're using the right tool? (This question is poorly worded, but I'm unable to explain it better presently) Maybe a few value objects would be better suited?
Depending on the contents of the methods, I'm also wondering if maybe they're better placed in a helper function file instead? But that's iffy...
¯\_(ツ)_/¯
02:58
ATM I have each child just doing the same thing. the main thing is they call a service, do some things, catch an exception, and render if error. It's 10 lines I'm literally copy/pasting into each child controller. If I could get this in the base controller I can just check true/false, if false set flash, and in child controller its 3 lines, check bool, return render if false.
yeah as above the main functionality is already abstracted in a service each controller calls. I'm probably being overly abstracty :D
Are the children even necessary?
(out of context joke of the day)
children are controllers with routes, do various other (controlly) things too
children of the cornstructor? (sorry)
Remembering a code base that I'm working from recently, all routes are in one class
Granted, it's a code base that I'm still wrapping my head around and I don't fully understand how some things work
ah I tend to split those out. I have multiple methods per controller of course, but only relevant to a page/route. I prefer routes in their own controller. but it's all debatable :)
Yeah, it may be a matter of preference, I dunno.
I really do need to get to sleep though. Good luck. I hope that I was somewhat helpful as a rubber duck.
03:04
:) yeah thanks something might trigger soon hopefully
 
5 hours later…
08:00
existential of or relating to existence: Does climate change pose an existential threat to humanity?
08:17
Reflection detects abstract non-static class as abstract static – #78895
08:47
morning
 
1 hour later…
cmb
cmb
10:16
\o
10:33
posted on November 29, 2019

So yeah. I’m not quite feeling Black Friday / Cyber Monday this year. No idea why. Project discussion time! My new comic website template is coming along nicely. I’d like to roll it out in early 2020. I also plan on making the template available for free to any other webcomics out there. If you have complaints or suggestions for donthitsave.com (the website, not the comic), now is your

11:16
@cmb why are we so shambolic ...
do something about the way security things are managed ... I never got access to the sec repo
cmb
cmb
Well, we have to be good at something, at least. ;)
I also don't have access to sec repo (or mailing list), but I have access to sec bugs.
Snaps problem? – #78896
so do I, but my comms with anything to do with php is pretty fucked, having had to add so many different filters for so many different problems, I'm not even sure I get all relevant mail in any inbox ...
we should be able to access the sec repo
cmb
cmb
Would probably have to ask on sec mailing list.
it shouldn't be down to one person, I've never felt like I've been equipped to do this part of the job properly, whether sec fixes are merged (correctly, with news and so on) is literally down to one person, and we are sometimes made aware of some of it ...
cmb
cmb
11:19
OTOH, I don't think these patches have already been committed to sec repo.
that you (and I) don't know is utterly ridiculous
cmb
cmb
well, next GA releases are more than 2 weeks away
at bottom, as release managers, we should have access to our branches all the time, and the branch in the sec repo is actually the branch as it will be released, it makes no sense to hide it from rms, none at all
I don't have an idea to solve it mind you, it's a problem whatever ...
cmb
cmb
I agree that it makes no sense that RMs have no access to sec repo. I'll request that to be changed on sec ML right away.
@James best solution is to never use __constructors.... and only 'named static function method.'
11:32
ReflectionMethod::getClosure declaration changed silently in 7.4 – #78897
12:11
anybody know if this is expected in 7.4? call_user_func(['parent' lands in __call instead of protected method
12:26
@Danack just to clarify, because I'm curious as well, it should look something like this? gist.github.com/tiffany-taylor/550fcc6c653bbc9111d9f17c12eed410 I have this feeling that I'm doing something wrong in here, but it's not apparent to me...
12:43
@Tiffany Needs to be static
And don't give it the same name as the class
And don't uppercase the classname
Use the parent keyword
Also I don't really agree with the statement made by james
@Sjon looks like a bug to me
I don't see how it relates to autowring
@bwoebi okay - I'll report it
@Sjon especially as it's clearly still dispatching to the parent method - and thus the fake scope handling seems to be simply missing there
the back of my cereal box came with actual reality goggles
so of course I had to put them together
12:48
Good fps and resolution? :P
is there any way with which I can convert below arrays 0th element-
$list = array(
0 => array(
'name' => 'id',
'value' => '9d20b80c-7c3b-12fb-4c26-5de0e5b9c26f, 000008dc-c205-4c9e-8b12-1ebcf956addb, 00000903-be07-44fa-8ebf-448bb77f6219'
),
1 => array(
'name' => 'is_read',
'value' => '0'
)
);
Into
$list = array(
0 => array(
'name' => 'id',
'value' => '9d20b80c-7c3b-12fb-4c26-5de0e5b9c26f'
),
1=> array(
'name' => 'id',
'value' => '000008dc-c205-4c9e-8b12-1ebcf956addb'
),
2 => array(
'name' => 'id',
I need an xacto knife to cut these last two bits... I need to cut slots and they're ridiculously tiny for my scissors
@James How is autowiring related here?
Also how is DI related there?
12:56
@Tiffany At least in part I was being glib, as I dislike both inheritance and constructors..... and the problem the person was facing is similar to this one. But if you have two classes that ....have 'overlapping implementations' (i.e. use inheritance for extension) to such an extent then I would prefer: gist.github.com/Danack/dd73cc59c1e464ba8d9c0368f8bcbc26 as it makes it much easier to follow for me.
@PeeHaa good FPS/resolution on my cats giving me "WTF" looks
@PeeHaa It means you need to write more characters....such an intolerable burden.
@Sjon I tried to look, I think nikic tidied up some crap related to non-existent parent calls succeeding, and bizarre behaviour related to method exists....but can't see exactly.
@Tiffany :P
@Danack gif used in your tweet is pretty accurate
@Danack ;)
13:01
@PeeHaa And yes, I can try to carry you in some Aram.....though have you considered taking up some healthier, and more societally-beneficial activities? Like smoking meth and selling it near schools?
ahaha
@Danack would this example be useful for factories? trying to connect some dots in my head
Not really....it's just useful for simplicity. it means that when you're looking at the code for how something is created it's really obvious, and you don't need to look at multiple files/functions...
I just keep coming back to thinking that having constructors in the language are convenient, but they lead people down shitty paths, and that if we didn't have them, code would take slightly longer to write, but be easier to read (though possibly also slightly harder to maintain).
@Jeeves Why are you outputting broken markdown :-(
@Danack cheers. I've been going through commits as well but I just couldn't find anything related (except for a reverted commit)
Sep 3 at 11:08, by NikiC
Reports private methods from parent classes as "existing"
13:07
ah, that is a nice reference
@PeeHaa one of my cats has a Pavlovian reaction to me pouring cereal in a bowl, because I typically let her lick the remnants of milk from the bowl when I'm done. I poured the cereal in the bowl, but went on to put the goggles together. So she kept looking at me like ... i.imgflip.com/3i5l6r.jpg
@Danack what's your opinion on throwing exceptions in the constructor?
@Jeeves sure - just paste your error in every textfield available. Is this brute-force bug reporting?
@Tiffany xkcd.com/463/ - nsfw one imo.... I'd have to ask why you'd want that. It sounds like either bad design, or possibly a legitimate trade-off that might be have better solutions.
13:12
@Danack I'm not sure that I've done it in my own code, but I've seen it done in code that I've read, and I wasn't sure if it was good or bad
@Jeeves the expected result and actual result are the same... that means there's no problem, right? working as intended ...
@Danack hehehehhe
Blame @Ekin for getting me into lol
@Tiffany It's a trade-off mostly - gist.github.com/Danack/cd4bf499627d89cd8c03138460e82cfa those two bits of code will work the same, and most of the time people won't care about the difference. It just (imo) spreads a bit of complexity around...
13:28
@Danack I very much prefer the no exception variant as it clearly limits what input the class gets (in particular you see that it wants Bar and not something (hidden in code) from the god object)
@bwoebi after talking to some framework people, I'm getting the impression that a lot of PHP coders just don't care about the cleaness of how their app bootstraps...
@PeeHaa any luck on Jeeves 2?
Nope not really. Going to try again after my shower
Would be nice if either @Trowski or @kelunik could point out my mistake instead though :)
Worst case I will just clone their project(s) and fix it there
13:44
I'm hoping to mess about with it today
I should be able to at least start working on the booze plugin without example, I just won't be able to use it
I just create a test file when working on a plugin which calls the plugin as if it were running fromthe bot
Easier to dick around in isolation
yeah
Also I expect tests :-)
And just ping me when you need my help
14:05
@Danack tbf, this is not about bootstrap, but about generally limiting the data inputs - it doesn't matter when writing code ... only when maintaining it later on.
and a lot of people don't have to maintain code...
or well yes, they maintain some code, but they don't see why they are inefficient at maintaining it
@Danack also: one thing which is annoying about a DIC, you have to trace back to the actual definitions of the DIC (which may be implicit, somewhere in some helper file etc.)
It sometimes is reasonable, but I found it to make life often harder than needed when jumping into unknown code
straightforward explicit declaration, always, is just easiest
Does someone know how could it be possible to throw a error about `Invalid datetime format` in the sql when there's no column with date type? `*11132 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x8C\x8C\xF0\x9F...' for column `db`.`users`.`username` at row 1 in /path/data.php:33
Stack trace:
#0 /path/data.php(33): PDOStatement->execute(Array)`
14:22
10
A: Invalid datetime format: 1366 Incorrect string value

omixamI solved it, encoding to uft-8 all string columns that generated this error before insert. For example, the column that generated the error was column-name, I encoded as show bellow. Also I found other column with the same error, I used this solution, too. $data [ //key=>values ]; $myModel = n...

14:32
Well.... that is a pretty terrible answer :P
@PeeHaa I'd blame pdo or the database server for generating such a horrible error - but it seems like the correct solution, right?
If that is actually the problem the solution is the fix the encoding of the thing where the input is coming from
14:53
Also isn't the problem more liely to be at mysql side? @Sjon
As in wrong encoding there
@boss what is the char set of that column? Is it not utf8_mb4...?
I am trying to create an function that check if current/user ip is equal specific ip,
I thought something like but it is not working. any suggestions?
   public function isOfficeIp()
    {

        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        //so I will be adding specific here
        if ($ip !== '92.0.0.0') {
            return false;
        }

        return true;
    }
15:08
@luffy don't blindly trust HTTP_CLIENT_IP or HTTP_X_FORWADED_FOR, especially in a security context. Only trust them if you know you have a proxy infront of your server: blog.ircmaxell.com/2012/11/anatomy-of-attack-how-i-hacked.html
@ircmaxell thanks so from what I read only use REMOTE_ADDR?
unless you use a reverse proxy infront of your server, yes, use REMOTE_ADDR
ok thanks
@ircmaxell Without opening, is that the one where you PWND Stack Overflow? :D
15:16
@luffy REMOTE_ADDR is the correct one
But if you have a proxy in front of you, you will always see the IP of the proxy, because it is the only thing that actually calls you in practice
For this reason, most proxy tutorials will show you how to add a header such as HTTP_X_FORWARDED_FOR or some other such, to pass the actual REMOTE_ADDR through
@ircmaxell what do you think o this class? raw.githubusercontent.com/zendframework/zend-http/master/src/…
@MadaraUchiha ok thanks for explaining
what about it?
t also considers the $_SERVER properties HTTP_X_FORWARDED_FOR, HTTP_CLIENT_IP, REMOTE_ADDR but it declares a class for it to set some trusted proxies and it returns one IP address not an array. I think this is the solution that comes closest to it
15:45
@Wes huh nice, I didn't know of these! so far I've been using green cabbage, sliced in long fine parts, as pasta replacement :P
@luffy yes, it explicitly forces you to trust a proxy, which is the point I was making above :)
@FélixGagnon-Grenier I really enjoy zucchini spaghetti, not sure about PeeHaa :-P
16:23
@Ekin lol, make him :P
16:41
@JoeWatkins I've been thinking about it more. Fundamentally, I need the return value of a function even if the user's code doesn't use it. For example, getting the number of rows a PDO statement affected; that isn't something the user probably checked for, but definitely something they'd like to see in the UI when they have issues.
This is the piece that makes much of the existing code unusable, because it frees the return value without a hook in the middle that can be used before that happens (except zend_execute_ex, which we cannot use because of stack overflows).
For PHP 8, we should just make sure we get that piece right when we implement the zend_instrument API. For PHP 7, though, I'll need a plan to get that value, and at the moment the best thing I can think of is to somehow change it at compile time so that it is always "used", and then have my opcode handler free it if it isn't "really" used.
@JoeWatkins Wait... you're still working on PHP-SRC, right?
/cc @bwoebi on all of that ^
16:50
Hi, sorry for a noob question and the symfony website doesn't seem to be available from my end atm - how do I get the abc from https://example.com/abc with HTTPFoundation Request? request->getPathInfo() returns "/abc", i.e., the path but IIRC there was some way to get just abc too.
cmb
cmb
@LeviMorrison, there are some internal functions which explicitly check [USED_RET] (php-lxr.adamharvey.name/source/…), and take a different code path then.
@cmb Exactly, this is why I need everything to think that the return value is used.
@2dsharp getPathInfo seems to be the method recommended here. you can strip the forward slash from the beginning of the string. or do you mean that you want only the first part of the path, in case there are multiple?
routing systems I've workd with generally link handlers to routes starting with the slash anyway. I generally expect a path to begin with a slash.
@FélixGagnon-Grenier That's what I first thought but I thought I had some way to get it without the slash. Memory isn't serving me well, although having slashes is what I would generally expect.
I don't know why the Symfony docs aren't accessible from my end so I can't see the link atm.
16:58
Something's wrong with facebook/instagram from here too. Could be some geographic outage. :/
Does anyone know where the helper function is written in Laravel/framework? They don't seem to have a helper.php class or smth like that
@Adam stackoverflow.com/questions/34114667/… I don't know if it has been changed as of 58.
Phpstorm can easily help you find those.
@LeviMorrison so you essentially need to remove EXT_STMT_UNUSED post-compilation and insert FREE opcodes yourself?
@bwoebi Something like that, yes. At least, that's the best idea I've found yet.
@LeviMorrison but opcache will mess with you there, you'll need to remove quite some optimizations I guess
17:33
\o/ humidifier #3 works, after humidifier #2 being a dud
now I can stand to be in my living room for longer than 15 minutes
@Tiffany what cause use of humidifier? the heater
@Ghostff yes, I have central air, and it dries my sinuses like a grape into a raisin
@ircmaxell I'm curious, in the article you say to never blindly trust infrastructure. What if the developer also configures the production web server? e.g. in my former job, I maintained the application, but I also administrated the production server and IIS. The only thing I didn't manage on the server was OS updates (Windows server).
@JoeWatkins fyi, apcu tests are broken on php 7.4
001+ Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /builds/vendor/php-apcu/stretch/src-7.4-zts/tests/apc_entry_003.php:3
001- %s fatal error: Object of class stdClass could not be converted to string in %s on line %d
002+ Stack trace:
003+ #0 [internal function]: {closure}()
004+ #1 /builds/vendor/php-apcu/stretch/src-7.4-zts/tests/apc_entry_003.php(4): apcu_entry()
005+ #2 {main}
006+   thrown in /builds/vendor/php-apcu/stretch/src-7.4-zts/tests/apc_entry_003.php on line 3
ultimately because of this wiki.php.net/rfc/tostring_exceptions
(a bunch of extensions tests are broken because of that, another one is amqp)
cc @NikiC given that you're the rfc's author ;-)
18:02
mysqli_real_connect(): (HY000/1130): Host 'localhost' is not allowed to connect to this MariaDB server
everything was ok, somebody knows why this happend?
I think it may be corrupted
@OtávioBarreto has it worked in the past?
are you using a new user account and it was created to only allow specific IP addresses to connect to the database?
no, same account
root
cmb
cmb
@FlorianMargaine, ah very good catch. Unless this is fixed (or it's pretty clear that this won't cause serious issues), these exts should not be used with PHP 7.4. Note that PECL mass rebuild for Windows is scheduled for this week (likely to start tomorrow).
18:05
I'm not sure then
Thanks, I thin it may be corrupted
I will reinstall and see what happens
18:27
I am trying to understand something about REST. Do websites like twitter have two endpoints one of which render the html and the other exposing the API for the html/js to update data from the client?
@2dsharp You question is a bit confusing, but they probably have more than 100 endpoints.
19:01
your*
19:15
@Ghostff my question is: how would someone go about implement something like twitter given the fact that they render the pages on the server side with html/css/js and then the js makes requests to the api to update the pages? Since only the representation is changing from html to json, does it make sense for the rendering service on the server side to make requests to the API server the same way the client would do?
@2dsharp No, and of course they have there reasons. but generally, returning a JSON or XML seem ideal since it gives more flexibility.
 
1 hour later…
20:30
@cmb build is fine, it's the tests that all fail
well, "all"
21:27
@Tiffany then that's not blind trust ;)
@PeeHaa where do you need help?
@ircmaxell fair point
22:08
2 days ago, by PeeHaa
I am having a hard time installing several amp packages together due to versions and I found: https://github.com/amphp/websocket-client/blob/master/composer.json#L35
Hi guys, Im so sorry to be here, kinda spamming, crying for help but Im stuck in a Symfony project and I really need a little help: https://stackoverflow.com/questions/59145926/symfony-4-get-config-parameters-from-controller-within-a-custom-bundle
even if you are now going to help, I thank you for reading my message. Have a nice day
 
1 hour later…
23:31
Note 124462 seems to be an actual bug, opinions:
Undocumented change since 7.4.0 is released:

<?php
class Foo
{
private function privateMethodTest()
{

}
}

class Bar extends Foo
{

}

var_dump(method_exists(Bar::class, 'privateMethodTest'));
// PHP 7.4: bool(false)
// PHP 7.3: bool(true)

var_dump(is_callable(Bar::class, 'privateMethodTest'));
// PHP 7.3: bool(true)
// PHP 7.4: bool(true)

« first day (3334 days earlier)      last day (1839 days later) »