« first day (1587 days earlier)      last day (3346 days later) » 

11:07 AM
@Fabor Only the fact that it was wednesday
 
@Alexander pong
 
@DaveRandom heh. Good enough
 
ThW
Morning
 
Morning
 
11:31 AM
@JoeWatkins I didn't see it clearly stated in the RFC, does the custom assertion for assert have to descend from AssertionException?
 
@SergeyTelshevsky trust me 5.2 is worse ^^
 
11:46 AM
@ShubhamNishad you could use Google/Facebook Authentication
 
@NikiC hello, we can start our discussion )
To anyone who interested in the Parser API RFC, here is a link wiki.php.net/rfc/parser-extension-api
 
2
Q: How to use array_filter() function recursively on a multi-dimensional array in order to remove the key-value pairs that contains null values?

user2839497There is one associative array titled $post_data. The actual array is very large. For your reference I'm just putting below two elements from it : Array ( [0] => Array ( [feed_id] => 1331 [app_id] => 0 [privacy] => 0 ...

I'm not able to get the answer posted for this question.
 
Hey @Alexander
@Alexander btw, I'm currently working on importing asts back into php. but still at the "assembling all the necessary metadata" point ^^
 
@NikiC great, what kind of metadata do you need?
 
@Alexander precise information about which node can contain which node at which position and which flags it can use in which combination :/
If nothing else, it will serve as good documentation for the AST structure ;)
 
11:52 AM
@NikiC yes, It's not so easy ) Because it require parse-level information about Grammar
 
exactly
so anyway, about the apis...
 
@NikiC I have a though about introducing interfaces for nodes. For example, ClassElementNode. And ClassNode will have a method add(ClassElementNode $node)
 
@Alexander it would be kind of nice to have individual node classes with names for the children (instead of indixes), but it makes the whole thing much more complicated, both from API and implementation perspective
 
@NikiC some languages provide single class for each type of node
 
it means instead of one or two classes you need two hundred
 
11:55 AM
yes
 
I think it may be hard to get two hundred new classes past dmitry ^^
 
Can this information be automatically generated from .y file? ))
 
nope, .y file is not really laid out to allow automatic extraction of info
 
It's pitty... However, what is your vision about node class? Should it be only one or one per each node kind?
 
If this should go into core I think it should be just one node class
well or maybe two, an extra one for declarations as they have a bit of extra info
 
11:59 AM
but then we will have an issue with AST validation, if we decide to implement NodeTransformers
 
validation at which point?
 
If PHP hook will change an AST and add "Statment Node" into the "Class node" directly.
Compiler can be very puzzled to see this node for class-level node.
 
separate node types won't help with validation when importing a userland ast - even with typehints and inheritance hierarchy you can't really trust what you're getting
it requires explicit validation (thus the metadata ^^)
 
Yeah... but maybe it's ok, just to throw CompilerException and finish execution?
 
@NikiC Is this something that can come later?
 
12:02 PM
<?php $email_attch=false; ?>
@if(condition)
    @foreach(condition)
        @if(!$email_attach)//I don't wy It's not working here
            do stuff
         @endif
     @endforeach
@endif
 
@Leigh it's probably something to be done in userland
 
Even better :)
 
@user2736704 Thanks for reminding me I hate template libraries
 
@user2736704 The PHP in that is fine. Problem is elsewhere.
 
@Leigh do you see any prob there?
@PeeHaa :/
 
12:04 PM
psst
"attach" has two "a"s in it
but the PHP is fine
 
@Alexander I think we had some disagreement about the use of functions ...
 
:/ :)
 
hey guys, does anyone here ver use dhtmlx scheduler? i´m havig trouble loading data from my database...i was wondering, is this possible:
$scheduler->render_sql("TipoQuarto","idTipoQuarto","Nome,Preco");
echo scheduler;
can i echo the variable scheduler to see if there is data inside it?
 
@Japa $scheduler ? (missing sigil), try var_dump($scheduler);
Glad to see the quality of SO has remained constant, last two issues in here have been typo's :D
 
@NikiC yes, this should be discussed. From my point of view, it's much easier to work with classes, because they provide logical unit, whereas functions is just mix of functionality. + class have good autocompletion for methods
 
12:07 PM
@Leigh instead of just doying the echo?
 
@Alexander well, functions have just as good autocomplete ;)
 
@Japa why don't you try it and find out
 
@Leigh lol you´re right, but it´s not working
i keep getting the same response: { "data":[]}
 
@NikiC but they can be imported by different names: use function Php\Ast\parse as foobar; foobar('Hello, WTF');
 
the reason I want to have functions that can work just on kinds (without instantiated node) is introspection/metadata. E.g. I'd like to do something like var_dump(array_map('php\ast\get_kind_name', ast\get_kinds())) to get a full list of kinds in human-readable format
@Alexander You can import classes by nonsentical names as well ^^ Ability to import is actually advantage of functions ;)
 
12:10 PM
@NikiC why do you need to call get_kind_name on integers?
 
@Alexander Not sure what you mean?
 
@NikiC this information is useless without node kind
 
@Alexander why? This just gives me an overview of all available kinds
if the extension exports the metadata I'm currently assembling, you could print not just the available kinds, but also what the subnodes are allowed to use etc
 
@NikiC this information can be stored as list of constants in the Php\Parser\Node class: var_dump((new ReflectionClass(Node::class))->getConstants()
@NikiC
 
@JoeWatkins I answered my own question. I see instanceof comparison with the AssertionException CE in the patch. I was hinging between yes and yes+custom, but with this restriction, I think custom is fine.
 
12:12 PM
@NikiC or just empty enumeration interface, like Php\Parser\KindList { const AST_XXX= 'AST_XXX'; }
 
so instead of having a simple array of available kinds we now need to use reflection?
 
@NikiC $kindName = KindList::AST_XXX; or (new ReflectionClass(KindList::class))->getConstants() to fetch all available names of all kinds
@NikiC I'm thinks about usage from userland. array is not friendly tool to work with such information, so I want to put this into classes. This keep a way for class extension for future needs
thinking
 
@Alexander Okay, so that gives you the names. What about other metadata?
Actually, arrays are the most friendly tool in PHP ^^
 
@NikiC @NikiC not sure )
@NikiC flags can be enumerated as constants too. Only the question with use_flags
 
@Alexander yes. use_flags and other things that may be added
like num_children or allowed_children etc
 
12:18 PM
@NikiC could you provide more examples?
@NikiC this information should be stored in the concrete node class for better design...
 
@Alexander in which case you will only be able to access it if you already have a syntax tree
 
Jay
hey
ping pong
Can anyone answer me why I am getting an error with this code.
db_update('file_managed')
            ->fields(array(
              'uri' => $new_file
            ))
            ->condition('filename', $image_id, '=')
            ->execute();
 
@NikiC no this is not needed. Create (or take existing) parent node, ask for max children and add several children nodes.
 
Jay
Its Drupal
 
1. eww drupal
2. what is the error?
3. method chaining does not exactly make debugging easier...
 
Jay
12:23 PM
just says: The website encountered an unexpected error. Please try again later.
 
@Alexander sounds like very roundabout way, just to avoid exposing functions ;)
 
@NikiC this information is only relevant for concrete node, I can't imagine the situation, when I want to ask how many children can have a node with kind=123
 
Jay
Even when I tried this as a test it still gives that error
db_query("UPDATE file_managed SET uri = '".$new_file."' WHERE filename = '".$image_id."'");
 
@Alexander Can you think of a situation when you need a list of all token types PHP supports?
 
@NikiC can you give an examples with functions how this metadata will be accessed&
 
12:25 PM
@Jay why don't you configure your error reporting properly?
 
Jay
@Patrick please advise how this is done
@p
I got it mate thanks
 
@NikiC yes, (new ReflectionClass(KindList::class))->getConstants()
 
@Alexander I'm just asking whether there's a situation where that would be useful (and referring to token types here, not ast kinds)
 
@NikiC not sure that I understand correctly what you are referring to
 
Okay, let me give you a simple example ... I want to export the AST into XML and want to create an DTD schema that specifies how the result should look like and validates that it is correct. If I have the metadata available I can simply generate the DTD file. Well, "simple" as far as anything involving XML is simple ;)
And very generally, this is a design concern. Basically you are saying that in order to get information about the TYPE you require an instance of that type. This is classic violation of object oriented principles, as you are asking for things that you do not actually depend on.
It's like passing in a service locator because you need something that's stored in it
Of course here, much less of an issue ;)
 
12:32 PM
@NikiC I'm affraid, that without concrete classes for each node type this will be impossible ( Or DTD just will check that Node can have som attrs and node can have nested nodes.
 
@Alexander Storing it in one class in PHP does not prevent you to generate different XML node types based on the kind name
 
@NikiC so we are here to find the best way ) discussion is a good way to choose best decision
 
@Alexander Of course you are totally right in saying "Who the f* wants to use XML?" and dismiss the use case :)
 
/**
* @notauthor Marcel Burkhard
*/
I just found that in some ugly legacy code that I had previously touched ^^ like a year ago or so
 
@NikiC what If we extract all this metadata (meat-data :) ) into the one class? Maybe with public static properties or even array constants
 
12:36 PM
lol
 
laravel.io/bin/yGKRm when tried to echo the statement prints 1 inside foreach
 
@NikiC yes )) But validation of XML with DTD is a very clever thing, Symfony uses XML a lot for services definition.
 
ouch laravel is really ugly: laravel-recipes.com/recipes/256/…
 
@Alexander Yeah ... not a fan personally ^^
 
12:40 PM
@MarcelBurkhard it's scope issue or may be something else..
 
@NikiC I like the last sentence in this post: "But it’s just a thought ;) Maybe I got it all wrong." ))
 
@Alexander :D
@Alexander One part I certainly don't have wrong is that anything that contains the word "static" is a code smell. That's conventional wisdom around these parts :P
I've been slowly migrating away from static methods and properties
 
@NikiC Static methods almost equal to functions ) You should like them
 
So, this is it
2
 
@Alexander Depends. Either they are like functions (in which case they should be functions, not static methods) or they are an artifact of class-oriented design (in which case they should be eradicated)
@AlmaDo Crap, I got an error downloading the internet
 
12:49 PM
@NikiC class is just a good entry point for concrete API. I chose a static methods, because parser doesn't have a state to store between consequent parses , so no instances. Etensions are per single instance too, so static methods and properties IMO good way to represent this behavior. What should I do to convince you to choose Php\Parser\Engine class instead of list of functions?
 
@AlmaDo @NikiC strongly suggest you to watch this episode of IT Crowd about the internet
 
Good morning
 
@Alexander I don't think you can convince me of that. If it has state, I'd totally approve of using a class for it. However if you're just using static methods as means of namespacing, I don't see the point. The only thing it does is hurt importability. For the extensions I'd probably go with instances.
 
@ircmaxell Good morning
 
Is it even possible to put static methods in an interface?
 
12:53 PM
@NikiC what about future use of extensions? It's a state
 
hi
 
@NikiC yes, sure
 
anybody know how to make a curl request using command line
for posting json data as well as a file
?
 
@sharath google knows
 
@Patrick i tried a lot
 
12:54 PM
 
i am not sure weather its my requests problem
 
@sharath what have you tried? what errors did you get?
 
Literally the first result has your answer when I searched "how to make a curl request using command line"
 
@ircmaxell morning
@Alexander k
@Alexander not sure what you mean there
 
@Patrick curl -X POST -H "X-Parse-Application-Id: sdgfsdfgsdfgsdfgsdfgsdg" -H "X-Parse-REST-API-Key: sdfgsdfgsdfgsdfgsdfgsdfgsdfgsdfgsdg" -d '{"username":"aaaaaaaa","email":"aaaaaaaaa@gmail.com","password":"123"}' --data "image:@/home/user/Pictures/gravatar.jpg" api.parse.com/1/functions/signUpUser
@Fabor this is my curl request
 
12:57 PM
Hi is anyone here familiar with zend in particular the zend 2 blog tutorial ?
 
@NikiC Parser::registerExtension($myExtension1); Parser::registerExtension($myExtension2); Parser::parse(file_get_contents(_FILE_));
 

« first day (1587 days earlier)      last day (3346 days later) »