« first day (662 days earlier)      last day (4271 days later) » 

3:01 PM
@PeeHaa just shitting questions in. it helps. any kind of feedback helps with guessing.
 
what's the difference between neon and yaml...
 
@Lusitanian one is a color and the other one a disease?
or was it a gas and a css framework?
 
......................
ne-on.org vs yaml. just saw this somewhere
 
user895378
@Lusitanian I personally wouldn't use either for a PHP application -- they aren't supported in the PHP core and require extensions.
 
@rdlowrey i don't, i just dunno wth it is
 
user895378
3:04 PM
They look exactly the same to my eye
 
as mine
 
@Lusitanian > NEON is very similar to YAML.The main difference is that the NEON supports "entities" (so can be used e.g. to parse phpDoc annotations) and tab characters for indentation. NEON syntax is a little simpler and the parsing is faster.
 
user895378
They probably aren't though.
 
user895378
omg
 
what does that even mean
 
user895378
3:04 PM
Just what we need. A meta data format that allows us to keep code annotations. WTF.
 
tab characters for indentation. oh man. at least spaces should work or you ask for trouble.
 
user895378
That sounds so dumb.
 
sounds beyond pointless
 
it sounds like someone had an itch to scratch and did it.
 
user895378
but if your <insert framework name here> framework runs off of annotations you need that kind of stupidity
 
3:06 PM
however it looks like somebody looked for simplicity. but I can not tell you if it is a stable format.
 
@rdlowrey i use annotations and certainly don't need murdered yaml to use them
 
user895378
:)
 
what has annotations to do with a configuration file format?
 
no idea
 
I'm a bit puzzeled.
 
user895378
3:11 PM
You know what I never realized before this week? PHP sends a Transfer-Encoding: chunked header (unless you've specifically sent a Content-Length header) the moment you echo output and chunks everything from there. It makes sense as this is the only way to send a valid HTTP message when PHP has no idea what the length of your content is going to be.
 
Transfer-encoding: JonSkeet Content-length: doesn'tmatter
 
> **Steep Learning Curve**
> You will learn to create web applications for a very short time.

http://ne-on.org → http://nette.org
O_o?
 
what's nette?
 
> Neon is part of Nette Framework
 
oh god i'm sorry i asked
 
user895378
3:13 PM
> It eliminates security risks
 
user895378
Well if that isn't an invitation I don't know what is
 
great!
 
user895378
> Perfect Security
 
perfect!
 
@rdlowrey too bad I have an open security bug with it
 
3:15 PM
certified symfony developer?
 
does it support jQuery AJAX, or just old AJAX...
 
user895378
I'm going to chalk those statements up as translation difficulties ...
 
@rdlowrey Funny though. :D
And worrying, if they can't even be bothered to get their homepage proof read.
 
After my time on SO and dealing with this API (Who throws an uncaught exception on bad username/password?) I'm getting my "dealing with idiots" cert.
 
I want a Latte templating engine cert
 
user895378
3:17 PM
// $container is a system container, e.g. from $presenter->context
$httpRequest = $container->getService('httpRequest');
 
user895378
 
that, y'know, only defeats the purpose of DI a little
 
user895378
Yay! Service Locator!
 
Service locators --- because you can't predict what dependencies you'll use in your classes. Service locators. Screwing up code since 1990.
4
 
@Lusitanian is Symfony an institution?
 
user895378
3:18 PM
Why ask for what you need when you can ask for ... everything
 
the service locator is one of my main gripes with symfony
it was all going along so well until they decided to shove the entire container into each controller by default
 
user895378
yup
 
granted, it's not hard to avoid that since you don't need to use their controller class but it forces everyone into senseless defaults
 
I'm going to blog on that again
 
user895378
It's (symfony) mostly not terrible (what I've seen of it) ... but that's a big problem (service locator)
 
3:20 PM
it makes developing some apps a lot faster
 
user895378
so does global
 
:)
it is the only framework i will defend
 
@Lusitanian 60/60 rule: developing apps faster at the cost of the long term will cost you more than spending more time in primary development to save long term costs...
 
0
A: Attempting to run PHPUnit with a configuration XML file results in exception

hakreWhat you experience is a fallback. It looks like your testsuite is empty (and there is not other additional non-empty testsuite as well). In that case PHPUnit will to also try to just open something fitting, which does not work. Then you see an error. If you have only one empty testsuite, you ...

 
@hakre Perfect timing
I just came back :D
 
3:22 PM
@ircmaxell I've heard it and know it, but one-off projects and RAD-style things tend not to need maintenence
 
Yeah, that all I could find out. Does not look like a bug. You have that testsuite empty?
 
famous last words
 
(me double crosses fingers)
 
No, the testsuite has one test, and it runs fine when I run it pinpointed from CLI :(
 
if you don't produce shitty software you can not be very productive optimizing it later on. this is from a point of view.
@Truth okay. so you need to configure with PHPStorm.
However, the results you see in my answer are from within phpstorm.
My commandline in PHPStorm differs, I'll paste it:
 
user895378
3:25 PM
11 hours ago, by tereško
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." (c) Brian Kernighan — tereško 22 secs ago
 
user895378
Just in case you missed it or haven't seen that.
 
C:\Programme\PHP-5.4\php.exe "C:\Dokumente und Einstellungen\hakre\Lokale Einstellungen\Temp\ide-phpunit.php" --configuration "C:\Dokumente und Einstellungen\hakre\PhpstormProjects\PHPoAuthLib\tests\phpunit.xml"
 
 
Next blog post going live in 3 minutes
 
user895378
@Truth never used phpstorm, but here's an example phpunit.xml file that works just fine for me in case it helps...
 
3:28 PM
The file displayed is lamed.php inside of test
 
sure, but I wonder why your bootstrap.php file is green.
 
@ircmaxell is this the one about DI?
 
you have more edits than in the XML, so probably there are more cases of error?
 
@hakre Because I added it and didn't commit it yet
black is for unchanged, green for new, blue for changed, and red for new and untracked.
PhpStorm's git integration
 
@Truth but bootstrap.php is part of PHPoAuthLib already.
 
3:30 PM
@hakre I didn't use his library, I only copied and modified his phpunit.xml file, my project is different
 
My clone is only some hours old.
Okay, that's fine. Your error then is somewhere in your difference.
 
My phpunit.xml file now looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
        backupGlobals               = "false"
        backupStaticAttributes      = "false"
        colors                      = "true"
        convertErrorsToExceptions   = "true"
        convertNoticesToExceptions  = "true"
        convertWarningsToExceptions = "true"
        processIsolation            = "false"
        stopOnFailure               = "false"
        syntaxCheck                 = "false"
        bootstrap                   = "bootstrap.php" >
 
@ircmaxell ohh, oh well haha, going to read this post though
 
@ircmaxell Is this one blog post per day keeps the witch-doctor away?
 
3:31 PM
Not sure whether I'm getting old and don't like chnages in general... or GitHub's new notifications just suck
 
@ircmaxell It has happened by the way
A bug in the ship
The software developer forgot to take the earth's rotation into account, and the ship landed approx 3000 miles off the landing zone :D
 
@Truth link?
 
@PeeHaa I must admit, if they had not mailed me I have not noticed much change. However, I like that notices are now grouped per project. That's a relief.
@Truth Distance is relative in time and space. So are errors ;)
Some errors are just a fail but some errors are really kewl.
 
@PeeHaa Can't seem to find it now
 
:(
 
3:34 PM
@hakre So, what could cause the problem?
 
@Truth: Remove the testsuite. Just run tests. Does it work?
 
@hakre Running tests from the CLI works
 
You need to do some basic debugging.
And running tests from PHPStorm?
 
How do I run a single test from PHPStorm?
 
Right click the test.
(you can also right-click the XML file btw. if you need that configuration or want to test multiple ones and choose one)
 
3:36 PM
Right click and run?
@hakre
Problem solved
I can't believe it...
@hakre did you know that all tests must be called WhateverNameYouChooseTest.php?
 
 
@hakre No, 3 per week
 
@Truth Yes, however that is something common with XUnit style of test frameworks. You will do that little mistake only once.
 
@hakre You bet I will :o
 
@Truth Starting is most hard ;)
 
3:45 PM
Now to enable coverage analysis :D
I've seen in PhpStorm's screenshots that it can show me which units of my code I have covered, and which I don't
 
@Truth You can do that with right-click as well, PHPStorm 4 supports that now.
 
Hey guys.
 
@hakre Run with coverege?
The Xdebug extension is not loaded. No code coverage will be generated.
Hmmm, now to figure out how to load it :o
 
@Truth Have you configured xdebug for the php binary?
 
@hakre Apparently I haven't :o
 
3:48 PM
@Truth that's easy
 
pipe the output of php -i into a file or the clipboard. Go to xdebug.org/wizard.php and paste it in there. Follow the instructions.
 
just remember zend_extension, not extension
 
Do not forget to send Derrick some donations for xdebug.
Because once you use PHPStorm with XDebug you will see it's worth to have!
 
@hakre If I deem it worthy (which I sometimes do) I'll send a donation
I did so for PHPUnit, I'll probably do the same for xDebug
 
@Truth Send a donation and I double it.
 
3:50 PM
Now the question remains (I'm such a n00b when it comes to CLI) how do I dump php -i to a file? :o
 
posted on August 08, 2012 by Anthony Ferrara

Today's post is in response to an article that I read yesterday entitled They Write The Right Stuff. It's a very interesting and insightful look into one of the most complex and critical pieces of software ever produced (also one of the most expensive). I think we can learn a lot from what they are doing, but I also think we should avoid copying what they are doing. The point that's missed is p

 
ehm, you know what a shell in windows is?
 
I know what CMD is
don't know many commands though :o
 
okay, that is it.
start it
 
I already have
I can run php -i
but how do I dump it into a file?
 
3:51 PM
okay, type: php -i > output.txt
output of php -i well get redirected into the file.
 
epic
 
then open the file and copy it's contents
 
@ircmaxell except NASA still crashed a mars rover because someone didn't conver units
*orbiter
 
@Lusitanian bugs still exist for sure, they always will. but how much money and effort is it worth to try to eliminate lal of them
 
3:53 PM
And if the software works, hardware gets broken ;)
 
After I edited php.ini
do I need to recompile/rehash php.exe binary?
 
have you downloaded the extension as well?
 
@Truth no
 
@Truth What @Lusitanian says, no recompilation necessary.
 
@hakre Not yet, where do I download it?
@hakre Awesome, it works
@ircmaxell The kind of service I offered for my freelancers was to eliminate bugs as I find them, I usually went over the source code in my free time (I like it, call me a workaholic), and sqush bugs I find, or refactor routines
 
3:56 PM
Okay, as it can't work without the extension dll, you have downloaded the extension ;)
 
@hakre Oh, yeah I did
php_xdebug-2.2.1-5.4-vc9.dll
:)
 
@rdlowrey Any grand improvements since last night?
 
@Truth Congratulations, you now have installed xdebug. The xdebug.org homepage is a nice resource, don't forget to go there in case you run into problems.
Also tag your question on stack overflow with the tag, even it's author is lurking around here from time to time.
 
@LeviMorrison @rdlowrey @hakre and others :) Would the second example be a good example for the tutorial (functions topic)? gist.github.com/3207318
I'm not sure about using the mb_* functions and @deceze mentioned perhaps dropping the HTML
What do you people say?
 
@PeeHaa The first description sounds like it's the same as an include;)
 
3:59 PM
@PeeHaa yeah, mb_ isn't standard, right?
 
it's core, but not enabled by default (must be compiled in)
 
user895378
@LeviMorrison nope. I was pretty tired and went to sleep soon after I talked to you. I'm trying to work out the best way to transparently manage the php://input stream as the request body input to StdRequest for framework applications ... because it can only be read once and isn't seekable in a web SAPI.
 
@rdlowrey I assume you can't write back to it?
 
user895378
Right now I'm thinking of having a public Message::bufferBody method that will load the full stream into memory if the message body is a stream and then transparently copy the stream to a php://memory stream on getBody so that the stream can be reused
 
user895378
@LeviMorrison right --read only
 
4:01 PM
@hakre :P Besides the input part yup. It's damn hard to come up with this shit (much harder than I though of when I started :P)
@LeviMorrison Might not be installed indeed on some environments
@ircmaxell Is there any reason it is not compiled it? Sounds like a pretty useful feature to me?
 
@PeeHaa Then I'd drop it. Anything that isn't included in a standard PHP 5.3.6 build probably shouldn't be used.
 
@PeeHaa Not sure
 
@LeviMorrison done
@ircmaxell k
Is this something I can drop a mail for to internals?
 
user895378
@LeviMorrison That means you can't compress/uncompress http messages because while ZLIB is in core, it must also be compiled in --with-zlib[=DIR] :)
 
user895378
The Artax\Http stuff works just fine without it, but you're missing out on the benefits of compressed transfers :)
 
4:04 PM
@rdlowrey I meant in a PHP.net tutorial. The exception is when you are explaining something more recent.
 
user895378
@LeviMorrison Oh I see.
 
hehe :P
Drop it like it's hot... ooowwwh shit :)
 
user895378
lol
 
user895378
also, zlib is nice because ...
 
user895378
> The Windows version of PHP has built-in support for this extension
 
4:07 PM
@PeeHaa Yes I can imagine. I forked it and gardened a little but this is not the end of the flag-pole gg
"A function therefore is a little program inside a larger program. It sometimes is called subroutine as well because of that."
Maybe it's worth to start with the abs example and turn it into a function.
new users should have fun to create their own functions.
@rdlowrey You need to add a PHP only implementation. It floats around somewhere.
 
@hakre Like instead of using the builtin abs() let the reader build it's own implemantation?
 
user895378
@hakre that would be nice ...
 
@PeeHaa No just like in refactoring. How to move some code into a function. It shows how to create the parameters and what the return value is.
(Refactoring: Extract function) - ups Extract Method (sorry) refactoring.com/catalog/extractMethod.html :)
 
Ah right
 
Better description of the Refactoring above: sourcemaking.com/refactoring/extract-method
 
4:13 PM
http://stackoverflow.com/questions/11868270/php-server-is-refused-to-post-html-content
 
Also try not to formulate in passive language. That is hard to understand.
 
@Truth: Everything works now?
 
user895378
@hakre I can't seem to locate any php gzip implementations that don't use the zlib functions :/
 
@rdlowrey Ah somebody must have been that crazy. What about pclzip? phpconcept.net/pclzip
 
user895378
4:21 PM
will check it out ...
 
phpconcept.net/pcltar <- with zlib support. no idea if it is native.
 
user895378
From pclzip.lib.php:
 
user895378
// ----- Tests the zlib
if (!function_exists('gzopen'))
{
  die('Abort '.basename(__FILE__).' : Missing zlib extensions');
}
 
mkay, dus nod wrk. :/
 
@hakre Yes, thanks :)
You guys helped me a lot
 
You're welcome. We need you being fluid with testing so you can help out in the diverse projects ;)
 
@hakre +1 :D
 
@hakre Heh
Let me finish my service first, then we'll talk about diverse projects :D
 
No joke, taking a look into other projects helps a lot to progress as a developer. I stayed too long with wordpress so pick better projects your own ;)
But regardless of the project, getting involved is always like learning a lot.
 
The Gemini V space capsule missed its scheduled landing target by a hundred miles, because a programmer forgot to take into account the rotation of the Earth.
@PeeHaa
not sure why I thought it was 3000 miles, but w/e :D
 
4:31 PM
@Truth I would still hate it to walk that distance :)
 
@PeeHaa I bet the capsule was written in jQuery @webarto
 
huh, what... yeah jQuery Capsule Plugin v0.1
damn, almost fell asleep
 
user895378
Somehow I doubt NASA is big on rapid application development programming shortcuts.
 
@Truth That sounds like typical wikipedia wording with an immense POV: Agile folks coin it so: The documentation of the scheduled landing target was in the software, but the product documentation not updated to current at the time of landing.
 
user895378
JPL: Jquery Propulsion Laboratory
 
user895378
4:35 PM
(what NASA's really up to)
 
@PeeHaa again, show jquery in php
echo "('#phpoutput').addClass('jquery-is-awesome')";
 
4:49 PM
@ircmaxell "Welcome to the show…where WE ask the fucking questions and give you your answers too!"
 
morning
 
@NikiC morning
 
it's so unmorningy though :(
 
@PeeHaa repwhoring?
 
Damn that sarcasm thing really is hard to do on the web :D — PeeHaa 31 secs ago
:D
 
5:01 PM
sender_id/receiver_id or from_id/to_id, question is now :P
 
THERE! I was looking for a good question to mark that as a dup, I was pretty skeptical that no one had ever asked it before
Of course, Google would have answered just as well
 
I think it is bad idea to answer to user* questions...
 
user895378
yeah, if you can't be bothered to register a real account I can't be bothered to help you
 
user895378
@PeeHaa later
 
5:12 PM
@webarto They won't accept, that's for sure
 
@Chris not just because of that, but it's disrespect... To you (answerer) and the community. I'm guessing that current model is doomed to fail in near future.
 
I see little difference between a person who won't register and a person who registered, asked a single question, then doesn't come back. Forcing registration just makes more of the latter accounts exist.
 
hello everyone
 
Yup, and I would disable "Ask Question" for people that have lots more of Questions than Answers... You were given knowledge, and you don't pass it on... @Chris
 
i need few guidelines about a problem. suppose i have a live database and few local databases at different locations. now if data is changed/added in local db i want it to be available on live db as well and vice versa. any idea how can i do that?
im using mysql and all databases have same schema.
 
5:23 PM
Don't think that is entirely possible like you imagined, you can write some DB wrapper, that will execute same commands on all databases... howtoforge.com/mysql_database_replication
 
I am designing an architecture for a process that has given us problems for a long time.  The basic flow of the process is as follows:

request comes in ->
    validate request  ->
        onError -> ?
        onSuccess ->
           persist request ->
               onError ->
                   log error
                   email webmaster
               onSuccess -> perform misc post-process things
I was thinking about having it register callbacks for what to do onSuccess and onError for the persist part and throwing an exception if the request is invalid.
I don't like that approach because on some errors I throw exceptions and some errors I run some callbacks.
What would you guys suggest doing? I'm open to throwing the whole design out, btw.
The process was developed by a previous developer and I have permission to rewrite this baby from scratch.
It's given us too many bugs over the years.
@ircmaxell @rdlowrey @tereško I'd appreciate your thoughts if you guys have time.
 
user895378
@LeviMorrison I hate callbacks, personally -- they're an inferior design compared to a truly pluggable system. My default for something like that is injecting a Mediator (as you know) and having the injected object notify listeners whenever something notable happens.
 
user895378
I'm not talking about the full blown Artax Mediator that uses automatic class provisioning -- I'm talking about something like this that allows registration of any valid callable
 
@rdlowrey I had something like that in mind as well.
I meant that you would register what callbacks you want to happen with the event.
 
user895378
@LeviMorrison An example of how I would do it is here: github.com/rdlowrey/Artax/blob/master/src/Artax/Framework/Http/…
 
user895378
5:31 PM
That just illustrates how you can take a normal class and add a mediator to make it fully pluggable.
 
@rdlowrey Could you define what you consider a "callback" versus a "listener"? Your comment doesn't grok, but I suspect it is a terminology misapprehension on my part.
 
user895378
Well, I think of a callback as something you hardcode into your class -- you might have an optional $callback = null parameter at the end of a method signature.
 
user895378
And you have the option of passing in a callable to be invoked when something happens.
 
The obvious downside to a callback is that it's just ONE callback.
 
$file = preg_replace("[\s]/(?=[a-zA-Z])", '><', $file);
Why is this returning NULL?
 
5:33 PM
@SomeKittens Because you are trying to parse HTML via regex?
 
$file = preg_replace("#[\s]\/(?=[a-zA-Z])#s", '><', $file);
 
/half joking
 
user895378
@Chris But when I talk about a listener (which technically could be a callback), I mean callables that are registered with a central event dispatcher that you've injected into the class. It allows you to register an infinite and changeable number of callbacks for a given event.
 
user895378
Instead of just hard-coding in a fixed callable or callables for fixed scenarios
 
@webarto yes im just trying to figure it out yet. and problem is that i wont have access to live db all the time, so i cant execute same commands on all databases at same time. i need a way to store that data in locally and then transfer it to live database when i have access to it.
 
5:34 PM
@LeviMorrison Technically, it's XML
@webarto That worked, but why?
 
user895378
The important thing to do is keep the pluggable class completely ignorant as to what callables are attached to listen to its events.
 
@SomeKittens Then use an XML parser. I recommend DomDocument and friends.
 
user895378
The pluggable class shouldn't know or care if any callbacks/listeners are registered to handle its events. It should just tell the event dispatcher (mediator) that "event X happened in case anyone's interested"
 
user895378
Basically, the Mediator pattern decouples the event occurrence from the callback(s) that respond(s) to it.
 
@LeviMorrison That would be wonderful, if only the API I was using supported normal XML, instead of their !EXCLUSIVE! variety...
 
5:38 PM
@rdlowrey Right, I'm totally on board with that. My question is more about my overall design.
 
@webarto
Check your e-mail.
Still waiting
 
@user1535882 sent it on Monday
 
Ok.
 
I'll send you a receipt.
 
@rdlowrey Gotchya, that was a terminology disconnect. I would call those "listeners" callbacks :)
One other thing... "Mediator" would refer to the mechanism used to track attached listeners, and to trigger the listeners from within a class, yes? I would implement that as an interface with methods like "addListener" and "triggerListener".
Or would you inject the "mediator" in the constructor, and the event itself provides an "addListener" method.
 
user895378
5:53 PM
@Chris Any of those work fine as well. I personally prefer to inject an event mediator through the constructor.
 
@rdlowrey Do you have time to help me learn PHPUnit's mockign?
 
user895378
@LeviMorrison yeah sure -- I wish I didn't have to blindly find my way through it. It's uber-helpful.
 
user895378
@Chris And like you said, the object that sends notifications can also expose addListener type methods that it directly relays to the mediator. It's really up to you.
 
bla bli blub
 
user895378
@LeviMorrison I'm actually about to do an english-standard ton of mocking to test the http client ...
 
5:59 PM
@rdlowrey Just making sure we are on the same page before I ask: what do you guys thing about using a trait to introduce a mediator to a class?
I really, really want to find some redeeming use of traits :p
 

« first day (662 days earlier)      last day (4271 days later) »