More cruft for objects

This commit is contained in:
Hannes Magnusson
2014-06-24 14:39:13 -07:00
parent c4bf2f76cf
commit 7295acdd01
21 changed files with 639 additions and 31 deletions
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_command_ce;
PHONGO_API zend_class_entry *php_phongo_command_ce;
/* {{{ proto MongoDB\Command\Command Command::__construct(array|object $document)
Constructs a new MongoDB Command */
@@ -83,6 +83,34 @@ static zend_function_entry php_phongo_command_me[] = {
/* }}} */
/* {{{ php_phongo_command_free_object && php_phongo_command_create_object */
static void php_phongo_command_free_object(void *object TSRMLS_DC)
{
php_phongo_command_t *intern = (php_phongo_command_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_command_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_command_t *intern;
intern = (php_phongo_command_t *)emalloc(sizeof(php_phongo_command_t));
memset(intern, 0, sizeof(php_phongo_command_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_command_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(Command)
{
@@ -90,6 +118,7 @@ PHP_MINIT_FUNCTION(Command)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Command", "Command", php_phongo_command_me);
ce.create_object = php_phongo_command_create_object;
php_phongo_command_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+35 -6
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_commandcursor_ce;
PHONGO_API zend_class_entry *php_phongo_commandcursor_ce;
/* {{{ proto MongoDB\Command\CommandCursor CommandCursor::__construct(MongoDB\Server $server, MongoDB\CursorId $cursorId, array $firstBatch)
Constructs a new CommandCursor object */
@@ -144,7 +144,7 @@ PHP_METHOD(CommandCursor, setBatchSize)
}
/* }}} */
/* {{{ proto void CommandCursor::current()
*/
*/
PHP_METHOD(CommandCursor, current)
{
php_phongo_commandcursor_t *intern;
@@ -163,7 +163,7 @@ PHP_METHOD(CommandCursor, current)
}
/* }}} */
/* {{{ proto void CommandCursor::next()
*/
*/
PHP_METHOD(CommandCursor, next)
{
php_phongo_commandcursor_t *intern;
@@ -182,7 +182,7 @@ PHP_METHOD(CommandCursor, next)
}
/* }}} */
/* {{{ proto void CommandCursor::key()
*/
*/
PHP_METHOD(CommandCursor, key)
{
php_phongo_commandcursor_t *intern;
@@ -201,7 +201,7 @@ PHP_METHOD(CommandCursor, key)
}
/* }}} */
/* {{{ proto void CommandCursor::valid()
*/
*/
PHP_METHOD(CommandCursor, valid)
{
php_phongo_commandcursor_t *intern;
@@ -220,7 +220,7 @@ PHP_METHOD(CommandCursor, valid)
}
/* }}} */
/* {{{ proto void CommandCursor::rewind()
*/
*/
PHP_METHOD(CommandCursor, rewind)
{
php_phongo_commandcursor_t *intern;
@@ -303,6 +303,34 @@ static zend_function_entry php_phongo_commandcursor_me[] = {
/* }}} */
/* {{{ php_phongo_commandcursor_free_object && php_phongo_commandcursor_create_object */
static void php_phongo_commandcursor_free_object(void *object TSRMLS_DC)
{
php_phongo_commandcursor_t *intern = (php_phongo_commandcursor_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_commandcursor_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_commandcursor_t *intern;
intern = (php_phongo_commandcursor_t *)emalloc(sizeof(php_phongo_commandcursor_t));
memset(intern, 0, sizeof(php_phongo_commandcursor_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_commandcursor_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(CommandCursor)
{
@@ -310,6 +338,7 @@ PHP_MINIT_FUNCTION(CommandCursor)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Command", "CommandCursor", php_phongo_commandcursor_me);
ce.create_object = php_phongo_commandcursor_create_object;
php_phongo_commandcursor_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_commandcursor_ce TSRMLS_CC, 1, php_phongo_cursor_ce);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_commandresult_ce;
PHONGO_API zend_class_entry *php_phongo_commandresult_ce;
/* {{{ proto MongoDB\Command\CommandResult CommandResult::__construct(MongoDB\Server $server, array|object $responseDocument)
Constructs a new CommandResult */
@@ -131,6 +131,34 @@ static zend_function_entry php_phongo_commandresult_me[] = {
/* }}} */
/* {{{ php_phongo_commandresult_free_object && php_phongo_commandresult_create_object */
static void php_phongo_commandresult_free_object(void *object TSRMLS_DC)
{
php_phongo_commandresult_t *intern = (php_phongo_commandresult_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_commandresult_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_commandresult_t *intern;
intern = (php_phongo_commandresult_t *)emalloc(sizeof(php_phongo_commandresult_t));
memset(intern, 0, sizeof(php_phongo_commandresult_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_commandresult_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(CommandResult)
{
@@ -138,6 +166,7 @@ PHP_MINIT_FUNCTION(CommandResult)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Command", "CommandResult", php_phongo_commandresult_me);
ce.create_object = php_phongo_commandresult_create_object;
php_phongo_commandresult_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+29 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_cursor_ce;
PHONGO_API zend_class_entry *php_phongo_cursor_ce;
@@ -98,6 +98,34 @@ static zend_function_entry php_phongo_cursor_me[] = {
/* }}} */
/* {{{ php_phongo_cursor_free_object && php_phongo_cursor_create_object */
static void php_phongo_cursor_free_object(void *object TSRMLS_DC)
{
php_phongo_cursor_t *intern = (php_phongo_cursor_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_cursor_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_cursor_t *intern;
intern = (php_phongo_cursor_t *)emalloc(sizeof(php_phongo_cursor_t));
memset(intern, 0, sizeof(php_phongo_cursor_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_cursor_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(Cursor)
{
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_cursorid_ce;
PHONGO_API zend_class_entry *php_phongo_cursorid_ce;
/* {{{ proto MongoDB\CursorId CursorId::__construct(string $id)
Construct a new CursorId */
@@ -110,6 +110,34 @@ static zend_function_entry php_phongo_cursorid_me[] = {
/* }}} */
/* {{{ php_phongo_cursorid_free_object && php_phongo_cursorid_create_object */
static void php_phongo_cursorid_free_object(void *object TSRMLS_DC)
{
php_phongo_cursorid_t *intern = (php_phongo_cursorid_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_cursorid_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_cursorid_t *intern;
intern = (php_phongo_cursorid_t *)emalloc(sizeof(php_phongo_cursorid_t));
memset(intern, 0, sizeof(php_phongo_cursorid_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_cursorid_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(CursorId)
{
@@ -117,6 +145,7 @@ PHP_MINIT_FUNCTION(CursorId)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB", "CursorId", php_phongo_cursorid_me);
ce.create_object = php_phongo_cursorid_create_object;
php_phongo_cursorid_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_deletebatch_ce;
PHONGO_API zend_class_entry *php_phongo_deletebatch_ce;
/* {{{ proto MongoDB\Write\DeleteBatch DeleteBatch::add(array|object $document)
Adds a new operation to be executed */
@@ -106,6 +106,34 @@ static zend_function_entry php_phongo_deletebatch_me[] = {
/* }}} */
/* {{{ php_phongo_deletebatch_free_object && php_phongo_deletebatch_create_object */
static void php_phongo_deletebatch_free_object(void *object TSRMLS_DC)
{
php_phongo_deletebatch_t *intern = (php_phongo_deletebatch_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_deletebatch_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_deletebatch_t *intern;
intern = (php_phongo_deletebatch_t *)emalloc(sizeof(php_phongo_deletebatch_t));
memset(intern, 0, sizeof(php_phongo_deletebatch_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_deletebatch_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(DeleteBatch)
{
@@ -113,6 +141,7 @@ PHP_MINIT_FUNCTION(DeleteBatch)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "DeleteBatch", php_phongo_deletebatch_me);
ce.create_object = php_phongo_deletebatch_create_object;
php_phongo_deletebatch_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_deletebatch_ce TSRMLS_CC, 1, php_phongo_writebatch_ce);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_deleteresult_ce;
PHONGO_API zend_class_entry *php_phongo_deleteresult_ce;
/* {{{ proto integer DeleteResult::getNumRemoved()
Returns the Number of documents that got removed */
@@ -177,6 +177,34 @@ static zend_function_entry php_phongo_deleteresult_me[] = {
/* }}} */
/* {{{ php_phongo_deleteresult_free_object && php_phongo_deleteresult_create_object */
static void php_phongo_deleteresult_free_object(void *object TSRMLS_DC)
{
php_phongo_deleteresult_t *intern = (php_phongo_deleteresult_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_deleteresult_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_deleteresult_t *intern;
intern = (php_phongo_deleteresult_t *)emalloc(sizeof(php_phongo_deleteresult_t));
memset(intern, 0, sizeof(php_phongo_deleteresult_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_deleteresult_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(DeleteResult)
{
@@ -184,6 +212,7 @@ PHP_MINIT_FUNCTION(DeleteResult)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "DeleteResult", php_phongo_deleteresult_me);
ce.create_object = php_phongo_deleteresult_create_object;
php_phongo_deleteresult_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_deleteresult_ce TSRMLS_CC, 1, php_phongo_writeresult_ce);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_generatedid_ce;
PHONGO_API zend_class_entry *php_phongo_generatedid_ce;
/* {{{ proto MongoDB\Write\GeneratedId GeneratedId::__construct(mixed $id, integer $index)
Constructs a new GeneratedId */
@@ -132,6 +132,34 @@ static zend_function_entry php_phongo_generatedid_me[] = {
/* }}} */
/* {{{ php_phongo_generatedid_free_object && php_phongo_generatedid_create_object */
static void php_phongo_generatedid_free_object(void *object TSRMLS_DC)
{
php_phongo_generatedid_t *intern = (php_phongo_generatedid_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_generatedid_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_generatedid_t *intern;
intern = (php_phongo_generatedid_t *)emalloc(sizeof(php_phongo_generatedid_t));
memset(intern, 0, sizeof(php_phongo_generatedid_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_generatedid_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(GeneratedId)
{
@@ -139,6 +167,7 @@ PHP_MINIT_FUNCTION(GeneratedId)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "GeneratedId", php_phongo_generatedid_me);
ce.create_object = php_phongo_generatedid_create_object;
php_phongo_generatedid_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_insertbatch_ce;
PHONGO_API zend_class_entry *php_phongo_insertbatch_ce;
/* {{{ proto MongoDB\Write\InsertBatch InsertBatch::add(array|object $document)
Adds a new operation to be executed */
@@ -106,6 +106,34 @@ static zend_function_entry php_phongo_insertbatch_me[] = {
/* }}} */
/* {{{ php_phongo_insertbatch_free_object && php_phongo_insertbatch_create_object */
static void php_phongo_insertbatch_free_object(void *object TSRMLS_DC)
{
php_phongo_insertbatch_t *intern = (php_phongo_insertbatch_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_insertbatch_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_insertbatch_t *intern;
intern = (php_phongo_insertbatch_t *)emalloc(sizeof(php_phongo_insertbatch_t));
memset(intern, 0, sizeof(php_phongo_insertbatch_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_insertbatch_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(InsertBatch)
{
@@ -113,6 +141,7 @@ PHP_MINIT_FUNCTION(InsertBatch)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "InsertBatch", php_phongo_insertbatch_me);
ce.create_object = php_phongo_insertbatch_create_object;
php_phongo_insertbatch_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_insertbatch_ce TSRMLS_CC, 1, php_phongo_writebatch_ce);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_insertresult_ce;
PHONGO_API zend_class_entry *php_phongo_insertresult_ce;
/* {{{ proto integer InsertResult::getNumInserted()
Returns the Number of documents that where inserted */
@@ -200,6 +200,34 @@ static zend_function_entry php_phongo_insertresult_me[] = {
/* }}} */
/* {{{ php_phongo_insertresult_free_object && php_phongo_insertresult_create_object */
static void php_phongo_insertresult_free_object(void *object TSRMLS_DC)
{
php_phongo_insertresult_t *intern = (php_phongo_insertresult_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_insertresult_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_insertresult_t *intern;
intern = (php_phongo_insertresult_t *)emalloc(sizeof(php_phongo_insertresult_t));
memset(intern, 0, sizeof(php_phongo_insertresult_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_insertresult_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(InsertResult)
{
@@ -207,6 +235,7 @@ PHP_MINIT_FUNCTION(InsertResult)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "InsertResult", php_phongo_insertresult_me);
ce.create_object = php_phongo_insertresult_create_object;
php_phongo_insertresult_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_insertresult_ce TSRMLS_CC, 1, php_phongo_writeresult_ce);
+32 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_manager_ce;
PHONGO_API zend_class_entry *php_phongo_manager_ce;
/* {{{ proto MongoDB\Manager Manager::__construct(string $uri[, array $options = array()[, array $driverOptions = array()]])
Constructs a new Manager */
@@ -308,6 +308,36 @@ static zend_function_entry php_phongo_manager_me[] = {
/* }}} */
/* {{{ php_phongo_manager_free_object && php_phongo_manager_create_object */
static void php_phongo_manager_free_object(void *object TSRMLS_DC)
{
php_phongo_manager_t *intern = (php_phongo_manager_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
mongoc_client_destroy(intern->client);
efree(intern);
}
zend_object_value php_phongo_manager_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_manager_t *intern;
intern = (php_phongo_manager_t *)emalloc(sizeof(php_phongo_manager_t));
memset(intern, 0, sizeof(php_phongo_manager_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_manager_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(Manager)
{
@@ -315,6 +345,7 @@ PHP_MINIT_FUNCTION(Manager)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB", "Manager", php_phongo_manager_me);
ce.create_object = php_phongo_manager_create_object;
php_phongo_manager_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_query_ce;
PHONGO_API zend_class_entry *php_phongo_query_ce;
/* {{{ proto MongoDB\Query\Query Query::__construct(array|object $query, array|object $selector, integer $flags, integer $skip, integer $limit)
Constructs a new Query */
@@ -96,6 +96,34 @@ static zend_function_entry php_phongo_query_me[] = {
/* }}} */
/* {{{ php_phongo_query_free_object && php_phongo_query_create_object */
static void php_phongo_query_free_object(void *object TSRMLS_DC)
{
php_phongo_query_t *intern = (php_phongo_query_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_query_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_query_t *intern;
intern = (php_phongo_query_t *)emalloc(sizeof(php_phongo_query_t));
memset(intern, 0, sizeof(php_phongo_query_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_query_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(Query)
{
@@ -103,6 +131,7 @@ PHP_MINIT_FUNCTION(Query)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Query", "Query", php_phongo_query_me);
ce.create_object = php_phongo_query_create_object;
php_phongo_query_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_declare_class_constant_long(php_phongo_query_ce, ZEND_STRL("FLAG_TAILABLE_CURSOR"), 0x01 TSRMLS_CC);
zend_declare_class_constant_long(php_phongo_query_ce, ZEND_STRL("FLAG_SLAVE_OK"), 0x02 TSRMLS_CC);
+35 -6
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_querycursor_ce;
PHONGO_API zend_class_entry *php_phongo_querycursor_ce;
/* {{{ proto MongoDB\Query\QueryCursor QueryCursor::__construct(MongoDB\Server $server, MongoDB\CursorId $cursorId)
Construct a new QueryCursor */
@@ -143,7 +143,7 @@ PHP_METHOD(QueryCursor, setBatchSize)
}
/* }}} */
/* {{{ proto void QueryCursor::current()
*/
*/
PHP_METHOD(QueryCursor, current)
{
php_phongo_querycursor_t *intern;
@@ -162,7 +162,7 @@ PHP_METHOD(QueryCursor, current)
}
/* }}} */
/* {{{ proto void QueryCursor::next()
*/
*/
PHP_METHOD(QueryCursor, next)
{
php_phongo_querycursor_t *intern;
@@ -181,7 +181,7 @@ PHP_METHOD(QueryCursor, next)
}
/* }}} */
/* {{{ proto void QueryCursor::key()
*/
*/
PHP_METHOD(QueryCursor, key)
{
php_phongo_querycursor_t *intern;
@@ -200,7 +200,7 @@ PHP_METHOD(QueryCursor, key)
}
/* }}} */
/* {{{ proto void QueryCursor::valid()
*/
*/
PHP_METHOD(QueryCursor, valid)
{
php_phongo_querycursor_t *intern;
@@ -219,7 +219,7 @@ PHP_METHOD(QueryCursor, valid)
}
/* }}} */
/* {{{ proto void QueryCursor::rewind()
*/
*/
PHP_METHOD(QueryCursor, rewind)
{
php_phongo_querycursor_t *intern;
@@ -300,6 +300,34 @@ static zend_function_entry php_phongo_querycursor_me[] = {
/* }}} */
/* {{{ php_phongo_querycursor_free_object && php_phongo_querycursor_create_object */
static void php_phongo_querycursor_free_object(void *object TSRMLS_DC)
{
php_phongo_querycursor_t *intern = (php_phongo_querycursor_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_querycursor_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_querycursor_t *intern;
intern = (php_phongo_querycursor_t *)emalloc(sizeof(php_phongo_querycursor_t));
memset(intern, 0, sizeof(php_phongo_querycursor_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_querycursor_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(QueryCursor)
{
@@ -307,6 +335,7 @@ PHP_MINIT_FUNCTION(QueryCursor)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Query", "QueryCursor", php_phongo_querycursor_me);
ce.create_object = php_phongo_querycursor_create_object;
php_phongo_querycursor_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_querycursor_ce TSRMLS_CC, 1, php_phongo_cursor_ce);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_readpreference_ce;
PHONGO_API zend_class_entry *php_phongo_readpreference_ce;
/* {{{ proto MongoDB\ReadPreference ReadPreference::__construct(string $readPreference[, array $tagSets = array()])
Constructs a new ReadPreference */
@@ -86,6 +86,34 @@ static zend_function_entry php_phongo_readpreference_me[] = {
/* }}} */
/* {{{ php_phongo_readpreference_free_object && php_phongo_readpreference_create_object */
static void php_phongo_readpreference_free_object(void *object TSRMLS_DC)
{
php_phongo_readpreference_t *intern = (php_phongo_readpreference_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_readpreference_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_readpreference_t *intern;
intern = (php_phongo_readpreference_t *)emalloc(sizeof(php_phongo_readpreference_t));
memset(intern, 0, sizeof(php_phongo_readpreference_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_readpreference_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(ReadPreference)
{
@@ -93,6 +121,7 @@ PHP_MINIT_FUNCTION(ReadPreference)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB", "ReadPreference", php_phongo_readpreference_me);
ce.create_object = php_phongo_readpreference_create_object;
php_phongo_readpreference_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_declare_class_constant_string(php_phongo_readpreference_ce, ZEND_STRL("RP_PRIMARY"), "primary" TSRMLS_DC);
zend_declare_class_constant_string(php_phongo_readpreference_ce, ZEND_STRL("RP_PRIMARY_PREFERRED"), "primaryPreferred" TSRMLS_DC);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_server_ce;
PHONGO_API zend_class_entry *php_phongo_server_ce;
/* {{{ proto MongoDB\Server Server::__construct(string $host, integer $port[, array $options = array()[, array $driverOptions = array()]])
Constructs a new Server */
@@ -368,6 +368,34 @@ static zend_function_entry php_phongo_server_me[] = {
/* }}} */
/* {{{ php_phongo_server_free_object && php_phongo_server_create_object */
static void php_phongo_server_free_object(void *object TSRMLS_DC)
{
php_phongo_server_t *intern = (php_phongo_server_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_server_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_server_t *intern;
intern = (php_phongo_server_t *)emalloc(sizeof(php_phongo_server_t));
memset(intern, 0, sizeof(php_phongo_server_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_server_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(Server)
{
@@ -375,6 +403,7 @@ PHP_MINIT_FUNCTION(Server)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB", "Server", php_phongo_server_me);
ce.create_object = php_phongo_server_create_object;
php_phongo_server_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_declare_class_constant_long(php_phongo_server_ce, ZEND_STRL("TYPE_MONGOS"), 0x01 TSRMLS_CC);
zend_declare_class_constant_long(php_phongo_server_ce, ZEND_STRL("TYPE_STANDALONE"), 0x02 TSRMLS_CC);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_updatebatch_ce;
PHONGO_API zend_class_entry *php_phongo_updatebatch_ce;
/* {{{ proto MongoDB\Write\UpdateBatch UpdateBatch::add(array|object $document)
Adds a new operation to be executed */
@@ -106,6 +106,34 @@ static zend_function_entry php_phongo_updatebatch_me[] = {
/* }}} */
/* {{{ php_phongo_updatebatch_free_object && php_phongo_updatebatch_create_object */
static void php_phongo_updatebatch_free_object(void *object TSRMLS_DC)
{
php_phongo_updatebatch_t *intern = (php_phongo_updatebatch_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_updatebatch_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_updatebatch_t *intern;
intern = (php_phongo_updatebatch_t *)emalloc(sizeof(php_phongo_updatebatch_t));
memset(intern, 0, sizeof(php_phongo_updatebatch_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_updatebatch_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(UpdateBatch)
{
@@ -113,6 +141,7 @@ PHP_MINIT_FUNCTION(UpdateBatch)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "UpdateBatch", php_phongo_updatebatch_me);
ce.create_object = php_phongo_updatebatch_create_object;
php_phongo_updatebatch_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_updatebatch_ce TSRMLS_CC, 1, php_phongo_writebatch_ce);
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_updateresult_ce;
PHONGO_API zend_class_entry *php_phongo_updateresult_ce;
/* {{{ proto integer UpdateResult::getNumMatched()
Returns the number of documents matching the criteria */
@@ -246,6 +246,34 @@ static zend_function_entry php_phongo_updateresult_me[] = {
/* }}} */
/* {{{ php_phongo_updateresult_free_object && php_phongo_updateresult_create_object */
static void php_phongo_updateresult_free_object(void *object TSRMLS_DC)
{
php_phongo_updateresult_t *intern = (php_phongo_updateresult_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_updateresult_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_updateresult_t *intern;
intern = (php_phongo_updateresult_t *)emalloc(sizeof(php_phongo_updateresult_t));
memset(intern, 0, sizeof(php_phongo_updateresult_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_updateresult_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(UpdateResult)
{
@@ -253,6 +281,7 @@ PHP_MINIT_FUNCTION(UpdateResult)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "UpdateResult", php_phongo_updateresult_me);
ce.create_object = php_phongo_updateresult_create_object;
php_phongo_updateresult_ce = zend_register_internal_class(&ce TSRMLS_CC);
zend_class_implements(php_phongo_updateresult_ce TSRMLS_CC, 1, php_phongo_writeresult_ce);
+29 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_writebatch_ce;
PHONGO_API zend_class_entry *php_phongo_writebatch_ce;
@@ -68,6 +68,34 @@ static zend_function_entry php_phongo_writebatch_me[] = {
/* }}} */
/* {{{ php_phongo_writebatch_free_object && php_phongo_writebatch_create_object */
static void php_phongo_writebatch_free_object(void *object TSRMLS_DC)
{
php_phongo_writebatch_t *intern = (php_phongo_writebatch_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_writebatch_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_writebatch_t *intern;
intern = (php_phongo_writebatch_t *)emalloc(sizeof(php_phongo_writebatch_t));
memset(intern, 0, sizeof(php_phongo_writebatch_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_writebatch_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(WriteBatch)
{
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_writeconcernerror_ce;
PHONGO_API zend_class_entry *php_phongo_writeconcernerror_ce;
/* {{{ proto MongoDB\Write\WriteConcernError WriteConcernError::__construct(string $message, integer $code, array $info)
Constructs a new WriteConcernError object */
@@ -157,6 +157,34 @@ static zend_function_entry php_phongo_writeconcernerror_me[] = {
/* }}} */
/* {{{ php_phongo_writeconcernerror_free_object && php_phongo_writeconcernerror_create_object */
static void php_phongo_writeconcernerror_free_object(void *object TSRMLS_DC)
{
php_phongo_writeconcernerror_t *intern = (php_phongo_writeconcernerror_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_writeconcernerror_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_writeconcernerror_t *intern;
intern = (php_phongo_writeconcernerror_t *)emalloc(sizeof(php_phongo_writeconcernerror_t));
memset(intern, 0, sizeof(php_phongo_writeconcernerror_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_writeconcernerror_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(WriteConcernError)
{
@@ -164,6 +192,7 @@ PHP_MINIT_FUNCTION(WriteConcernError)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "WriteConcernError", php_phongo_writeconcernerror_me);
ce.create_object = php_phongo_writeconcernerror_create_object;
php_phongo_writeconcernerror_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+30 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_writeerror_ce;
PHONGO_API zend_class_entry *php_phongo_writeerror_ce;
/* {{{ proto MongoDB\Write\WriteError WriteError::__construct(string $message, integer $code, integer $index, array|object $operation)
Constructs a new WriteError object */
@@ -182,6 +182,34 @@ static zend_function_entry php_phongo_writeerror_me[] = {
/* }}} */
/* {{{ php_phongo_writeerror_free_object && php_phongo_writeerror_create_object */
static void php_phongo_writeerror_free_object(void *object TSRMLS_DC)
{
php_phongo_writeerror_t *intern = (php_phongo_writeerror_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_writeerror_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_writeerror_t *intern;
intern = (php_phongo_writeerror_t *)emalloc(sizeof(php_phongo_writeerror_t));
memset(intern, 0, sizeof(php_phongo_writeerror_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_writeerror_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(WriteError)
{
@@ -189,6 +217,7 @@ PHP_MINIT_FUNCTION(WriteError)
zend_class_entry ce;
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Write", "WriteError", php_phongo_writeerror_me);
ce.create_object = php_phongo_writeerror_create_object;
php_phongo_writeerror_ce = zend_register_internal_class(&ce TSRMLS_CC);
return SUCCESS;
+29 -1
View File
@@ -42,7 +42,7 @@
#include "php_bson.h"
PHPAPI zend_class_entry *php_phongo_writeresult_ce;
PHONGO_API zend_class_entry *php_phongo_writeresult_ce;
@@ -96,6 +96,34 @@ static zend_function_entry php_phongo_writeresult_me[] = {
/* }}} */
/* {{{ php_phongo_writeresult_free_object && php_phongo_writeresult_create_object */
static void php_phongo_writeresult_free_object(void *object TSRMLS_DC)
{
php_phongo_writeresult_t *intern = (php_phongo_writeresult_t*)object;
zend_object_std_dtor(&intern->std TSRMLS_CC);
efree(intern);
}
zend_object_value php_phongo_writeresult_create_object(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
php_phongo_writeresult_t *intern;
intern = (php_phongo_writeresult_t *)emalloc(sizeof(php_phongo_writeresult_t));
memset(intern, 0, sizeof(php_phongo_writeresult_t));
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
object_properties_init(&intern->std, class_type);
retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, php_phongo_writeresult_free_object, NULL TSRMLS_CC);
retval.handlers = phongo_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(WriteResult)
{