« first day (1014 days earlier)      last day (4159 days later) » 

Anonymous
13:01
hi @gr4devel
Hi friends
can anybody fix that problem?
PLB
PLB
Programming interfaces first and then classes helps keeping clean structure but sometimes I end-up with 1:1 proportion. Is that ok? Or do I understand interface-based programming wrong?
:) I'll try to be brief, here's my problem of the day: I'm trying to recursively iterate in a root directory to get all the php files and that's fine till I get an exception caused by the lack of permission on reading a directory...
@PLB I think you understand right :)
@PLB programming by interface helps to keep systems at a good level of abstraction and permits to extend them more easily
@PLB however it also must be said that all is relevant to the context you're in
PLB
PLB
13:05
@gr4devel I am actually playing with some random stuff, because I really suck at application architecture.
@PLB you're not alone buddy :D
@Mr.Alien lol
PLB
PLB
@gr4devel Of course, not but that does not change anything. :)
btw morning
@PLB you're right what I meant is that I suck too in application architecture
@PLB :)
13:10
@Ocramius But why take it out on us?
hi @Simon
@gr4devel You could use fileperms() to check you have permission to enter the directory: php.net/manual/en/function.fileperms.php
@Jimbo thnx man ;) but the problem here is that I use an iterator in a foreach loop and sincerely I don't know how to check the permissions...here's the code:
foreach ($iterator as $file){
echo "{$file->getPathname()}\n";
}
@Jimbo You want the chat linkifier.
@MadaraUchiha Tried it, got an error trying to install in chrome
Something about it being an invalid crx file
13:17
@Jimbo btw what's your problem maybe I can help you :)
@LeviMorrison Yep, bitten by reflection. var_export() generating some code that results in Fatal error: Call to undefined method ReflectionClass::__set_state()
@Jimbo Odd, you should ask @DaveRandom
@gr4devel Not sure I can help with that. I would literally do it directory by directory. Loop parent dir, for all child dirs, check perms, loop ones that have perms
@gr4devel Also, I have no problem, thanks :)
:-S
Doesn't matter, the new sparkly version won't be too long now
Package is invalid: 'CRX_MAGIC_NUMBER_INVALID'
13:18
@dragon112 because there's enough people here :P
@Jimbo ok thnx :D...if you have just ask so that I can pay you back for your help :)
@Jimbo That's very weird
But now you hurt my feelings
well not really, but you did heart my eyes
@Jimbo Can you open the file you have in a hex editor and tell me what the first 4 bytes are?
@DaveRandom Just to check it wasn't a corrupt download (which I've never had before anyway), I redownloaded and still the same
@DaveRandom 43 72 32 34
Btw whoever starred that thing above - no need to star it :/
13:21
That's the right magic number, afaik it hasn't changed, what version of Chrome are you running?
@DaveRandom 28.0.1500.71
On Ubuntu 12.04
or .10, can't remember
@Jimbo wait, how are you trying to install it? Have you drag/dropped it onto the extensions page?
@DaveRandom Yep, that's how I'm doing it
ikr
13:26
That's really odd, I just burned my install of it and re-installed the file I just downloaded from github.com/PHP-Chat/chat-linkifier/raw/master/… and it worked
Same Chrome build, although on Windows
There's a few people suggesting that signing chrome in will fix it, can't see why that should be though
@all see you guys and thanks for everythin :)
@Jimbo @PLB bye buddies ;)
@DaveRandom Will give it a shot - nope, same issue
PLB
PLB
Have a nice day.
Anonymous
It amazes me, that there is no beginner friendly tutorial for XMPP anywhere
@Simon_eQ hm? What exactly are you missing?
I used XMPP ages ago
13:32
@Simon_eQ why you need xmpp tutorial ?
XMPP
Anonymous
@Ocramius a good beginner-friendly tutorial, to convert my AJAX chat script to XMPP
PLB
PLB
@Simon_eQ There're few books available .
Anonymous
@PLB Hmm... thanks. Web tutorials would be awesome though
@Simon_eQ XMPP is a bunch of RFCs... you should read those, they're not written in crazy jargon iirc
but mainly, there's libraries like strophe.js or such
PLB
PLB
13:38
@Simon_eQ Most web tutorials show how tutorials show how to do stuff but they don't show how to do it properly. In the result, you get that either you don't understand what you are doing, or you do it wrong.
I hate those web tutorials out there. You'd better waste few days and read some good books.
@Simon_eQ by the way, the protocol is really simple
Using composer, downloading Silex 1.* - but I don't want some of the dependencies within silex - can I set a rule to ignore specific sub-dependencies? For example, I don't want pimple
Anonymous
@Ocramius thanks. How hard would you say it is though? @
Anonymous
@PLB thanks. have you worked with xmpp
@Simon_eQ it's not hard. There's just a lot of things that are going on in a standard server
PLB
PLB
13:41
No, I have not.
such as rooms, rosters, auth, registration, administration panels, special stanza types, file transfer, streams, blah blah
strophe.js makes it quite simple though
hmm... I see the library stopped being developed
guess you should look for newer ones. Google surely had something since wave was based on XMPP
sameplace for firefox has something too
@Jimbo, are you using APC as a user cache?
@Leigh Nope, literally just done a composer install of silex 1.*
Anonymous
I wander why it gets less hype than websockets / ajax or node.js because, from what I have heard it its the fastest thing out there
@Jimbo Wasn't in relation to that
13:45
@Leigh Oh... nope, haven't used APC for that yet, why?
@Simon_eQ XMPP works on HTTP and can work also on BOSH and websockets as well as real sockets
it's a higher level protocol
been playing with Auryn reflection pools, my file based pool failed due to reflection classes not having __set_state. APC works because it can store objects, I now have an idea that may speed up APC cache further, but I cba to set it up to test :p
Anonymous
@Ocramius So, assuming you wanted to write chat script, what would be choice websockets/node/xmpp
@Simon_eQ I said that XMPP works ON websockets and http
so you can just go on and use it
13:49
sup?
Anonymous
@Orangepill yo. were talking about xmpp vs websockets vs node
@Simon_eQ again, it's not a VS...
Anonymous
which one would be chuck norris for chat site
/me bangs head on wall.
Anonymous
sorry, I dont get it
13:50
XMPP is a message format built on top of HTTP/websockets
Anonymous
let me think
it just defines WHAT is in the HTTP requests or what is transmitted via the websockets
it's just a very standardized way of writing a chat
or generally messages (I used it for data mining long time ago)
@Simon_eQ I might learn something then :)
@MadaraUchiha nuoooooooooooooooooooh :(
13:56
2 messages moved to Trash can
Anonymous
aghhh... off to do some reading ...
There shalt be no Rebecca Black in this channel as long as I am an owner here!
There's a remedy to that:
more of it
@Simon_eQ seriously though, go read the RFCs, they're simple
@Jimbo hmm, Auryn doesn't resolve namespaces it seems, sucks a little having to specify fully qualified namespaces for each class
and there's even an xmpp.org site
13:58
1 message moved to Trash can
@Ocramius Are you sure?
room mode changed to Gallery: anyone may enter, but only approved users can talk
=)
Anonymous
@MadaraUchiha if you make me room owner, I'll remove anything containing 'Rebecca' in it
huh what happened? @MadaraUchiha
Anonymous
:p
Made it into a gallery :D
wtf is going on?
Anonymous
13:59
@Ocramius give me a starter pls..
To remedy the Rebecca Black disease.
room mode changed to Public: anyone may enter and talk
in Trash can, 35 secs ago, by Jimbo
DAMNIT, IT WAS FOUND
rofl
@MadaraUchiha If you put it to gallery at least give me write access =/
14:00
Seriously gtfo with that Rebecca black shit
Hate that shit
@salathe Ok now that song is AWESOME
I may be in love with Jack Black
@dragon112 join the queue :)
What queue?
Happy SysAdmin Appreciation Day! =o)
@salathe LOL!!! Ben Stiller @ 4:02!
@crypticツ lol
boss, i need if 1.00 then 1.0 and if 1.07 then 1.07 means it's not simple case. try to get my point and answers please — Shrikant Gupta 37 secs ago
PLB
PLB
Why does not PhpStorm complain about this: foo(TypeHint $var = 'bar')? :s
14:10
Because TypeHint isn't a valid type?
:D
I am so helpful.
PLB
PLB
:P
@PLB Good question. I see it too
Oh, oh
@PLB You didn't finish your ternary!
foo(TypeHint $var = 'bar') ?: s; <-- semicolon
@HamZa OMG that guy looks like a rapist (the OP)
2
14:12
@dragon112 lmao
@dragon112 hahahahaha
hello
im new here but need some help in php
I definitely don't want to meet him in a dark alley...
> I am Software Engineer at Reppify India Pvt. Ltd and Working as a Core Developer in a US based Social Media Start-up. -Working in Java Web Development -Love to put hands on PL/SQL as well.
close enough hahahha
PLB
PLB
14:13
@MadaraUchiha Yes, it's really bad. This is especially noticeable when you do refactoring.
Wow just one letter off
@HamZa haha, so close
@michael92 Before you post anything it's considered 'the right thing' to read the room description first. It says (and I quote) "Don't ask whether someone is here to help you. If someone is around and wants to help they will.".
2
i want create a cURL connection that will post data into a server...the data to be posted has eight parameters so i want help creating the whole cURL in php to do that for me:
@michael92 lulz, have you check the docs? There are tons of Questions and answers on SO
14:16
@HamZa...yes none seems to do what im looking for
@michael92 impossible
PLB
PLB
@michael92 Hire developer then.
@HamZa..very true
@PLB... im not developing a whole solution...im trying my hands on something new
So when you set CURLOPT_POSTFIELDS, set it to an array of your eight parameters
14:19
good afternoon
user895378
@DaveRandom and @Leigh I only ever use my DIC (Auryn) for allowing extensible string-based application config. But as for this:
user895378
> but I've never seen anything written by either that actually uses it.
@Jimbo... ok
@michael92 so what are you trying to do, and what does not work ?
user895378
How do you think I turn the following into a full-blown http and websocket server?
user895378
14:21
(new Bootstrapper)->createServer([[
    'listenOn'      => '*:80',
    'name'          => 'mysite.com'
    'application'   => 'MyApplicationClass',
    'mods' => [
        'websocket' => [
            '/websocketapp1' => [
                'endpoint' => 'MyEndpointClass'
            ]
        ]
    ]
]])->start();
stackoverflow.com/users/2401227/shrikant-gupta -> "Love to put hands on PL/SQL as well." OMG he is raping SQL!
user895378
@DaveRandom When the relevant classes have constructors like this:
I just noticed xD
user895378
class MyApplicationClass {
    function __construct(Reactor $eventReactor, Server $httpServer, AsyncCallDispatcher $dispatcher) {
        //...
    }
}
@HamZa..im trying to post data into a server using curl in php
@HamZa so that when the data is posted the php file posting the data now redirects to another page upon success of post
14:23
@dragon112 lol that guy, seriously (facepalm)
user895378
So a DIC is extremely useful if you want to provide dead-simple configuration for an applications. But pretty much any other use ends up being an anti-pattern.
@michael92 Do you have any code ?
@dragon112 PL/SQL isn't SQL
@HamZa yes but im not too sure it's working well
umm, what's with the access requests?
14:25
@michael92 pastebin ?
@salathe It has the three letters SQL in the correct order, It's SQL
@HamZa what's pastebin?
@michael92 pastebin.com
@dragon112 I guess "women" are "men", then.
3
14:26
@salathe They are.
right?
lol
@HamZa i should go paste the code over there?
@michael92 yup, since a wall of code isn't appreciated here ...
@salathe On the other hand a slash / sign means or where i come from, so he likes to put his hands on polish people and SQL
@HamZa ...ok so you will work on it there?
14:28
or poland as a country, either of those
@dragon112 Ahh, now you understand. :)
@michael92 Noone is going to do your work, that's for sure.
We might help you, but nothing more than that.
@michael92 lol drop the code and describe the problem. Now it looks like you want us to write code for you. Which isn't right, I mean you have to try something, no ?
@dragon112...apparently that's not what i mean
@HamZa...no definitely that's not what im talking about..
Then post the relevant code in a paste bin
Anyway, I have to go now. Good weekend all of you!
14:31
@rdlowrey Yea seems pretty overkill for my needs, I was more interested in the concept of it's usage, I use DI throughout my projects, but I don't think I'd gain much (if anything) from using a DI container - except hiding bits of construction.
@dragon112 take care
Quite disappointed, was looking for a way to find the calling namespace, so I could make $a->make('Class'); resolve to \Calling\Namespace\Class, but if you call from the global scope, there's not enough backtrace info available to determine NS
user895378
$injector = new Auryn\Provider;
$injector->alias('Class', 'Calling\Namespace\Class');
$obj = $injector->make('Class');
user895378
@Leigh ^
too much overhead! :)
user895378
14:34
Only on the first call. Reflections are cached for subsequent use. Which is all you need in long-running applications. If you're doing it in a web SAPI context you would use the APC reflection pool.
Oh, WRT the APCReflectionPool, what do you think about storing the whole cache array on shutdown if the cache is tainted, and loading the whole cache on init
Wondering the performance gain (or hit), from making only one fetch/store call
@HamZa i have pasted the code at pastebin.com with account honumaxwell
user895378
@Leigh I actually have a class written to do exactly that. I think there would be huge benefits. But I haven't pushed it to the repo yet because I don't have test coverage on it.
@michael92 dude, you don't have to create an account (facepalm) just drop the link already
14:36
I was implementing the concept as file storage, but ReflectionClass and friends don't like being var_export()ed
at least APC can store objects
user895378
When using APC storage an average request your application would barely need to perform any reflections at all. So it should be a huge win for web SAPI use-cases.
@HamZa....ok
@michael92 Have you enabled error reporting ? The array you're creating is not the right syntax
@hamza what is the right syntax then?
@salathe How do you call men without beard?
14:43
please, when you develop, enable error reporting. Here go learn the syntax http://php.net/manual/en/language.types.array.php
This is too trivial,
If this is for your job, then please do the following:
first learn, then practice and then do your job
6
@MadaraUchiha "Jim"
@HamZa ★ for the "first learn, then practice, then job"
@HamZa i'm new to php....now learning please bear with me man
@michael92 Well sorry, you're now a helpvampire.
@HamZa....hmmmm
14:48
@HamZa First learn, then practice, then apply for a job
Oh, Madara already said that :P, well, it's true
@Leigh my english is bad :p
@Leigh but if this (ie. the help he is needing for the problem he is having)is for your job, it's already to late for that approach..
@Jasper So go do a job you're more suited to, like shining shoes
PLB
PLB
@Jasper Not really. You just need to change it like: first quit job, then learn, ...
http://stackoverflow.com/questions/17884453/php-redirect-user-back-to-login-page
14:52
@Leigh Were I in a position where I was earning much more than my capabilities merited (as you're implying), I'd try to hold on to that as long as I could. Shining shoes is always an option after they find out you're a fraud.
@Jasper This may be true. But if you are a programmer basic syntax for your language of choice should not be a question you ask on SO. RTFM. Seriously, I understand people gotta get started but basic syntax is not an appropriate question for this site imo.
Zzzzz
@cspray You're reading things into my comments I never meant to say; really, I am not saying this is a good question for SO. I wasn't commenting on @HamZa's comment, I was commenting on @Leigh's addendum to it, which I think was unwarranted (as the if I mentioned was already in the original post)
fake it til you make it
14:58
@Orangepill you got up late pilly..
@Mr.Alien I wish ... just had to actually do work when I got to the office... :(
@Orangepill get back to wrk than :P
@rdlowrey Potential downside to the bulk cache pull - can't test it - would it cause an autoload of every class referenced by the cached ReflectionClass objects? That would surely be undesirable.
user895378
@Leigh Well you could easily do it yourself manually using the particular request URI as a key ...
user895378
Targeted solutions are always better than one-size fits all.
15:03
@rdlowrey That's a good point, don't have to use a global cache.
Meh... again that argument missing bullshit talk from you... Stay away from CakePHP and stop the FUD, thanks. — burzum 28 mins ago
someone can add arguments nr.6+ , if you have time to waste
lol .. i wonder , why that comment got 3 upvotes
user895378
@Leigh I'm thinking something like this would probably be helpful:
user895378
$reflectionPool = new Auryn\ApcReflectionPool;
$reflectionPool->setAutoDumpKey($requestUri);
$reflectionPool->enableAutoDump(); // store the dump automatically at $requestUri key on __destruct()
$reflectionPool->loadAutoDump(); // may or may not have anything stored for $requestUri

$injector = new Auryn\Provider($reflectionPool);

// your app here
user895378
It just makes sense to route any reflection calls through a system-wide in-memory cache. Any Reflection speed drawbacks can be largely mitigated by doing this sort of thing.
15:26
hello everyone
@Leigh Have you had any problems with silex + urls with slugs in them - know of any extra setup required to get these working?
anyone here using LARAVEL 4 framework?
@Jimbo I don't use Silex, sorry
@Leigh Ah okay, no worries
/me should look into Auryn...
user895378
15:30
@Ocramius I dunno ... I hadn't worked on it for several months but there seems to have been a lot of interest in it recently. I could significantly improve the reflection pool stuff if I sat down and rewrote it now.
@rdlowrey I agree, I like the idea of the uri specific cache. As long as the app is well designed, and the function of a single uri doesn't vary widely, it will preload the reflection cache and autoload all of the required classes up front (I think). Still requires some benchmarking though I think. Who knows what the performance of that big fetch is vs X many reflection calls.
user895378
@Leigh Yeah -- I'll try to play with that over the weekend and do some benchmarking and see what happens.
@rdlowrey Made a tweak to delegates, not really necessary if using closures, but for factories that expect some sort of arguments to be supplied, could be useful github.com/leight/Auryn/commit/…
@rdlowrey fact is that I'm doing a lot of evil stuff lately. Adding a serialized reflection pool seems a good idea even just for the name :)
user895378
@Ocramius lol that's my favorite part of the library ... the name ReflectionPool
15:34
@Ocramius More difficult that it sounds, the ReflectionClass, ReflectionMethod, etc. objects do not like to be serialised
@Leigh I know :D
@rdlowrey I'm thinking of basing the next injector on pure code generation
no runtime execution. If you want things injected at runtime, you compile a new container
user895378
Sounds interesting ...
In case anyone has any Silex knowledge
0
Q: Silex slugs cause 404 page not found

JimboFollowing the documentation, Silex allows "slugs" to be passed in via the URL for use within your code. The following example works: $app = new Silex\Application(); $app->get('/', function () { return 'HAI'; }); However, the following gives a 404 Not Found: $app = new Silex\Application(...

that: 1) saves us from morons that replace services at runtime 2) guarantees immutability 3) is fast.
@dragon112 confirmed:
> Love to put hands on PL/SQL as well.
15:37
@Ocramius I kind of thought the point of Auryn was to get away from the "compile a container" approach.
@Leigh yes, but looking into different approaches is always good
> Ocramius has requested access to PHP.
dafuq
@DaveRandom because I made all reflection properties unaccessible...
Not really a fan of code that generates code, unless you're writing malware
Bad skills
15:38
Or a compiler, duh
posted on July 26, 2013 by Anna Filina

