Skip to content

Commit

Permalink
1. Fixed issues #4
Browse files Browse the repository at this point in the history
2. Compatible with php trunk
  • Loading branch information
laruence committed Aug 17, 2012
1 parent f8bbe99 commit d473a48
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CREDITS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Yaf
Xinchen Hui<Laruence@php.net>
Xinchen Hui
3 changes: 1 addition & 2 deletions php_yaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: php_yaf.h 326615 2012-07-12 09:10:29Z laruence $ */
/* $Id: php_yaf.h 327064 2012-08-12 03:04:55Z laruence $ */

#ifndef PHP_YAF_H
#define PHP_YAF_H
Expand Down Expand Up @@ -73,7 +73,6 @@ extern zend_module_entry yaf_module_entry;
#define yaf_session_t zval
#define yaf_exception_t zval

extern PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size);
extern PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC);
extern PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC);

Expand Down
4 changes: 2 additions & 2 deletions routes/static.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: static.c 326904 2012-07-31 15:00:05Z laruence $ */
/* $Id: static.c 327068 2012-08-12 08:04:53Z laruence $ */

zend_class_entry * yaf_route_static_ce;

Expand Down Expand Up @@ -196,7 +196,7 @@ zend_function_entry yaf_route_static_methods[] = {
YAF_STARTUP_FUNCTION(route_static) {
zend_class_entry ce;

YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Static", "Yaf\\Route\\Static", yaf_route_static_methods);
YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Static", "Yaf\\Route_Static", yaf_route_static_methods);
yaf_route_static_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC);
zend_class_implements(yaf_route_static_ce TSRMLS_CC, 1, yaf_router_ce);

Expand Down
7 changes: 5 additions & 2 deletions yaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf.c 325605 2012-05-09 07:16:31Z laruence $ */
/* $Id: yaf.c 327064 2012-08-12 03:04:55Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -100,7 +100,9 @@ PHP_MINIT_FUNCTION(yaf)
{
REGISTER_INI_ENTRIES();

#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 5
php_register_info_logo(YAF_LOGO_GUID, YAF_LOGO_MIME_TYPE, yaf_logo, sizeof(yaf_logo));
#endif

#ifdef YAF_HAVE_NAMESPACE
if(YAF_G(use_namespace)) {
Expand Down Expand Up @@ -232,12 +234,13 @@ PHP_RSHUTDOWN_FUNCTION(yaf)
PHP_MINFO_FUNCTION(yaf)
{
php_info_print_table_start();
if (PG(expose_php)) {
if (PG(expose_php) && !sapi_module.phpinfo_as_text) {
php_info_print_table_header(2, "yaf support", YAF_LOGO_IMG"enabled");
} else {
php_info_print_table_header(2, "yaf support", "enabled");
}


php_info_print_table_row(2, "Version", YAF_VERSION);
php_info_print_table_row(2, "Supports", YAF_SUPPORT_URL);
php_info_print_table_end();
Expand Down
4 changes: 2 additions & 2 deletions yaf_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_config.c 325800 2012-05-25 03:25:11Z laruence $ */
/* $Id: yaf_config.c 327093 2012-08-13 06:04:16Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -55,7 +55,7 @@ static zval * yaf_config_ini_zval_losable(zval *zvalue TSRMLS_DC);
*/
static int yaf_config_ini_modified(zval * file, long ctime TSRMLS_DC) {
zval n_ctime;
php_stat(Z_STRVAL_P(file), Z_STRLEN_P(file), 7 /*YAF_FS_CTIME*/ , &n_ctime TSRMLS_CC);
php_stat(Z_STRVAL_P(file), Z_STRLEN_P(file), 7 /* FS_CTIME */ , &n_ctime TSRMLS_CC);
if (Z_TYPE(n_ctime) != IS_BOOL && ctime != Z_LVAL(n_ctime)) {
return Z_LVAL(n_ctime);
}
Expand Down
43 changes: 41 additions & 2 deletions yaf_logo.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_logo.h 321289 2011-12-21 02:53:29Z laruence $ */
/* $Id: yaf_logo.h 327064 2012-08-12 03:04:55Z laruence $ */

#ifndef YAF_LOGO_H
#define YAF_LOGO_H

#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 5
#define YAF_LOGO_MIME_TYPE "image/png"
#define YAF_LOGO_GUID "YAF-LOGO-LARUNECE-COM"
#define YAF_SUPPORT_URL "http://pecl.php.net/package/yaf"
#define YAF_LOGO_IMG "<a href=" YAF_SUPPORT_URL "> \
<img src=\"?="YAF_LOGO_GUID"\" alt=\"Yaf logo\" /></a>\n"
<img src=\"" YAF_LOGO_GUID "\" alt=\"Yaf logo\" /></a>\n"

static const unsigned char yaf_logo[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
Expand Down Expand Up @@ -170,6 +171,44 @@ static const unsigned char yaf_logo[] = {
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};

extern PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size);
#else
#define YAF_LOGO_BASE64 "iVBORw0KGgoAAAANSUhEUgAAAB8AAAAVCAYAAAC+NTVfAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz" \
"AAALEAAACxABrSO9dQAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngA" \
"AAYaSURBVEhLlVUJTJRHFEYEhXIoQm0EQyKklkMOOSxq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GHYdU2gAAAABJRU5ErkJggg=="
#define YAF_LOGO_DATA "data:image/png;base64," YAF_LOGO_BASE64
#define YAF_SUPPORT_URL "http://pecl.php.net/package/yaf"
#define YAF_LOGO_IMG "<a href=" YAF_SUPPORT_URL "> \
<img src=\"" YAF_LOGO_DATA "\" alt=\"Yaf logo\" /></a>\n"

#endif
#endif

/*
Expand Down

0 comments on commit d473a48

Please sign in to comment.