Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in Travis scripts #949

Merged
merged 8 commits into from Jul 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ before_script:
- (cd php-tests/library/Mustache; git checkout master )
- (cd php-tests/library/Twig; git checkout master )
- (cd unit-tests/engines/; git clone -q git://github.com/bobthecow/mustache.php.git & git clone -q git://github.com/fabpot/Twig.git & wait)
- (cd ext; export CFLAGS="-g3 -O1 -fno-delete-null-pointer-checks -Wall"; phpize && ./configure --enable-phalcon && make -j2 && sudo make install && phpenv config-add ../unit-tests/ci/phalcon.ini)
- (cd ext; export CFLAGS="-g3 -O1 -std=gnu90 -Wall"; phpize && ./configure --enable-phalcon && make --silent -j2 && sudo make --silent install && phpenv config-add ../unit-tests/ci/phalcon.ini)
- ulimit -c unlimited || true

script:
Expand Down
43 changes: 24 additions & 19 deletions ext/mvc/collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,11 +1385,11 @@ PHP_METHOD(Phalcon_Mvc_Collection, save){
if (PHALCON_IS_STRING(key, "_id")) {

if (Z_TYPE_P(value) != IS_NULL) {
phalcon_array_update_zval(&data, key, &value, PH_COPY | PH_SEPARATE);
phalcon_array_update_zval(&data, key, &value, PH_COPY);
}
} else {
if (!phalcon_array_isset(reserved, key)) {
phalcon_array_update_zval(&data, key, &value, PH_COPY | PH_SEPARATE);
phalcon_array_update_zval(&data, key, &value, PH_COPY);
}
}

Expand All @@ -1398,24 +1398,29 @@ PHP_METHOD(Phalcon_Mvc_Collection, save){

PHALCON_INIT_VAR(success);
ZVAL_BOOL(success, 0);

/**
* We always use safe stores to get the success state
*/
PHALCON_INIT_VAR(options);
array_init_size(options, 1);
add_assoc_bool_ex(options, SS("safe"), 1);

/**
* Save the document
*/

PHALCON_INIT_NVAR(status);
Z_SET_ISREF_P(options);
Z_ADDREF_P(options);
phalcon_call_method_p2(status, collection, "save", data, options);
if (Z_REFCOUNT_P(options) > 1) {
Z_UNSET_ISREF_P(options);
Z_DELREF_P(options);
{
zval *params[2];
zval func;

ZVAL_STRING(&func, "save", 0);

/**
* We always use safe stores to get the success state
*/
ALLOC_INIT_ZVAL(options);
array_init(options);
add_assoc_long_ex(options, SS("w"), 1);

params[0] = data;
params[1] = options;

/**
* Save the document
*/
call_user_function(NULL, &collection, &func, status, 2, params TSRMLS_CC);
zval_ptr_dtor(&options);
}

if (Z_TYPE_P(status) == IS_ARRAY) {
Expand Down
2 changes: 2 additions & 0 deletions ext/php_phalcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#define PHP_PHALCON_VERSION "1.2.1"
#define PHP_PHALCON_EXTNAME "phalcon"

#include "main/php.h"

/** Memory frame */
typedef struct _phalcon_memory_entry {
size_t pointer;
Expand Down
3 changes: 3 additions & 0 deletions unit-tests/ci/after_failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ quit
EOF
fi
done

$(phpenv which php) -m
$(phpenv which php) -i
3 changes: 0 additions & 3 deletions unit-tests/ci/igbinary.ini

This file was deleted.

10 changes: 0 additions & 10 deletions unit-tests/ci/install_apc.sh

This file was deleted.

6 changes: 3 additions & 3 deletions unit-tests/ci/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ else
phpenv config-add "$DIR/apc.ini"
fi

pecl install igbinary < /dev/null && phpenv config-add $(DIR)/igbinary.ini &
pecl upgrade mongo < /dev/null && phpenv config-add $(DIR)/mongo.ini &
pecl install igbinary < /dev/null &
CFLAGS="-O1 -g" pecl upgrade mongo < /dev/null &

phpenv config-add $(DIR)/memcache.ini
phpenv config-add "$DIR/memcache.ini"
wait
1 change: 0 additions & 1 deletion unit-tests/ci/mongo.ini

This file was deleted.