Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

Update php-parser to use latest version (2.0.0) #183

Closed
nevadascout opened this issue Nov 4, 2016 · 11 comments
Closed

Update php-parser to use latest version (2.0.0) #183

nevadascout opened this issue Nov 4, 2016 · 11 comments
Assignees
Milestone

Comments

@nevadascout
Copy link
Member

No description provided.

@nevadascout nevadascout added this to the 0.2.5 milestone Nov 4, 2016
@nevadascout nevadascout self-assigned this Nov 4, 2016
@ichiriac
Copy link
Collaborator

Hi @nevadascout,

For your information, I've fixed last bugs and I will release the code under 0.1.2 this weekend. Actually tests pass over these frameworks : https://github.com/glayzzle/php-parser/blob/master/.gitmodules

Tell me if you need to cover other frameworks, or I've missed a bug.

@nevadascout
Copy link
Member Author

Thanks @ichiriac 😄

@ichiriac
Copy link
Collaborator

Warning on backward compatibility,

The next implementation will support comments as you can see here glayzzle/php-parser@54a4521 - So if you enable them with parser.extractDoc = true class nodes will be prefixed with doc or comments nodes as you can see here https://github.com/glayzzle/php-parser/blob/master/test/functional/commentTests.js

By default they are disabled, so the behavior should be the same as before.

It's missing tests for publishing the new version, need about another week to fully implement nodes positions and comments.

There is some issues with AST (they were here from always) as you can see here (https://travis-ci.org/glayzzle/php-parser/builds/179250360) - so need more fixes.

I wish the next release to be solid rock with much less bugs so I can start to work on my other glayzzle project - I'll notify here when the release is published.

@ichiriac
Copy link
Collaborator

ichiriac commented Nov 30, 2016

FYI - 0.1.2 released 🎉 - many AST fixes done, now parsing AST correctly from any framework (including php7)

A lot of bugs are related to this release

@ichiriac
Copy link
Collaborator

ichiriac commented Dec 2, 2016

Hi @nevadascout,

I'm actually preparing a new library based on php-parser : https://github.com/glayzzle/php-reflection and I plan to move some code there.

The idea behind this library is to enable code reflection like an in-memory database - far more easy to use than the plain array version.

What it will do :

  • can add files to be analyzed
  • can lookup functions, classes, namespace, traits...
  • can handle references (like where a class is defined, where is instanciated, where is used as declaration)
  • can handle files refreshing (with a datetime flag to check if file need refresh)
  • can handle scopes (like in file.php at offset X it will return an object with the current namespace, current class, function, list of variables)
  • can handle caching (gets/sets a json serializable object from repository state)

Moved code :

  • the gracefull mode : it's not necessary to be defined in the AST parser, it's more a specific behaviour
  • the comments : I will implement a docBlock parser dirrectly inside this project (php-parser will only return comments with comments sources

I've made the plain array version in order to parse as fast as possible with the least memory usage (for writing a transcripter) but for your project (and maybe others) is not enough easy to use directly.

Stay tuned 😄

@nevadascout
Copy link
Member Author

Sounds great! I look forward to seeing it!

@ichiriac
Copy link
Collaborator

ichiriac commented Dec 3, 2016

@nevadascout

It starts to work but I've made a major release on php-parser(0.1.3) for this (a major bug on static instanciation - now it's using real prototyped instances) and remains commits.

I will finish all library before releasing it.

You can take a look at the API documentation here - and you can try it from test/index.js

The hard part is done, now remains the fun part of defining nodes 😄

@ichiriac
Copy link
Collaborator

Hi @nevadascout,

I would like to chat with you about migrating crane. The php-reflection is functionnal and runs well, could correct major party of bugs here.

Could you please tell me how I can help.

@nevadascout
Copy link
Member Author

Hey @ichiriac that sounds great!

I've been pretty busy lately, but lets talk at some point this week about getting this done! Is Gitter the best place to talk?

@ichiriac
Copy link
Collaborator

It's fine for me, I've already found your profile & tried to contact you by gitter 😄 - I'm online each night, so we can chat when you want.

See u soon, Ioan

@nevadascout nevadascout changed the title Update php-parser to use latest version (0.1.0) Update php-parser to use latest version (2.0.0) Mar 4, 2017
@nevadascout nevadascout modified the milestones: 0.3.0, 0.2.5 Mar 4, 2017
@nevadascout nevadascout modified the milestones: 0.3.0, 0.4.0 Mar 4, 2017
@nevadascout
Copy link
Member Author

Released in v0.3.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants