Skip to content

mongator/codeigniter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongator CodeIgniter Spark Build Status

Spark for using Mongator with CodeIgniter

Requirements

  • PHP >=5.3.0
  • CodeIgniter >=2.0.0
  • mongator/mongator

Installation

You should generally use the spark system to install mongator. From the terminal, and inside the root of your CodeIgniter project, type:

php tools/spark install -v0.0.1 mongator

After this you need install all the mongator spark dependencies through composer. Again inside the root of your CodeIgniter project, type:

cd  ./sparks/mongator/
composer install

Configuration

You can find a example of the configuration file and a help inside of the spark content. Configure it to function correctly.

Usage

$CI = get_instance();

$articleRepository = $CI->mongator->getRepository('Model\Article');
$article = $articleRepository->findOneById($id);

** Remember, before use the models you must generate it. (You can use the command provided with this package.) **

Commands

With this package you can find three useful commands:

  • mongator:generate: Process config classes and generate the files of the classes.
  • mongator:indexes: Ensure the indexes of all repositories
  • mongator:fix: Fixes all the missing references.

Typing ./tools/mongator.php inside the root of a CodeIgniter project, you will get a list of command available.

Tests

Tests are in the tests folder. To run them, you need PHPUnit. Example:

$ phpunit --configuration phpunit.xml.dist

License

MIT, see LICENSE

About

Spark for using Mongator with CodeIgniter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages