« first day (724 days earlier)      last day (4207 days later) » 

3:00 PM
@rdlowrey btw: It would probably a sign of a beautiful design if the injection container would actually inject it's ReflectionPool dependency by/to it's own.
 
user895378
@hakre I feel like that would be too magical though. IMHO, there's no sense in gratuitous usage -- if you know exactly what a class needs dependency-wise, I think you should just inject it directly.
 
user895378
Also, the container works off of reflection, so if you already know what dependencies are required but use the container to provision something anyway, you're just adding extra processing to your code. Caching mitigates this, but I'm still not crazy about the idea of adding unnecessary reflections to your code.
 
@rdlowrey Sure, I also have no such design at hand of which I would say it's beautiful. Probably it's worth adding adding a listener to the pool so that it can generate a static version of the information gathered so that the use of reflection can be reduced for usage that went through a built.
 
@gordon I think it says it cannot include the required file "facebook.php" because its include_path variable cannot be found
@Gordon
I am sorry for my clumsy entries in this chat. Very new to the chat area
 
3:11 PM
@ConversationCompany What do you think would be a good next step to fix that?
 
@ConversationCompany What you say suggests that there is some vague understanding of what the include_path is about: php.net/include_path
 
@SomeKittens I think a good place to start would be the php.ini file
 
@ConversationCompany Awesome. What would you do in php.ini?
 
@SomeKittens I would look for the include_path variable and set it to my php/pear folder. I don't know why the pear folder, though
 
@ConversationCompany you are on the right trail. require cannot find the facebook.php file. But you should have a look at what that include_path thing really means. @hakre gave a good link for that purpose.
 
3:13 PM
@ConversationCompany I don't either. Do you know where facebook.php is?
 
@NikiC Has it been totally overlooked, that you cannot define $var and $__var any more with this implementation? If you do $obj->var = foo, then $obj->__var is also automatically set. Too much BC potential.
 
user379888
Hello. I have developed a widget for a person which includes images in a carosel. He will be creating many more widgets out of that one widget. The person wants to make the task of adding images to the carosel easy so he asked me to add a drag and drop action for the images. I am thinking to use a PHP drag and drop script to upload the images but how do I enable making of different widgets by using the same drag and drop code?
 
@Gordon originally my include_path was commented out and pointed to ".;C:/php5/pear". I just blindly changed it to my operating PHP folder, d:/php/pear, not completely understanding what include_path really means. So let me have a look at that link and come back here in a bit
 
Hi
how could i execute a curl string like curl -u userid:secret jira.atlassian.com/rest/api/latest/issue/JRA-9.json ?
 
@Gor
Sorry. @Gordon, @SomeKittens, @hakre - I think I see my problem. My facebook.php is supposedly in sdk/src/ in my app folder. So, I must also point my include_path to that folder. Am I correct?
 
3:20 PM
@PhpInternals
 
user895378
@NikiC Another (small) benefit of a DIC that I don't really cover in the wiki is that it provides a modicum of extensibility in procedural code that otherwise might not offer it. For example, in an application bootstrap file you can't really allow custom implementations of the newables in that file because you're instantiating them directly:
 
user895378
<?php // my bootstrap file
$obj = new SomeLowLevelApplicationClass();
$obj->doStuff();
 
user895378
Whereas if you program to interfaces and used the DIC to instantiate your bootstrap newables you could enable custom implementations of SomeLowLevelApplicationClass for downstream users without those users having to hack up the internals of your bootstrap file:
 
I can definitely see the benefit to having a small, elite group of people plan out a language instead of true group collaboration.
 
user895378
<?php // the same bootstrap file
define('INJECTION_DEFINITION_CONFIG', '/hard/path/to/definitions.php');
$injector = new Auryn\Provider(new Auryn\ReflectionPool);

require INJECTION_DEFINITION_CONFIG;
$injector->implementAll($implementations); // $implementations stored in config file
$obj = $injector->make(InterfaceForSomeLowLevelApplicationClass);
 
user895378
3:22 PM
In the second bootstrap file above, a simple configuration allows the end-user to swap out core functionality at any point in an application.
 
@ConversationCompany either that or you put the facebook sdk into your current path. In general it is good not to have too many paths in the include_path because php will go through all of them when using include/require
 
@rdlowrey smells like global state
 
user895378
@tereško It's only appropriate at a bootstrap level -- and it's no different from using a factory class.
 
user895378
You're simply wiring together the application -- it should never be used anywhere but the very top of the object graph
 
3:23 PM
@StartupCrazy make the widget into an object and instantiate multiple instances each with their own listeners
 
@Gordon - but the problem is, my sdk folder is empty. Before I installed apache, I have been git commiting my app files to see the changes on Heroku. So I don't know how the facebook.php was included when it is not present in my directory. Am I missing something basic here?
 
hi to all
 
user895378
@LeviMorrison 'morning
 
is there a way to convert mp4 files to flv?
 
ffmpeg
 
user895378
3:24 PM
@LeviMorrison +1
 
0
Q: getting an external webpage with curl, password and username

Dan Sternim retreiving a webpage as a string using curl and php code: $ch = curl_init(); // the external url $url = 'http://cursos.puc.cl/eaa220a-1/correo/main.html'; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;...

 
yes i found that ffmepg can do this, but it makes with serverside commands. i need to make it with php.
 
@codeTemplar ...which is also serverside...?
 
@SomeKittens you mean i can execute serverside commands with php?
 
@ConversationCompany your setup is pretty much a black box for me so I can't tell. sorry.
 
3:26 PM
@SomeKittens thanks!
 
@ConversationCompany Let me fetch you a good reference question.
 
@codeTemplar No problem. I use that a lot for Prolog
 
0
Q: Failed to open stream even though place exists

DdordaI'm trying to include a file using: require_once '../config/configVARS.php'; but I get the error: Warning: require_once(../config/configVARS.php): failed to open stream: No such file or directory in ..../classes/FileHandler.php on line 2 Fatal error: require_once(): Failed opening required '...

 
I count 6 references to TLDs in this question (including title) and it would seem the OP does not even know what they are...
2 in the same sentence
 
@hakre But the OP in that question knows that the file is there. I can't find the file though the set up worked fine without the file in my directory when I was running the app from a webhost (heroku)
This question, I feel, is very similar to my problem
@Gordon - thanks a lot for your help. I learnt a lot in a short time
 
3:35 PM
@ConversationCompany You do not even know where the file is? Well, before you can do any include, you need first of all know where the file is, it's full path. Otherwise you do not need to ask about anything else I'd say.
@DaveRandom I CV'ed as NARQ and left a comment.
 
@Leigh No BC potential. If you don't use accessors, they aren't used ^^ But it's still very ugly, that's why I don't like it
 
@ConversationCompany you are welcome :)
 
@hakre Well if we're getting WP-specific I'm out. I know basically nothing about WP and the more I learn the more I wish I hadn't learnt.
 
@DaveRandom I think that user is just asking for a free "how to solve this intelligently" anyway. If you actually answer new questions will pop-up following the trail of his needs.
See his comment. Wordpress is sort of like jQuery. You only need a plugin or so.
 
@hakre $(posts).each(function(post) { badly_named_completely_nondescript_function_that_takes_no_arguments_and_does_fuc‌​k_knows_what(); });
 
3:45 PM
@LeviMorrison Not sure if sarcastic or not
 
@DaveRandom for the fun: jsfiddle.net/m9pA6
 
@hakre Nice! Didn't even think of that, I was going down the onchange route. I love stuff like that where 1 CSS rule does the same thing as 20 lines of JS
 
one more question
any idea how to play mp4 files on any browser (maybe except explorer)?
 
