« first day (1832 days earlier)      last day (3110 days later) » 

12:15 AM
@rdlowrey added tests as requested :-) … Shall I merge into master now? github.com/amphp/aerys/compare/body_parsing
 
I don't think I can do my if else statement inside my echo
 
1:13 AM
Has anyone clicked the 'important message' ?
 
yes xD
(not the link inside, ofc)
 
I got it
 
@Danack hmm??
 
Someone on internals has virus/worm on their computer apparently.
 
greetings room, long time no see :)
 
1:22 AM
ah, landed in junk
@Ja͢ck Hey :> … Yesterday Igor, today you… who comes back tomorrow?
 
Hey @Ja͢ck, you been off living life?
 
hehe yeah
 
@Danack that was sent to all lists, even announce where I think it hit by moderation, but else it landed in my junk box too
 
i've changed jobs, moved into another startup after 10 years heh
 
@Danack hmh, that's just trivial spam …
A meta redirect to avazunic dot com, which is redirecting forward to normal spam… I think it's safe to click ^^
 
1:32 AM
why does include still exist
what possible use case could there be
 
if (file_exists($file)) {
    require $file; // fatals out when file is removed in between
}
 
@bwoebi but include produces a warning
you could silence with @ I guess
 
precisely ;-D
 
I wonder why 'real' still exists in PHP
 
nobody removed it?
 
@KalleSommerNielsen I mean, I guess the reason is just that nobody removed it
we also have (double)
or (int) and (integer) etc.
 
I should write an RFC to get rid of the aliases in 8
 
completely redundant and not helpful at all, possibly just confusing people trying to use return types.
 
or maybe not, they're harmless mostly
we also have the is_ aliases
 
@Andrea then please take care of real too =P
@bwoebi @Andrea does ext/hash build for you in master?
 
1:45 AM
@KalleSommerNielsen what's the issue?
 
ahh, MSVC is the problem as usual
no top declaration in hash_sha3.c
oh well fixed
 
@KalleSommerNielsen why is this thing so strict about it?
 
@bwoebi think its because msvc only support a subset of c99
 
@KalleSommerNielsen what version are we compiling against today?
 
@bwoebi 7.0+ is VC14, 5.6+5.5 is VC11 and 5.4 is VC9
 
1:55 AM
I thought vc14 to be less restricted about these things… mhhhh.
 
Hmm, I think VC14 focused more on C++11/14/17, not so much about C99. I remember complaining about it more than once before
 
hmmm :s
 
We also still have the b'' constant string prefix and (binary) typecast from 5.2 as a prepration for php6 in the code today =/
 
aww, yea
 
2:12 AM
sql.safe_mode anyone? So many old goodies
Which only interbase sort of respects
 
@KalleSommerNielsen sql has a separate safe_mode? TIL…
 
@bwoebi php.net/manual/en/ini.core.php#ini.sql.safe-mode you will never be suprised when digging into PHP
 
Hello
everyone
what are the chances that someone here familiar with WooCommerce?
 
everyone is asleep?
 
 
1 hour later…
3:41 AM
morning
 
4:14 AM
good morning : )
 
good morning
 
@SammyK sorry for not merging anything on D2 yet - busy with the talk stuff
 
hi all,morning..
 
morning
 
i hv some question here
$page = file_get_contents('http://121.121.15.38/');


preg_match('#<tr><td><input value=.></td></tr>#', $page, $lala);

print_r($lala);
the output come out with empty array
i noticed maybe my preg_match not right.
anyone can help?
 
4:25 AM
are you sure you are getting anything in $page as well
 
i hv go thru php.net/manual/en/function.preg-match.php but still not found answer
 
maybe you should start by stating what it is you want to accomplish
 
@Orangepill i need to pull out value from that page
 
first off are you sure you are getting anything in $page after the file_get_contents call
Secondly you probably mean something more liek like preg_match('#<tr><td><input value=(.+?)></td></tr>#', $page, $lala);
and thirdly you probably don't want to use regular expressions to do this... you probably want to use DomDocument with an xpath expression instead.
 
yes,i can get the page after file_get_contents call
ok, will try take a look on dom document.thanks for the suggestion @Orangepill
 
4:37 AM
it will be more complex but a lot less fragile
 
