PHPackages                             devmustafa/yii2-blog-mongodb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. devmustafa/yii2-blog-mongodb

ActiveYii2-extension[Database &amp; ORM](/categories/database)

devmustafa/yii2-blog-mongodb
============================

Yii2 blog working with mongodb

1.0.4(9y ago)2842GPL-3.0+PHP

Since Aug 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/devmustafa/yii2-blog-mongodb)[ Packagist](https://packagist.org/packages/devmustafa/yii2-blog-mongodb)[ RSS](/packages/devmustafa-yii2-blog-mongodb/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (6)Used By (0)

Yii2 Blog MongoDB
=================

[](#yii2-blog-mongodb)

It's a multi-language blog extension that uses Mongodb that gives you an awesome performance.

Check [this tutorial](http://www.tutorialspoint.com/mongodb/) that I like, in order to know more about Mongodb.

Installation
============

[](#installation)

- You have to have Mongodb up and running, so download it [from here](https://www.mongodb.com/download-center).
- Also you have to have [Mongodb PHP](http://php.net/manual/en/mongodb.installation.php) driver installed.

And you run Mongodb through the following command:

```
mongod --fork --logpath /var/log/mongodb/mongodb.log

```

- And you setup the extension through the composer:

    composer require devmustafa/yii2-blog-mongodb

Or add the following line in your composer.json:

```
"devmustafa/yii2-blog-mongodb": "*"

```

Configuration
=============

[](#configuration)

1. In your common config file add the following db component:

    ```
     ...
     'components' => [
         ...
         'mongodb' => [
             'class' => '\yii\mongodb\Connection',
             'dsn' => 'mongodb://127.0.0.1/DB_MONGO_NAME', // local
             // 'dsn' => 'mongodb://DB_MONGO_USERNAME:DB_MONGO_PASSWORD@DB_MONGO_HOST/DB_MONGO_NAME, // remote
         ],
         ...
     ],
     ...

    ```
2. In your frontend config file add the following module:

    ```
     ...
     'modules' => [
         ...
         'blog' => [
             'id' => 'blog',
             'class' => devmustafa\blog\modules\frontend\Module::className(),
             'used_languages' => ['en', 'ar'], // list of languages used
             'default_language' => 'en', // default language
             'listing_size' => 10, // default size of listing page
             'rules' => [ // setup rules for frontend routes
                 // change key not value
                 'posts' => '/post',
                 'post/' => '/post/single',
                 'category/' => '/post/category', // posts related to a specific category
             ]
         ],
         ...
     ]
     ...

    ```
3. In your backend config file add the following module:

    ```
     ...
     'modules' => [
         ...
         'blog' => [
             'id' => 'blog',
             'class' => devmustafa\blog\modules\backend\Module::className(),
             'upload_url' => 'http://example.com/uploads', // full upload url
             'upload_directory' => '/full/path/to/uploads/dir', // full upload directory
             'used_languages' => ['en', 'ar'], // list of languages used
             'default_language' => 'en', // default language
         ],
         ...
     ]
     ...

    ```

##### Note:

[](#note)

`default_language` must be one of your `used_languages` array, and if you would like to use a dynamic language in your app, so leave it empty:

```
'default_language' => '', // empty (don't remove)

```

In this case the extension reading the value of `Yii::$app->langauge` and it should be one of your defined `used_languages` array.

Usage
=====

[](#usage)

1. Go to your backend url to add some posts/authors/categories:

    - /blog/post
    - /blog/author
    - /blog/category
2. Then you check it out on your frontend:

    - /posts

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Total

5

Last Release

3492d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/770c173ff53dc9bc3faca2adc4f47b1fa5e93b393baefc3b9ef33da496127916?d=identicon)[devmustafa](/maintainers/devmustafa)

---

Top Contributors

[![MustafaMagdi](https://avatars.githubusercontent.com/u/1572395?v=4)](https://github.com/MustafaMagdi "MustafaMagdi (18 commits)")

---

Tags

mongodbyii2extensionblog

### Embed Badge

![Health badge](/badges/devmustafa-yii2-blog-mongodb/health.svg)

```
[![Health](https://phpackages.com/badges/devmustafa-yii2-blog-mongodb/health.svg)](https://phpackages.com/packages/devmustafa-yii2-blog-mongodb)
```

###  Alternatives

[dmstr/yii2-migrate-command

Console Migration Command with multiple paths/aliases support

31297.1k6](/packages/dmstr-yii2-migrate-command)[dmstr/yii2-db

Database extensions

19642.9k6](/packages/dmstr-yii2-db)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
