|
| 1 | +/* |
| 2 | + +---------------------------------------------------------------------------+ |
| 3 | + | PHP Driver for MongoDB | |
| 4 | + +---------------------------------------------------------------------------+ |
| 5 | + | Copyright 2013-2014 MongoDB, Inc. | |
| 6 | + | | |
| 7 | + | Licensed under the Apache License, Version 2.0 (the "License"); | |
| 8 | + | you may not use this file except in compliance with the License. | |
| 9 | + | You may obtain a copy of the License at | |
| 10 | + | | |
| 11 | + | http://www.apache.org/licenses/LICENSE-2.0 | |
| 12 | + | | |
| 13 | + | Unless required by applicable law or agreed to in writing, software | |
| 14 | + | distributed under the License is distributed on an "AS IS" BASIS, | |
| 15 | + | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 16 | + | See the License for the specific language governing permissions and | |
| 17 | + | limitations under the License. | |
| 18 | + +---------------------------------------------------------------------------+ |
| 19 | + | Copyright (c) 2014, MongoDB, Inc. | |
| 20 | + +---------------------------------------------------------------------------+ |
| 21 | +*/ |
| 22 | + |
| 23 | +#ifdef HAVE_CONFIG_H |
| 24 | +# include "config.h" |
| 25 | +#endif |
| 26 | + |
| 27 | +/* External libs */ |
| 28 | +#include <bson.h> |
| 29 | +#include <mongoc.h> |
| 30 | + |
| 31 | +/* PHP Core stuff */ |
| 32 | +#include <php.h> |
| 33 | +#include <php_ini.h> |
| 34 | +#include <ext/standard/info.h> |
| 35 | +#include <Zend/zend_interfaces.h> |
| 36 | +#include <ext/spl/spl_iterators.h> |
| 37 | +/* Our Compatability header */ |
| 38 | +#include "php_compat_53.h" |
| 39 | + |
| 40 | +/* Our stuffz */ |
| 41 | +#include "php_phongo.h" |
| 42 | +#include "php_bson.h" |
| 43 | + |
| 44 | + |
| 45 | +PHONGO_API zend_class_entry *php_phongo_unserializable_ce; |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +/* {{{ BSON\Unserializable */ |
| 50 | + |
| 51 | +ZEND_BEGIN_ARG_INFO_EX(ai_unserializable_bsonunserialize, 0, 0, 1) |
| 52 | + ZEND_ARG_ARRAY_INFO(0, data, 0) |
| 53 | +ZEND_END_ARG_INFO(); |
| 54 | + |
| 55 | + |
| 56 | +static zend_function_entry php_phongo_unserializable_me[] = { |
| 57 | + ZEND_ABSTRACT_ME(Unserializable, bsonUnserialize, ai_unserializable_bsonunserialize) |
| 58 | + PHP_FE_END |
| 59 | +}; |
| 60 | + |
| 61 | +/* }}} */ |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +/* {{{ PHP_MINIT_FUNCTION */ |
| 66 | +PHP_MINIT_FUNCTION(Unserializable) |
| 67 | +{ |
| 68 | + (void)type; |
| 69 | + (void)module_number; |
| 70 | + zend_class_entry ce; |
| 71 | + |
| 72 | + INIT_NS_CLASS_ENTRY(ce, "BSON", "Unserializable", php_phongo_unserializable_me); |
| 73 | + php_phongo_unserializable_ce = zend_register_internal_interface(&ce TSRMLS_CC); |
| 74 | + |
| 75 | + return SUCCESS; |
| 76 | +} |
| 77 | +/* }}} */ |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +/* |
| 82 | + * Local variables: |
| 83 | + * tab-width: 4 |
| 84 | + * c-basic-offset: 4 |
| 85 | + * End: |
| 86 | + * vim600: noet sw=4 ts=4 fdm=marker |
| 87 | + * vim<600: noet sw=4 ts=4 |
| 88 | + */ |
0 commit comments