Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP_FUNCTION(publicize)
- {
- char *classname = NULL;
- int classname_len;
- ulong i;
- char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
- &classname, &classname_len) == FAILURE) {
- return;
- }
- zend_class_entry **ce = NULL;
- zend_hash_find(EG(class_table), classname, classname_len + 1, (void
- **) &ce);
- if(!ce) {
- spprintf(&str, 0, "Class %s does not exist", classname);
- zend_throw_exception(NULL, str, 0 TSRMLS_CC);
- return;
- }
- HashTable *class_methods = &(*ce)->function_table;
- if(class_methods && zend_hash_num_elements(class_methods) > 0) {
- zend_hash_internal_pointer_reset(class_methods);
- zend_function *method;
- while(zend_hash_get_current_data(class_methods, (void **)
- &method) == SUCCESS) {
- method->common.fn_flags = method->common.fn_flags &
- ZEND_ACC_PUBLIC;
- zend_hash_move_forward(class_methods);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement