Skip to content

Commit

Permalink
Merged identical arginfos
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Aug 15, 2013
1 parent 35720e2 commit e50b445
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 225 deletions.
88 changes: 4 additions & 84 deletions ext/cache/frontend/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include "php_phalcon.h"
#include "phalcon.h"

#include "cache/frontend/data.h"
#include "cache/frontend/base64.h"

#include "Zend/zend_operators.h"
#include "Zend/zend_exceptions.h"
#include "Zend/zend_interfaces.h"
Expand Down Expand Up @@ -78,94 +81,11 @@
*/
PHALCON_INIT_CLASS(Phalcon_Cache_Frontend_Base64){

PHALCON_REGISTER_CLASS(Phalcon\\Cache\\Frontend, Base64, cache_frontend_base64, phalcon_cache_frontend_base64_method_entry, 0);

zend_declare_property_null(phalcon_cache_frontend_base64_ce, SL("_frontendOptions"), ZEND_ACC_PROTECTED TSRMLS_CC);
PHALCON_REGISTER_CLASS_EX(Phalcon\\Cache\\Frontend, Base64, cache_frontend_base64, "phalcon\\cache\\frontend\\data", phalcon_cache_frontend_base64_method_entry, 0);

zend_class_implements(phalcon_cache_frontend_base64_ce TSRMLS_CC, 1, phalcon_cache_frontendinterface_ce);

return SUCCESS;
}

/**
* Phalcon\Cache\Frontend\Base64 constructor
*
* @param array $frontendOptions
*/
PHP_METHOD(Phalcon_Cache_Frontend_Base64, __construct){

zval *frontend_options = NULL;

phalcon_fetch_params(0, 0, 1, &frontend_options);

if (frontend_options) {
phalcon_update_property_this(this_ptr, SL("_frontendOptions"), frontend_options TSRMLS_CC);
}
}

/**
* Returns the cache lifetime
*
* @return integer
*/
PHP_METHOD(Phalcon_Cache_Frontend_Base64, getLifetime){

zval **options, **lifetime;

options = phalcon_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC);
if (phalcon_array_isset_string_fetch(&lifetime, *options, SS("lifetime"))) {
if (return_value_ptr) {
zval_ptr_dtor(return_value_ptr);
*return_value_ptr = *lifetime;
Z_ADDREF_PP(lifetime);
}
else {
RETURN_ZVAL(*lifetime, 1, 0);
}
}
else {
RETURN_LONG(1);
}
}

/**
* Check whether if frontend is buffering output
*
* @return boolean
*/
PHP_METHOD(Phalcon_Cache_Frontend_Base64, isBuffering){


RETURN_FALSE;
}

/**
* Starts output frontend. Actually, does nothing
*/
PHP_METHOD(Phalcon_Cache_Frontend_Base64, start){



}

/**
* Returns output cached content
*
* @return string
*/
PHP_METHOD(Phalcon_Cache_Frontend_Base64, getContent){


RETURN_NULL();
}

/**
* Stops output frontend
*/
PHP_METHOD(Phalcon_Cache_Frontend_Base64, stop){



}

/**
Expand Down
34 changes: 8 additions & 26 deletions ext/cache/frontend/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,22 @@
+------------------------------------------------------------------------+
*/

#ifndef PHALCON_CACHE_FRONTEND_BASE64_H
#define PHALCON_CACHE_FRONTEND_BASE64_H

#include "cache/frontendinterface.h"

extern zend_class_entry *phalcon_cache_frontend_base64_ce;

PHALCON_INIT_CLASS(Phalcon_Cache_Frontend_Base64);

PHP_METHOD(Phalcon_Cache_Frontend_Base64, __construct);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, getLifetime);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, isBuffering);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, start);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, getContent);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, stop);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, beforeStore);
PHP_METHOD(Phalcon_Cache_Frontend_Base64, afterRetrieve);

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_base64___construct, 0, 0, 0)
ZEND_ARG_INFO(0, frontendOptions)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_base64_beforestore, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_base64_afterretrieve, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

