[PHP-CVS] cvs: php-src /ext/standard dl.c

2009-01-07 Thread Pierre-Alain Joye
pajoye  Wed Jan  7 13:03:37 2009 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  - MFB: declaration and impl match
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.128r2=1.129diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.128 php-src/ext/standard/dl.c:1.129
--- php-src/ext/standard/dl.c:1.128 Wed Dec 31 11:12:36 2008
+++ php-src/ext/standard/dl.c   Wed Jan  7 13:03:37 2009
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.128 2008/12/31 11:12:36 sebastian Exp $ */
+/* $Id: dl.c,v 1.129 2009/01/07 13:03:37 pajoye Exp $ */
 
 #include php.h
 #include dl.h
@@ -52,7 +52,7 @@
 
 /* {{{ proto int dl(string extension_filename) U
Load a PHP extension at runtime */
-PHP_FUNCTION(dl)
+PHPAPI PHP_FUNCTION(dl)
 {
char *filename;
int filename_len;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2008-05-16 Thread Antony Dovgal

On 16.05.2008 07:11, Felipe Pena wrote:

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, filename) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) 
== FAILURE) {
return;
}
+   
+   convert_to_string(filename);


Why not use s ?
That would also give you nice notices when you pass in non-scalar values.

--
Wbr, 
Antony Dovgal


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2008-05-16 Thread Felipe Pena
Em Sex, 2008-05-16 às 11:40 +0400, Antony Dovgal escreveu:
 On 16.05.2008 07:11, Felipe Pena wrote:
  -   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, filename) == 
  FAILURE) {
  +   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) 
  == FAILURE) {
  return;
  }
  +   
  +   convert_to_string(filename);
 
 Why not use s ?
 That would also give you nice notices when you pass in non-scalar values.

Because php_dl() expects zval* and i thought to keep it.
But, i'll change, whereas php_dl() doesn't make anything with zvals.

-- 
Regards,
Felipe Pena.


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c dl.h

2008-05-16 Thread Felipe Pena
felipe  Fri May 16 12:11:15 2008 UTC

  Modified files:  
/php-src/ext/standard   dl.c dl.h 
  Log:
  - Improved fix (used 's' in parameter parsing)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.126r2=1.127diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.126 php-src/ext/standard/dl.c:1.127
--- php-src/ext/standard/dl.c:1.126 Fri May 16 03:11:56 2008
+++ php-src/ext/standard/dl.c   Fri May 16 12:11:15 2008
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.126 2008/05/16 03:11:56 felipe Exp $ */
+/* $Id: dl.c,v 1.127 2008/05/16 12:11:15 felipe Exp $ */
 
 #include php.h
 #include dl.h
@@ -54,15 +54,14 @@
Load a PHP extension at runtime */
 PHP_FUNCTION(dl)
 {
-   zval *filename;
+   char *filename;
+   int filename_len;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) 
== FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, filename, 
filename_len, ZEND_U_CONVERTER(UG(filesystem_encoding_conv))) == FAILURE) {
return;
}
-   
-   convert_to_string(filename);
 
-   if (Z_STRLEN_P(filename) = MAXPATHLEN) {
+   if (filename_len = MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds 
the maximum allowed length of %d characters, MAXPATHLEN);
RETURN_FALSE;
}
@@ -72,10 +71,10 @@
(strncmp(sapi_module.name, embed, 5) != 0)
) {
 #ifdef ZTS
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in 
multithreaded Web servers - use extension=%s in your php.ini, 
Z_STRVAL_P(filename));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in 
multithreaded Web servers - use extension=%s in your php.ini, filename);
RETURN_FALSE;
 #else
-   php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, dl() is 
deprecated - use extension=%s in your php.ini, Z_STRVAL_P(filename));
+   php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, dl() is 
deprecated - use extension=%s in your php.ini, filename);
 #endif
}
 
@@ -243,29 +242,14 @@
 
 /* {{{ php_dl
  */
-PHPAPI void php_dl(zval *file, int type, zval *return_value, int start_now 
TSRMLS_DC)
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now 
TSRMLS_DC)
 {
-   char *filename;
-   int filename_len;
-   
-   if (Z_TYPE_P(file) == IS_UNICODE) {
-   if (FAILURE == php_stream_path_encode(NULL, filename, 
filename_len, Z_USTRVAL_P(file), Z_USTRLEN_P(file), REPORT_ERRORS, 
FG(default_context))) {
-   return;
-   }
-   } else {
-   filename = Z_STRVAL_P(file);
-   }
-
/* Load extension */
-   if (php_load_extension(filename, type, start_now TSRMLS_CC) == FAILURE) 
{
+   if (php_load_extension(file, type, start_now TSRMLS_CC) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
}
-
-   if (Z_TYPE_P(file) == IS_UNICODE) {
-   efree(filename);
-   }
 }
 /* }}} */
 
@@ -276,9 +260,9 @@
 
 #else
 
-PHPAPI void php_dl(zval *file, int type, zval *return_value, int start_now 
TSRMLS_DC)
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now 
TSRMLS_DC)
 {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %R 
- dynamic modules are not supported, Z_TYPE_P(file), Z_UNIVAL_P(file));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %s 
- dynamic modules are not supported, file);
RETURN_FALSE;
 }
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.h?r1=1.28r2=1.29diff_format=u
Index: php-src/ext/standard/dl.h
diff -u php-src/ext/standard/dl.h:1.28 php-src/ext/standard/dl.h:1.29
--- php-src/ext/standard/dl.h:1.28  Mon Dec 31 07:12:15 2007
+++ php-src/ext/standard/dl.h   Fri May 16 12:11:15 2008
@@ -18,13 +18,13 @@
+--+
 */
 
-/* $Id: dl.h,v 1.28 2007/12/31 07:12:15 sebastian Exp $ */
+/* $Id: dl.h,v 1.29 2008/05/16 12:11:15 felipe Exp $ */
 
 #ifndef DL_H
 #define DL_H
 
 PHPAPI int php_load_extension(char *filename, int type, int start_now 
TSRMLS_DC);
-PHPAPI void php_dl(zval *file,int type, zval *return_value, int start_now 
TSRMLS_DC);
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now 
TSRMLS_DC);
 
 /* dynamic loading functions */
 PHPAPI PHP_FUNCTION(dl);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2008-05-15 Thread Felipe Pena
felipe  Fri May 16 03:11:56 2008 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  - MFB: Added conversion to string.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.125r2=1.126diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.125 php-src/ext/standard/dl.c:1.126
--- php-src/ext/standard/dl.c:1.125 Thu Feb 28 16:59:21 2008
+++ php-src/ext/standard/dl.c   Fri May 16 03:11:56 2008
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.125 2008/02/28 16:59:21 dmitry Exp $ */
+/* $Id: dl.c,v 1.126 2008/05/16 03:11:56 felipe Exp $ */
 
 #include php.h
 #include dl.h
@@ -56,9 +56,11 @@
 {
zval *filename;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, filename) == 
FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) 
== FAILURE) {
return;
}
+   
+   convert_to_string(filename);
 
if (Z_STRLEN_P(filename) = MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds 
the maximum allowed length of %d characters, MAXPATHLEN);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2008-02-28 Thread Dmitry Stogov
dmitry  Thu Feb 28 16:59:21 2008 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  We don't nave to change request shutdown sequence if dl() was failed
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.124r2=1.125diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.124 php-src/ext/standard/dl.c:1.125
--- php-src/ext/standard/dl.c:1.124 Sat Feb 23 17:03:53 2008
+++ php-src/ext/standard/dl.c   Thu Feb 28 16:59:21 2008
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.124 2008/02/23 17:03:53 helly Exp $ */
+/* $Id: dl.c,v 1.125 2008/02/28 16:59:21 dmitry Exp $ */
 
 #include php.h
 #include dl.h
@@ -78,7 +78,9 @@
}
 
php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
-   EG(full_tables_cleanup) = 1;
+   if (Z_LVAL_P(return_value) == 1) {
+   EG(full_tables_cleanup) = 1;
+   }
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-11-09 Thread Jani Taskinen
janiFri Nov  9 13:49:06 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  ws + cs
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.120r2=1.121diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.120 php-src/ext/standard/dl.c:1.121
--- php-src/ext/standard/dl.c:1.120 Thu Sep 27 18:28:42 2007
+++ php-src/ext/standard/dl.c   Fri Nov  9 13:49:06 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.120 2007/09/27 18:28:42 dmitry Exp $ */
+/* $Id: dl.c,v 1.121 2007/11/09 13:49:06 jani Exp $ */
 
 #include php.h
 #include dl.h
@@ -32,7 +32,6 @@
 #if defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H
 #include stdlib.h
 #include stdio.h
-
 #ifdef HAVE_STRING_H
 #include string.h
 #else
@@ -49,10 +48,8 @@
 #include sys/param.h
 #define GET_DL_ERROR() DL_ERROR()
 #endif
-
 #endif /* defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H */
 
-
 /* {{{ proto int dl(string extension_filename) U
Load a PHP extension at runtime */
 PHP_FUNCTION(dl)
@@ -71,10 +68,8 @@
php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
EG(full_tables_cleanup) = 1;
 }
-
 /* }}} */
 
-
 #if defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H
 
 #ifdef ZTS
@@ -153,14 +148,13 @@
 
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, 
get_module);
 
-   /*
-* some OS prepend _ to symbol names while their dynamic linker
+   /* Some OS prepend _ to symbol names while their dynamic linker
 * does not do that automatically. Thus we check manually for
-* _get_module.
-*/
+* _get_module. */
 
-   if (!get_module)
+   if (!get_module) {
get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, _get_module);
+   }
 
if (!get_module) {
DL_UNLOAD(handle);
@@ -168,27 +162,29 @@
RETURN_FALSE;
}
module_entry = get_module();
-   if ((module_entry-zend_debug != ZEND_DEBUG) || (module_entry-zts != 
USING_ZTS)
-   || (module_entry-zend_api != ZEND_MODULE_API_NO)) {
+   if ((module_entry-zend_debug != ZEND_DEBUG) ||
+   (module_entry-zts != USING_ZTS) ||
+   (module_entry-zend_api != ZEND_MODULE_API_NO)
+   ) {
/* Check for pre-4.1.0 module which has a slightly different 
module_entry structure :( */
struct pre_4_1_0_module_entry {
- char *name;
- zend_function_entry *functions;
- int (*module_startup_func)(INIT_FUNC_ARGS);
- int 
(*module_shutdown_func)(SHUTDOWN_FUNC_ARGS);
- int (*request_startup_func)(INIT_FUNC_ARGS);
- int 
(*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
- void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
- int (*global_startup_func)(void);
- int (*global_shutdown_func)(void);
- int globals_id;
- int module_started;
- unsigned char type;
- void *handle;
- int module_number;
- unsigned char zend_debug;
- unsigned char zts;
- unsigned int zend_api;
+   char *name;
+   zend_function_entry *functions;
+   int (*module_startup_func)(INIT_FUNC_ARGS);
+   int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS);
+   int (*request_startup_func)(INIT_FUNC_ARGS);
+   int 
(*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
+   void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
+   int (*global_startup_func)(void);
+   int (*global_shutdown_func)(void);
+   int globals_id;
+   int module_started;
+   unsigned char type;
+   void *handle;
+   int module_number;
+   unsigned char zend_debug;
+   unsigned char zts;
+   unsigned int zend_api;
};
 
const char *name;
@@ -198,24 +194,24 @@
if struct pre_4_1_0_module_entry 
*)module_entry)-zend_api  2000) 
(((struct pre_4_1_0_module_entry 
*)module_entry)-zend_api  20010901)
) {
-  

[PHP-CVS] cvs: php-src /ext/standard dl.c dl.h /main php_ini.c

2007-11-09 Thread Jani Taskinen
janiFri Nov  9 16:26:55 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c dl.h 
/php-src/main   php_ini.c 
  Log:
  - Allow using full path to load modules using extension directive
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.121r2=1.122diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.121 php-src/ext/standard/dl.c:1.122
--- php-src/ext/standard/dl.c:1.121 Fri Nov  9 13:49:06 2007
+++ php-src/ext/standard/dl.c   Fri Nov  9 16:26:55 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.121 2007/11/09 13:49:06 jani Exp $ */
+/* $Id: dl.c,v 1.122 2007/11/09 16:26:55 jani Exp $ */
 
 #include php.h
 #include dl.h
@@ -80,7 +80,7 @@
 
 /* {{{ php_dl
  */
-void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
+PHPAPI int php_load_extension(char *filename, int type, int start_now 
TSRMLS_DC) /* {{{ */
 {
void *handle;
char *libpath;
@@ -88,8 +88,6 @@
zend_module_entry *(*get_module)(void);
int error_type;
char *extension_dir;
-   char *filename;
-   int filename_len;
 
if (type == MODULE_PERSISTENT) {
extension_dir = INI_STR(extension_dir);
@@ -103,24 +101,16 @@
error_type = E_CORE_WARNING;
}
 
-   if (Z_TYPE_P(file) == IS_UNICODE) {
-   if (FAILURE == php_stream_path_encode(NULL, filename, 
filename_len, Z_USTRVAL_P(file), Z_USTRLEN_P(file), REPORT_ERRORS, 
FG(default_context))) {
-   return;
-   }
-   } else {
-   filename = Z_STRVAL_P(file);
-   filename_len = Z_STRLEN_P(file);
-   }
-
-   if (extension_dir  extension_dir[0]){
-   int extension_dir_len = strlen(extension_dir);
-
+   /* Check if passed filename contains directory separators */
+   if (strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != 
NULL) {
+   /* Passing modules with full path is not supported for 
dynamically loaded extensions */
if (type == MODULE_TEMPORARY) {
-   if (strchr(filename, '/') != NULL || strchr(filename, 
DEFAULT_SLASH) != NULL) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Temporary module name should contain only filename);
-   RETURN_FALSE;
-   }
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Temporary 
module name should contain only filename);
+   return FAILURE;
}
+   libpath = estrdup(filename);
+   } else if (extension_dir  extension_dir[0]) {
+   int extension_dir_len = strlen(extension_dir);
 
if (IS_SLASH(extension_dir[extension_dir_len-1])) {
spprintf(libpath, 0, %s%s, extension_dir, filename); 
/* SAFE */
@@ -128,11 +118,7 @@
spprintf(libpath, 0, %s%c%s, extension_dir, 
DEFAULT_SLASH, filename); /* SAFE */
}
} else {
-   libpath = estrndup(filename, filename_len);
-   }
-
-   if (Z_TYPE_P(file) == IS_UNICODE) {
-   efree(filename);
+   return FAILURE; /* Not full path given or extension_dir is not 
set */
}
 
/* load dynamic symbol */
@@ -141,9 +127,8 @@
php_error_docref(NULL TSRMLS_CC, error_type, Unable to load 
dynamic library '%s' - %s, libpath, GET_DL_ERROR());
GET_DL_ERROR(); /* free the buffer storing the error */
efree(libpath);
-   RETURN_FALSE;
+   return FAILURE;
}
-
efree(libpath);
 
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, 
get_module);
@@ -158,8 +143,8 @@
 
if (!get_module) {
DL_UNLOAD(handle);
-   php_error_docref(NULL TSRMLS_CC, error_type, Invalid library 
(maybe not a PHP library) '%R', Z_TYPE_P(file), Z_UNIVAL_P(file));
-   RETURN_FALSE;
+   php_error_docref(NULL TSRMLS_CC, error_type, Invalid library 
(maybe not a PHP library) '%s', filename);
+   return FAILURE;
}
module_entry = get_module();
if ((module_entry-zend_debug != ZEND_DEBUG) ||
@@ -213,7 +198,7 @@
name, zend_api, zend_debug, zts,
ZEND_MODULE_API_NO, ZEND_DEBUG, 
USING_ZTS);
DL_UNLOAD(handle);
-   RETURN_FALSE;
+   return FAILURE;
}
module_entry-type = type;
module_entry-module_number = zend_next_free_module();
@@ -221,22 +206,50 @@
 
if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == 
NULL) {
DL_UNLOAD(handle);
-   RETURN_FALSE;
+   

[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-18 Thread Stanislav Malyshev
stasTue Sep 18 20:21:04 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  limit dl() argument length (patch by Christian Hoffmann)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.116r2=1.117diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.116 php-src/ext/standard/dl.c:1.117
--- php-src/ext/standard/dl.c:1.116 Thu Sep 13 07:41:59 2007
+++ php-src/ext/standard/dl.c   Tue Sep 18 20:21:04 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.116 2007/09/13 07:41:59 jani Exp $ */
+/* $Id: dl.c,v 1.117 2007/09/18 20:21:04 stas Exp $ */
 
 #include php.h
 #include dl.h
@@ -63,6 +63,11 @@
return;
}
 
+   if (Z_STRLEN_PP(file) = MAXPATHLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds 
the maximum allowed length of %d characters, MAXPATHLEN);
+   RETURN_FALSE;
+   }
+
php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
EG(full_tables_cleanup) = 1;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-18 Thread Stanislav Malyshev
stasWed Sep 19 00:06:06 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  use right variable name
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.117r2=1.118diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.117 php-src/ext/standard/dl.c:1.118
--- php-src/ext/standard/dl.c:1.117 Tue Sep 18 20:21:04 2007
+++ php-src/ext/standard/dl.c   Wed Sep 19 00:06:05 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.117 2007/09/18 20:21:04 stas Exp $ */
+/* $Id: dl.c,v 1.118 2007/09/19 00:06:05 stas Exp $ */
 
 #include php.h
 #include dl.h
@@ -63,7 +63,7 @@
return;
}
 
-   if (Z_STRLEN_PP(file) = MAXPATHLEN) {
+   if (Z_STRLEN_PP(filename) = MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds 
the maximum allowed length of %d characters, MAXPATHLEN);
RETURN_FALSE;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-18 Thread Johannes Schl�ter
johannesWed Sep 19 01:08:39 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  - Fix build (filename is a zval * here, not a zval** like in 5_2)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.118r2=1.119diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.118 php-src/ext/standard/dl.c:1.119
--- php-src/ext/standard/dl.c:1.118 Wed Sep 19 00:06:05 2007
+++ php-src/ext/standard/dl.c   Wed Sep 19 01:08:38 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.118 2007/09/19 00:06:05 stas Exp $ */
+/* $Id: dl.c,v 1.119 2007/09/19 01:08:38 johannes Exp $ */
 
 #include php.h
 #include dl.h
@@ -63,7 +63,7 @@
return;
}
 
-   if (Z_STRLEN_PP(filename) = MAXPATHLEN) {
+   if (Z_STRLEN_P(filename) = MAXPATHLEN) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds 
the maximum allowed length of %d characters, MAXPATHLEN);
RETURN_FALSE;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-13 Thread Jani Taskinen
janiThu Sep 13 07:41:59 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  cs/ws fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.115r2=1.116diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.115 php-src/ext/standard/dl.c:1.116
--- php-src/ext/standard/dl.c:1.115 Thu Sep 13 01:16:24 2007
+++ php-src/ext/standard/dl.c   Thu Sep 13 07:41:59 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.115 2007/09/13 01:16:24 stas Exp $ */
+/* $Id: dl.c,v 1.116 2007/09/13 07:41:59 jani Exp $ */
 
 #include php.h
 #include dl.h
@@ -115,8 +115,8 @@
if (extension_dir  extension_dir[0]){
int extension_dir_len = strlen(extension_dir);
 
-   if(type == MODULE_TEMPORARY) {
-   if(strchr(filename, '/') != NULL || strchr(filename, 
DEFAULT_SLASH) != NULL) {
+   if (type == MODULE_TEMPORARY) {
+   if (strchr(filename, '/') != NULL || strchr(filename, 
DEFAULT_SLASH) != NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Temporary module name should contain only filename);
RETURN_FALSE;
}
@@ -190,8 +190,9 @@
int zend_api;
unsigned char zend_debug, zts;
 
-   if((  ((struct pre_4_1_0_module_entry 
*)module_entry)-zend_api  2000)
-  (((struct pre_4_1_0_module_entry 
*)module_entry)-zend_api  20010901)) {
+   if struct pre_4_1_0_module_entry 
*)module_entry)-zend_api  2000) 
+   (((struct pre_4_1_0_module_entry 
*)module_entry)-zend_api  20010901)
+   ) {
name   = ((struct pre_4_1_0_module_entry 
*)module_entry)-name;
zend_api   = ((struct pre_4_1_0_module_entry 
*)module_entry)-zend_api;
zend_debug = ((struct pre_4_1_0_module_entry 
*)module_entry)-zend_debug;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-13 Thread Marcus Boerger
Hello Stanislav,

Thursday, September 13, 2007, 3:16:24 AM, you wrote:

 stasThu Sep 13 01:16:24 2007 UTC

   Modified files:  
 /php-src/ext/standard   dl.c 
   Log:
   MFB: docs say dl() parameter can be filename only - enforce it
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.114r2=1.115diff_format=u
 Index: php-src/ext/standard/dl.c
 diff -u php-src/ext/standard/dl.c:1.114 php-src/ext/standard/dl.c:1.115
 --- php-src/ext/standard/dl.c:1.114 Tue May 29 21:24:45 2007
 +++ php-src/ext/standard/dl.c   Thu Sep 13 01:16:24 2007
 @@ -18,7 +18,7 @@
 +--+
  */
  
 -/* $Id: dl.c,v 1.114 2007/05/29 21:24:45 tony2001 Exp $ */
 +/* $Id: dl.c,v 1.115 2007/09/13 01:16:24 stas Exp $ */
  
  #include php.h
  #include dl.h
 @@ -115,6 +115,13 @@
 if (extension_dir  extension_dir[0]){
 int extension_dir_len = strlen(extension_dir);
  
 +   if(type == MODULE_TEMPORARY) {
 +   if(strchr(filename, '/') != NULL ||
 strchr(filename, DEFAULT_SLASH) != NULL) {

Wouldn't something with strcspn and a string build form '/' and
DEFAULT_SLASH be faster?

 +   php_error_docref(NULL TSRMLS_CC,
 E_WARNING, Temporary module name should contain only
 filename);
 +   RETURN_FALSE;
 +   }
 +   }
 +
 if (IS_SLASH(extension_dir[extension_dir_len-1])) {
 spprintf(libpath, 0, %s%s, extension_dir, 
 filename); /* SAFE */
 } else {




Best regards,
 Marcus

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-13 Thread Stanislav Malyshev

Wouldn't something with strcspn and a string build form '/' and
DEFAULT_SLASH be faster?


Not sure. I would rather use strpbrk, though I'm not sure how easy is to 
actually build that string from macros.  But dl() is anyway not the 
shining star of performance, so saving a dozen of CPU cycles while we 
are going to spend thousands on loading new module wasn't a big 
priority. But you may fix it if you feel it's worth it :)

--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-09-12 Thread Stanislav Malyshev
stasThu Sep 13 01:16:24 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  MFB: docs say dl() parameter can be filename only - enforce it
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.114r2=1.115diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.114 php-src/ext/standard/dl.c:1.115
--- php-src/ext/standard/dl.c:1.114 Tue May 29 21:24:45 2007
+++ php-src/ext/standard/dl.c   Thu Sep 13 01:16:24 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.114 2007/05/29 21:24:45 tony2001 Exp $ */
+/* $Id: dl.c,v 1.115 2007/09/13 01:16:24 stas Exp $ */
 
 #include php.h
 #include dl.h
@@ -115,6 +115,13 @@
if (extension_dir  extension_dir[0]){
int extension_dir_len = strlen(extension_dir);
 
+   if(type == MODULE_TEMPORARY) {
+   if(strchr(filename, '/') != NULL || strchr(filename, 
DEFAULT_SLASH) != NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Temporary module name should contain only filename);
+   RETURN_FALSE;
+   }
+   }
+
if (IS_SLASH(extension_dir[extension_dir_len-1])) {
spprintf(libpath, 0, %s%s, extension_dir, filename); 
/* SAFE */
} else {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2007-05-29 Thread Antony Dovgal
tony2001Tue May 29 21:24:45 2007 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  more typofixes
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.113r2=1.114diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.113 php-src/ext/standard/dl.c:1.114
--- php-src/ext/standard/dl.c:1.113 Tue May 29 21:06:04 2007
+++ php-src/ext/standard/dl.c   Tue May 29 21:24:45 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.113 2007/05/29 21:06:04 iliaa Exp $ */
+/* $Id: dl.c,v 1.114 2007/05/29 21:24:45 tony2001 Exp $ */
 
 #include php.h
 #include dl.h
@@ -116,9 +116,9 @@
int extension_dir_len = strlen(extension_dir);
 
if (IS_SLASH(extension_dir[extension_dir_len-1])) {
-   spprintf(libpath, 0, %s%s, extension_dir, filename); 
/* SAFE */
+   spprintf(libpath, 0, %s%s, extension_dir, filename); 
/* SAFE */
} else {
-   spprintf(libpath, 0, %s%c%s, extension_dir, 
DEFAULT_SLASH, filename); /* SAFE */
+   spprintf(libpath, 0, %s%c%s, extension_dir, 
DEFAULT_SLASH, filename); /* SAFE */
}
} else {
libpath = estrndup(filename, filename_len);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2006-12-08 Thread Andrei Zmievski
andrei  Fri Dec  8 19:13:51 2006 UTC

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Unicode filename support in dl().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.110r2=1.111diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.110 php-src/ext/standard/dl.c:1.111
--- php-src/ext/standard/dl.c:1.110 Sun Oct  8 13:34:23 2006
+++ php-src/ext/standard/dl.c   Fri Dec  8 19:13:51 2006
@@ -18,13 +18,14 @@
+--+
 */
 
-/* $Id: dl.c,v 1.110 2006/10/08 13:34:23 bjori Exp $ */
+/* $Id: dl.c,v 1.111 2006/12/08 19:13:51 andrei Exp $ */
 
 #include php.h
 #include dl.h
 #include php_globals.h
 #include php_ini.h
 #include ext/standard/info.h
+#include ext/standard/file.h
 
 #include SAPI.h
 
@@ -52,20 +53,17 @@
 #endif /* defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H */
 
 
-/* {{{ proto int dl(string extension_filename)
+/* {{{ proto int dl(string extension_filename) U
Load a PHP extension at runtime */
 PHP_FUNCTION(dl)
 {
-   zval **file;
+   zval *filename;
 
-   /* obtain arguments */
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, file) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, filename) == 
FAILURE) {
+   return;
}
 
-   convert_to_string_ex(file);
-
-   php_dl(*file, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
+   php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
EG(full_tables_cleanup) = 1;
 }
 
@@ -90,6 +88,8 @@
zend_module_entry *(*get_module)(void);
int error_type;
char *extension_dir;
+   char *filename;
+   int filename_len;
 
if (type == MODULE_PERSISTENT) {
extension_dir = INI_STR(extension_dir);
@@ -103,18 +103,31 @@
error_type = E_CORE_WARNING;
}
 
+   if (Z_TYPE_P(file) == IS_UNICODE) {
+   if (FAILURE == php_stream_path_encode(NULL, filename, 
filename_len, Z_USTRVAL_P(file), Z_USTRLEN_P(file), REPORT_ERRORS, 
FG(default_context))) {
+   return;
+   }
+   } else {
+   filename = Z_STRVAL_P(file);
+   filename_len = Z_STRLEN_P(file);
+   }
+
if (extension_dir  extension_dir[0]){
int extension_dir_len = strlen(extension_dir);
 
-   libpath = emalloc(extension_dir_len+Z_STRLEN_P(file)+2);
+   libpath = emalloc(extension_dir_len+filename_len+2);
 
if (IS_SLASH(extension_dir[extension_dir_len-1])) {
-   sprintf(libpath, %s%s, extension_dir, 
Z_STRVAL_P(file)); /* SAFE */
+   sprintf(libpath, %s%s, extension_dir, filename); /* 
SAFE */
} else {
-   sprintf(libpath, %s%c%s, extension_dir, 
DEFAULT_SLASH, Z_STRVAL_P(file)); /* SAFE */
+   sprintf(libpath, %s%c%s, extension_dir, 
DEFAULT_SLASH, filename); /* SAFE */
}
} else {
-   libpath = estrndup(Z_STRVAL_P(file), Z_STRLEN_P(file));
+   libpath = estrndup(filename, filename_len);
+   }
+
+   if (Z_TYPE_P(file) == IS_UNICODE) {
+   efree(filename);
}
 
/* load dynamic symbol */
@@ -141,7 +154,7 @@
 
if (!get_module) {
DL_UNLOAD(handle);
-   php_error_docref(NULL TSRMLS_CC, error_type, Invalid library 
(maybe not a PHP library) '%s', Z_STRVAL_P(file));
+   php_error_docref(NULL TSRMLS_CC, error_type, Invalid library 
(maybe not a PHP library) '%R', Z_TYPE_P(file), Z_UNIVAL_P(file));
RETURN_FALSE;
}
module_entry = get_module();
@@ -229,7 +242,7 @@
 
 void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
 {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %s 
- dynamic modules are not supported, Z_STRVAL_P(file));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %R 
- dynamic modules are not supported, Z_TYPE_P(file), Z_UNIVAL_P(file));
RETURN_FALSE;
 }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c dl.h /main php_ini.c /sapi/cli php_cli.c

2005-08-08 Thread Jani Taskinen
sniper  Mon Aug  8 12:49:45 2005 EDT

  Modified files:  
/php-src/ext/standard   dl.c dl.h 
/php-src/main   php_ini.c 
/php-src/sapi/cli   php_cli.c 
  Log:
  - Fixed problem with -dextension=foobar.so not having it's MINIT run.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.105r2=1.106ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.105 php-src/ext/standard/dl.c:1.106
--- php-src/ext/standard/dl.c:1.105 Wed Aug  3 10:07:58 2005
+++ php-src/ext/standard/dl.c   Mon Aug  8 12:49:43 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.105 2005/08/03 14:07:58 sniper Exp $ */
+/* $Id: dl.c,v 1.106 2005/08/08 16:49:43 sniper Exp $ */
 
 #include php.h
 #include dl.h
@@ -84,7 +84,7 @@
 #endif
}
 
-   php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
+   php_dl(*file, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
EG(full_tables_cleanup) = 1;
 }
 
@@ -101,7 +101,7 @@
 
 /* {{{ php_dl
  */
-void php_dl(zval *file, int type, zval *return_value TSRMLS_DC)
+void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
 {
void *handle;
char *libpath;
@@ -223,12 +223,12 @@
RETURN_FALSE;
}
 
-   if (type == MODULE_TEMPORARY  zend_startup_module_ex(module_entry 
TSRMLS_CC) == FAILURE) {
+   if ((type == MODULE_TEMPORARY || start_now)  
zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) {
DL_UNLOAD(handle);
RETURN_FALSE;
}
 
-   if ((type == MODULE_TEMPORARY)  module_entry-request_startup_func) {
+   if ((type == MODULE_TEMPORARY || start_now)  
module_entry-request_startup_func) {
if (module_entry-request_startup_func(type, 
module_entry-module_number TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, error_type, Unable to 
initialize module '%s', module_entry-name);
DL_UNLOAD(handle);
@@ -246,7 +246,7 @@
 
 #else
 
-void php_dl(zval *file, int type, zval *return_value TSRMLS_DC)
+void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
 {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %s 
- dynamic modules are not supported, Z_STRVAL_P(file));
RETURN_FALSE;
http://cvs.php.net/diff.php/php-src/ext/standard/dl.h?r1=1.22r2=1.23ty=u
Index: php-src/ext/standard/dl.h
diff -u php-src/ext/standard/dl.h:1.22 php-src/ext/standard/dl.h:1.23
--- php-src/ext/standard/dl.h:1.22  Wed Aug  3 10:07:58 2005
+++ php-src/ext/standard/dl.h   Mon Aug  8 12:49:43 2005
@@ -18,12 +18,12 @@
+--+
 */
 
-/* $Id: dl.h,v 1.22 2005/08/03 14:07:58 sniper Exp $ */
+/* $Id: dl.h,v 1.23 2005/08/08 16:49:43 sniper Exp $ */
 
 #ifndef DL_H
 #define DL_H
 
-PHPAPI void php_dl(zval *file,int type, zval *return_value TSRMLS_DC);
+PHPAPI void php_dl(zval *file,int type, zval *return_value, int start_now 
TSRMLS_DC);
 
 /* dynamic loading functions */
 PHP_FUNCTION(dl);
http://cvs.php.net/diff.php/php-src/main/php_ini.c?r1=1.135r2=1.136ty=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.135 php-src/main/php_ini.c:1.136
--- php-src/main/php_ini.c:1.135Wed Aug  3 10:08:34 2005
+++ php-src/main/php_ini.c  Mon Aug  8 12:49:43 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.135 2005/08/03 14:08:34 sniper Exp $ */
+/* $Id: php_ini.c,v 1.136 2005/08/08 16:49:43 sniper Exp $ */
 
 #include php.h
 #include ext/standard/info.h
@@ -242,7 +242,7 @@
zval *extension = (zval *) arg;
zval zval;
 
-   php_dl(extension, MODULE_PERSISTENT, zval TSRMLS_CC);
+   php_dl(extension, MODULE_PERSISTENT, zval, 0 TSRMLS_CC);
 }
 /* }}} */
 
http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.128r2=1.129ty=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.128 php-src/sapi/cli/php_cli.c:1.129
--- php-src/sapi/cli/php_cli.c:1.128Mon Aug  8 04:45:33 2005
+++ php-src/sapi/cli/php_cli.c  Mon Aug  8 12:49:44 2005
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.128 2005/08/08 08:45:33 hholzgra Exp $ */
+/* $Id: php_cli.c,v 1.129 2005/08/08 16:49:44 sniper Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -438,7 +438,7 @@
if (!strcasecmp(name, extension)) { /* load function module */
zval extension, zval;
ZVAL_STRING(extension, value, 0);
-   php_dl(extension, MODULE_TEMPORARY, zval TSRMLS_CC);
+   php_dl(extension, MODULE_PERSISTENT, zval, 1 TSRMLS_CC);
} else {
zend_alter_ini_entry(name, strlen(name)+1, value, 
strlen(value), PHP_INI_SYSTEM, 

[PHP-CVS] cvs: php-src /ext/standard dl.c /main main.c

2005-07-18 Thread Dmitry Stogov
dmitry  Mon Jul 18 12:20:08 2005 EDT

  Modified files:  
/php-src/main   main.c 
/php-src/ext/standard   dl.c 
  Log:
  Fixed bug in new module statrup mechanism
  
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.637r2=1.638ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.637 php-src/main/main.c:1.638
--- php-src/main/main.c:1.637   Sat Jul 16 08:21:34 2005
+++ php-src/main/main.c Mon Jul 18 12:20:07 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.637 2005/07/16 12:21:34 hyanantha Exp $ */
+/* $Id: main.c,v 1.638 2005/07/18 16:20:07 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -1296,7 +1296,7 @@
 
while (ptr  end) {
if (*ptr) {
-   if (zend_register_internal_module(*ptr 
TSRMLS_CC)==FAILURE) {
+   if (zend_register_internal_module(*ptr 
TSRMLS_CC)==NULL) {
return FAILURE;
}
}
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.102r2=1.103ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.102 php-src/ext/standard/dl.c:1.103
--- php-src/ext/standard/dl.c:1.102 Thu Jun 30 09:43:00 2005
+++ php-src/ext/standard/dl.c   Mon Jul 18 12:20:08 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.102 2005/06/30 13:43:00 dmitry Exp $ */
+/* $Id: dl.c,v 1.103 2005/07/18 16:20:08 dmitry Exp $ */
 
 #include php.h
 #include dl.h
@@ -219,7 +219,7 @@
module_entry-module_number = zend_next_free_module();
module_entry-handle = handle;
 
-   if (zend_register_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+   if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == 
NULL) {
DL_UNLOAD(handle);
RETURN_FALSE;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2005-06-30 Thread Dmitry Stogov
dmitry  Thu Jun 30 09:43:00 2005 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Restored old behavior of zend_statup_module()
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.101r2=1.102ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.101 php-src/ext/standard/dl.c:1.102
--- php-src/ext/standard/dl.c:1.101 Fri Jun 17 05:39:21 2005
+++ php-src/ext/standard/dl.c   Thu Jun 30 09:43:00 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.101 2005/06/17 09:39:21 dmitry Exp $ */
+/* $Id: dl.c,v 1.102 2005/06/30 13:43:00 dmitry Exp $ */
 
 #include php.h
 #include dl.h
@@ -224,7 +224,7 @@
RETURN_FALSE;
}
 
-   if (type == MODULE_TEMPORARY  zend_startup_module(module_entry 
TSRMLS_CC) == FAILURE) {
+   if (type == MODULE_TEMPORARY  zend_startup_module_ex(module_entry 
TSRMLS_CC) == FAILURE) {
DL_UNLOAD(handle);
RETURN_FALSE;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2005-06-16 Thread Wez Furlong
wez Thu Jun 16 11:36:40 2005 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Don't emit the E_STRICT dl-is-deprecated notice on SAPI's where dl() is 
widely (and safely) used.
  This allows our test-suite to run in E_STRICT mode.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.99r2=1.100ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.99 php-src/ext/standard/dl.c:1.100
--- php-src/ext/standard/dl.c:1.99  Wed May  4 09:26:28 2005
+++ php-src/ext/standard/dl.c   Thu Jun 16 11:36:39 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.99 2005/05/04 13:26:28 hyanantha Exp $ */
+/* $Id: dl.c,v 1.100 2005/06/16 15:36:39 wez Exp $ */
 
 #include php.h
 #include dl.h
@@ -63,24 +63,27 @@
 
convert_to_string_ex(file);
 
-#ifdef ZTS
+   if (!PG(enable_dl)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't enabled);
+   RETURN_FALSE;
+   } else if (PG(safe_mode)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't allowed when running in Safe Mode);
+   RETURN_FALSE;
+   }
+
if ((strncmp(sapi_module.name, cgi, 3)!=0)  
(strcmp(sapi_module.name, cli)!=0) 
(strncmp(sapi_module.name, embed, 5)!=0)) {
+#ifdef ZTS
php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in 
multithreaded Web servers - use extension=%s in your php.ini, 
Z_STRVAL_PP(file));
RETURN_FALSE;
-   }
+#else
+   php_error_docref(NULL TSRMLS_CC, E_STRICT, dl() is deprecated 
- use extension=%s in your php.ini, Z_STRVAL_PP(file));
 #endif
-
-   if (!PG(enable_dl)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't enabled);
-   } else if (PG(safe_mode)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't allowed when running in Safe Mode);
-   } else {
-   zend_error(E_STRICT, dl() is deprecated - use extension=%s in 
your php.ini, Z_STRVAL_PP(file));
-   php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
-   EG(full_tables_cleanup) = 1;
}
+
+   php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
+   EG(full_tables_cleanup) = 1;
 }
 
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2005-06-16 Thread Derick Rethans
On Thu, 16 Jun 2005, Wez Furlong wrote:

 wez   Thu Jun 16 11:36:40 2005 EDT
 
   Modified files:  
 /php-src/ext/standard dl.c 
   Log:
   Don't emit the E_STRICT dl-is-deprecated notice on SAPI's where dl() is 
 widely (and safely) used.
   This allows our test-suite to run in E_STRICT mode.

None of our tests should use dl(), can you please point out which ones 
do this?

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2005-06-16 Thread Wez Furlong

The PDO tests; Cc'd to the PDO test gurus.

--Wez.

Derick Rethans wrote:

On Thu, 16 Jun 2005, Wez Furlong wrote:



wez Thu Jun 16 11:36:40 2005 EDT

 Modified files:  
   /php-src/ext/standard	dl.c 
 Log:

 Don't emit the E_STRICT dl-is-deprecated notice on SAPI's where dl() is widely 
(and safely) used.
 This allows our test-suite to run in E_STRICT mode.



None of our tests should use dl(), can you please point out which ones 
do this?


Derick



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2005-05-04 Thread Anantha Kesari H Y
hyanantha   Wed May  4 09:26:28 2005 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  NetWare LibC dlsym works perfectly only thing that each of the extension need 
to export a symbol with FULL capital prefix.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.98r2=1.99ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.98 php-src/ext/standard/dl.c:1.99
--- php-src/ext/standard/dl.c:1.98  Mon Sep 27 10:51:17 2004
+++ php-src/ext/standard/dl.c   Wed May  4 09:26:28 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.98 2004/09/27 14:51:17 hyanantha Exp $ */
+/* $Id: dl.c,v 1.99 2005/05/04 13:26:28 hyanantha Exp $ */
 
 #include php.h
 #include dl.h
@@ -145,7 +145,6 @@
 
efree(libpath);
 
-#ifndef NETWARE
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, 
get_module);
 
/*
@@ -156,23 +155,6 @@
 
if (!get_module)
get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, _get_module);
-#else
-   /* NetWare doesn't support two NLMs exporting same symbol */
-   {
-   char symbol_name[64] = \0;
-   int module_name_length = Z_STRLEN_P(file) - 4;  /* '.nlm' is 4 
characters; knock it off */
-
-   /* Take the module name (e.g.: 'php_ldap') and append 
'@get_module' to it */
-   strncpy(symbol_name, Z_STRVAL_P(file), module_name_length);
-   symbol_name[module_name_length] = '\0';
-   strcat(symbol_name, @);
-   strcat(symbol_name, get_module);
-
-   get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, symbol_name);
-   }
-   /* NetWare doesn't prepend '_' to symbol names; so the corresponding 
portion of code is also
-  not required for NetWare */
-#endif
 
if (!get_module) {
DL_UNLOAD(handle);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-07-20 Thread Marcus Boerger
helly   Tue Jul 20 15:23:55 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  - Need to set handle prior to calling zend_register_module_ex() 
(Marcus, Kamesh Jayachandran kameshj at fastmail dot fm)
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.96r2=1.97ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.96 php-src/ext/standard/dl.c:1.97
--- php-src/ext/standard/dl.c:1.96  Tue Jul  6 14:48:39 2004
+++ php-src/ext/standard/dl.c   Tue Jul 20 15:23:55 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.96 2004/07/06 18:48:39 helly Exp $ */
+/* $Id: dl.c,v 1.97 2004/07/20 19:23:55 helly Exp $ */
 
 #include php.h
 #include dl.h
@@ -236,7 +236,8 @@
}
module_entry-type = type;
module_entry-module_number = zend_next_free_module();
-   
+   module_entry-handle = handle;
+
if (zend_register_module_ex(module_entry TSRMLS_CC) == FAILURE) {
DL_UNLOAD(handle);
RETURN_FALSE;
@@ -250,8 +251,6 @@
}
}

-   module_entry-handle = handle;
-
RETURN_TRUE;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-07-06 Thread Marcus Boerger
helly   Tue Jul  6 14:48:39 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  - Revert storing handle, got lost in 1.92, noticed by Kamesh Jayachandran 
kameshj at fastmail dot fm
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.95r2=1.96ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.95 php-src/ext/standard/dl.c:1.96
--- php-src/ext/standard/dl.c:1.95  Tue May 25 09:51:00 2004
+++ php-src/ext/standard/dl.c   Tue Jul  6 14:48:39 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.95 2004/05/25 13:51:00 iliaa Exp $ */
+/* $Id: dl.c,v 1.96 2004/07/06 18:48:39 helly Exp $ */
 
 #include php.h
 #include dl.h
@@ -250,6 +250,8 @@
}
}

+   module_entry-handle = handle;
+
RETURN_TRUE;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-05-25 Thread Wez Furlong
wez Tue May 25 09:25:22 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Merge that nicer error message here too
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.93r2=1.94ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.93 php-src/ext/standard/dl.c:1.94
--- php-src/ext/standard/dl.c:1.93  Fri May 21 13:17:55 2004
+++ php-src/ext/standard/dl.c   Tue May 25 09:25:22 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.93 2004/05/21 17:17:55 wez Exp $ */
+/* $Id: dl.c,v 1.94 2004/05/25 13:25:22 wez Exp $ */
 
 #include php.h
 #include dl.h
@@ -60,21 +60,21 @@
 {
pval **file;
 
+   /* obtain arguments */
+   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, file) == FAILURE) {
+   WRONG_PARAM_COUNT;
+   }
+
+   convert_to_string_ex(file);
+
 #ifdef ZTS
if ((strncmp(sapi_module.name, cgi, 3)!=0)  
(strcmp(sapi_module.name, cli)!=0) 
(strncmp(sapi_module.name, embed, 5)!=0)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in 
multithreaded Web servers - use extension statements in your php.ini);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in 
multithreaded Web servers - use extension=%s in your php.ini, Z_STRVAL_PP(file));
RETURN_FALSE;
}
 #endif
-
-   /* obtain arguments */
-   if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, file) == FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-
-   convert_to_string_ex(file);
 
if (!PG(enable_dl)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't enabled);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-05-21 Thread Wez Furlong
wez Fri May 21 13:08:36 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Update to reflect recent changes in dl()
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.91r2=1.92ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.91 php-src/ext/standard/dl.c:1.92
--- php-src/ext/standard/dl.c:1.91  Tue May 18 12:13:57 2004
+++ php-src/ext/standard/dl.c   Fri May 21 13:08:36 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.91 2004/05/18 16:13:57 stas Exp $ */
+/* $Id: dl.c,v 1.92 2004/05/21 17:08:36 wez Exp $ */
 
 #include php.h
 #include dl.h
@@ -236,22 +236,11 @@
}
module_entry-type = type;
module_entry-module_number = zend_next_free_module();
-   zend_register_module_ex(module_entry TSRMLS_CC);
-
-   if ((type == MODULE_TEMPORARY)  module_entry-request_startup_func) {
-   if (module_entry-request_startup_func(type, 
module_entry-module_number TSRMLS_CC)) {
-   php_error_docref(NULL TSRMLS_CC, error_type, Unable to 
initialize module '%s', module_entry-name);
-   DL_UNLOAD(handle);
-   RETURN_FALSE;
-   }
-   }

-   /* update the .request_started property... */
-   if (zend_hash_find(module_registry, module_entry-name, 
strlen(module_entry-name)+1, (void **) tmp)==FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, error_type, Loaded module '%s' got 
lost, module_entry-name);
+   if (zend_register_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+   DL_UNLOAD(handle);
RETURN_FALSE;
}
-   tmp-handle = handle;

RETURN_TRUE;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-05-21 Thread Wez Furlong
wez Fri May 21 13:17:55 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Ok, so we do need to rinit here after all.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.92r2=1.93ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.92 php-src/ext/standard/dl.c:1.93
--- php-src/ext/standard/dl.c:1.92  Fri May 21 13:08:36 2004
+++ php-src/ext/standard/dl.c   Fri May 21 13:17:55 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.92 2004/05/21 17:08:36 wez Exp $ */
+/* $Id: dl.c,v 1.93 2004/05/21 17:17:55 wez Exp $ */
 
 #include php.h
 #include dl.h
@@ -241,6 +241,14 @@
DL_UNLOAD(handle);
RETURN_FALSE;
}
+
+   if ((type == MODULE_TEMPORARY)  module_entry-request_startup_func) {
+   if (module_entry-request_startup_func(type, 
module_entry-module_number TSRMLS_CC)) {
+   php_error_docref(NULL TSRMLS_CC, error_type, Unable to 
initialize module '%s', module_entry-name);
+   DL_UNLOAD(handle);
+   RETURN_FALSE;
+   }
+   }

RETURN_TRUE;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-05-18 Thread Wez Furlong
wez Tue May 18 11:26:32 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Fix dl() and extension=
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.89r2=1.90ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.89 php-src/ext/standard/dl.c:1.90
--- php-src/ext/standard/dl.c:1.89  Sat May  1 16:34:15 2004
+++ php-src/ext/standard/dl.c   Tue May 18 11:26:32 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.89 2004/05/01 20:34:15 helly Exp $ */
+/* $Id: dl.c,v 1.90 2004/05/18 15:26:32 wez Exp $ */
 
 #include php.h
 #include dl.h
@@ -108,8 +108,6 @@
zend_module_entry *(*get_module)(void);
int error_type;
char *extension_dir;
-   int name_len;
-   char *lcname;
 
if (type==MODULE_PERSISTENT) {
/* Use the configuration hash directly, the INI mechanism is not yet 
initialized */
@@ -236,25 +234,9 @@
DL_UNLOAD(handle);
RETURN_FALSE;
}
-   name_len = strlen(module_entry-name);
-   lcname = zend_str_tolower_dup(module_entry-name, name_len);
-   if (zend_hash_exists(module_registry, lcname, name_len+1)) {
-   efree(lcname);
-   php_error_docref(NULL TSRMLS_CC, error_type, Module '%s' already 
loaded, module_entry-name);
-   DL_UNLOAD(handle);
-   RETURN_FALSE;
-   }
-   efree(lcname);
Z_TYPE_P(module_entry) = type;
module_entry-module_number = zend_next_free_module();
-   if (module_entry-module_startup_func) {
-   if (module_entry-module_startup_func(type, 
module_entry-module_number TSRMLS_CC)==FAILURE) {
-   php_error_docref(NULL TSRMLS_CC, error_type, Unable to 
initialize module '%s', module_entry-name);
-   DL_UNLOAD(handle);
-   RETURN_FALSE;
-   }
-   }
-   zend_register_module(module_entry);
+   zend_register_module_ex(module_entry TSRMLS_CC);
 
if ((type == MODULE_TEMPORARY)  module_entry-request_startup_func) {
if (module_entry-request_startup_func(type, 
module_entry-module_number TSRMLS_CC)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-05-18 Thread Stanislav Malyshev
stasTue May 18 12:13:58 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Z_TYPE_P is for zvals
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.90r2=1.91ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.90 php-src/ext/standard/dl.c:1.91
--- php-src/ext/standard/dl.c:1.90  Tue May 18 11:26:32 2004
+++ php-src/ext/standard/dl.c   Tue May 18 12:13:57 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.90 2004/05/18 15:26:32 wez Exp $ */
+/* $Id: dl.c,v 1.91 2004/05/18 16:13:57 stas Exp $ */
 
 #include php.h
 #include dl.h
@@ -234,7 +234,7 @@
DL_UNLOAD(handle);
RETURN_FALSE;
}
-   Z_TYPE_P(module_entry) = type;
+   module_entry-type = type;
module_entry-module_number = zend_next_free_module();
zend_register_module_ex(module_entry TSRMLS_CC);
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-05-01 Thread Marcus Boerger
helly   Sat May  1 16:34:15 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Don't load modules twice
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.88r2=1.89ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.88 php-src/ext/standard/dl.c:1.89
--- php-src/ext/standard/dl.c:1.88  Sat Feb 14 14:02:23 2004
+++ php-src/ext/standard/dl.c   Sat May  1 16:34:15 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.88 2004/02/14 19:02:23 jan Exp $ */
+/* $Id: dl.c,v 1.89 2004/05/01 20:34:15 helly Exp $ */
 
 #include php.h
 #include dl.h
@@ -108,6 +108,8 @@
zend_module_entry *(*get_module)(void);
int error_type;
char *extension_dir;
+   int name_len;
+   char *lcname;
 
if (type==MODULE_PERSISTENT) {
/* Use the configuration hash directly, the INI mechanism is not yet 
initialized */
@@ -234,6 +236,15 @@
DL_UNLOAD(handle);
RETURN_FALSE;
}
+   name_len = strlen(module_entry-name);
+   lcname = zend_str_tolower_dup(module_entry-name, name_len);
+   if (zend_hash_exists(module_registry, lcname, name_len+1)) {
+   efree(lcname);
+   php_error_docref(NULL TSRMLS_CC, error_type, Module '%s' already 
loaded, module_entry-name);
+   DL_UNLOAD(handle);
+   RETURN_FALSE;
+   }
+   efree(lcname);
Z_TYPE_P(module_entry) = type;
module_entry-module_number = zend_next_free_module();
if (module_entry-module_startup_func) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-02-14 Thread Jan Lehnardt
jan Sat Feb 14 14:02:23 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
   - improve error message
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.87r2=1.88ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.87 php-src/ext/standard/dl.c:1.88
--- php-src/ext/standard/dl.c:1.87  Wed Feb 11 06:46:20 2004
+++ php-src/ext/standard/dl.c   Sat Feb 14 14:02:23 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.87 2004/02/11 11:46:20 zeev Exp $ */
+/* $Id: dl.c,v 1.88 2004/02/14 19:02:23 jan Exp $ */
 
 #include php.h
 #include dl.h
@@ -81,7 +81,7 @@
} else if (PG(safe_mode)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't allowed when running in Safe Mode);
} else {
-   zend_error(E_STRICT, dl() is deprecated - use extension= in your 
php.ini);
+   zend_error(E_STRICT, dl() is deprecated - use extension=%s in your 
php.ini, Z_STRVAL_PP(file));
php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
EG(full_tables_cleanup) = 1;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2004-02-14 Thread Pierre-Alain Joye
On Sat, 14 Feb 2004 19:02:23 -
Jan Lehnardt [EMAIL PROTECTED] wrote:

   Modified files:  
 /php-src/ext/standard dl.c 
   Log:
- improve error message

The best way to improve it is to remove it ;)

pierre

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2004-02-14 Thread Jan Lehnardt
Hi Pierre
On 14 Feb 2004, at 20:03, Pierre-Alain Joye wrote:
The best way to improve it is to remove it ;)
ranting helps. Please see internals, this is unrelated to
the discussion.
Jan
--
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2004-02-14 Thread Jan Lehnardt
Hi,
On 11 Feb 2004, at 12:46, Zeev Suraski wrote:
+		zend_error(E_STRICT, dl() is deprecated - use extension= in your 
php.ini);
unrelated to the ongoing discussion, wouldn't it make
sense to show the module's name in the error message?
Something like:
 zend_error(E_STRICT, dl() is deprecated - use 'extension=%s' in 
your php.ini, Z_STRVAL_PP(file));

Would print out:

Strict Standards: dl() is deprecated - use 'extension=/path/to/foo.so' 
in your php.ini in /path/to/file.php on line xy

Note: I also added '' but that is just a matter
of taste I guess. Users might copy the single
quotes into the php.ini and complain about
errors.
Regards,
Jan
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /ext/standard dl.c

2004-02-14 Thread Andi Gutmans
At 06:54 PM 2/14/2004 +0100, Jan Lehnardt wrote:
Hi,
On 11 Feb 2004, at 12:46, Zeev Suraski wrote:
+   zend_error(E_STRICT, dl() is deprecated - use extension= 
in your php.ini);
unrelated to the ongoing discussion, wouldn't it make
sense to show the module's name in the error message?
Something like:
 zend_error(E_STRICT, dl() is deprecated - use 'extension=%s' in 
your php.ini, Z_STRVAL_PP(file));

Would print out:

Strict Standards: dl() is deprecated - use 'extension=/path/to/foo.so' in 
your php.ini in /path/to/file.php on line xy

Note: I also added '' but that is just a matter
of taste I guess. Users might copy the single
quotes into the php.ini and complain about
errors.
Yeah I think that would be nice (it might not always be 100% accurate 
because dl() uses CWD and I think php.ini needs full-path (or Apache CWD) 
but it would probably still make it look nicer.

Andi

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-CVS] cvs: php-src /ext/standard dl.c

2004-02-11 Thread Zeev Suraski
zeevWed Feb 11 06:46:21 2004 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  Finally add a notice to hint people that using dl() is a bad idea...
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.86r2=1.87ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.86 php-src/ext/standard/dl.c:1.87
--- php-src/ext/standard/dl.c:1.86  Thu Jan  8 03:17:31 2004
+++ php-src/ext/standard/dl.c   Wed Feb 11 06:46:20 2004
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.86 2004/01/08 08:17:31 andi Exp $ */
+/* $Id: dl.c,v 1.87 2004/02/11 11:46:20 zeev Exp $ */
 
 #include php.h
 #include dl.h
@@ -81,6 +81,7 @@
} else if (PG(safe_mode)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't allowed when running in Safe Mode);
} else {
+   zend_error(E_STRICT, dl() is deprecated - use extension= in your 
php.ini);
php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC);
EG(full_tables_cleanup) = 1;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c /win32 winutil.c

2003-12-17 Thread Marcus Boerger
helly   Wed Dec 17 06:20:36 2003 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
/php-src/win32  winutil.c 
  Log:
  Fix a memleak: A second call to *nix version of dlerror() frees the error
  string. This behavior is also adapted to the win build so that the buffer
  returned by FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER) can be freed too.
  
  
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.84 php-src/ext/standard/dl.c:1.85
--- php-src/ext/standard/dl.c:1.84  Sun Aug 17 05:57:21 2003
+++ php-src/ext/standard/dl.c   Wed Dec 17 06:20:35 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.84 2003/08/17 09:57:21 david Exp $ */
+/* $Id: dl.c,v 1.85 2003/12/17 11:20:35 helly Exp $ */
 
 #include php.h
 #include dl.h
@@ -141,6 +141,7 @@
handle = DL_LOAD(libpath);
if (!handle) {
php_error_docref(NULL TSRMLS_CC, error_type, Unable to load dynamic 
library '%s' - %s, libpath, GET_DL_ERROR());
+   GET_DL_ERROR(); /* free the buffer storing the error */
efree(libpath);
RETURN_FALSE;
}
Index: php-src/win32/winutil.c
diff -u php-src/win32/winutil.c:1.10 php-src/win32/winutil.c:1.11
--- php-src/win32/winutil.c:1.10Tue Jun 10 16:03:46 2003
+++ php-src/win32/winutil.c Wed Dec 17 06:20:35 2003
@@ -20,8 +20,12 @@
 
 PHPAPI char *php_win_err(int error)
 {
-   char *buf;
+   static char *buf = NULL;
 
+   if (buf) {
+   free(buf);
+   buf = NULL;
+   }
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |   
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)buf, 
0, NULL

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/standard dl.c

2003-08-17 Thread David Croft
david   Sun Aug 17 05:57:21 2003 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  #typo
  
  
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.83 php-src/ext/standard/dl.c:1.84
--- php-src/ext/standard/dl.c:1.83  Tue Jun 10 16:03:37 2003
+++ php-src/ext/standard/dl.c   Sun Aug 17 05:57:21 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.83 2003/06/10 20:03:37 imajes Exp $ */
+/* $Id: dl.c,v 1.84 2003/08/17 09:57:21 david Exp $ */
 
 #include php.h
 #include dl.h
@@ -77,7 +77,7 @@
convert_to_string_ex(file);
 
if (!PG(enable_dl)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extentions aren't enabled);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't enabled);
} else if (PG(safe_mode)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded 
extensions aren't allowed when running in Safe Mode);
} else {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php