« first day (1033 days earlier)      last day (3912 days later) » 

8:00 PM
How does Silex's .htaccess look?
 
Anonymous
I was going to say, that.
 
Anonymous
It must be an .htaccess issue.
 
Anonymous
Let me find that freaking file
 
Anonymous
I could run the built-in server, too much work.
 
Anonymous
@Wrikken as suspected, no .htacces file
 
8:02 PM
@Simon_eQ "/web/go/" != "/go/"
 
Anonymous
@Danack I'm listening.
 
Anyone know how I could force Google Chrome to download files into a directory with today's an date? Something like %downloads%/yyyy-mm-dd/
 
Anonymous
@Danack If I removed that go/ it will work fine. So, the problem must be internal with the routing or something
 
@Bracketworks: symlink a defualt directory to one, & run a daily cron repointing the symlink?
 
Anonymous
$app->get('/', function() {
    return 'Hello!';
});
 
8:04 PM
So in the event I download something, say today; if a folder named whatever/2013-08-14 doesn't exist, it'll create it and dump the file there; otherwise, dump the file.
 
Anonymous
That will work fine
 
@Wrikken Blagh; yea, I could do that.
Actually, I couldn't; shitty XP box.
 
@Bracketworks: I would be afraid that it's either that, or download the Chromium source & hack it in :P
 
@Wrikken That's probably more viable than jobs & symlinks (ridiculous as that is).
 
Anonymous
8:06 PM
@tereško help here pls
 
@Wrikken Ah, doesn't need a resource kit like linkd
That could work.
 
@Simon_eQ what if you remove the trailing slash in both the route and your browser url
 
Anonymous
@cheesemacfly Just tried it. Same error.
 
You need to setup a virtual host to point to c:/wamp/www/web or setup an .htaccess to do the proper redirection
 
Anonymous
@cspray But, this is at the hello world stage. redirecting at this level does not make sense. does it?
 
Anonymous
8:09 PM
I thought, once the project is finished, then you can re-write urls
 
@Wrikken Sweet deal; thanks :-)
 
@Simon_eQ so $app->get('/', function() { return 'Hello!'; }); works if you go to 127.0.0.1/web/, but $app->get('/go', function() { return 'Hello!'; }); if you go to 127.0.0.1/web/go doesn't?
 
Anonymous
Anyway, I removed all my files from www/ path, for better debugging, but it didn't help.
 
Anonymous
@cheesemacfly exactly.
 
Do you have the rewrite module on?
 
Anonymous
8:12 PM
@cheesemacfly always.
 
Anonymous
I even just checked
 
So you are all good with this: silex.sensiolabs.org/doc/web_servers.html ?
 
Hehe, that's double..
 
Anonymous
@cheesemacfly wait, that was not mentioned in this guide
 
Anonymous
Anyway, I will try that now.
 
8:15 PM
@Simon_eQ: "Then, you have to configure your web server (read the dedicated chapter for more information)." => the devil is in the details ;)
 
^^ you beat me to it!
 
Well, one good thing came from that Silex story for me here: I learned about FallbackResource... Very nice.
 
Anonymous
@Wrikken @cheesemacfly KISS, KISS, HUG, HUG!
 
:)
 
Anonymous
Ok, I'm out. Let me Silex things
 
native is usually if not always faster than an extension right?
 
@DaveChen: usually, but not without exception. Any specifics in mind?
 
fmod vs bcmod
 
@DaveChen: those do different things. bcmod could be a bit slower for low numbers, but fmod breaks on higher ones. Depends on how big your numbers get.
 
@Wrikken fmod seems to work on ... like really big numbers, codepad.org/nJgbCUrQ
 
8:31 PM
@DaveChen: breaks as in supplies wrong data, not breaks as in does nothing.
 
ah. just did some tests, so why isn't it stated in the PHP manual? :P
 
@DaveChen: floating point problems (en.wikipedia.org/wiki/Floating_point#Accuracy_problems) is not PHP specific, the PHP manual assumes programmers are aware of it.
So, if precision matters:
echo fmod(9223372036854775807,9223372036854775807123).PHP_EOL;
echo bcmod("9223372036854775807","9223372036854775807123").PHP_EOL;
9.2233720368548E+18
9223372036854775807
 
8:47 PM
@Wrikken TIL fmod
 
TIL?
 
Today I Learned, pardon me.
 
Aha, ok ;)
 
I on the other hand learned bcmod does not handle floating points... yech.
 
8:49 PM
Nice.
 
@Eugene yeah, meh, thanks
 
@webarto No prob. Kohana has a nice error/Exception viewer
 
@Eugene Yeah, except my entire site is an error.
 
@webarto ah yes. Now I see. Routing issue.
 
No, too lazy to finish anything issue :)
I wouldn't use .html, I'm not a savage.
 
9:12 PM
@webarto Sure sure)
started major refactoring of the api I'm working on
 
Why not use .html? Prerender your site, be enterprise-ready for CDN's ;)
 
@Wrikken Yeah, I sort of do that because of no good reason, but it's just not showing .html :)
 
Hehe, good stufff then ;)
 
9:34 PM
http://stackoverflow.com/questions/18242684/pwned-generation-ssh-keys-have-patterns-because-they-are-generated-the-guys-t
 
@Danack sorry busy with apcu, if you look at PR carefully I didn't change autoload stuff just sync stuff ... it should work as you expect it I think ...
anyone on a mac ?
 
@JoeWatkins Yep
 
9:51 PM
git clone https://github.com/krakjoe/apcu
cd apcu
phpize
./configure
can you send me pastebin of that output ?
 
@JoeWatkins My problem isn't urgent - I was just starting out with pthreads for fun, not for a serious project. But yeah, it's throwing that weird 'interface not defined' even after your pull request to do the wait properly.
 
what's a good authentication library?
 
@JoeWatkins Sure give me a min
 
@JoeWatkins I'm using MacPorts on osx 10.6.8 pastebin.com/Yqu03EgT
 
@Danack
make test
can I get output of that pls?
@cspray you on newer kernel ?
 
9:55 PM
@JoeWatkins I'm running OSX 10.7.5
 
@cspray, osx version, and can I get a make test output too ??
 
make test output - pastebin.com/T7naPgYL
 
@Danack
phpize --clean
/opt/local/bin/phpize
./configure --with-php-config=/opt/local/bin/php-config
make test
@cspray as expected, ta...
 
@JoeWatkins no prob
 
10:01 PM
@JoeWatkins pasted pastebin.com/bfU8uCTU but I it's complaining about something.
 
bugger, well I'll just hope it's still okay ... one set of tests is more than I normally get from a mac user :) two would have probably been spoiling me ...
anyone ever actually managed to run a decent vm with osx from a unix host (redhat in particular) ?? even when I can get it to install it's so slow it's painful, so I don't bother testing on mac anymore ...
I got a pretty good machine, quad+ht@3.4ghz 16GB DDR3 I can give it half of that and it's still too rubbish to use ...
 
You've looked at the obvious google results like serverfault.com/questions/330845/… ?
 
@Danack
TEST_PHP_EXECUTABLE=/opt/local/bin/php /opt/local/bin/php run-tests.php
 
that's not very useful....
 
I tried host i/o cache yeah, just as slow ...
 
10:08 PM
0
A: PHP Syntax Checking with lint and how to do this on a string, NOT a FILE

hakreYou can check code with php -l from STDIN by piping it in. Example: $ echo "<?php echo 'hello world'" | php -l Parse error: syntax error, unexpected end of file, expecting ',' or ';' in - on line 2 Errors parsing - Here the ending semicolon ; is missing after the single quoted string. If you...

 
@Danack /opt/local/bin/php -v
 
I don't have APCu installed on my osx....
Dan-Ackroyds-MacBook-Pro:apcu danack$ /opt/local/bin/php -v
PHP 5.4.9 (cli) (built: Nov 23 2012 02:31:44)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
 
@Danack you shouldn't need it to run test suite....
 
something between brainfuck and modern art — hek2mgl 13 mins ago
 
@Danack, you are running ZTS ?
 
10:11 PM
@Hamza the characters used don't lend itself to brainfuck...
 
@Orangepill Yeah I know
it was just fun to read :p
 
@Hamza I know...
 
@JoeWatkins No? Remind me how I can check properly please.
 
great
 
ah "Thread Safety => disabled"
 
10:13 PM
@Danack bravely ... I give up ...
 
user895378
@Danack compile php with --enable-maintainer-zts
 
@Danack, while I think about it, you're not using xdebug+pthreads are you ?
 
No - pthreads is in my centos vm.
 
@HamZa Doesn't brainfuck ignore non-whitespace characters much like how most languages ignore whitespace. It looks like there might well be a hidden brainfuck program in there.
Also, a <3k user took the time to fix it, so approve!
 
@Danack oh okay good ... I wll go back to your pthreads error tomorrow
 
10:14 PM
....
 
my head is tired, I hate freebsd
 
user895378
Basically I just do something like this:
 
it is the year 2013, it cannot share a ruddy mutex/rwlock between processes
 
@rdlowrey I meant how can you tell if PHP installed from macports is ZTS or not.
 
user895378
@Danack oh, I'm not sure. I have exactly zero mac experience with PHP. I probably can't help :/
 
10:16 PM
whitespace looks like a fun programming language
 
APCu has to use file locking, yeah you heard me, file locking, like from the 70's file locking for the cache ...
 
user895378
@Danack Easiest just to download a new version and compile it yourself to make sure it's setup correctly
 
@Danack php -i | grep --enable-maintainer-zts
 
@Orangepill lol have you seen that last comment ?
 
APC just did it by default without telling anyone ... how crap is that ... i's a pretty basic thing that every other implementer of posix saw fit to implement, but oooooh no, no freebsd because it's "special" ... dicks ...
 
10:18 PM
@rdlowrey yes - Joe was just asking to test stuff on Mac for unknown reasons. Back to Centos I fly.
 
has anyone looked into YAC far enough to run proper apps with it yet ??
 
@Hamza I was referencing a viable on topic programming language, It just happens that the technology referenced was an expletive
 
@Orangepill yeah ...
 
@igorw you C/Zend right ??
do you see a problem with the premise of YAC that it will provide benefit to operate on the cache lockless ? have you looked at it at all ?
it so clever, but I have a sizable doubt that it will lead to desriable behaviour under load ... if feedback on it, whenever it arrives is positive I'll probably borrow it's allocator for APCu ...
 
@JoeWatkins I don't have much experience with the zend engine. I've only mucked with the compiler a bit.
 
10:23 PM
I have a base class which extends another library. In my base class I have a method called from another class called "settings" and passing the $this as a parameter, the method has type hinting setup with base class expected only. But as soon as I call a method from the library it fails non-object. Why?
 
"it fails non-object" ?
 
Yup but works for any method inside of base class and the method I'm calling is a public one in library. I can successfully call it from base class no problem.
 
Is Niki on holiday or something?
 
@jason do any of the player's happen to be static?
 
user895378
@Leigh Either he died or school is getting back in session. I wondered that as well.
 
10:26 PM
niki's not in IRC either ... presumed dead ...
 
@Or
@Orangepill no
 
:/
found a type in his code, I don't like making pull requests for such trivial shit :p
 
@Danack Fatal error: Call to a member function addReceiveContentType() on a non-object
 
a typo is a serious offence, not only would I submit a pull request, I would issue a fatwa ....
 
@JoeWatkins lolz
 
10:30 PM
@Jason Try doing a var_dump on the variable that you are calling that function on - because you're thinking it's an object, but PHP doesn't think so.
 
@HamZa :D
 
Some music: Beastie Boys vs Jet Set Radio - youtube.com/watch?v=wb9rdGfrLdc
 
What's with gravatar github.com/nikic
 
@webarto hope the commit message was intentional
 
10:37 PM
@Leigh I hope it wasn't :P
 
@Danack It dumps as: object(webCrawler)#1 (34) with all the related class items.
@Danack I just realized the var I am passing is from a static class. FOOBAR
 
@Orangepill the ? in that case will make it ungreedy. But it doesn't make sense since it will match 13 times
 
@Jason PEBKAC
 
greedy or not, 13 stays 13 :)
 
lol
@Danack @Orangepill THANKS
 
10:40 PM
;)
 
hmm, some functions didn't get old in PHP: php.net/manual/en/function.php-check-syntax.php
 
@Danack while you're doing vs beastie boys, I always quite liked youtube.com/watch?v=XL0YWTPDMUI
 
@hakre: ooh, rightly so "(and execute)" ... the horror.
 
