« first day (1384 days earlier)      last day (3790 days later) » 

12:00
@PeeHaa sorry, I thought you wanted something efficient
I opened Outlook this morning... took almost 15mins to load completely
:p
@Ocramius heh
I've got this code, that's not working in wordpress :(

<?php

register_activation_hook( __FILE__, 'wintertour_install' );
function wintertour_install() {
global $wpdb;

$wpdb->query(file_get_contents(plugins_url("CREATE_DATABASE.sql", __FILE__ )));
}
?>
I've got the Wordpress, that's not working in life
12:11
global $wpdb; ... where's the nearest suicide booth.
@DaveRandom Say, you aren't a guy that shies away from Iterators, right?
we should make global deprecated. So it will be removed just like pass by reference
I agree, but I need this to work o.O
okay, in this version - just warning that it's deprecated. In next - remove at all
good luck with that
sounds like s/lu/fu
@HamZa lol. completly forgot about that xD
hmmmmm... I'll look at it if worse comes to worse.
No, removing global is a good idea and change for next major version that for some reason is 7 instead of 6.
also, please, remove var
@HamZa ohh of course, i was so close
12:15
But that would cause that hosting providers will keep 5 forever due to wordpress.
We like it or not most of the php is wordpress.
@HamZa I'm stuck at level 12 ;\
@Leri so.. let them rot
@Leri that will break a lot of code. Also PHP NG is using WP to do some performance benchmark. Dat irony
@MoshMage 35 here
@MoshMage ah 12... E_TOO_EASY :P
Ah, I might have an idea! Create solutions for each level and spam my website with ads!
now there's a plan!
@HamZa That's the point. :D
12:18
@HamZa that'll give you $$$$ indeed.
< This guy wants to earn some money
Everybody wants that. ^
Do you ever have a Validator that an object calls $this->validator->isValid($this); with?
@Leri Need to brainstorm on some ideas
AWWWWWYEAH! I just got it :D
12:19
So you're passing an instance of yourself to be validated?
indeed. E_TOO_EASY i wasn't really looking at it until now :x
@Jimbo That doesn't look right... A visitor maybe
I wish, I finished just one app. I've released only one extension that has just 70 weekly users. :/
@Jimbo looks ugly. Why your object should contain validator of itself?
Validation separate object, DI it into object that needs to be validated
So that Object::isValid() uses the validator to check this
12:21
or validate as a separate operation
@Leri You have to start somewhere!
@PeeHaa 100eur to do that in Python is easy money!
@HamZa Yeah. /me needs to look all my alpha projects
@HamZa Yeap it even contains unit tests
12:24
@AlmaDo As in Validator::validate(Object $obj)?
@Leri I think a "webshop" but for phones as in android/ios app is not that popular. Creating such a thing dynamically might be something?
@Jimbo your validator barely has something to do with your object. Thus, composition of them like you've described is at best odd. I'm not sure I can give an advice, since all picture is unknown to me, but - seems like you have two independent entities, so they should behave independent (and interconnection between them should be done somewhere in 3-rd party)
@HamZa And what should I be selling? did not get your idea..
@AlmaDo This is the visitor pattern though right? Separating the thing that validates it from the thing that holds the data.
Now assume you want to force that validation, so that the object can't be used without it. Now see why I was DI'ing into the object to be used by calling validate($this)?
@Leri You sell the setup, or service. So, let's say a client wants a webshop. He also wants the webshop as an Android app. Since you have already developed it, you only need to add products/categories
12:27
@Jimbo so place validation into the factory? and prohibit instantiation of incorrect entity? But that's only initial state. Your state-changing mechanics should follow that as well
thus pass validator as a parameter
@HamZa So you're suggesting e-commerce solution with mobile apps. Hmm, pretty much even if I had full time.
@AlmaDo Hmmm, force instantiation through a factory that uses the validator.. then the factory would also be a little like a service.
?
like public function changeState($stateData, MyValidator $validator)
you'll pass validator to the factory as well
@Leri Then I guess there's nothing better than getting clients and do what they want
@HamZa I have few tools for windows removed duplicated files, etc.. I was planning to make one more powerful and have in-app purchases. Also few good business plans. To realize them I'd need to quit my job but I can hardly afford that. I'd be starving if I do that literally. So my current plan is to make some extra money with projects that don't require much time so I can quite my job.
12:33
@Leri you finished your studies?
No, not yet. 1 year is left.
@Leri ah no wonder. Maybe you will have more time left :)
@HamZa I hope so. And yeah, in summer I manage to do things. University is time-waster.
At least mine.
hi, any free extensions for joomla, which enables to make online test? Adding question and giving 4 options, from which a user can select one answer and submit?
@Leri @HamZa yeah, it was the same for me "time-waster".. All I had learnt was in summer.. :-)
12:43
@Code I think joomla has a repo for extensions. Quite easy to browse and search
Is joomla still that awful?
@Leri it's ok
@HamZa src contains tests...
That's enough to judge
@Leri java style :P
@HamZa Wish it was. It's just a static helper class... with bunch of statics that make your code unusable without them.
12:54
@Leri That's our framework all over
Logging, database, user details
We're using $_SERVER all over the place
user895378
morning
@rdlowrey yo
@Jimbo I heard $GLOBALS is bad so I use $_SERVER now instead to store all my user variables
Word
@rdlowrey yo. Where did we land on the composer/github CA cert thing? Not possible?
user895378
@DaveRandom totally possible and implemented locally. You won't have to do anything but use composer to install things and you'll be all set.
12:59
@HamZa I just had to do it, GAMEABOUTSQUARES.Interface.completeLvl()
@Jimbo I try to achieve architecture where my code depends on nothing and does not care about anything. However, that requires extra libs (I call bridges) that can become quite dirty. That's what I don't like
I'm sure I could also find the switchlvl ;P
user895378
This made me very happy.
@rdlowrey Oh cool, can you pastebin the code to make it work? Need it for something else
user895378
yeah one minute
13:00
ta
@MoshMage I'm @ lvl 23 no cheating xD
<-- Level 32
<-- Level 0
@Zorgatone I got stuck at 14th and I was like "WAIT A DAMN MINUTE! If I was able to hack cheat that cookie game, I gather I could also hack cheat this one" ;x
user895378
I put on my robe and wizard hat.
13:01
What game are you talking about?
It's not hard
@rdlowrey Did your code magic fail? :-/
user895378
@DaveRandom here's the unpushed local composer file that does it. Just look at the things pertaining to bagder/ca-bundle
<-- Level -1
13:02
thanks
haxxor
user895378
@bwoebi lol, no I'm referencing some old-school internet awesomeness that's been around for like 15 years. I was laughing about bloodninja when I was in college.
@rdlowrey DAMN those are old ;O
Always like to reread them :)
Ahaha :')
@phpinternals, Worldwide
I am the PHP internals mailing list. NO, I'M NOT. I AM A PARODY!
25 tweets, 8 followers, following 1 users
lollerskates
@rdlowrey dev-master plays nice without minimum-stability? I totally don't get how that element of composer works
user895378
@DaveRandom the hell if I know
@rdlowrey did the documentation myself, like an ehhh .. someone who documents heh
user895378
@Jack was it painful?
just two commits, not extremely horrific
not knowing what it looks like on the actual site is kind of a pain though
user895378
13:07
^ THAT.
user895378
Such a terrible UI experience.
though .. i think that can be easily fixed
ThW
ThW
@DaveRandom not any more, the default stability was changed to stable some months ago
i could see if simply pulling the css from the main site will just make it work
user895378
I have to still do a fair amount of docs too. There are several TLS things that didn't appear in the RFCs that I've done that no one outside room 11 knows about and aren't documented.
13:08
I love those things.
They will be our little secret ^.^
@ThW That's what I thought
eminemBNJA: damn I gotta write down your names or something <-
I'm stuck XD
And yet your composer.json works when you just do composer install @rdlowrey?
What version of composer are you using?
Okay. PHP. 6 vs 7.
user895378
13:14
@DaveRandom Yes it works. Version:
user895378
Composer version e77435cd0c984e2031d915a6b42648e7b284dd5c 2014-07-02 15:44:54
Why do people keep returning false when exceptions should be thrown? sigh github.com/joomla/joomla-framework/blob/staging/src/Joomla/DI/…
Is JavaScript ever really that readable?
@Leri well, strpos returns false when string wasn't found..
13:16
@AlmaDo strpos is not part of OO api...
user895378
@Leri I have no problem with returning false there. Exceptions aren't for relaying error information in unexceptional circumstances. If the program can continue without crashing in such an event an exception would only add complexity.
user895378
An exception may or may not be appropriate. It just depends on the circumstances.
@Leri hehe, imagine it will raise exceptions
@rdlowrey exceptions don't cause a halt if the catch is in place
@rdlowrey I strongly disagree there. I do care because it violates return type constraints. If I call method and expect it to return instance of an object I should never get anything but object (or null, if it's nullable). In that circumstance the only way for method to notify caller about the error is exception. If caller can continue without crashing it should just catch that exception.
user895378
13:19
@Grim... Right. And you now need a try/catch (complexity) to ensure you don't crash the entire PHP process. In particular this becomes problematic for libraries which may throw in unexpected places.
user895378
@Leri PHP is not Java. There's such a thing as mixed returns and IMHO it's one of the best features about the language.
@Leri The return type is documented as mixed.
I'm certainly no fan of overusing them - I wouldn't want one on strpos, for example. They have their place, like every other bit of OO code, I guess. @rdlowrey
@Leri you just provided circumstances. In your circumstances - yes, exceptions are preferable
user895378
Exceptions are inexpensive in the PHP web SAPI because the process is going to die off really soon either way.
user895378
13:21
But when you start writing programs where crashes aren't okay the usefulness of exceptions starts to get a lot muddier.
@Jack And that's what I hate. Mixed return types in OO.
Good morning
user895378
I would venture to say that the way exceptions are used in most PHP applications is downright harmful outside of the web sapi where it doesn't matter that you kill your process.
user895378
@ircmaxell morning
And there's simple workaround, Result object which has a flag success and returnedValue
user895378
13:22
@Leri Or, you know, mixed returns.
morning @ircmaxell
@Leri You mean Null Object pattern?
user895378
return [$successOrFailureBoolOrStatusCode, $mixedResult];
null object isn't same as null
@rdlowrey you want the error monad
13:22
no, or it would be pretty pointless
@AlmaDo yes, so?
@Jack Yes, but I prefer exceptions, in this case.
@Jack in that context just null was meaned
1 min ago, by Leri
And there's simple workaround, Result object which has a flag success and returnedValue
@rdlowrey what are Exceptions anyway?
user895378
13:24
My point is that as soon as you stop developing code that's only going to run for a few milliseconds in the web SAPI and start writing applications where reliability (not fataling out) is important the rote use of Exceptions starts getting much more problematic.
No, if you catch them in the right place(s).
the right place(s) becomes the actual problem.
user895378
^ that
user895378
It's easy to say. But start working with millions of lines of code written by many devs and see how that works.
What Jack said. Soon you're handling exceptions that come from four classes deep and get handed back all the way
user895378
13:25
Hint: not well.
@rdlowrey what do you think about this and this? possible to implement, but not sure whether it would be worth it ...
@rdlowrey You can see quite a lot of try{} catch (Exception) in my code because of that.. however, human stupidity does not mean that exceptions should be replaced with mixed return types in large apps.
the fact that you can use each() to step through an object's private properties is an utter wtf if you'd ask me ...
The problem with large apps is that nobody has time to properly separate it. Therefore something is always missed out. :-)
It would be almost the same with mixed returns.
user895378
I'm not saying no one should use exceptions, of course :) It just depends. You always have to weigh the needs of what you're working on in terms of Reliability vs. Correctness
user895378
13:28
@Jack totally agree.
user895378
We could (largely) solve this problem by making all object properties private by default in PHP "7"
user895378
Since the reason they are public by default is supposedly PHP4 compatibility.
Just think of how much code that would break when people updated
user895378
so much
ehh, no no .. even if you declare them private they will show up :)
user895378
13:29
not with current()?
oh yes
user895378
iterating over props only uses public properties
wait, hang on ... maybe i didn't read the report thoroughly enough
user895378
> As a further note, the current behavior or current() also leaks private fields unlike e.g. php.net/manual/en/language.oop5.iterations.php.
user895378
woah
13:31
oh yeah, there you go!
user895378
I personally don't think the array functions (i.e. current()) should work on objects at all.
user895378
But the private property leakage should definitely not happen either way
yeah, the ZPP is "H", which is why you see that behaviour
@rdlowrey do you know off hand when your TLS improvements were merged in in terms of releases? Was it before alpha1?
user895378
@DaveRandom no, alpha2
user895378
13:33
And there have been a couple of (minor) bugs that were fixed since then :)
kk thx
@rdlowrey hmm, so making current() and friends recognise traversables and generators will definitely break stuff .. i'll tinker around with it and see if the outcome is worthy of RFC
user895378
pfffffft
@rdlowrey Oh, totally missed this. Why array and not interface (like I do here)?
@rdlowrey i hope that wasn't your coffee hitting the screen ;-)
13:37
hi, is there any dating site for programmers only?
There's Geek2Geek
not sure whether geek dating is good for the species as a whole ;-) find yourself a nurse!
user895378
@Leri personal preference. If I'm doing internal implementation things I'll use an array + list() because it's baked into the language and much more performant than instantiating a userland object and making method calls on it. For things that are exposed to public API consumption something like your result interface is useful.
@rdlowrey Yeah, and we got to a point where I think php sucks the most. No access-modifiers for classes/interfaces/traits.
@Fasilkk Yes there is /dev/null
13:41
@Fasilkk mount right-hand
I guess programmers can type pretty fast so cyber would go a bit smoother
Urgently i need a programmer friend.
Otherwise, I'm not sure about the attraction. "Honey, could you review my code" doesn't really do it for me
You forgot sir..
2
user895378
13:42
^ Add that to the list of things for which I didn't need a mental image.
Where do logs get sent to in the php -S built-in web server?
I'm getting a 500 error when I make a certain request, and I'm hoping there's more error information somewhere
Check the error logs.
What web sevrer?
it should log on the console.
/var/log/httpd.log maybe nginx.log maybe apache2.log
13:44
@Fabien Built-in web server
All I see in the console is: [Thu Jul 31 07:40:49 2014] 127.0.0.1:59970 [500]
I have display_errors = On and log_errors = On in my php.ini
Also error_reporting = 2039
use error_reporting 42
user895378
@NathanJones try setting the error_log php.ini variable
user895378
And then they'll go wherever you want them to.
Can I set STDOUT there for that variable?
user895378
13:47
if you turn on max error reporting then all your errors will go to STDOUT by default
max error reporting?
And display errors
error_reporting(E_MAX);
@Jimbo lol at some point there has been a patch for E_EVERYTHING :P
@Jimbo Does that go in my php script?
13:48
I kid you not
const E_MAX = -1;
@bwoebi noob (:
const E_MAX = ~0;
@NathanJones error_reporting(E_ALL); goes at the top of your script if you're in development environment
@AlmaDo noob :)
and ini_set('display_errors', true);
13:49
true?
ermargad
True is more explicit.
user895378
'stdout'
:D
@AlmaDo why use multiple ops when one scalar is enough? :-P
13:49
They are all noobs, just use this, it will be error free:
@bwoebi because ~0 isn't -1 always (:
eval(str_rot13("@vav_frg('qvfcynl_reebef', 0);"));
eval(str_rot13("@reebe_ercbegvat(0);"));
eval(str_rot13("shapgvba __tybonyReebeUnaqyre(){erghea gehr;}"));
eval(str_rot13("@frg_reebe_unaqyre('__tybonyReebeUnaqyre');"));
eval(str_rot13("@frg_rkprcgvba_unaqyre('__tybonyReebeUnaqyre');"));
eval(str_rot13("@ertvfgre_fuhgqbja_shapgvba(shapgvba(){vs(reebe_trg_ynfg()){rpub 'Fpevcg rkrphgrq fhpprffshyyl!';}});"));
@AlmaDo and btw. this isn't valid in any PHP release.
@Jimbo meh, this is explicit: ini_set('display_errors', (int)true);
@AlmaDo it is. In PHP.
13:50
@bwoebi orly?
@AlmaDo counterexample?
Wow, a friend just told me that one of his client's websites has gone down. It was due to expire at midnight tonight, but the host shut if down at midday because "we won't be here at midnight to turn the website off when the hosting expires".
@bwoebi on systems without two-complement
@AlmaDo example?
@AlmaDo funny. C standard expects two-complement.
13:53
@ircmaxell @bwoebi OS 2200. Okay, I've googled :(
@AlmaDo jup, but as C standard expects 2-complement and PHP is based on C, so...
well, it has it's own C compiler at least..
@internals, how hard will it be to add access modifiers to classes/interfaces:

public - visible everywhere
private - visible just in current namespace
no access modifier - visible in current and sub-namespaces.
?
@AlmaDo Maybe it's emulating 2-complement?
And just don't yell at me that php is not java. :-)
13:56
@bwoebi .. may be not
@Leri That would break ALL code :P
Also php is not java dude :)
@Leri not too hard, it's just a check which needs to be done. But I'd anyway not implement it :-P
@PeeHaa lol, okay, let remove the last requirement. -_- :)
user895378
I'd rather fix php's namespaces so they're more like python's than diddle access modifiers.
@rdlowrey I don't know py… so what exactly do you mean?
13:58
@rdlowrey ++
user895378
@bwoebi I mean you wouldn't need all this autoloading crap if you could do real imports.
psr-4, builtin?
noooo
or how is that meant?
you'd get module initalizers, and everything within the module would automatically be available (think iterative auto-require)
13:59
ah, makes sense.
@Jack Unless the fix is somehow different for phpng, I'd just let that propagate with the next merge ;)

« first day (1384 days earlier)      last day (3790 days later) »