PHALCON_INIT_FUNCS(phalcon_cache_frontend_base64_method_entry){
PHP_ME(Phalcon_Cache_Frontend_Base64, __construct, arginfo_phalcon_cache_frontend_base64___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Cache_Frontend_Base64, getLifetime, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, isBuffering, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, start, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, getContent, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, stop, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, beforeStore, arginfo_phalcon_cache_frontend_base64_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, afterRetrieve, arginfo_phalcon_cache_frontend_base64_afterretrieve, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, beforeStore, arginfo_phalcon_cache_frontendinterface_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Base64, afterRetrieve, arginfo_phalcon_cache_frontendinterface_afterretrieve, ZEND_ACC_PUBLIC)
PHP_FE_END
};

#endif /* PHALCON_CACHE_FRONTEND_BASE64_H */
2 changes: 2 additions & 0 deletions ext/cache/frontend/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "php_phalcon.h"
#include "phalcon.h"

#include "cache/frontend/data.h"

#include "Zend/zend_operators.h"
#include "Zend/zend_exceptions.h"
#include "Zend/zend_interfaces.h"
Expand Down
28 changes: 13 additions & 15 deletions ext/cache/frontend/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
+------------------------------------------------------------------------+
*/

#ifndef PHALCON_CACHE_FRONTEND_DATA_H
#define PHALCON_CACHE_FRONTEND_DATA_H

#include "cache/frontendinterface.h"

extern zend_class_entry *phalcon_cache_frontend_data_ce;

PHALCON_INIT_CLASS(Phalcon_Cache_Frontend_Data);
Expand All @@ -34,23 +39,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_data___construct, 0, 0, 0)
ZEND_ARG_INFO(0, frontendOptions)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_data_beforestore, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_data_afterretrieve, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

PHALCON_INIT_FUNCS(phalcon_cache_frontend_data_method_entry){
PHP_ME(Phalcon_Cache_Frontend_Data, __construct, arginfo_phalcon_cache_frontend_data___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(Phalcon_Cache_Frontend_Data, getLifetime, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, isBuffering, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, start, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, getContent, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, stop, NULL, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, beforeStore, arginfo_phalcon_cache_frontend_data_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, afterRetrieve, arginfo_phalcon_cache_frontend_data_afterretrieve, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, getLifetime, arginfo_phalcon_cache_frontendinterface_empty, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, isBuffering, arginfo_phalcon_cache_frontendinterface_empty, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, start, arginfo_phalcon_cache_frontendinterface_empty, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, getContent, arginfo_phalcon_cache_frontendinterface_empty, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, stop, arginfo_phalcon_cache_frontendinterface_empty, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, beforeStore, arginfo_phalcon_cache_frontendinterface_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Data, afterRetrieve, arginfo_phalcon_cache_frontendinterface_afterretrieve, ZEND_ACC_PUBLIC)
PHP_FE_END
};

#endif /* PHALCON_CACHE_FRONTEND_DATA_H */
3 changes: 3 additions & 0 deletions ext/cache/frontend/igbinary.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "php_phalcon.h"
#include "phalcon.h"

#include "cache/frontend/data.h"
#include "cache/frontend/igbinary.h"

#include "Zend/zend_operators.h"
#include "Zend/zend_exceptions.h"
#include "Zend/zend_interfaces.h"
Expand Down
18 changes: 8 additions & 10 deletions ext/cache/frontend/igbinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,22 @@
+------------------------------------------------------------------------+
*/

#ifndef PHALCON_CACHE_FRONTEND_IGBINARY_H
#define PHALCON_CACHE_FRONTEND_IGBINARY_H

#include "cache/frontendinterface.h"

extern zend_class_entry *phalcon_cache_frontend_igbinary_ce;

PHALCON_INIT_CLASS(Phalcon_Cache_Frontend_Igbinary);

PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, beforeStore);
PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, afterRetrieve);

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_beforestore, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_afterretrieve, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