@codeTemplar install the vlc player plugin.
 
3:54 PM
@hakre thanks but i need to make a small web and i dont want all the users to install plugins
 
@SomeKittens :D
 
@SomeKittens lol
 
@slugonamission It's probably Robert'; DROP TABLE students; --DaveRandom 1 min ago
:-D
 
@codeTemplar then just tell your users they need to be apple users.
 
4:04 PM
@DaveRandom And now the variant with CSS 3 selectors: jsfiddle.net/m9pA6/1
 
@hakre :checked? That's a little counter-intuitive, is there no :selected?
 
@DaveRandom it's the same. HTML4 selected and checked attributes are both covered by that selector.
so you can use it for radios and checkboxes, too.
I think the real fun is putting both selectors together: jsfiddle.net/m9pA6/2 - You can only select a new value and not that one you already selected. Nifty. That improves UX because the list get's smaller!
(Note that you can already scroll through with cursor keys)
 
pce
@hakre woah, nice solution to solve such an idea.
 
@hakre Genius. Maybe what the OP really wants is just decide for them. That would be the least cost route, I feel.
 
@DaveRandom
@pce hi!
 
4:30 PM
 
@hakre thx
 
@Gordon +1
 
@hakre I'm having real difficulty wrapping my head around that "both" thing. Why does it never show you 20 in the list? It's as if by using the CSS3 :checked it stops selected from being changed?
@tereško Someone's singing you a song stackoverflow.com/questions/12804525/…
Holy crap is it "badly indented code Tuesday" or something? The last 20 or so questions I've looked at have either been a wall of code or it looks like someone's been standing on the left margin firing machine gun bursts into it.
 
4:46 PM
@Gordon we unlocked the unlock achievement.
yay!
 
Is there a badge for getting 100 more upvotes than the accepted answer?
119
A: PHP validation/regex for URL

StanislavGalen is right, filter_var() function is the best way to validate whether a string is URL or not. var_dump(filter_var('example.com', FILTER_VALIDATE_URL)); It's a bad practice to use regular expressions where is's not necessary.

 
@DaveRandom It's not actually a good answer
filter_var is really bad for URLs
 
@NikiC Why? What's wrong with it? Implementation problem?
 
@DaveRandom It lets too many things thought that one would not usually consider a URL ;)
 
4:56 PM
@hakre nice
 
user895378
@DaveRandom all filter_var does is check that there is a scheme followed by valid URL characters ... which could be pretty much anything ... dumb://x or http://z ... they're technically valid URIs according to the spec.
 
@DaveRandom wow. so many link only answers. had to flag three
 
user895378
4
A: Anything start with http:// is validated by FILTER_VALIDATE_URL?

rdlowreyWell technically, any URI that starts with a scheme (like http://) and contains valid URI characters after that is valid as per the official URI specification in RFC 3986: Each URI begins with a scheme name, as defined in Section 3.1, that refers to a specification for assigning identifiers w...

 
@NikiC @rdlowrey Even so, I suspect it would do a better job than a regex rolled by someone who has to ask for help with it. And I'm not suggesting I could do it any better. Although I have to say that all I usually want to check is that the URL is syntactically valid, I have been known to invent URL schemes for stuff in the past and I also have had many dealings with SIP. If I need to analyse parts of it I can always throw it into parse_url() afterwards.
@Gordon Did you look at the already deleted answers?
> I was looking for such kind of post since a long time to understand this topic in well manner. Now I am satisfied and got lots of thing after visiting this post. Delhi Escorts
 
user895378
@DaveRandom I tend to agree with you -- most people just don't understand that there's a difference between technically valid URLs and what they see as OMG there's a user input with no TLD in the URL!!!
 
4:59 PM
@DaveRandom Depends, if you want a tighter whitelist (i.e. only allow FTP scheme urls), than filter_var may not be for you.
If someone here still can
 
user895378
@MadaraUchiha but it's trivial after calling filter_var to add a check like parse_url($url, PHP_URL_SCHEME) === 'ftp'
 
@rdlowrey True, didn't think of that
And it looks better too.
Carry on
Could anyone help me find Symphony's router implementation?
 
@DaveRandom Delhi Escorts, hrhrhrhr
 
Can't find it in their source code
 
private $parts; is still the best variable declaration ever
 
5:07 PM
@Gordon Exception up = new Exception(); throw up;
2
or tantrum, also epic
 
@MadaraUchiha :)
 
