Skip to content

Commit

Permalink
PHPC-174: Rename module registration, constants and so on to mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
bjori committed Mar 23, 2015
1 parent 234da99 commit 809e99d
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 95 deletions.
18 changes: 9 additions & 9 deletions Makefile.frag
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.PHONY: coverage testclean ChangeLog RELEASE package.xml docs

DATE=`date +%Y-%m-%d--%H-%M-%S`
PHONGO_VERSION=`php -n -dextension=modules/phongo.so -r 'echo PHONGO_VERSION;'`
PHONGO_STABILITY=`php -n -dextension=modules/phongo.so -r 'echo PHONGO_STABILITY;'`
MONGODB_VERSION=`php -n -dextension=modules/mongodb.so -r 'echo MONGODB_VERSION;'`
MONGODB_STABILITY=`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
Expand Down Expand Up @@ -43,7 +43,7 @@ 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 "phongo code coverage" --output-directory coverage
genhtml .coverage.lcov --legend --title "mongodb code coverage" --output-directory coverage


coveralls: mv-coverage lcov-coveralls
Expand Down Expand Up @@ -101,14 +101,14 @@ testclean:
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;

phongodep:
mongodbdep:

release: test ChangeLog RELEASE package.xml
pecl package package.xml
@echo "Please run:"
@echo " " git add RELEASE-$(PHONGO_VERSION)
@echo " " git commit -m \"Add $(PHONGO_VERSION) release notes\"
@echo " " git tag -a -m \"Release $(PHONGO_VERSION)\" $(PHONGO_VERSION)
@echo " " git add RELEASE-$(MONGODB_VERSION)
@echo " " git commit -m \"Add $(MONGODB_VERSION) release notes\"
@echo " " git tag -a -m \"Release $(MONGODB_VERSION)\" $(MONGODB_VERSION)
@echo " " git push --tags
@echo " " make release-docs
@echo "And don't forget to bump version in php_phongo.h"
Expand All @@ -120,10 +120,10 @@ release-docs: docs
mkdocs gh-deploy --clean

package.xml:
php bin/prep-release.php $(PHONGO_VERSION)-$(PHONGO_STABILITY)
php bin/prep-release.php $(MONGODB_VERSION)-$(MONGODB_STABILITY)

RELEASE:
@git log --pretty=format:"%ad %an <%ae>%n%x09* %s%n" --date short --since="$$(git show -s --format=%ad `git rev-list --tags --max-count=1`)" > RELEASE-$(PHONGO_VERSION)
@git log --pretty=format:"%ad %an <%ae>%n%x09* %s%n" --date short --since="$$(git show -s --format=%ad `git rev-list --tags --max-count=1`)" > RELEASE-$(MONGODB_VERSION)

ChangeLog:
@git log --pretty=format:"%ad %an <%ae>%n%x09* %s%n" --date short > ChangeLog
Expand Down
2 changes: 1 addition & 1 deletion bin/prep-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function usage() {
$NOTES = array();
foreach($fullnotes as $note) {
$note = " " . str_replace("&", "&amp;", trim($note));
/* PHP phongo JIRA Project */
/* PHP PHPC JIRA Project */
if (strstr($note, "PHPC-") !== false) {
$NOTES[] = $note;
continue;
Expand Down
66 changes: 33 additions & 33 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ AC_DEFUN([PHP_BSON_CLOCK],

MONGOC_SYMBOL_SUFFIX="priv"

if test "$PHONGO" != "no"; then
if test "$MONGODB" != "no"; then
PHP_ARG_ENABLE(developer-flags, whether to enable developer build flags,
[ --enable-developer-flags Enable developer flags],, no)

Expand Down Expand Up @@ -126,10 +126,10 @@ if test "$PHONGO" != "no"; then
EXTRA_LDFLAGS="$COVERAGE_CFLAGS"
fi

PHONGO_BSON="\
MONGODB_BSON="\
src/bson.c \
";
PHONGO_BSON_CLASSES="\
MONGODB_BSON_CLASSES="\
src/BSON/Type.c \
src/BSON/Unserializable.c \
src/BSON/Serializable.c \
Expand All @@ -143,10 +143,10 @@ if test "$PHONGO" != "no"; then
src/BSON/Timestamp.c \
src/BSON/UTCDatetime.c \
";
PHONGO_ROOT="\
MONGODB_ROOT="\
php_phongo.c \
";
PHONGO_MONGODB_CLASSES="\
MONGODB_MONGODB_CLASSES="\
src/MongoDB/Command.c \
src/MongoDB/Cursor.c \
src/MongoDB/CursorId.c \
Expand All @@ -161,7 +161,7 @@ if test "$PHONGO" != "no"; then
src/MongoDB/WriteError.c \
src/MongoDB/WriteResult.c \
";
PHONGO_MONGODB_EXCEPTIONS="\
MONGODB_MONGODB_EXCEPTIONS="\
src/MongoDB/Exception.c \
src/MongoDB/RuntimeException.c \
src/MongoDB/InvalidArgumentException.c \
Expand Down Expand Up @@ -268,15 +268,15 @@ MONGOC_SOURCES_SASL=mongoc-sasl.c


if test "$ext_shared" = "no"; then
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $PHONGO_BSON)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $PHONGO_BSON_CLASSES)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $PHONGO_MONGODB_CLASSES)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $PHONGO_MONGODB_EXCEPTIONS)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_BSON)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_BSON_CLASSES)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_CLASSES)
PHP_ADD_SOURCES(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS)
else
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $PHONGO_BSON, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $PHONGO_BSON_CLASSES, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $PHONGO_MONGODB_CLASSES, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $PHONGO_MONGODB_EXCEPTIONS, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_BSON, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_BSON_CLASSES, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_CLASSES, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb), $MONGODB_MONGODB_EXCEPTIONS, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS], shared_objects_mongodb, yes)
fi

dnl libmongoc stuff {{{
Expand All @@ -293,64 +293,64 @@ dnl libmongoc stuff {{{
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_SSL, [$STD_CFLAGS], shared_objects_mongodb, yes)


PHP_SETUP_OPENSSL(PHONGO_SHARED_LIBADD)
PHP_SETUP_OPENSSL(MONGODB_SHARED_LIBADD)
MONGOC_ENABLE_SSL=1
AC_SUBST(MONGOC_ENABLE_SSL)


PHP_ARG_WITH(mongodb-sasl, Build with Cyrus SASL support,
[ --with-mongodb-sasl[=DIR] mongodb: Include Cyrus SASL support], auto, yes)

if test "$PHP_PHONGO_SASL" != "no"; then
if test "$PHP_MONGODB_SASL" != "no"; then
AC_MSG_CHECKING(for SASL)
for i in $PHONGO_SASL /usr /usr/local; do
for i in $MONGODB_SASL /usr /usr/local; do
if test -f $i/include/sasl/sasl.h; then
PHONGO_SASL_DIR=$i
MONGODB_SASL_DIR=$i
AC_MSG_RESULT(found in $i)
break
fi
done

if test -z "$PHONGO_SASL_DIR"; then
if test -z "$MONGODB_SASL_DIR"; then
AC_MSG_RESULT(not found)
if test "$PHONGO_SASL" != "auto"; then
if test "$MONGODB_SASL" != "auto"; then
AC_MSG_ERROR([sasl.h not found!])
fi
fi

PHP_CHECK_LIBRARY(sasl2, sasl_version,
[
PHP_ADD_INCLUDE($PHONGO_SASL_DIR)
PHP_ADD_LIBRARY_WITH_PATH(sasl2, $PHONGO_SASL_DIR/$PHP_LIBDIR, PHONGO_SHARED_LIBADD)
PHP_ADD_INCLUDE($MONGODB_SASL_DIR)
PHP_ADD_LIBRARY_WITH_PATH(sasl2, $MONGODB_SASL_DIR/$PHP_LIBDIR, MONGODB_SHARED_LIBADD)
MONGOC_ENABLE_SASL=1
AC_SUBST(MONGOC_ENABLE_SASL)
], [
if test "$PHONGO_SASL" != "auto"; then
if test "$MONGODB_SASL" != "auto"; then
AC_MSG_ERROR([MONGO SASL check failed. Please check config.log for more information.])
fi
], [
-L$PHONGO_SASL_DIR/$PHP_LIBDIR
-L$MONGODB_SASL_DIR/$PHP_LIBDIR
])
fi
m4_include(src/libmongoc/build/autotools/m4/ax_pthread.m4)
AX_PTHREAD

AC_CHECK_FUNCS([shm_open], [SHM_LIB=], [AC_CHECK_LIB([rt], [shm_open], [SHM_LIB=-lrt], [SHM_LIB=])])
PHONGO_SHARED_LIBADD="$PHONGO_SHARED_LIBADD $SHM_LIB"
MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD $SHM_LIB"


dnl PHP_ADD_LIBRARY_WITH_PATH(bson-1.0, src/libbson/.libs, PHONGO_SHARED_LIBADD)
dnl PHP_ADD_LIBRARY_WITH_PATH(mongoc-priv, src/libmongoc/.libs, PHONGO_SHARED_LIBADD)
dnl PHP_ADD_LIBRARY_WITH_PATH(bson-1.0, src/libbson/.libs, MONGODB_SHARED_LIBADD)
dnl PHP_ADD_LIBRARY_WITH_PATH(mongoc-priv, src/libmongoc/.libs, MONGODB_SHARED_LIBADD)
EXTRA_CFLAGS="$PTHREAD_CFLAGS $SASL_CFLAGS"
PHP_SUBST(EXTRA_CFLAGS)
PHP_SUBST(EXTRA_LDFLAGS)

PHONGO_SHARED_LIBADD="$PHONGO_SHARED_LIBADD $PTHREAD_LIBS $SASL_LIBS"
PHP_SUBST(PHONGO_SHARED_LIBADD)
MONGODB_SHARED_LIBADD="$MONGODB_SHARED_LIBADD $PTHREAD_LIBS $SASL_LIBS"
PHP_SUBST(MONGODB_SHARED_LIBADD)

dnl }}}

PHP_NEW_EXTENSION(mongodb, $PHONGO_ROOT, $ext_shared,, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS])
PHP_NEW_EXTENSION(mongodb, $MONGODB_ROOT, $ext_shared,, [$STD_CFLAGS $MAINTAINER_CFLAGS $COVERAGE_CFLAGS])
PHP_ADD_EXTENSION_DEP(mongodb, spl)

m4_include(src/libbson/build/autotools/CheckAtomics.m4)
Expand All @@ -372,8 +372,8 @@ dnl }}}
PHP_ADD_BUILD_DIR([$ext_builddir/src/libbson/src/bson/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/libmongoc/src/mongoc/])

dnl PHONGO_SHARED_DEPENDENCIES="mongodbdep"
dnl PHP_SUBST(PHONGO_SHARED_DEPENDENCIES)
dnl MONGODB_SHARED_DEPENDENCIES="mongodbdep"
dnl PHP_SUBST(MONGODB_SHARED_DEPENDENCIES)

PHP_BSON_BIGENDIAN
AC_HEADER_STDBOOL
Expand Down Expand Up @@ -440,7 +440,7 @@ Build configuration:
Code Coverage flags (extra slow) : $COVERAGE_CFLAGS
LDFLAGS : $LDFLAGS
EXTRA_LDFLAGS : $EXTRA_LDFLAGS
PHONGO_SHARED_LIBADD : $PHONGO_SHARED_LIBADD
MONGODB_SHARED_LIBADD : $MONGODB_SHARED_LIBADD
Please submit bugreports at:
https://jira.mongodb.org/browse/PHP
Expand Down
Loading

0 comments on commit 809e99d

Please sign in to comment.