PHALCON_INIT_FUNCS(phalcon_cache_frontend_igbinary_method_entry){
PHP_ME(Phalcon_Cache_Frontend_Igbinary, beforeStore, arginfo_phalcon_cache_frontend_igbinary_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Igbinary, afterRetrieve, arginfo_phalcon_cache_frontend_igbinary_afterretrieve, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Igbinary, beforeStore, arginfo_phalcon_cache_frontendinterface_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Igbinary, afterRetrieve, arginfo_phalcon_cache_frontendinterface_afterretrieve, ZEND_ACC_PUBLIC)
PHP_FE_END
};

#endif /* PHALCON_CACHE_FRONTEND_IGBINARY_H */
3 changes: 3 additions & 0 deletions ext/cache/frontend/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "php_phalcon.h"
#include "phalcon.h"

#include "cache/frontend/data.h"
#include "cache/frontend/json.h"

#include "Zend/zend_operators.h"
#include "Zend/zend_exceptions.h"
#include "Zend/zend_interfaces.h"
Expand Down
19 changes: 9 additions & 10 deletions ext/cache/frontend/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
+------------------------------------------------------------------------+
*/

#ifndef PHALCON_CACHE_FRONTEND_JSON_H
#define PHALCON_CACHE_FRONTEND_JSON_H

#include "cache/frontendinterface.h"

extern zend_class_entry *phalcon_cache_frontend_json_ce;

PHALCON_INIT_CLASS(Phalcon_Cache_Frontend_Json);

PHP_METHOD(Phalcon_Cache_Frontend_Json, beforeStore);
PHP_METHOD(Phalcon_Cache_Frontend_Json, afterRetrieve);

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_json_beforestore, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_json_afterretrieve, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_END_ARG_INFO()

PHALCON_INIT_FUNCS(phalcon_cache_frontend_json_method_entry){
PHP_ME(Phalcon_Cache_Frontend_Json, beforeStore, arginfo_phalcon_cache_frontend_json_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Json, afterRetrieve, arginfo_phalcon_cache_frontend_json_afterretrieve, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Json, beforeStore, arginfo_phalcon_cache_frontendinterface_beforestore, ZEND_ACC_PUBLIC)
PHP_ME(Phalcon_Cache_Frontend_Json, afterRetrieve, arginfo_phalcon_cache_frontendinterface_afterretrieve, ZEND_ACC_PUBLIC)
PHP_FE_END
};

#endif /* PHALCON_CACHE_FRONTEND_JSON_H */
45 changes: 4 additions & 41 deletions ext/cache/frontend/none.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "config.h"
#endif

#include "cache/frontend/data.h"
#include "cache/frontend/none.h"

#include "php.h"
#include "php_phalcon.h"
#include "phalcon.h"
Expand Down Expand Up @@ -74,7 +77,7 @@
*/
PHALCON_INIT_CLASS(Phalcon_Cache_Frontend_None){

PHALCON_REGISTER_CLASS(Phalcon\\Cache\\Frontend, None, cache_frontend_none, phalcon_cache_frontend_none_method_entry, 0);
PHALCON_REGISTER_CLASS_EX(Phalcon\\Cache\\Frontend, None, cache_frontend_none, "phalcon\\cache\\frontend\\data", phalcon_cache_frontend_none_method_entry, 0);

zend_class_implements(phalcon_cache_frontend_none_ce TSRMLS_CC, 1, phalcon_cache_frontendinterface_ce);

Expand All @@ -90,46 +93,6 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, getLifetime){


RETURN_LONG(1);
}

/**
* Check whether if frontend is buffering output, always false
*
* @return boolean
*/
PHP_METHOD(Phalcon_Cache_Frontend_None, isBuffering){


RETURN_FALSE;
}

/**
* Starts output frontend
*/
PHP_METHOD(Phalcon_Cache_Frontend_None, start){



}

/**
* Returns output cached content
*
* @return string
*/
PHP_METHOD(Phalcon_Cache_Frontend_None, getContent){



}

/**
* Stops output frontend
*/
PHP_METHOD(Phalcon_Cache_Frontend_None, stop){



}

/**
Expand Down
Loading

0 comments on commit e50b445

Please sign in to comment.