morning
just read some book on veganism. any vegan phprogrammer 'round here?
(how do you manage to not eat meat? is my question. Morally and environmentally veganism is pretty much the only viable option for humanity on the long term, but I just can't stop eating meat (yet))
 
5:23 AM
@Orangepill Good morning
 
good morning
 
Quick question for you. for nikic/FastRoute
How can I set route from two different place/file?
For main app route from main route.php and other routes from modules/route.php ?
@Orangepill with static class it's really easy store in class variable but with normal class not sure.
 
You can either collect up all of the routes from the modules in the route collector or you can abandon fast route in favor of a more hierarchical routing library.
 
Is there anyways I can declare normal class variable and access from anywhere?
like with any files after that request?
 
5:40 AM
give an example...
you want something to persist between requests?
 
All this secnario work with static class
Example: I have class `Route()`
From Main application I set route and it's work with static methods of class
Route::get('/', 'HomeController@index');
Route::get('/test', 'HomeController@index');
Route::get('/data', 'HomeController@index');

and I can access class this class from everywhere it's autloaded from begining.
Also I can call from my modules for new routes.

Now I read couple of articles and it says that don't use static class it's not good prectice for test code and many mroe things.
 
php.net is down
oh. www.php.net to be specific. Is this a deadlink?
 
i might as well go home now, can't work without an online manual =o
 
6:00 AM
@andho no repro
 
Hi, can some one please help in parsing an array ..
 
why don't you parse your own arrays?
 
hmmm. comes to mind json_decode and unserialize @user4943236. what do you mean?
(nice hat @Ja͢ck)
 
:)
 
@FélixGagnon-Grenier seems only if https. I followed link from google. php.net
 
6:07 AM
from where I click from, php.net is just an untrusted connection
as sites which do not have https protocols seem to throw (citation/source needed)
please remove that ^^
someone
 
God damn it, why is it that the "fraud / revenge down vote" system always only reverts 6 of my rep all the time despite me loosing more.
 
because of the passing by downvote
 
I'm 80% sure that it's the same down voter
they are too tightly clustered within 1 min.
both times :(
It's only 10-12 rep both of the times, but each time it's put me at 999 rep points
meaning I lose the 1k priveleges. god damn it
 
999 is harsh
i feel you
 
It's almost as if some one doesn't want me above 1k :P
 
6:16 AM
yeah. he's called murphy
 
I don't like murphy, or his law.
 
:p
in any event, I think I just got to the point where I can go sleep in peace, with a bellyfull of beer. have great nights
 
Nights? but it's morning D; either well, sleep well.
 
6:32 AM
posted on October 22, 2015 by nlecointre

/* by Frankie */

 
morning
 
6:51 AM
moin
 
Morn Joe
 
Anyone had experience with Laravel?
 
Abe
7:19 AM
o/
 
\o/
 
<(^_^<) ^(^_^)^ (>^_^)> v(^_^)V ^(^_^)^
 
Abe
7:39 AM
there is no god for a programmer
 
yeah programmer's themselves are god :P
 
Wouldn't it create a paradox for a atheist to be a programmer then?
Or is it just a case of really low self-esteem?
 
which framework do you use
 
@Epodax paradox sounds good :D
@ZYWJ currently none
 
@Epodax yeah correct i take my words back :)
 
7:49 AM
im going to hate php, c#, java and my life >.>
 
hatting C# is ok but why php,java and life??
 
Almost friday!
 
morning
 
im trying to rewrite a pice of code from java in php and/or c#
but im failing this is why i hate everything :D
 
8:07 AM
@AnmolRaghuvanshiVersion1.0 Correct? How? ^^ it was a question, not a statement.
 
8:17 AM
 
morning :)
 
@marcio I burned through some easy answers to get reputation, and I am finally here
I do have to make some curmudgeon comment about IRC being good enough, don't trust the blasted 3rd party services.
@NikiC thanks for the code review! I think I addressed hopefully everything, I need to call it a night but wanted to give a thank to everyone that help. @bwoebi and @marcio have been super helpful as well, thank you!
 
Mornin'!
 
8:36 AM
posted on October 22, 2015 by nlecointre

/* by MonsieurLeMarquis */

 
Mogguh
 
@SeanDuBois oh, are you the sean of constant visibility? :)
 
@SammyK Good to know my current approach isn't full retard :P
@SeanDuBois Welcome :)
 
Abe
welcome @SeanDuBois
similar_text("php", "room11", $p); echo $p; // 93.714286804199
 
9:17 AM
@Ja͢ck "visibility" is the same with "perspective" in this context?
 
if that's how you want to look at it.
 
ok :-)
 
I really thought it was Tuesday yesterday ):
The good news, however, is that it's almost Friday
 
9:33 AM
3v4l.org/K1M7G what's with "33" at the end of the message?
 
@iroegbu **<blink>S</blink>**printf...
Fuck you too markdown
 
oh! Thanks
 
np
 
> Returns the length of the outputted string.
^^ missed that bit in the manual
 
9:49 AM
morning
 
Yo @NullPoiиteя
 
hola, how you doing?
 
@NullPoiиteя Busy === good
 
nice!
 
@PeeHaa What do you CV them under? Too broad? Off topic because..?
 
9:55 AM
too broad
 
i really liked previous close reason tl and tb. Now close dialog box itself tb
 
@Lars these are just crappy people who use thing make money from it and keep blaming to others, do nothing
 
@Abe :-) I see tnx (however last one was a bit +18 ;-) )
 
Abe
10:09 AM
this is why i wrote NSFW (not safe for work)
 
ow :-) !!
I have some duplicate code between all methods of class, so can I write them (just one for time) in the __construct() ?
 
10:24 AM
@Sajad Your constructor is only to create the object in it's valid state. If you have code used through multiple methods, put it into a protected method and just call that method multiple times in your other methods
 
@Jimbo eem, seems reasonable ..! I will think about it, thanks
@Jimbo something else: can I write PDO database connection in the __construct() ? because I need to database in all methods
 
@Sajad arent you 18+ ?
 
I'm 22 years old. But I'm muslim and it is like I'm always under 18 years for seeing some kind of those photos ;-)
 
muhahaha what does religion has to do with this
 
Anonymous
ugghghghg, .io domain is $32
 
10:31 AM
@NullPoiиteя "Lust" hurts my religion!
 
Anonymous
yay, $1.88 for .pw
 
@samayo .io stands what is it? (shorten)
 
@Sajad Yep. If you do that, you're saying that "my object needs a \PDO to exist in a valid state
 
@samayo namecheap?
 
Anonymous
10:33 AM
yes
 
@Jimbo I got it
 
you should pass a valid PDO object to your constructor, not create it there
public function __construct(\PDO $dbh) {$this->dbh = $dbh; //other things }
 
@iroegbu and @Jimbo this is correct? gist.github.com/anonymous/1392df456339de836456
 
How deep down the rabbit hole do you need to go for dependency injection? Eventually you'll hit a point where you need to create the object in order to pass it on. For example, at what point to you establish a PDO object in order to pass it on?
 
@Sean Right back to the beginning, in your composition root.
If you do it manually, you'll need to define your object graph (the objects and every dependency) in your composition root
If you do it automatically, your concrete objects are read via introspection (ie. Auryn library) and injected for you
 
10:43 AM
@Sajad no... what if you want to use that connection in 10 other classes, you'll write that snippet 10 times.
Then in future if you need to change the database name or something, you have 10+ places to change it in
 
@iroegbu you are right, you have any solution ? (protected class?)
 
10:57 AM
hello, anyone got the problem while compiling the PHP7 RC5? My vagrant complains about cURL
looks like some curl headers are missing
 
@Sajad gist.github.com/Stricted/02990b5e719e2f88208d thats how i do it on some projects
 
@Sajad Please ignore that code above ^
 
R.P
Quick question: how should I solve a case when making class called "UserEntityUpdater" for entity (let's say "UserEntity"). UserEntityUpdate would need to use UserEntity setters/getters and would have 5 main functions (which gets data from 5 different system).
In case UserEntityUpdater does not extend UserEntity, then each of these functions would need reference of UserEntity object as input parameter, because function 4 does depend on result of function 1.
While not extending, getting values would be like: "$this->getUser()->getName()", where getUser is object that is stored as UserEntityUpdater's property.
If I choose to extend, then I could use $this->getName(), which would make code cleaner, but it this practise doesn't actually share Entities logic - thus not a good practise. Any ideas/suggestions?
Also there is possibility of declaring $user before functions calling and give $user as reference input parameter and getting values in functions like $user->getName(). I believe this looks silly as input same input parameter is used for all 5 functions.
 
11:21 AM
@R.P Have you considered calling $user->changeName($name);, then passing that user to $userRepository->update($user); which figures out the changes internally?
 
R.P
11:39 AM
Thanks for the question @Jimbo , I now realized how bad the description is. Actually UserEntityUpdater's point won't only be updating the entity itself, but also perform insert/delete for other tables that are "connected" to UserEntity. For example there is no data change done in function 2, but getters are used for if conditions.
Example (very raw) pastebin.com/svtkDjQd
 
morning
 
Abe
11:55 AM
@R.P "function1()" won't help us understand what your code is supposed to do
 
guys how can i create file from each attachemtns in .eml file with its own name in temp dicretory?
 
R.P
Well, in short it updates entity and afterwards adds changes to database. Thus creating/updating User row.
 
with curl and php
 
R.P
other functions barely set values for UserEntity on certain conditions (like update time or something)
 
Abe
so performPostLoginActions groups 3 transactions in one, for instance?
 
R.P
11:59 AM
well, yea they are in same database transaction if that is what You mean.
 
@Stricted thanks :-)
@Jimbo ok!
How can I have a main class (protected - parent) and several classes (extended - children) in the separated scripts ? (should I use autoloader?)
 
Abe
@R.P ok got it. you shouldn't inject the objects but fetch them within those methods... for instance pastebin.com/Ckx9tgKj
aggregate means it's not just a single object but the whole collection of objects required to perform changes in a consistent way
 
What is the best way now a days to use OOP in PHP?
 
Start by learning OOP
Then use it.
 
Any article will help
My question is related to OOP pattern. Factory or simple approach?
 
ThW
12:14 PM
@SalmanShahid Dependency Injection
 
@SalmanShahid it's not that simple. You cannot learn OOP by reading one article. Hell, you cannot learn OOP by reading 10 articles and a book.
take for example this question of yours: while you are using OOP-related tools(classes, methods), that code is 100% procedural
 
Abe
`catch(PDOException $e){ throw new Exception("Error In INSERT STATMENT: " . $e->getMessage()); }`
there is nothing that beginners can understand less than exceptions :)
doing this is not helping you in any way. you are telling to the consumer that the error is generic, rather than specifying that it's about a database problem
 
c9s
having one question about the zend op_array
the refcount defined in op_array uses uint32 pointer instead of just uint32
why? isn't uint32 faster than using a pointer of uint32?
 
12:30 PM
I actually suspect that this whole mess is a result of the remote execution vuln in flash
 
class Child extends Father {}, should I include() the Father class? (Child and Father are in the two separated script)
how Father and Child find each other?
 
You're saying that Child is-a Father. If you want has-a relationship, use composition instead of inheritance. class Father { public function __construct(Child $child) { $this->child = $child; } }
 
Abe
class Incest{}
 
c9s
@Sajad use either SPL class loader
or simply require the class
 
Abe
@Sajad usually happens in a hospital when the Mother gives birth to the Child, unless the Father is a debauched asshole
 
12:35 PM
@Jimbo when you send me a code, I understand I don't know nothing !!!
@Abe :)
@c9s tnx
@Jimbo here is my current structure ..! how implement better ...!!!!
all arrays are exactly identical in all classes
 
Why use style in the PHP rather than a class?
And even then. HTML in PHP.
 
because some of my html codes are dynamic.
 
@Abe This is the future now. PHP 7 should allow Child {} to become it's own Grandfather {}
 
R.P
@Abe is UserAggregateRepository supposed to be one that makes queries to database?
 
12:51 PM
@Abe The best/worst question on SO: stackoverflow.com/questions/6163683/…
4
 
Abe
@R.P not really, the repository collects objects that fetched from the data mapper(s) (which contain the SQL), and offers functions for (or directs) their persistence
@Danack hahaha
 
1:26 PM
@tereško Well i'm not asking about to teach me OOP. My question is simple which is what should i learn it's not that teach me with one article.
 
Gotta be careful using Google Images lol twitter.com/kalpenn/status/656807127755943937
 
Abe
@Machavity ahahhahahaha
 
I will start learning and already have good concepts what we read in books old days OOP i was just asking about advance level Object oriented
 
@SalmanShahid try going through the linked materials: stackoverflow.com/a/16356866/727208 (except the 4 books)
 
@tereško That's more like it :)
You got me or i got you? :)
 
1:31 PM
@SalmanShahid you probably could also benefit from stackoverflow.com/a/20135990/727208 and stackoverflow.com/a/11369679/727208
you probably should ask PeeHaa and ircmaxell to link some of their content
 
@tereško I'd say the most relevant of his stuff is blog.ircmaxell.com/2014/11/…
 
@Machavity for what?
 