Agile methodologies are a big trend. Some adherents promote their methodologies like religious fanatics. They tell you that your soul will burn in hell if you don’t embrace the teachings… err that you’ll have a dysfunctional team and that your project will fail. Although these methodologies have some merits, they’re not infallible. The belief that an agile methodology works for everyone, i

@Leigh it should not be something you want to read. I'm already doing a lot of code generation and I tipically tell users to just stay away from it
I wrote a full class mocker using reflection years ago, as you say, ugly as sin
@Leigh I know the feeling... still, it's better than resolving things at runtime
and I really want this concept of "ImmutableDiContainer"
the two things work fine together imo
getcomposer.org is down :(
15:43
@Feeds She could add that "people staying open-minded when others challenge their methodology or find better ways to do things" is actually pretty much what Agile is about.
@Ocramius Resolving at runtime has its benefits, especially in early development where things change a lot and regenerating code and clearing cache becomes a headache rather than a feature. Being able to flip between runtime and compiletime would be good.
@Leigh no caches... I'm no symfony
the container would be compiled and eval'd at runtime I suppose. Or I'd just have a runtime version of it
I just want a "freeze" point, when the container actually becomes immutable after app bootstrap
From the settings of an FF extension:
> Don't start a gesture when the alt-key is depressed
FU RFC2616
The second arg is supplied in order of the server's preferred types for the resource, so if multiple possibilities are present from the client's point of view the server will serve its preferred type from those possibilities
It's a really stupidly complicated mechanism.
user895378
@DaveRandom Nice.
15:49
@Jimbo You don't need DirectoryIndex in your apache config if you use the .htaccess that comes with silex
user895378
@DaveRandom While we're on the topic can we just mention how asinine it is that the PECL extension's http_negotiate_content_type function doesn't allow you to pass in the header to be negotiated against? WTF Who thought that was a good idea?
@rdlowrey It's slightly O(scary) though, not recommended unless you don't mind a bit of a performance hit
user895378
@DaveRandom Do you have a set of tests to run against it (aside from example.php)?
@DaveRandom FWIW, this shouldn't bottleneck an application, seeing as what it is. I like it :-)
No, I've fudged the example around a bit and it always produces the results I expect but tbh I only finished writing it about half an hour ago
@Bracketworks Too much preg_* for my liking but I think anything else wouldn't really be any quicker (not in userland, anyway). Also I don't like that you need to parse out the whole thing, params and all, but in order to follow the rulez that is what you must do.
user895378
15:54
> TODO: we don't account for accept-extensions
user895378
^ I would drop the "TODO" in favor of "we don't account for accept-extension. Don't use them, you moron."
I don't know if there are any defined anyway, I haven't checked
@DaveRandom Well, if someone bottlenecks on this, it'll be due to parsing hundreds or thousands of content type negotiation values. If that's the case, then they're probably better off planting trees, or dry-walling.
@Bracketworks Have you heard about Aerys? ;-)
(sorry ping-tastic)
@DaveRandom Point sir. Point and match.
15:56
@cheesemacfly I'm not using .htaccess actually... could be the issue, or just a side one?
I'm too busy thinking of PHP in the conventional sense.
@rdlowrey Go plant a tree.
user895378
I've come back around to the feeling that I'm not going to be able to get what I want out of Aerys until I implement some things in C and expose a PHP extension to do them.
I may wrap it into an Aerys mod at some point, I'd be interested to see what the real-world performance hit actually is
@Jimbo Ah. Not sure, let me see if I try on mine.
@cheesemacfly Nicely done, you do need the htaccess
:D
user895378
15:57
@DaveRandom I could do it for you. I'll actually try to do that later today just to see what's up.
@Jimbo It works if you put it back?
@cheesemacfly Yep, putting the .htaccess in there with "FallbackResource /index.php" makes slugs work
@Jimbo Well then it's just about apache configuration :)
user895378
@DaveRandom Well, partly. It's just a losing battle to try to match compiled performance in PHP. It's possible to be comparable, but when every line can potentially blow up your benchmarks it's excruciating to write code that way.
15:58
@cheesemacfly Yep!

« first day (1014 days earlier)      last day (4159 days later) »