Commit 7764245c authored by Ondrej Sury's avatar Ondrej Sury

New upstream version 1.5.2

parent 6bd97b8e

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

MongoDB Driver for PHP
Hannes Magnusson, Jeremy Mikola, Derick Rethans
.PHONY: coverage test-clean package package.xml
DATE=`date +%Y-%m-%d--%H-%M-%S`
MONGODB_VERSION=$(shell php -n -dextension=modules/mongodb.so -r 'echo MONGODB_VERSION;')
MONGODB_MINOR=$(shell echo $(MONGODB_VERSION) | cut -d. -f1,2)
MONGODB_STABILITY=$(shell php -n -dextension=modules/mongodb.so -r 'echo MONGODB_STABILITY;')
help:
@echo -e "\t$$ make vm"
@echo -e "\t - Launches VMs for running multiple MongoDB variations"
@echo -e "\t$$ make list-servers"
@echo -e "\t - Lists running servers, and their URIs"
@echo -e "\t$$ make test-bootstrap"
@echo -e "\t - Starts up MongoDB through mongo-orchestration"
@echo ""
@echo -e "\t$$ make coveralls"
@echo -e "\t - Creates code coverage report using coveralls"
@echo -e "\t$$ make coverage"
@echo -e "\t - Creates code coverage report using gcov"
@echo ""
@echo -e "\t$$ make distcheck"
@echo -e "\t - Builds the archive, runs the virtual tests"
@echo ""
@echo -e "\t$$ make package.xml"
@echo -e "\t - Creates a package.xml file with empty release notes"
@echo -e "\t$$ make package"
@echo -e "\t - Creates the pecl archive to use for provisioning"
@echo -e "\t$$ make test-virtual"
@echo -e "\t - Provisions some VMs, installs the pecl archive and executes the tests"
mv-coverage:
@if test -e $(top_srcdir)/coverage; then \
echo "Moving previous coverage run to coverage-$(DATE)"; \
mv coverage coverage-$(DATE); \
fi
lcov-coveralls:
lcov --gcov-tool $(top_srcdir)/.llvm-cov.sh --capture --directory . --output-file .coverage.lcov --no-external
lcov-local:
lcov --gcov-tool $(top_srcdir)/.llvm-cov.sh --capture --derive-func-data --directory . --output-file .coverage.lcov --no-external
coverage: mv-coverage lcov-local
genhtml .coverage.lcov --legend --title "mongodb code coverage" --output-directory coverage
coveralls: mv-coverage lcov-coveralls
coveralls --exclude src/libbson --exclude src/libmongoc --exclude src/contrib --exclude lib --exclude tests
vm:
@command -v vagrant >/dev/null 2>&1 || { echo >&2 "Vagrant needs to be installed to run vms"; exit 1; }
@vagrant up ldap mo
list-servers:
php scripts/list-servers.php
test-bootstrap:
vagrant reload mo
vagrant ssh mo -c 'sudo rm -f /home/vagrant/server.pid'
vagrant ssh mo -c 'sudo mongo-orchestration -f mongo-orchestration-config.json -b 192.168.112.10 --enable-majority-read-concern start'
php scripts/start-servers.php
distcheck: package test-virtual
test-virtual: package
sh ./scripts/run-tests-on.sh freebsd
sh ./scripts/run-tests-on.sh precise32
sh ./scripts/run-tests-on.sh precise64
test-clean:
find $(top_srcdir)/tests -not \( -path $(top_srcdir)/tests/utils -prune \) -type f -name "*.diff" -o -name "*.exp" -o -name "*.log" -o -name "*.mem" -o -name "*.out" -o -name "*.php" -o -name "*.sh" | xargs -r rm
package:
pecl package package.xml
package.xml:
php bin/prep-release.php $(MONGODB_VERSION) $(MONGODB_STABILITY)
# pecl/mongodb (MongoDB driver for PHP)
[![Build Status](https://api.travis-ci.org/mongodb/mongo-php-driver.png?branch=master)](https://travis-ci.org/mongodb/mongo-php-driver)
[![Coverage Status](https://coveralls.io/repos/mongodb/mongo-php-driver/badge.svg?branch=master&service=github)](https://coveralls.io/github/mongodb/mongo-php-driver?branch=master)
This is the low-level PHP driver for MongoDB. The API is the same
as the HHVM driver for MongoDB. The documentation for both of them is the same,
and can be found at http://docs.php.net/manual/en/set.mongodb.php
The driver is written to be a bare bone layer to talk to MongoDB, and
therefore misses many convenience features. Instead, these convenience methods
have been split out into a layer written in PHP, the
[MongoDB Library](http://mongodb.github.io/mongo-php-library/).
Using this library should be your preferred way of interacting with MongoDB.
Please note that the new HHVM and PHP drivers implement a **different API**
from the legacy driver at http://pecl.php.net/package/mongo; therefore
existing libraries that use the legacy driver (e.g.
[Doctrine MongoDB's ODM](http://doctrine-mongodb-odm.readthedocs.org/en/latest/))
will not work with the new drivers.
In the long run, we hope that userland packages will be built atop this driver
to implement various APIs (e.g. a BC layer for the existing driver, new fluent
interfaces), management utilities (for creating admin utilities and cluster
management applications), and other interesting libraries.
## Documentation
- http://docs.php.net/set.mongodb
## Installation
To build and install the driver:
```
$ pecl install mongodb
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
```
We recommend using this extension in conjunction with our
[userland library](https://github.com/mongodb/mongo-php-library),
which is distributed as
[mongodb/mongodb](https://packagist.org/packages/mongodb/mongodb) for Composer.
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## Related Projects
- [HHVM Implementation of this driver](https://github.com/mongodb/mongo-hhvm-driver)
- [Official high-level library](https://github.com/mongodb/mongo-php-library)
- [MongoDB Transistor](https://github.com/bjori/mongo-php-transistor) Lightweight ODM using the [Persistable](http://php.net/bson\\persistable) interface
# -*- mode: ruby -*-
# vi: set ft=ruby et sw=2 :
Vagrant.configure(2) do |config|
config.vm.synced_folder ".", "/phongo"
config.vm.provider "vmware_workstation" do |vmware, override|
vmware.vmx["memsize"] = "8192"
vmware.vmx["numvcpus"] = "2"
end
config.vm.provider "virtualbox" do |virtualbox|
virtualbox.memory = 2048
virtualbox.cpus = 2
end
config.vm.define "mo", primary: true do |mo|
mo.vm.network "private_network", ip: "192.168.112.10"
mo.vm.box = "ubuntu/trusty64"
mo.vm.provision "shell", path: "scripts/ubuntu/essentials.sh", privileged: true
mo.vm.provision "file", source: "scripts/ubuntu/get-pip.py", destination: "get-pip.py"
mo.vm.provision "file", source: "scripts/ubuntu/mongo-orchestration-config.json", destination: "mongo-orchestration-config.json"
mo.vm.provision "shell", path: "scripts/ubuntu/mongo-orchestration.sh", privileged: true
mo.vm.provision "shell", path: "scripts/ubuntu/ldap/install.sh", privileged: true
end
config.vm.define "ldap", autostart: false do |ldap|
ldap.vm.network "private_network", ip: "192.168.112.20"
ldap.vm.box = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box"
ldap.vm.provider "vmware_workstation" do |vmware, override|
override.vm.box_url = "https://dl.dropbox.com/u/5721940/vagrant-boxes/vagrant-centos-6.4-x86_64-vmware_fusion.box"
override.vm.provision "shell", path: "scripts/vmware/kernel.sh", privileged: true
end
ldap.vm.provision "shell", path: "scripts/centos/essentials.sh", privileged: true
ldap.vm.provision "shell", path: "scripts/centos/ldap/install.sh", privileged: true
end
config.vm.define "freebsd", autostart: false do |bsd|
bsd.vm.network "private_network", ip: "192.168.112.30"
bsd.vm.box = "geoffgarside/freebsd-10.0"
bsd.vm.provision "shell", path: "scripts/freebsd/essentials.sh", privileged: true
bsd.vm.provision "file", source: "/tmp/PHONGO-SERVERS.json", destination: "/tmp/PHONGO-SERVERS.json"
bsd.vm.provision "file", source: "scripts/configs/.gdbinit", destination: "/home/vagrant/.gdbinit"
bsd.vm.provision "shell", path: "scripts/freebsd/phongo.sh", privileged: true
bsd.vm.synced_folder ".", "/phongo", :nfs => true, id: "vagrant-root"
end
config.vm.define "precise64" do |linux|
linux.vm.network "private_network", ip: "192.168.112.40"
linux.vm.box = "http://files.vagrantup.com/precise64.box"
linux.vm.provider "vmware_workstation" do |vmware, override|
override.vm.box_url = 'http://files.vagrantup.com/precise64_vmware.box'
override.vm.provision "shell", path: "scripts/vmware/kernel.sh", privileged: true
end
linux.vm.provision "shell", path: "scripts/ubuntu/essentials.sh", privileged: true
linux.vm.provision "file", source: "/tmp/PHONGO-SERVERS.json", destination: "/tmp/PHONGO-SERVERS.json"
linux.vm.provision "file", source: "scripts/configs/.gdbinit", destination: "/home/vagrant/.gdbinit"
linux.vm.provision "shell", path: "scripts/ubuntu/phongo.sh", privileged: true
end
config.vm.define "precise32" do |linux|
linux.vm.network "private_network", ip: "192.168.112.50"
linux.vm.box = "bjori/precise32"
linux.vm.provider "vmware_workstation" do |vmware, override|
override.vm.box_url = "bjori/precise32"
override.vm.provision "shell", path: "scripts/vmware/kernel.sh", privileged: true
end
linux.vm.provision "shell", path: "scripts/ubuntu/essentials.sh", privileged: true
linux.vm.provision "file", source: "/tmp/PHONGO-SERVERS.json", destination: "/tmp/PHONGO-SERVERS.json"
linux.vm.provision "file", source: "scripts/configs/.gdbinit", destination: "/home/vagrant/.gdbinit"
linux.vm.provision "shell", path: "scripts/ubuntu/phongo.sh", privileged: true
end