@tereško if I could make every beginner looking for coding advice read that I would
 
@Machavity his question is about learning OOP and actually completely unrelated to MVC
 
@PeeHaa Yo, I'm invading your country starting tomorrow :D
 
Anonymous
1:42 PM
Is there anything wrong with placing All interfaces or Exceptions in one place. Not just in one folder, they can also mirror the application.
 
Anonymous
I hate it when interfaces and exceptions clutter the application.
 
@tereško Ah. Still a worthwhile read
 
@samayo Yes. You're not separating your code up into 'parts', or modules, they're just 'there'
Show's theres no domain knowledge there
 
@samayo Makes it very difficult to use autoload
 
Anonymous
@Machavity not necessarily, you can always use use PlaceWhereInterfacesAre\Http\RequestInterface`
 
1:45 PM
@samayo I am not sure we have the same definition of "clutter"
also, if you insist on using suffixes, be consistent
namespace ApplicationNamespace\HttpNamespace;
class RequestClass implements AcceptableInterface {
    public initFunction () {
        if ($this->pageVariable) {
            thrown new SomeException;
        }
    }
}
 
Anonymous
It does clutter the application though. It makes it hard to work with files, since all the redundant files are mixed with the application.
 
@Naruto Where ya going?
 
@PeeHaa centerparks kempervennen ^^
 
Abe
how bad is for performances instantiating an exception that not necessarily i'm going to throw?
 
@Abe Performance? Probably about as much as calling a function (meaning hardly any at all). But the better question is why would you do that?
 
1:55 PM
anyway, @samayo, my first point is RequestInterface is a really bad class name
 
Abe
@Machavity doing nasty things, i guess :B
 
also, you should make you code made from independent (to a reasonable extent) "packages", that are self-contained
 
Anonymous
hm..
 
Anonymous
 
hello, is it possible to make a html </br> when a string is longet than x chars?
 
Anonymous
2:05 PM
@sguetsch what?
 
Good morning
 
@sguetsch you can add a zero width breaking space every x characters.
 
@marcio @samayo now it's the complete backend: github.com/kelunik/chat-main
 
There's built-in function to do that, that I can never remember then name of.
 
2:07 PM
@kelunik thx, that's what i was looking for
 
Anonymous
@kelunik nice. The Login is only via Github right? If, so I might add something to it.
 
GitHub and StackExchange, but I think I have to add a sample config first.
 
@sguetsch $string = chunk_split($string, 10, "\xE2\x80\x8B");
The word wrap one does weird stuff to spaces apparently.
 
posted on October 22, 2015 by nlecointre

/* by dmaidana */

 
2:37 PM
hey guys. Did anyone work with Zend\Barcode of ZF1?
 
@GNi33 a little
 
ZF1??? wow, that's old
 
good morning
 
I'm getting a "contains invalid characters" exception when using it with code39
but the input string looks fine
 
What is the input string
 
2:39 PM
oh wait, don't mind me
sorry :D I just realised that I can only use uppercase letters, sorry for bothering you
 
wordwrap($value, 100, '</br>')
adds a html break every 100 characters
and i want that it breaks near the 100th char after a comma. any ideas?
 
Abe
@LeviMorrison type declaration makes me think of "class Foo{}" :P would use "parameter/argument type" or "type check"
80 files changed (sorry)
 
Bit of progress from yesterday. I have a nice factory taking in API data and popping out a nice api response object (one of a few different kinds). Is there a better way to then not just have a bunch of switch cases or if else statements to perform actions based on the type of response?
 
2:53 PM
@tereško thanks for that reference ...
Is there any difference (performance perspective) between writing HTML codes in the page (as static) and printing them by PHP ?
 
@Sean Where are your if/else statements / switches?
 
I guess I could make each response class type have some sort of process() method
 
@Sean see also Strategy Pattern
 
^^
Strategy = abstract out logic into another object, then you can switch logic implementations
I use it all the time, common use case
 
@Sean that's more or less it
 
2:57 PM
I've seen switches in factory though, nothing terrible about that
 
my concern is that it then makes the class have more than one job.. sortof.
If it's only meant to effectively hold the data from the api response, would giving it a `process`-esque method give it more responsibility than it should have?
 
A factory can do whatever it needs to, retrieving the data from wherever it needs to, to build what it's supposed to
It can use a DiC, configuration stuff, a repository...
 

« first day (1832 days earlier)      last day (3110 days later) »