Download the PHP package lewestopher/cakephp-monga without Composer

On this page you can find all versions of the php package lewestopher/cakephp-monga. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cakephp-monga

cakephp-monga

Framework Database license Github All Releases Travis Coverage Status

A plugin for accessing MongoDB NoSQL data stores in CakePHP 3.x.

Requirements

Installation

In your CakePHP root directory: run the following command:

Then in your config/bootstrap.php in your project root, add the following snippet:

or you can use the following shell command to enable to plugin in your bootstrap.php automatically:

Extended Documentation

For the extended docs, please visit our Wiki.

Usage

First, we define a new Datasource in our config/app.php file with our namespaced Connection class name:

Then we can instantiate our MongoDB connection anywhere that we need in the application via the ConnectionManager class:

Then from there we can get our Monga instance by using the connect() method on the returned connection:

Note that the $mongodb object instantiated above with the connect() method is the same object returned by Monga::connection() in the Monga API:

This information should help you make the bridge between instantiating the Datasource using CakePHP and utilizing the Monga API for data retrieval and saving.

Configuration

cakephp-monga accepts all of the same options in the Datasource configuration that can be passed into the MongoClient() object in PHP. Documentation for these options is defined here.

Connecting to a custom DNS using this library

By default, this library connects to the mongodb://localhost:27017 DNS string. You can specify a custom DNS to connect on by setting a 'dns' key on the connection's Datasource hash in the config/app.php file:

API and Accessing your MongoDB Instance

This plugin is a wrapper of the Mongo plugin by the League of Extraordinary Packages. To find out how to query, save, and update data within your Mongo collections, check out the Monga documentation.

Defining a custom Collection class

View the Accessing Collections Extended Docs page for more information on creating Collection classes.

As of version 0.2.0, CakeMonga supports the usage of custom Collection classes. These custom classes are located with the src/Model/MongoCollection folder an extend the CakeMonga\MongoCollection\BaseCollection class. Now you can use these classes to encapsulate data layer logic into the appropriate class locations. These methods are direct abstractions of their Monga counterparts. You can view the docs for these methods on the Monga API Docs. The BaseCollection class provides the following methods for data access:

`

Note that the MongoDB collection that is utilized by custom Collection classes is the tableized name of the Collection class itself. For example, UsersCollection.php would map to the users collection inside of your MongoDB instance.

Retrieving a custom Collection model using CollectionRegistry

As of 0.2.0, custom Collection models extended from BaseCollection can be retrieved using the CollectionRegistry singleton with the same syntax that TableRegistry employs:

By default, the CollectionRegistry utilizes the default connection defined as 'mongo_db' in your app.php file. Want to use a different Mongo datasource? No problem, just pass in a datasource string to the 'connection' attribute of the config array for CollectionRegistry::get():

This would construct the UsersCollection class with a connection to the other datasource.

Collection Event Hooks

As of 0.4.0, you can now define the following events on your Collection classes:

You can find more information on Collection events on the Accessing Collections Wiki Page

Custom Behaviors

As of 0.5.0, you can attach Behaviors to classes extending the BaseCollection class in the same manner that you would to a Table object. To create a custom behavior for a BaseCollection, you should extend the MongoBehavior class instead of the regular Behavior class.

You can find out more about Behaviors on collections on the Accessing Collections Wiki Page.

Query Logging

As of version 0.3.0, CakeMonga supports query logging via the Mongo logging context. To learn how to enable logging and create custom loggers, visit the Query Logging Wiki Page.

What is cakephp-monga?

This plugin is a wrapper for the popular Monga library provided by The League of Extraordinary packages. In it's current form, this plugin is intended to get you quickly set up and running with access to a MongoDB instance so that you can access your data in your application. This plugin provides all of the same functionality that the Monga library provides in terms of building queries and retrieving your data.

What is cakephp-monga not?

This plugin is not currently intended as a drop in replacement for the SQL ORM provided by CakePHP core. While you could theoretically build an entire application using cakephp-monga as the data layer, this plugin does not have the kind of application level integration (Events, Logging, etc) that the current ORM does. Additionally, there is not abstraction layer for Database level, Collection level, or Entity level objects (EG - Defining methods on a supposed UserCollection.php, or creating a Mongo Entity at User.php), although this is on the roadmap for a future version very soon.

Additionally, it's important to recognize that while certain relational features can be emulated within a MongoDB dataset, Mongo is still not an ACID compliant database. In the future, Collection level classes will be built for object abstraction that will implement CakePHP's Repository interface, but it should be noted that full ORM features will not be supported as Mongo is not a true object relational database.

Roadmap

Here are some of the features that I plan on integrating into this project very soon:

Support

For bugs and feature requests, please use the issues section of this repository.

Contributing

To contribute to this plugin please follow a few basic rules.

Change Log

Yes, we have one of those.

Creators

Wes King

Frank de Jonge - Creator of the Monga Dependency

Monga Contributors

License

Copyright 2016, Wes King

Licensed under The MIT License Redistributions of files must retain the above copyright notice.


All versions of cakephp-monga with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.16
cakephp/cakephp Version ~3.0
league/monga Version ^1.2
evert/phpdoc-md Version ~0.2.0
mockery/mockery Version 0.9.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lewestopher/cakephp-monga contains the following files

Loading the files please wait ....