Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2p relationships #137

Merged
merged 22 commits into from
Oct 27, 2014
Merged

P2p relationships #137

merged 22 commits into from
Oct 27, 2014

Conversation

atimmer
Copy link
Member

@atimmer atimmer commented Oct 12, 2014

Adds relationships to the parser, I want to improve the quality of the code because now there is a stack of 4 foreach calls. But the code is ready to be tested.

Reference #79, #112

pdclark and others added 17 commits June 30, 2014 02:06
minimum-stability set to "dev" because posts-to-posts requires scribu/scb-framework as dev-master. Dependency fails to load if parent project is not set to allow development branches.

Repository for posts-to-posts added manually because composer doesn't find it on its own.

Path for posts-to-posts manually set because type "wordpress-plugin" causes it to be installed in a wp-content directory created within this plugin directory.

Fixes WordPress#112
* Requires posts-to-posts vendor library if not loaded as a plugin.
* Registers post relationships
* Extends import to create relationships between plugins.

To-do:

* Connect functions to methods and hooks: "uses" arrays don't appear to be populating for either of these
* Connect Methods to methods and hooks
* Clear wp_p2p and wp_p2p_meta tables of previously imported relationships before running import. For now, the tables should be manually cleared.

Fixes WordPress#112
Instead of requiring only dev for all packages only specify it for p2p. Instead of including posts to posts with the UI we only include the core.
- Add a method call reflector to reflect a method call.
- Put the used methods in the exported phpdoc.
- Put the used methods in functions as a functions_to_methods relationship.
- Add methods_to_functions because it should be unique from functions_to_methods.
- Chang references to self and $this to the correct classname
- Put the things a method uses into the database as a p2p relationship
@Rarst
Copy link
Contributor

Rarst commented Oct 12, 2014

GitHub says merge conflict FYI. Might be conflicting with that bit of wp-cli decoupling. Just FYI, I'll look at it and hammer it in, just not right now. :)

Thank you!

@atimmer
Copy link
Member Author

atimmer commented Oct 12, 2014

The conflict is probably due to atimmer@46310ff

@Rarst
Copy link
Contributor

Rarst commented Oct 20, 2014

Ok, I made a fair attempt to merge manually and got scary unholy conflict across four files. :( Could you please resolve this on your side?

@@ -595,7 +595,7 @@ public function import_item( array $data, $parent_post_id = 0, $import_internal
* @param int $ID Optional; post ID of the inserted or updated item.
* @param array $data Data
*/
do_action( 'wp_parser_import_item', $ID, $data );
do_action( 'wp_parser_import_item', $ID, $data, $post_data );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to add a parameter to the hook, you should also update the hook docs.

Rarst added a commit that referenced this pull request Oct 27, 2014
@Rarst Rarst merged commit 660184d into WordPress:master Oct 27, 2014
@Rarst
Copy link
Contributor

Rarst commented Oct 27, 2014

Getting DB errors on import:

Removing current relationships...
WordPress database error:[Table 'developer.wp_p2p' doesn't exist]...

Is there any setup procedure to follow for tables?

@atimmer
Copy link
Member Author

atimmer commented Oct 28, 2014

You probably need to deactivate and activate wp-parser. It will create the missing tables.

I think we should try to create the tables when starting to parse as well, do you agree?

@atimmer atimmer deleted the p2p-relationships branch October 28, 2014 06:13
@Rarst
Copy link
Contributor

Rarst commented Oct 28, 2014

Cycling plugin on off got it. Yeah, the quick check before import won't hurt.

@atimmer
Copy link
Member Author

atimmer commented Dec 29, 2015

Check added in 4168422

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

Successfully merging this pull request may close these issues.

4 participants