We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Help with the API | Forum

Yevhen
Yevhen Apr 3 '17
Looking for some people, who can explain how the plugins work with DB. I mean the schema of adding items, changing and removing.
Scam Detector
Scam Detector Apr 4 '17
What exactly do you need to know?
Yevhen
Yevhen Apr 4 '17
First of all Newsfeed
When user:
1. add a post
2. modify post
3. remove post
4. like post
5. comment post
6. subscribe to other user posts

which data and to which tables is going. What is removed, what is changed, what is added into that tables. I need to reproduce this in the external API, manipulating with oxwall database.
Scam Detector
Scam Detector Apr 4 '17

I think that you are doing it the wrong way, this is why:

1.- If a plugin gets updated and the database too, you have to make updates to your api. So imagine the amount of updates that you are going to make for each plugin.

2.- A lot of plugins extends other plugin's classes of or require certain plugins and events.
The plugins are made in a way that you can call $class->method( $values ) or trigger an event to add/get the info to/from the plugin. SIMPLE.


This way you are re-using the code made by the original developers. If you are doing the API with another language code, you just need a bridge class for every plugin. That's it.


But instead of making it the right way, you are trying to remake all the code again, that is a HUGE problem now and it will be a problem in the near future. Some plugins depend of the events fired by the plugins, Eg: On every status update, some plugins add extra info. On every login another event is triggered.
So all you are doing is trying to rebuild all the oxwall software just in another language.
This is what I would do If I were you:


1.- Learn PHP

2.- Learn OOP the right way.

3.- Read the original code of every plugin

4.- Start making your own Oxwall API PHP


You should read all of this before continue with your journey:
DRY:

KISS:

SOLID:

I hope you decide to continue the right way.


Anyways, all the info that you need is contained in the files inside BOL folder of each plugin, it contains all the SQL sentenses, it is a lot of code, so adding it into a post it is not posible.


The Forum post is edited by Scam Detector Apr 4 '17
Yevhen
Yevhen Apr 5 '17
Unfortunately I have Python knowledge and the next language I will learn in few years. And i am not gonna learn PHP.  So the situation is:
+ we have volunteer Python coder, which CAN create API
+ we have PHP Oxwall CMS
- we have NO bridge between this two points
- we have nobody who can help to connect them together

I will do my project on my own, as I can from my side.

Good luck Oxwall :))