Skip to content

Commit

Permalink
Merge pull request #949 from sjinks/travis-bugs
Browse files Browse the repository at this point in the history
Fix bugs in Travis scripts
  • Loading branch information
Phalcon committed Jul 29, 2013
2 parents 7a0c019 + 9535235 commit 8704097
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 37 deletions.
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.

0 comments on commit 8704097

Please sign in to comment.