« first day (1569 days earlier)      last day (3372 days later) » 

12:53 AM
php.net/manual/pl/java.servlet.php - wat? Also when was it removed?
 
First time ever I've seen that
 
@Ocramius ended up scrapping the repo 'stack-csp', it was never fully functional and had a ton of problems. Working on a new version with a friend. You had the last remaining fork, which has now turned into the official source. So you can mark it as non-working, delete it, or provide support for it (but nobody ever used it) =o( just wanted to give you a heads up. =o) I have no idea how all this stuff works.
 
Ah, the "you touched it last it's yours" style of project management.
4
 
lol
 
Am I a bad person for wanting to bring back PHP 4 value-type classes?
 
1:09 AM
@AndreaFaulds I actually don't know what that means? Is it like a struct?
 
@Danack It's like an array in its copying semantics:
$a = new Foo(); $b = $a; // $b is a copy of $a (well, it may be the same until it is modified?)
oh wait, copy-on-write would be impossible to implement
:-/
screw it I should just quit PHP and make my own language (without blackjack nor hookers, because I don't believe in gambling, nor people trafficiking)
 
Boooooo your language sucks by design :(
 
@PeeHaa lol
 
:-)
 
I had a question the other day chat.stackoverflow.com/transcript/message/21251267#21251267 would this be possible for PHP to do? good idea? RFC?
 
OIS
1:12 AM
no blackjack or hookers?
who whould use such a language?
 
@crypticツ that is something that's often bothered me, I must admit
<?php
$a = "foo";
$a .= "bar";
$a .= "baz";
It's annoying how the first line differs
 
@AndreaFaulds Remove the space on the last two :)
 
But, that being said, I don't think we should allow what you're suggesting
Catching errors is good...
 
@crypticツ I would rather see the latter throw up tbh
 
@PeeHaa Or add a space on the first.
Another option is don't have the $a...
<?php
$a = "foo"
   . "bar"
   . "baz";
 
1:15 AM
People are probably going to hate me for this, but what I just suggested is waht I always do:
$query = 'UPDATE backup_tasks';
$query.= ' SET server_id = :server_id, name = :name, type = :type, start_time = :start_time';
$query.= ' WHERE id = :id';
 
lol
C has implicit concatenation for string literals:
char *foo = "foo"
            "bar"
            "baz";
 
That looks strange to me :)
Not bad, just strange
 
It makes more sense for longer multi-line things:
char *foo = "<!doctype html>\n"
            "<meta charset=utf-8>\n"
            "<title>you suck</title>\n"
            "<h1>and don't you know it</h1>\n";
(also handy in macros)
 
OIS
c don't have heredoc?
 
It doesn't, no.
You can also use `` like so:
char *foo = "<!doctype html>\n\
<meta charset=utf-8>\n\
<title>you suck</title>\n\
<h1>and don't you know it</h1>\n";
 
1:20 AM
@crypticツ So for me personally: yes, no, no :)
@AndreaFaulds And if it is PHP source:
char *foo = "<!doctype html>\n                                            \
<meta charset=utf-8>\n                                             \
<title>you suck</title>\n                                                                           \
<h1>and don't you know it</h1>\n";
 
@PeeHaa it only looks like that if you have the wrong tab width
and that's only for macros ;)
 
@AndreaFaulds s/tab width/character used for tab
 
@PeeHaa no, tab width
 
@PhilSturgeon I think possibly borked the breadcrumbs on the RFC homepage I am not good with computers
..
 
:-)
 
1:33 AM
@Danack the breadcrumbs on DokuWiki are not breadcrumbs, oddly
 
But they're in the place where every other site on the internet has breadcrumbs...
 
they're breadcrumbs in a more literal sense
they're your own trail of breadcrumbs
rather than the ideal, hierarchical, fake trail you're looking for
DokuWiki is clearly for people whose browsers lack back buttons and history.
 
2:20 AM
@PhilSturgeon You lied to me.
You said it was ReflectionProperty or something
^^ I didn't check the log; I could have misread
 
> In the spirit of open source, use of this library for evil is discouraged but not prohibited.
\o/
 
2:42 AM
I've looked around, but I can't find an answer anywhere - how can I dump all $_POST variables into an array of strings?
 
hello :)
@AndreaFaulds oh don't get pissed of because of my comment, I really wished you first proposal was already merged on master.
@PeeHaa this reminds me of the JSON license:
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software
> The Software shall be used for Good, not Evil.
 
Yeah yay for ambiguous licenses...
:P
 
how can ones define good or evil these days?
we shouldn't be using json because of this license.
 
@marcio no no, don't misunderstand
 
YAML FTW! :)
 
2:54 AM
I just don't want custom types like that to get in before scalar types of some kind
because otherwise every man and his dog's framework will have its own set of custom scalar type hints :(
 
@PeeHaa but YAML IS evil bcause it has too much features, you can even reference yaml files inside other yaml files.
 
Honestly I don't think JSON is ambiguous
good and evil won't holdup in court
The whole license would be dismissed.
Anyone who says "I should be able to use this for evil" is just stupid.
The actually concerned people are the ones who know it woudl get dismissed if it ever came to it.
Then they are using a license, once invalidated it would mean they can't use it.
 
You know what? PHP's copy-on-write model, and its concept of references, are actually almost perfect.
 
@AndreaFaulds I disagree with that but don't worry, I'll not put a concurrent RFC running the risk of puzzle what you already achieved so persistently
 
@AndreaFaulds Ugh, get thee hence thou fiend.
 
3:00 AM
@LeviMorrison I'm serious. The problem with references is just that they're per variable, not per value.
 
I don't care if copy-on-write model is perfect, good or evil I just want it to be fast :) and it is
 
Hmm
Types shouldn't be by-reference or by-value
You should be able to choose.
Instead of making objects be by-reference, we should have just fixed references
Alas.
 
@LeviMorrison not really true, some governments have an absurd vision of good and evil and people are subject to that definition, these people are not stupid.
 
3:24 AM
@LeviMorrison It would
A copyright license can place any restriction it likes
The GPL is only valid because of this
 
is there any tool to convert old array syntax to [] syntax?
 
3:39 AM
@marcio You could write one fairly easily if you wanted
 
4:00 AM
yep, but I imagined somebody would already have done it
 
 
2 hours later…
5:49 AM
hi guys
 
6:04 AM
Helllo guys, is websocket is the best option for creating socket listener rather than php ?
 
6:24 AM
woot! So I'm working on a bugfix and I rebased with master to get latest stuff. Now when I try to "make" I get the following error:
Generating phar.php
PHP Fatal error:  PDO: driver sqlite requires PDO API version 20150127; this is PDO version 20080721 in Unknown on line 0
PHP Fatal error:  Unable to start pdo_sqlite module in Unknown on line 0
make: ** [ext/phar/phar.php] Erro 254
solved ^
I just had to ./buildconf --force
 
7:35 AM
mornin
 
Mornin
 
Morning!
 
7:57 AM
Blah
About to depart heading homr
 
8:39 AM
morning
 
mornin
 
Hi everyone.
 
9:14 AM
What's the correct syntax for a vagrant shared folder from windows to amazon aws? I've tried every variation of c:\\myFolder, //myFolder, /cygdrive/c/myFolder, ./, etc etc.
 
9:37 AM
Do I really need PEAR to get PHPUnit working on windows?
turns out xampp already has phpunit
 
user3949359
In PHP preg_match
 
user3949359
int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )
 
user3949359
I'm readin the definition right now and can't figure out the difference between $pattern and $subject
 
user3949359
One is the string to look for, the other one is the input string
 
user3949359
aren't they the same thing? The input string is the exact pattern I would like to look for
 
9:54 AM
$pattern is your regular expression, while $subject is the string the regular expression will be applied against to find matches.
I don't see what the confusion is O_o
 
@MarcelBurkhard You should try out vagrant! It's twice the fun, and twice as slow :D
 
@BenjaminDiele is it like a vm from an image?
 
user3949359
@crypticツ The confusion comes from the definition in the PHP docs for $subject- "The input string."
 
user3949359
unbeliavable
 
@MarcelBurkhard Ya. You can use it to make several machines quickly with the exact same configuration.
Good for dev - test - prod for example
 
9:56 AM
@BenjaminDiele sounds very interesting will look into it but first I need to achieve it once myself :P
 
@nosille which is correct. It's the string you're providing (inputting) the function so it can then search it using the regex. Would it make more sense if instead of $subject it was $searchText? I'm assuming the noun used is what is confusing.
 
mornin', everyones
 
also "The input string is the exact pattern I would like to look for" then why use preg_match()? Why not just == or ===
morning
 
hi
does anybody know answer to this question :

If i start wordpress from function:

function startwordpress_($root)
{
define('WP_USE_THEMES', true);
require( dirname( __FILE__ ) . $root.'/wp-blog-header.php' );
}
starwordpress_('/blog');
it acts strange on some things, custom post types and some plugins. What is the issue there?
 
10:50 AM
morning
 
ThW
11:00 AM
Morning
 
user3949359
@crypticツ It makes sense to you, since you're familiar. It's worthless to me.
 
@nosille It's not the documentation's fault that you're not familiar with basic words.
 
there is documentation in many languages, maybe you should choose yours instead of english, @nosille?
 
user3949359
@PaulCrovella Of course. It's over-simplified, they didn't care to elaborate. It's like saying: "Humans are mammals", period.
 
11:19 AM
@nosille What are you talking about, there's nothing to elaborate on. Though hell, even if you can't figure it out from the text, or the context, you should be able to work it out from any one of the many examples given. I don't think putting the most basic, minimal effort in is too much to ask of a reader.
but sure, blame the documentation if that's below you
 
11:30 AM
@PaulCrovella Yo! I got everything working with vagrant now, thanks again for your help
 
@BenjaminDiele nice! no problem :)
 
@PaulCrovella But I've hit a snag when deploying to AWS. Right now I have my Vagrantfile & puphpet folder in my code repo, so that I can easily vagrant up via phpstorm. But I use a different vagrantfile for AWS, and thus can't really git clone my code otherwise I'd overwrite my AWS vagrantfile. How do you handle that?
if that ^ makes any sense :D
 
@BenjaminDiele I don't use aws for dev vms. You're not talking about a production deployment with vagrant, are you?
 
@PaulCrovella I think it would be best to provision each machine via vagrant, or not? This is my first time using it, so I don't know how this normally goes. A vagrant for each developer, a vagrant for testing servers, and a vagrant for production servers?
 
Vagrant isn't for production. Far too much is really, really insecure by default on a vagrant box (ssh keys and such.) It can be used there with some effort, but that's not what it's made for.
 
ThW
11:44 AM
Released FluentDOM 5.2.0: https://github.com/FluentDOM/FluentDOM/releases/tag/5.2.0
 
@PaulCrovella So what do people use? Still the same manual setup?
 
@BenjaminDiele chef, puppet, ansible, shell scripts, etc. - all kinds of stuff is used for provisioning
 
except vagrant then, because of its keys?
 
some people probably use vagrant too and spend the effort to harden it up, but that seems weird to me
basically the tools used to provision a vagrant box are the same sorts of tools you'd use to provision your production boxes without vagrant being involved at all.
 
12:23 PM
How do you guys create a class that depends on a constant?
 
ThW
@user3002233 "depends on a constant"? What do you mean by that?
 
I have some constants in my program like:
define('EMAIL', 'a@a.a');
define('BASE_URI', '/var/www/html/projects/a/');
And I want to use them in the controllers. But I don't know how.
I can use them by simply ... writing their names and using them!
But I don't think that it's a good idea.
Should I inject them?
 
ThW
I use a configuration object, that prefers the constant (with the option name)
 
well you're on to something, It really isn't a good idea. But the thing is you shouldn't use those defines in the first place, as they pollute global namespace. Instead you can define constant in a class, e.g.

class Something
{
const SOMETHING = 1;
}
Could be json, xml, ini, yaml, whatever ^^
@user3002233 use a configuration file (xml, yaml, ini, ...) and parse it
 
@MarcelBurkhard I don't think that it's a good idea to define them in the classes. Because for example I use the EMAIL constant in like 5 or 6 classes.
 
12:35 PM
@PaulCrovella since you seem to be the target, does this kind of thing interest you? github.com/Ralt/lxc-wrapper
 
I like lxc-wrapper ^ ( and it's made with common lisp <3 )
/me enters room
 
@user3002233 you can use constants from other classes too... if they're loaded (included/required) just do Something::SOMETHING
 
@MarcelBurkhard How do you mean?!
 
apparently it's impossible to avoid the wild card debate -> github.com/php/php-src/pull/1005#issuecomment-72311773
 
12:41 PM
@FlorianMargaine I've only recently started looking at things like that (well, docker, but close enough). I don't know yet how I feel about separation at that level.
 
How about workpress? When we first enter some information and then install it. It stores the data somewhere and then use them (probably in some classes).
 
@user3002233 wordpress is very old hybrid code and rarely a good example of coding practice
Use a config file
be it json, yaml or a pure php array with return
FILE A
 
trying to run a script in bash by calling php script. Works fine but the bash script is not able to touch and redirect files
 
`return ['dir' => ... ];
FILE B
$config = require( .. )
@user1977867 pastie?
 
@ronnie y?
 
12:46 PM
@user3002233 IIRC wordpress stores it in a file named wp_config.php, something like <?php $settings['wp_db_host'] = 'localhost'; //....
 
@user1977867 why not?
so we can see the code you are talking about
and not having to guess
 
@user1977867 I'd GUESS its a file permission issue ^^
 
@crypticツ thnx it's useful to know the IDE has the feature, but I need a cli tool and this one does the job cs.sensiolabs.org :)
 
@RonniSkansing, sorry im still new here and a bit overwhelmed with the lingo .. pastie is something .... im not sure what it meant... it meant maybe im pasting the same question everwhere or some spammer thing?
@MarcelBurkhard thanks basically its not running a simple command like touch /tmp/xyz
however its able to run commands like ls -l, etc
stackoverflow.com/questions/28206235/… this what my exact question is, can someone plz help
 
@RonniSkansing Then how to use $config in the controllers? Should I inject it?
@MarcelBurkhard I'm a little confused. So you mean I should use the constants by entering some words like Sorter::MOVE_UP instead of MOVE_UP? What is the difference? I mean... As we may know, It's better to inject the dependencies (But I'm but sure if I should inject the constants.)
 
12:55 PM
@user3002233 that was just an example to show you that you can use constants across multiple php classes, I wouldn't use that for configuration settings
@user3002233 so yes, inject it. I'm no expert in that but I would do it as follows: load your configuration.php from a folder protected by .htaccess, the configuration.php sets a $config array, inject it into the controller
or even better write another class called Configuration that takes the config array in the constructor and provides getters like getContactFormMailAddress() or getDatabaseHost()
 
You know what? I'm scared of dependencies! I do everything to avoid using another dependency in my classes. because this is how a class would look like if i want to inject it's dependencies: paste.ofcode.org/37aWyjkjg2xamVgT4wV2dch I mean... What the hell is that? all that lines!
 
@user3002233 well, that's just the way it is... has some advantages too, for example in unit testing
 
@MarcelBurkhard Yeah? So I'm not the only one. I feel better now.
 
1:11 PM
^^
 
Thanks guys. I think I know how to solve the problem now.
 
@user1977867 ah =] yes I see, I think we talked earlier
If I remember right, I told you that the top code was dangerous and that you should fix it and edit the questino
 
1:42 PM
@PaulCrovella "separation at that level"?
 
yay, got the 6th "guru" bad just now
 
@AndreaFaulds PERL 6 has been coming since at least 2008
 
@ircmaxell Oh yes, I know
I'm just predicting that the statement that Perl 6 will be out by September is unrealistic
 
how extensive are the changes ?
wont the end up with py3000 split ?
 
I'm not a Perl person but AIUI Perl 6 is completely different from Perl 5
Like, fundamentally
 
1:55 PM
so, looks like a split is almost inevitable
 
@ircmaxell Though it started in 2000
@tereško It's not intended to be compatible, so yes
 
"On branch master
Your branch is based on 'origin/master', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)

nothing to commit, working directory clean"
 
well, you messed up something
what did you do? force push ? removed deleted remote repository ?
 
The difference between Perl 6 and Duke Nukem Forever is that one of those was released.
 
@tereško How should force push delete a remote?
 
1:59 PM
this always happens... I git cloned my empty "btadmin.git" from git shell, added my files from a symfony project, drag&drop'ed the folder into github client and commited the files. Then I press Publish in github client which seems to work (but It doesn't because when I clone the repo its evidently still empty ...)
So what I'm going to do now is try again without that Github client
 
@kelunik why are you asking me that? I never said anything like that
 
> what did you do? force push ?
;-)
@MarcelBurkhard Did you copy another .git accidentally?
 
worked fine now from the shell
So I guess it's just the github client that messed up
 
use CLI
 
@tereško done?
@kelunik git --bare init in btadmin.git on remote, git clone from shell, added files, commit, push
 
2:05 PM
@MarcelBurkhard If it works from CLI, all is fine, GUIs for VCS aren't that good, except for remote code browsing and history (like those things that GitHub does).
 
@kelunik works fine I think, hope it wont complain later on that "the upstream is gone"
now lets get started with jenkins
 
2:18 PM
damnit guys stop making me feel bad about not going to conferences :p
 
Morning
 
morning @PeeHaa
 
@AndreaFaulds Your lack of being here is bad, and you should feel bad.
 
Yes it is.
I came a LOT further to be here than you would have had to. :p
 
@RonniSkansing i did edit the question "warned that this can be fatal if someone executes some random command. I agree to it, but only authorized person can get access to this page. Also if this is not possible what would be the way to run this script with appropriate checks."
 
2:32 PM
@user1977867 "but only authorized person can get access to this page" and the people who exploit the csrf vulnerability ;-)
 
posted on February 01, 2015 by ThomasWeinert

- Added: FluentDOM\Loader\Text\CSV loads csv data into a xml document - Added: FluentDOM::registerLoader() as a plugin system for loaders provided by other composer packages - Added: FluentDOM\DocumentFragment is an extended version of the DOMDocum...

 
on the chat the other day i mentioned that I would put a check in php script that if command contains ans word apart from specific (jus like grep, will see syntax for php) then dont run the command. Please tell whats wrong with this
 
afternoon
 
@JoeWatkins morning
 
Moring @JoeWatkins
 
ThW
2:35 PM
@JoeWatkins Morning
 
Why is my site scanned by a million bots?
 
@Danack getClassName returns string where getClass returns ReflectionClass, this is a non-issue; scalar types won't use the class_name to store type information
 
@Feeds Gratz @ThW \o/
@BenjaminGruenbaum Because wordpress
 
Seriously, this is so stupid. Some people on a AWS IP with useragent Ruby, people with user agents of a million different bots from sites.
 
@BenjaminGruenbaum because internet, it's wall-to-wall bots ...
 
2:38 PM
What do they even expect to find?
 
ThW
@PeeHaa Thanks :-)
 
@JoeWatkins I don't think how the information is stored is relevant. It's just going to be incredibly surprising when getClassName returns the string of the typehint some of the time, but doesn't in other cases.
Unless there's also getScalarName....which doesn't seem sensible.
 
hold on, you think it should return "integer" for an int type hint in the future ?? why would it do that ?
 
hello friends can any body tell me that with out multiple email ids can i create twitter follower pages
 
there's no reason to think getClassName will return anything for anything other than a class hinted type ...
 
2:42 PM
oh, is that a scalar return type I see there? :D #PHP #PHP7 /cc @SaraMG ;) http://t.co/ZYV8uc4vfR
 
it's not called getTypeName, it's not strange that getClass doesn't return a ReflectionClass for array today, and it won't be strange for integer in the future ...
 
@JoeWatkins Andrea had a good point we don't need to talk about the future; I think the method should return 'array' now for things that are type hinted to be array. Having to have multiple methods to get the type hint string seems nuts you'd have to code something like:
$type = $ref->getClassName();
if ($type == null) {
	$type = $ref->getScalarName();
}
Why not just have it be called $ref->getType(); and then it can support both?
 
@Danack Have a look at Sara's ReflectionTypeAnnotation RFC: wiki.php.net/rfc/reflectionparameter.typehint
 
@JoeWatkins No, that's sensible - an array isn't a class.
So returning something for getClass would be wrong.
 
Morning
 
2:44 PM
In it, you can do $someTypeAnnotation->__toString();
 
@Danack and integer isn't going to be a class either ...
 
getClass and getClassName should only work for classes or interfaces
I think that's fair enough.
 
of course ...
 
Thanks @Danack, @salathe and @marcio github.com/php/php-src/pull/1040#event-228098466 \o/
 
@AndreaFaulds Will they ever return namespace interface?
 
2:46 PM
@Leri getClassName should probably return a Fully Qualified Name (e.g. "Foo\Bar\Baz\Qux")
 
the issue of detecting type in a neat way exists today with isCallable and isArray, this is to be solved in another rfc, the end result of phils rfc should just ensure we can get a name without autoloading the class ...
 
/me is little bit drunk
 
@Leri Presumably?
 
@PeeHaa looks like Stas merged it xD
 
I mean, typehinting against an interface is common
 
2:47 PM
@AndreaFaulds Ok, but I still think that if you've got a method that's returning the typehint string, it would be more sensible to just have one that covers everything, rather than special casing stuff.
 
@Danack Depends on your use-case:
$foo = $someParam->getClassName();
if ($foo !== NULL) {
    // not class/interface
} else {
    // class
}
But I can see your point
 
@AndreaFaulds Yes, but imho getClassName($var); should return the name of the top level class.
 
I'd rather see a ReflectionParameter::getKind/getType, but it would leak implementation details ... I think that's why we don't have it today ...
 
@Leri Why not an interface?
@JoeWatkins Not future-proof
What if we add generics? What if we add nullables? etc.
The latter is pretty likely
 
@AndreaFaulds My long term use case is that I would love strong types class emailAddress extends String {}....
Or probably implements String.
 
2:49 PM
@AndreaFaulds neither is the current API, it's better to extend getType API than add isSomeType methods (which is what we have now in isCallable and isArray)
 
@AndreaFaulds Well, when I call method like that, mostly I am interested in actual class, because if I have type-hint defined in signature I already know the type at interface level.
 
@JoeWatkins Actually, the current API is plenty future-proof
Having one method per type means things aren't exclusive
 
that doesn't make sense
 
It's less rigid than, say, ->getKind()
We could add generics and nothing breaks here
 
not sure why it has to break getKind
 
2:51 PM
Whereas ->getKind() is broken because it's too simple and can't express the full type
 
a generic is going to be a class based thing, you will get IS_CLASS or whatever ...
 
@JoeWatkins ?int isn't IS_INTEGER so it can't be expressed by ->getKind()
 
@AndreaFaulds Yeah. I really don't like that. It's mixing up special behaviour in getClassName to allow people to determine if something is a class. They should be separate by adding isClass to ReflectionParameter and calling getClassName getType instead.
 
@JoeWatkins A complete generic type isn't a class, though.
 
isNullable ?
 
2:52 PM
@JoeWatkins But now ->getKind() lies.
 
so does isCallable for ?callable
 
@JoeWatkins Nope
The current API doesn't guarantee that much
 
yes it does
 
$foo->isCallable(); just tells you if it's callable - it doesn't tell you whether it's a nullable callable, or a generic callable, or whatever
 
@AndreaFaulds obviously getType/kind cannot make more guarantees than the current API ... not sure why you would expect it too
 
2:54 PM
@JoeWatkins Because what you're suggesting is something that can
The only usefulness of such a method is if it guarantees exclusivity, so you can use it in a switch () { or something
 
lol, your type system is hilarious :D
 
But PHP types are more complex than that
 
Do return type hints work for generators, so only certain types can be yielded?
 
@kelunik Unfortunately not.
You can do this: function foo(): Generator { yield; }
But there's no type hinting against the values a generator yields
 
@kelunik when you'll have generics...
 
2:56 PM
Yeah, Generics would provide a solution to this
 
@Danack for some reason jshrink minifier just returns the filename I try to minify. Have you ever had this?
 
@PeeHaa How does it even know the file name?
// Basic (default) usage.
$minifiedCode = \JShrink\Minifier::minify($js);
 
Anyway, can't use them yet, because it makes code unreadable in phpStorm, because of all those syntax errors. :(
 

« first day (1569 days earlier)      last day (3372 days later) »