Sanjeev Kumar | 1 Sep 19:34 2009
Picon

[PHP-DEV] Invalid library (maybe not a PHP library) : Error on load of new php pdo extension

Hello,

On Loading my new PDO-interface based driver, PHP gives the error:

"PHP: Startup: Invalid library (maybe not a PHP library) 'php_pdo_mydb.dll
in unknow on line 0 "

I wrote a PDO-based driver, modelling the code on lines of  SQLite driver.
Compiled my driver as win32-dll , added the extension to php.ini. on running
PHP, I get the above error  .

To crosscheck, I used DependencyWalker tool to see if I have missed some
Dll, I find that tools seems to find my Dll fine.
The output list of Dll pdependancies of my driver-Dll looks exactly like
that of php_pdo_sqlite.dll

Used latest PHP windows src base. (I get the invalid library problem with
both Debug & Release ver.)
I have generated my dll using VC9.0 on windows-vista(64) choosing
32-bit(X86), with following C++ options(paste from Property-pages):

/Od /I "../../main" /I "../../zend" /I "../../regex" /I "../../TSRM" /I
"../../win32" /I "../standard" /I "../pdo" /D "WIN32" /D "_MBCS" /D
"ZEND_WIN32" /D "FD_SETSIZE=256" /D "ZEND_DEBUG=0" /D "ZTS=1" /D
"_USE_32BIT_TIME" /D "PHP_WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D
"PDO_GROOVY_EXPORTS" /D "_WINDLL" /FD /EHsc /MD

Linker-Options(pasted from Property pages):
/OUT:"Release\pdo_groovy.dll" /INCREMENTAL /NOLOGO /LIBPATH:"f:\php\dev"
/DLL /MANIFEST /MANIFESTFILE:"Release\pdo_groovy.dll.intermediate.manifest"
(Continue reading)

Sebastian Bergmann | 2 Sep 21:48 2009
Picon

[PHP-DEV] ReflectionMethod::setAccessible()

 The patch below adds the ReflectionMethod::setAccessible() method and
 adds support for the ignore_visibility flag that is controlled by this
 method to ReflectionMethod::invoke() and ReflectionMethod::invokeArgs().

 The patch complements ReflectionProperty::setAccessible() that was added
 in PHP 5.3.0. It has been developed for PHP_5_3 and I am proposing it
 for PHP 5.3.1 (it's a new feature, but a minor one).

 If accepted, I will provide a patch against trunk as well as tests
 and documentation.

 Cheers!
Sebastian

Index: ext/reflection/php_reflection.c
===================================================================
--- ext/reflection/php_reflection.c	(revision 287971)
+++ ext/reflection/php_reflection.c	(working copy)
 <at>  <at>  -176,7 +176,6  <at>  <at> 
 typedef struct _property_reference {
 	zend_class_entry *ce;
 	zend_property_info prop;
-	unsigned int ignore_visibility:1;
 } property_reference;

 /* Struct for parameters */
 <at>  <at>  -201,6 +200,7  <at>  <at> 
 	reflection_type_t ref_type;
 	zval *obj;
 	zend_class_entry *ce;
(Continue reading)

Guilherme Blanco | 2 Sep 22:08 2009
Picon

Re: [PHP-DEV] ReflectionMethod::setAccessible()

This is a BC break and may possibly be rejected. Extended classes may
implement a method with same name.

Point is that Reflection API misses it and it should be added even
prior to 5.3.0 be released.
Currently there's no way to achieve such behavior.

So I'm +1.

Cheers,

On Wed, Sep 2, 2009 at 4:48 PM, Sebastian
Bergmann<sb <at> sebastian-bergmann.de> wrote:
>  The patch below adds the ReflectionMethod::setAccessible() method and
>  adds support for the ignore_visibility flag that is controlled by this
>  method to ReflectionMethod::invoke() and ReflectionMethod::invokeArgs().
>
>  The patch complements ReflectionProperty::setAccessible() that was added
>  in PHP 5.3.0. It has been developed for PHP_5_3 and I am proposing it
>  for PHP 5.3.1 (it's a new feature, but a minor one).
>
>  If accepted, I will provide a patch against trunk as well as tests
>  and documentation.
>
>  Cheers!
> Sebastian
>
> Index: ext/reflection/php_reflection.c
> ===================================================================
> --- ext/reflection/php_reflection.c     (revision 287971)
(Continue reading)

Garrett Serack | 2 Sep 23:02 2009
Picon

[PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly)

I finally got to the bottom of this bug. It was hiding nice and deep.

I thought I'd run this by folks first before committing, as it impacts streams, which are pretty important
:D . It passes the current tests, and I wrote test for it too. (below).

Index: main/streams/streams.c
===================================================================
--- main/streams/streams.c      (revision 287973)
+++ main/streams/streams.c      (working copy)
 <at>  <at>  -901,10 +901,7  <at>  <at> 
                }

                if (!e) {
-                       if (seek_len < maxlen && !stream->eof) {
-                               return NULL;
-                       }
-                       toread = maxlen;
+                       toread = (seek_len < maxlen) ? seek_len : maxlen;
                } else {
                        toread = e - (char *) stream->readbuf - stream->readpos;
                        skip = 1;

=======/ext/standard/tests/streams/bug49148.phpt:=======

--TEST--
Bug #49148 (combination of stream_get_line and fseek does not work correctly)
--FILE--
<?php
// should give back "line 1" and ""
$tmp = tmpfile();
(Continue reading)

Stanislav Malyshev | 2 Sep 23:14 2009

Re: [PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly)

Hi!

> I thought I'd run this by folks first before committing, as it 
> impacts streams, which are pretty important :D . It passes the 
> current tests, and I wrote test for it too. (below).

I notice that the bug says it happens only on Windows, while the fix
doesn't have anything specific for windows. Could you explain why it is so?
Another question is why stream->eof is not set in this case on Windows -
shouldn't it be?
-- 
Stanislav Malyshev, Zend Software Architect
stas <at> zend.com   http://www.zend.com/
(408)253-8829   MSN: stas <at> zend.com

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Stefan Marr | 2 Sep 23:49 2009
Picon

[PHP-DEV] Traits Patch available for Testing and Comments on PHP 5.3 and PHP 6

Dear internals:

Has been a while since we discussed whether the idea
of Traits fits into the programming model of PHP.

To encourage further discussion and experiments,
I managed to update some tests, to fix some bugs,
and eventually to use GitHub to make it accessible to you.

Please find a version for PHP 5.3 at:
   http://github.com/gron/php-src/tree/PHP_5_3-traits

and a version for PHP 6 at:
   http://github.com/gron/php-src/tree/PHP_6-traits

For a basic introduction please refer to
   * the RFC:
     http://wiki.php.net/rfc/horizontalreuse
   * the test cases available in the source folder under:
     Zend/tests/traits
and of course ask my directly or on this list.

Best regards
Stefan

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

(Continue reading)

Garrett Serack | 2 Sep 23:29 2009
Picon

RE: [PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly)

it happens on Linux and Windows. I've repro'd it in both places.

The bug submitter hadn't tested elsewhere.

G

-----Original Message-----
From: Stanislav Malyshev [mailto:stas <at> zend.com] 
Sent: Wednesday, September 02, 2009 2:15 PM
To: Garrett Serack
Cc: 'PHP Internals'
Subject: Re: [PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly)

Hi!

> I thought I'd run this by folks first before committing, as it 
> impacts streams, which are pretty important :D . It passes the 
> current tests, and I wrote test for it too. (below).

I notice that the bug says it happens only on Windows, while the fix
doesn't have anything specific for windows. Could you explain why it is so?
Another question is why stream->eof is not set in this case on Windows -
shouldn't it be?
-- 
Stanislav Malyshev, Zend Software Architect
stas <at> zend.com   http://www.zend.com/
(408)253-8829   MSN: stas <at> zend.com

--

-- 
PHP Internals - PHP Runtime Development Mailing List
(Continue reading)

Hans Åhlin | 3 Sep 07:29 2009

[PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly)

I just ran the test on Linux 2.6.29 FC11 Apache 2.2.13 and PHP 5.2.9

Result:

string 'line1' (length=5)
string '' (length=0)
string 'line1' (length=5)
string '' (length=0)
string 'line1' (length=5)
string 'line2' (length=5)
string 'line1' (length=5)
boolean false
string 'line1' (length=5)
string 'line2' (length=5)
string 'line1' (length=5)
string 'line2' (length=5)

-- 
MvH / Hans Åhlin
Tel: +46761488019
http//www.kronan-net.com/

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Aron Szabo | 3 Sep 11:12 2009

[PHP-DEV] Replace a builtin function

Hello!

Is it possible to replace an existing PHP function ( like mail() ) in an 
extension.
I've been patching PHP to have a custom mail() function, but I think 
replacing
the mail function with an extension would be better and will save a lot 
of time.

Can somebody give me a clue or an extension that replaces a built-in 
function so I can study it ?

Thanks!

Sorry if this is not the right place for my question ...

Yours,
Aron

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Johannes Schlüter | 3 Sep 11:25 2009
Picon

Re: [PHP-DEV] Replace a builtin function

Hi,

On Thu, 2009-09-03 at 11:12 +0200, Aron Szabo wrote:
> Hello!
> 
> Is it possible to replace an existing PHP function ( like mail() ) in an 
> extension.

Look for the implementation of disable_functions.
(zend_disable_function() in zend_API.c)

johannes

--

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Gmane