Commit a5dfecaa authored by Ondrej Sury's avatar Ondrej Sury

New upstream version 1.3.0

parent f77a8f3b

Too many changes to show.

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

.PHONY: coverage testclean 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;')
LIB_PATH=vendor/mongodb/mongodb
COMPOSER_ARGS=update --no-interaction --prefer-source
PHPUNIT_ARGS=--process-isolation
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 composer"
@echo -e "\t - Installs test dependencies using composer"
@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
composer:
@command -v composer >/dev/null 2>&1; \
if test $$? -eq 0; then \
composer $(COMPOSER_ARGS) ;\
if test -d $(LIB_PATH); then \
composer $(COMPOSER_ARGS) --working-dir $(LIB_PATH) ;\
fi \
elif test -r composer.phar; then \
php composer.phar $(COMPOSER_ARGS); \
if test -d $(LIB_PATH); then \
php $(top_srcdir)/composer.phar $(COMPOSER_ARGS) --working-dir $(LIB_PATH) ;\
fi \
else \
echo "Cannot find composer :("; \
echo "Aborting."; \
exit 1; \
fi
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:
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
testunit: composer
@command -v phpunit >/dev/null 2>&1; \
if test $$? -eq 0; then \
pushd $(LIB_PATH) ;\
phpunit $(PHPUNIT_ARGS) ;\
popd ;\
elif test -r phpunit.phar; then \
pushd $(LIB_PATH) ;\
php $(top_srcdir)/phpunit.phar $(PHPUNIT_ARGS) ;\
popd ;\
else \
echo "Cannot find phpunit :("; \
echo "Aborting."; \
exit 1; \
fi
testall: composer test testunit
testclean:
@for group in generic standalone; do \
find $(top_srcdir)/tests/$$group -type f -name "*.diff" -o -name "*.exp" -o -name "*.log" -o -name "*.mem" -o -name "*.out" -o -name "*.php" -o -name "*.sh" | xargs rm -f; \
done;
package:
pecl package package.xml
package.xml:
php bin/prep-release.php $(MONGODB_VERSION) $(MONGODB_STABILITY)
This diff is collapsed.
// vim:ft=javascript
function mongodb_generate_header(inpath, outpath, replacements)
{
STDOUT.WriteLine("Generating " + outpath);
var infile = FSO.OpenTextFile(inpath, 1);
var outdata = infile.ReadAll();
infile.Close();
for (var key in replacements) {
var replacement = replacements[key];
if (typeof replacement === 'string') {
replacement = replacement.replace(/"/g, '\\"');
}
outdata = outdata.replace(new RegExp('@' + key + '@', 'g'), replacement);
}
var outfile = FSO.CreateTextFile(outpath, true);
outfile.Write(outdata);
outfile.Close();
}
function mongodb_parse_version_file(inpath, prefix)
{
var infile = FSO.OpenTextFile(inpath, 1);
var version = infile.ReadLine();
infile.Close();
var xyz_pre = version.split("-");
var xyz = xyz_pre[0].split(".");
var pre = xyz_pre.length > 1 ? xyz_pre[1] : "";
var replacements = {};
replacements[prefix + "VERSION"] = version;
replacements[prefix + "MAJOR_VERSION"] = xyz[0];
replacements[prefix + "MINOR_VERSION"] = xyz[1];
replacements[prefix + "MICRO_VERSION"] = xyz[2];
replacements[prefix + "PRERELEASE_VERSION"] = pre;
return replacements;
}
ARG_ENABLE("mongodb", "MongoDB support", "no");
ARG_WITH("mongodb-sasl", "MongoDB: Build against Cyrus-SASL", "yes");
if (PHP_MONGODB != "no") {
/* Note: ADD_EXTENSION_DEP() cannot be used to declare that we depend on the
* date and standard extensions. Assume that they're always enabled. */
ADD_EXTENSION_DEP("mongodb", "json", false);
ADD_EXTENSION_DEP("mongodb", "spl", false);
/* MongoDB does not actually depend on PHP's OpenSSL extension, but this is in
* place to ensure that later SSL library checks succeed. This can be removed
* once we support building with Secure Channel. */
ADD_EXTENSION_DEP("mongodb", "openssl", false);
var PHP_MONGODB_CFLAGS="\
/D BSON_COMPILATION /D MONGOC_COMPILATION /D MONGOC_TRACE \
/I" + configure_module_dirname + " \
/I" + configure_module_dirname + "/src/BSON \
/I" + configure_module_dirname + "/src/MongoDB \
/I" + configure_module_dirname + "/src/MongoDB/Exception \
/I" + configure_module_dirname + "/src/contrib \
/I" + configure_module_dirname + "/src/libbson/src \
/I" + configure_module_dirname + "/src/libbson/src/bson \
/I" + configure_module_dirname + "/src/libbson/src/yajl \
/I" + configure_module_dirname + "/src/libmongoc/src/mongoc \
";
// Condense whitespace in CFLAGS
PHP_MONGODB_CFLAGS = PHP_MONGODB_CFLAGS.replace(/\s+/g, ' ');
// Generated with: find src/libbson/src/bson -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
var PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c";
// Generated with: find src/libbson/src/yajl -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
var PHP_MONGODB_YAJL_SOURCES="yajl_alloc.c yajl_buf.c yajl.c yajl_encode.c yajl_gen.c yajl_lex.c yajl_parser.c yajl_tree.c yajl_version.c";
// Generated with: find src/libmongoc/src/mongoc -name '*.c' -print0 | cut -sz -d / -f 4- | sort -z | tr '\000' ' '
var PHP_MONGODB_MONGOC_SOURCES="mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-b64.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-client.c mongoc-client-pool.c mongoc-cluster.c mongoc-collection.c mongoc-counters.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-cursorid.c mongoc-cursor-transform.c mongoc-database.c mongoc-find-and-modify.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-index.c mongoc-init.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-opcode.c mongoc-openssl.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-description.c mongoc-server-stream.c mongoc-set.c mongoc-socket.c mongoc-ssl.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c";
EXTENSION("mongodb", "php_phongo.c phongo_compat.c", null, PHP_MONGODB_CFLAGS);
ADD_SOURCES(configure_module_dirname + "/src", "bson.c", "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/BSON", "Binary.c Decimal128.c Javascript.c MaxKey.c MinKey.c ObjectID.c Persistable.c Regex.c Serializable.c Timestamp.c Type.c Unserializable.c UTCDateTime.c", "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/MongoDB", "BulkWrite.c Command.c Cursor.c CursorId.c Manager.c Query.c ReadConcern.c ReadPreference.c Server.c WriteConcern.c WriteConcernError.c WriteError.c WriteResult.c", "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Exception", "AuthenticationException.c BulkWriteException.c ConnectionException.c ConnectionTimeoutException.c Exception.c ExecutionTimeoutException.c InvalidArgumentException.c LogicException.c RuntimeException.c SSLConnectionException.c UnexpectedValueException.c WriteException.c", "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libbson/src/bson", PHP_MONGODB_BSON_SOURCES, "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libbson/src/yajl", PHP_MONGODB_YAJL_SOURCES, "mongodb");
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", PHP_MONGODB_MONGOC_SOURCES, "mongodb");
var bson_opts = {
BSON_BYTE_ORDER: 1234,
BSON_OS: 2,
BSON_HAVE_STDBOOL_H: 0,