@Wrikken yes, sounds like a total bs idea, I wonder how one could have sanely suggested to add it in the first place? to proof how akward static the PHP parser is working?
 
@hakre: or mainly, how they had the balls to call this "check syntax", but we're all familiar with function misnomers...
Hehe, we need Moar Globals! stackoverflow.com/questions/18243673/…
 
10:59 PM
lol
 
@Wrikken cross request persistence :D please just vote to close. I left a link to the manual already. :)
tooooo lazy looking for a dupe.
 
I still wish there was a RTFM close option...
 
@Wrikken Blech, the answer on that is awful
 
26
Q: PHP Pass variable to next page

Carloit seems pretty simple but I can't find a good way to do it. Say in the first page I create a variable $myVariable = "Some text"; And the form's action for that page is "Page2.php". So in Page2.php, how can I have access to that variable? I know I can do it with sessions but I think it's too ...

???
 
11:08 PM
@cspray: Yes, yes it is. Mainly because no one with enough knowledge is likely to want to do it ;)
 
@Wrikken No argument there :P
 
@Wrikken Yeah, the big lolsky, however, awfully true.
so now I've got a new mystery to solve.
when I invoke php -l this way:
<?php
/**
 * PHP Syntax Checking with lint and how to do this on a string, NOT a FILE
 *
 * @link stackoverflow.com/q/12152765/367456
 * @author hakre
 */

$code = "<?php echo 'hello world'";


$descriptor = array(
    0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
    1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
);

if (!$process = proc_open('php -l', $descriptor, $pipes)) {
    return;
}

fwrite($pipes[0], $code);
fclose($pipes[0]);
I get an exist code of -1 when the syntax check failed and 0 when it passes.
same when I use a file instead of stdin (a file as parameter to php -l.
 
@hakre: yes, what's the problem with that?
 
However when I do that in the shell, I always get echo "$?" the value of 0
I only get 1 in shell when I try with a non-existent file.
 
11:22 PM
Hm, I get 255
(on error)
Then again, does your shell call the binary directly?
 
good question.
perhaps not.
I must admit I have problems to find out.
 
What if you start a sub process?
 
what does that mean?
I could take a look in the process manager perhaps
 
(php -l ...etc.. ; echo $?)
() start their own shell
But yeah, Windows, I'm not a real big help there...
 
I get the same results with that.
 
11:27 PM
Bugger
 
I guess it's a problem with the bash I have here from git bash.
 
11:38 PM
@hakre: hm, having a hard time locating anything in the source. But I'm curious what happens if you try to run code with a parse error?
 
@hakre If you ping me tomorrow (if the problem isn't resolved by then) I'd be happy to help. I do have some experience with doing strange things in gitbash.
 
first of all I have now learned about -1 instead of 255: php.net/manual/en/function.proc-close.php - see Notes Unix-Only.
 
@Hakre: ah, that explains a lot.
 
@Jasper very nice of you. I will fall into the bed now. perhaps perhaps, I just wanted to blog about the exit code for further reference with php -l (e.g. intergration into shell scripts etc.) but now this all somewhat stinks. I have a better way anyway that is more robust, too and it's easy to find out if there was an issue, too.
so in the end I'm not so much depending on the exit-code but it would have been interesting to know what is going on with that.
anyway gn8 folks!
and thanks for all the fish!
learned a lot about sed today as well.
 
11:44 PM
sad part , most of people did not get the reference
 
Good night
@tereško I've yet to properly read all the books, but I did get the reference :D
 
i didn't like th ending of the last book
 
that was the one by a different author, right?
 
no , i mean from the ones made by Douglas
 
ah, yes. Well, I haven't read them all properly, so I can't really comment on that.
 
11:48 PM
In codeigniter, when you make a custom form validation rule their docs say that you can process then validated data by just returning the data in the custom rule callback function
I can't get this to work
any ideas?
 
why do people keep picking the worst possible frameworks ?!?
 
By the way, at my student's society, the cellar is named Milliways and we have a drink called Pangalactic Gargleblaster (which happens to be a thing we're known for around town because it is a pretty killing mix of alcohol and caffeine). If there ever were references that were blatant yet unknown to a large portion of people using the names, it's those two.
 
Not my choice
 
Good night, people
 

« first day (1033 days earlier)      last day (3912 days later) »