suyati / mongologue
There is no license information available for the latest version (dev-develop) of this package.
A Light Weight Micro Blogger Clone using MongoDB
dev-develop
2015-02-13 13:37 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: >=3.7.14
This package is not auto-updated.
Last update: 2025-04-12 17:32:43 UTC
README
#Mongologue
A PHP Library to help build Microblogging Servers using Mongo DB
Supports:
- Multi Media Posts
- Groups
- Follow, Unfollow and Block Actions for Users and Groups
- Commenting on Posts
- Liking Posts
##Installation
Mongologue is available as a Composer Package.
Just add the following to your composer.json file:
require : {"suyati/mongologue": "dev-develop"}
##Using Mongologue
###Initialize
$factory = new \Mongologue\Factory(); $mongologue = $factory->createMongologue(new \MongoClient("mongodb://127.0.0.1"), "MyTestDB");
###Add Users
$user = array( "id"=>"1238899884791", "handle"=>"jdoe_1", "email"=>"jdoe1@x.com", "firstName"=>"John_1", "lastName"=>"Doe" ); $mongologue->user('register', new \Mongologue\Models\User($user));
###Create Posts
$post = array( "userId"=>$userId, "datetime"=>time(), "content"=>"user one", "category" => 1, "filesToBeAdded" => array( __DIR__."/../resources/sherlock.jpg"=>array( "type"=>"jpeg", "size"=>"100" ) ) ); $mongologue->post('create', new \Mongologue\Models\Post($post));
###Groups
$group1 = array( "name" => "Cool Group 1" ); $groupId = $mongologue->group('register', new \Mongologue\Models\Group($group1)); $mongologue->group('join', $groupId, $userId);