@Gordon For colors there's #BADA55
Which is a yellow greenish color
 
@MadaraUchiha For the CMS?
 
@hakre Aye
I already have most of it implemented
But I want to see how they do the last part
(Actually routing after building the route objects)
So that I can get ideas for my own
 
Hey.
I have a question about isset()
 
5:12 PM
@JordanRichards Fire at will.
 
user1125394
isset(unset($x))===true;
 
say for now I had a post that was not set. Then defined a variable like so.
$hey = $_POST['I_aint_set'];
if(isset($hey)){
echo 'Would this be echo\'d?';
}
 
@MadaraUchiha Never heard that Sym*ph*ony2 CMS does have routing at all. It's normally an extension to it that provides that.
 
@hakre Really?
Can you direct me there?
 
@MadaraUchiha Really what? What's in the URL triggers what is fetched from the database which is then turned into XML and the XSLT processing is then fired.
You configure that in the admin.
 
5:17 PM
Anyone answer my question?
 
@JordanRichards I don't see a question here
 
Would this be echo\'d?
see?
 
Well, here's a silly question
Have you tried?
 
@jordan
oops here is the correct one codepad.org/fA7YxcmT
 
cheers :)
 
5:21 PM
@MadaraUchiha yupp. knew that already ;)
 
@JordanRichards I know it's tempting to ask everything and get an easy answer
But please PLEASE do some testing/trying/searching/debugging yourself
5
These are invaluable tools for a programmer, and you can't afford not to learn them if you plan on continuing on the course of web development, or software development in general
 
@JordanRichards another example, for your debugging needs, take a look at var_dump: codepad.org/xfK7b9T5
 
hiya
 
@PeeHaa Hi
 
good morning @PeeHaa
 
@MadaraUchiha: Maybe better luck here: getsymphony.com/learn/api/2.3
 
@hakre morning :)
 
@hakre Will try
 
I hate busses
 
@Leigh You don't want to open this subject with me in the room
 
5:39 PM
two closevotes on Operator Reference
 
Why is Javascript so damn stupid. God it sucks even moar than PHP. :(
 
@Leigh FSB or BSB?
 
lol
 
grrrr, I hate it that ff always assumes I want to bookmark a feed. it should offer me an option to watch the XML
 
Serious is there a easy way (i.e. without looping) to get the number of items in an array object?
 
5:45 PM
@PeeHaa isnt it countable?
ah, you mean in JS
 
@Gordon Not without looping :(
yep
 
@PeeHaa by array object you mean [1,2,3] ?
because that would be [1,2,3].length then
 
@PeeHaa .length
 
33 secs ago, by PeeHaa
@Gordon http://jsfiddle.net/PeeHaa/H4Run/
 
5:48 PM
anyone seen this clone Q&A forum? talk.webplatform.org/forums
 
@MattRockwell At least that one looks decent
 
@MattRockwell t.co/wGnFRFz1
 
@PeeHaa Look at the questins though
some awful moderation
 
5:52 PM
Makes want to start trolling over there :)
@MattRockwell btw isn't that site sponsored by some big names?
 
yup
the site itself is a cool concept, but it seems like they are just trying to jack SO for the forum
 
They are. Hey they even have a chat
 
@SomeKittens What do you mean by missing the point?
i think that person is trollin
 
^ new strategy: telling code does not work, but not posting it. can u fix it?
 
wtf:
> it's only critical if you prefer commas at the end of your element assignments.
 
posted on October 09, 2012 by Andi on Web & IT

I’m pleased to share that Red Hat and Zend today announced a partnership and the immediate availability of Zend Server for Red Hat OpenShift. With this partnership Red Hat and Zend are joining forces to support professional PHP Cloud developers. A developer can now spin up a gear of Zend Server on the OpenShift platform as a service and instantly get access to a full ready to go enterprise clas

 
"Enterprise PHP on Red Hat OpenShift PaaS"
wow
 
user1125394
 
user1125394
" in Javascript the comma on the last element raises an error"
 
user1125394
for me no
 
@cyril What browser?
 
user1125394
chrome
 
@PeeHaa Zenderprise PHP :)
 
6:16 PM
@cyril Try it on IE
 
user1125394
oh lol
 
user1125394
will be hard under lubuntu btw
 
user1125394
@MadaraUchiha right jsfiddle.net/4KJBB/1
 
@hakre wtf. how did that survive for so long?
 
6:18 PM
@MadaraUchiha right
Depends on user agent
 
@cyril Tried Lubuntu, didn't like it. There's always IE tab
 
@Gordon I have no fck ing clue. :)
 
Well it's dead now.
 
@PeeHaa @MadaraUchiha Also depends how you declare it. In Chrome 21 stuff = [0,0,0,0,]; works but stuff = new Array(0,0,0,0,); does not. (that you would ever do the second, and not that the second result is unexpected, but just illustrating the point)
...and evening all once more, I see a few fresh faces
 
6:24 PM
@hakre Hardly surprising with such a glaring error in the English syntax
 
Does anyone know, who is allowed on twitter to create on profile page such parts, i.e. twitter.com/mdo, twitter.com/twbootstrap etc.
 
@DaveRandom The latter option doesn't exist ;-)
 
I'm talking about those at the top
 
And evening Dave
 
good evening, good morning, good day, good night, good morning
 
6:26 PM
@Lusitanian Good grief!
 
lol
 
good evening
 
@PeeHaa You think we're ready for a PR yet? I've not seen anything unexpected for a couple of days.
 
user1125394
thx IEtab on chrome: https://chrome.google.com/webstore/detail/ie-tab/hehijbfgiekmjfkfjpbkbammjbdenadd,
wanted to try archlinux, but I'm not sure it will support well this crap laptop
 
@cyril Lubuntu had a lot of issues hibernating for me
i.e. it didn't.
 
6:30 PM
@Lusitanian hiya
 
user1125394
I use it because I don't like either the gnome or kde environments
 
@DaveRandom Works for me
 
hiya @PeeHaa
 
@cyril Mint (with Cinnamon) is excellent.
 
Why on earth would one need that? stackoverflow.com/questions/12804592/…
 
user1125394
6:31 PM
@SomeKittens is it light?
 
@DaveRandom do you need my key to pack it or should I just pull everything and pack it myself?
 
oooh, new review badges
shiny!
 
@SomeKittens They aren't that new
 
@hakre "Get rid of the meta tag"
 
I didn't realize there were gold ones
 
6:35 PM
53
Q: New Community Review badges

Shog9We're getting close, boys - we're gettin' close! The Community Review Dashboard is finally nearing something we can call "release quality". All of the major categories from the old system are in place, and the time has come to address those stinkin' badges... The old reviewer badge had a fairl...

 
user1125394
MATE mate-desktop.org is gnome-based?
 
user1125394
seems so
 
I really like those people who ask a question and then answer it themselves
"Does isset() work in this case?"
"It doesn't work for me"
 
I found a canonical for three error messages at once: stackoverflow.com/questions/12805278/…
 
@hakre Just wow
 
6:42 PM
@hakre :ם
Kill it! KILL IT WITH FIRE!
for those who aren't following :P
 
@hakre
 
Can someone please help me with my question here stackoverflow.com/questions/12365852/…
 
@cyril no , it is GTK based
there is huge difference
 
@Michael Your question is about to be closed.
Because there's no question there.
 
user1125394
6:59 PM
@tereško thx, it's at lower level
 
This one is funny too:
 
@PeeHaa Up to you, but I guess the easiest way would be for you to do it if you already have the key. I'll update the manifest to 0.19.0 and create a PR now.
 
7:14 PM
13
Q: Zend_Search_Lucene tries to allocate 3503812093817007931 bytes

DanI have around 250kb of static HTML that I have to search through. I figured I would use Zend Lucene for that. Creating indexes takes a few secs and all is nice and good except if I search for "about" it ends up with this: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to a...

 
@hakre Did I just see PHP 6?!
 
That version of php doesn't exist yet. So either you're lying, or can you give me the winner of the next 3 super bowls please? — ircmaxell 27 secs ago
 
That's a lot of RAM
 
@Jocelyn That means that an overflown integer was passed to an allocation function, on a 64bit platform ;)
You can get a result like that with most the the PHP string functions that take some kind of length / multiplier / whatever
 
@NikiC Come to that, does MySQL 6 exist in any meaningful way yet?
 
7:16 PM
Didn't they just release MySQL 5.6?
 
@NikiC OK, it explains why that gives so big a number then
 
@NikiC Looks like 5.6 is the dev, 5.5 is still the GA
 
5.6 is latest
 
naah .. i'll better stick with 9.2
 
7:18 PM
pgsql?
 
aha
 
aha?
 
aha, mhm .. unarticulated sound to communicate affirmative response
 
so, so
 
user1125394
7:26 PM
why are there so many Linux desktop environments en.wikipedia.org/wiki/Desktop_environment , it's great for the choice
 
user1125394
but people are (re)developping many things to fit in each environment
 
I got the information from a guy that works here, — EaterOfCorpses Jul 9 at 14:00
 
@hakre Yeah noticed that
 
i suspect, PHP team has not been informed, that they should be working on PHP7 now
 
pce
7:33 PM
ES6 is coming, the next Version of ECMA Script may come with generators, modules and named paramters and other goodies:
http://brendaneich.github.com/Strange-Loop-2012/#/
 
ESnext/ES6 has been coming-soon for some time (I'm not even sure if those are separate branches or same one)
 
@PeeHaa: There is no need to delete all these, at least not all, or is it?
 
@PeeHaa Merged, build at will.
 
updates for chrome ext?
 
@pce Seen it. Reminded me that I wanted to implement rest parameters and spread for PHP too
 
@hakre github.com/DaveRandom/cv-pls now first things first... beeeeeer time
 
pce
@NikiC That would be cool. Rest Parameters are ... as Array? What do or would you think about Modules in PHP?
 
@PeeHaa @DaveRandom Still waiting for the FF ext :P
 
7:51 PM
@NikiC Job number #next
 
@DaveRandom Gooood
@pce Nothing as I don't even know what modules are :P
 
@NikiC Sounds like they are trying to introduce a new way of doing some hefty tight coupling. Not sure though
 
Okay, I think we should consider that PHP start to support inline JS
 
@hakre Oktoberfest much?
 
@hakre Well, we do have a v8 ext for PHP ;)
 
7:54 PM
@PeeHaa Oktoberfest?
 
@NikiC Private inner classes would be fairly close (I think, if I'm not completely way off in my understanding of it)
 
Just wondering whether you are still drunk ;-)
@DaveRandom Why did you add you pem file? :P
 
@DaveRandom I think that modules are some kind of mix between include, namespaces and access control.
 
@PeeHaa God damn it! I was so careful all the way through not to do that! Not careful enough, it would seem.
 
Well. You are not the first. lol
 

« first day (724 days earlier)      last day (4207 days later) »