Re: [PHP-DEV] IMAP patches from kolab -- can we get these merged?

2010-07-29 Thread Mikko Koppanen
On Thu, Jul 29, 2010 at 9:01 AM, Hannes Magnusson
hannes.magnus...@gmail.com wrote:
 On Wed, Jul 28, 2010 at 17:09, Clint Byrum cl...@ubuntu.com wrote:
 I'd like to get these patches into mainstream PHP so that we don't have to
 ship some weird patched kolab-only IMAP module in Debian and Ubuntu. In
 fact, I'm quite opposed to doing that at all, but this means having a
 broken Kolab in Debian and Ubuntu (as I understand it, Horde uses the
 myrights patch too). I'm just wondering what it will take to get these
 patches merged into PHP. Do we need to update documentation as well?


Hi,

I was looking at annotations patch and it seems that my c-client does
not support the functionality (2007b on Debian Lenny). Do the
annotations require a custom patch to c-client as well?

-- 
Mikko Koppanen

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



Re: [PHP-DEV] Re: Commits to PHP_5_3

2010-03-18 Thread Mikko Koppanen
On Thu, Mar 18, 2010 at 6:44 PM, Raphael Geissert geiss...@php.net wrote:
 Here I'm talking about adding support for tokyo cabinets as a dba handler,
 not a complete interface to the multiple tokyo cabinet APIs.


This is already in old-trunk:
http://svn.php.net/repository/php/php-src/branches/FIRST_UNICODE_IMPLEMENTATION/NEWS

- Improved ext/dba:
  . Added support for Tokyo Cabinet. (Michael)


-- 
Mikko Koppanen

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



Re: [PHP-DEV] Re: array_seek function

2010-03-16 Thread Mikko Koppanen
On Tue, Mar 16, 2010 at 2:12 PM, Christian Schneider
cschn...@cschneid.com wrote
 I thinks the user space implementation

 function array_seek($array, $pos)
 {
        $a = array_values($array);
        return $a[$pos];
 }

 is simple enough to not add a native function for this.

 It might not be the most efficient way to do it but I doubt that it is
 something done frequently enough to justify another native function.

Hi,

slightly modified version of the original patch
http://valokuva.org/~mikko/array_seek.patch.txt. The difference to the
original is that the iterator position is left where the user seeked
to. So something like following should work:

?php
$arr = array(the, brown, fox, and, so, on);

echo array_seek($arr, 1) . \n; // brown
echo next($arr) . \n; // fox
?

Not sure how useful it is to have this in core but I do remember for
looking for a seek function for arrays before.

-- 
Mikko Koppanen

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



Re: [PHP-DEV] array_seek function

2010-03-16 Thread Mikko Koppanen
On Tue, Mar 16, 2010 at 4:22 PM, Derick Rethans der...@php.net wrote:
 I was also thinking, can we just make this work just like fseek (with a
 whence parameter) as well? (http://uk3.php.net/fseek)

Hi,

not sure how SEEK_END is supposed to work with arrays but here is
SEEK_SET and SEEK_CUR (with positive and negative offset)
http://valokuva.org/~mikko/array_seek_whence.patch.txt

-- 
Mikko Koppanen

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



Re: [PHP-DEV] Re: alternative to the fopen() hack in autoloaders

2009-12-23 Thread Mikko Koppanen
On Wed, Dec 9, 2009 at 2:04 AM, Stanislav Malyshev s...@zend.com wrote:
 Hi!

 I think stream_resolve_include_path() should be changed to work through
 zend_resolve_path, in any case. Also, what is the reason it can't be in 5.3
 too?
 I'd like to both fix stream_resolve_include_path() and get it into 5.3, any
 objections to that?


Hi,

this might work against PHP_5_3 and trunk:

http://valokuva.org/patches/php/new/stream_resolve_include_path.txt



-- 
Mikko Koppanen

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



Re: [PHP-DEV] Proposal: allow for includes in php.ini

2009-12-23 Thread Mikko Koppanen
2009/12/23 Michael Shadle mike...@gmail.com:
 i am fine with both too. i just think it's sorely lacking to be able
 to do it any other time than at compile time -and- that only provides
 you one location.

 could be very powerful to allow for any location to be scanned for ini files.


Hello,

I think you can use PHP_INI_SCAN_DIR environment variable which should
work runtime as well.

-- 
Mikko Koppanen

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



Re: [PHP-DEV] Proposal: allow for includes in php.ini

2009-12-23 Thread Mikko Koppanen
On Thu, Dec 24, 2009 at 12:23 AM, Pierre Joye pierre@gmail.com wrote:
 So what you need is multiple ini dirs, not actually include. I think
 there is a patch somewhere for this feature, or it may even be already
 in. If not, that could be something useful.

Hi,

I think this is the feature (in trunk currently):

http://svn.php.net/viewvc?view=revisionrevision=282878

-- 
Mikko Koppanen

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



[PHP-DEV] Ability to intercept errors even if set_error_handler has been called

2009-11-17 Thread Mikko Koppanen
Hello,

In monitoring type extensions such as Xdebug, APM etc it is common to
override zend_error_cb with a custom callback to intercept errors.
This however has a drawback: if user calls set_error_handler the
zend_error_cb does not get called at all for errors that can be
handled in userspace. There are a few approaches to solving this
(namely disabling set_error_handler or overriding set_error_handler)
but neither of them really seems like a good solution.

I made a simple patch that adds always_invoke_error_cb which allows
invoking the zend_error_cb in these cases (it needs to be set on
explicitly in an extension). error_handled_by_user setting allows
extensions to stop propagating the event if it's handled by user's
handler.

The patch is very simple and probably breaks horribly with some edge
cases. Ideas? Feedback?

http://pastie.org/702900

-- 
Mikko Koppanen

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



Re: [PHP-DEV] Re: alternative to the fopen() hack in autoloaders

2009-11-11 Thread Mikko Koppanen
On Wed, Nov 11, 2009 at 10:00 AM, Lukas Kahwe Smith m...@pooteeweet.org wrote:

 On 11.11.2009, at 01:50, Greg Beaver wrote:

 if (can_include($file)) {
   include $file;
 }


 I am sure you focused on the technical aspects. Just wanted to say that for
 a name can is not ideal, because there is no gurantee that the file will
 not have syntax errors. As such something with exists is better (for
 example include_file_exists(), though also not ideal) .. Stas proposal of a
 file_find() is also good, but I think it would be nice to have include
 in the name.


Isn't this what stream_resolve_include_path does?


-- 
Mikko Koppanen

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



Re: [PHP-DEV] Why is ereg being deprecated?

2009-10-12 Thread Mikko Koppanen
On Mon, Oct 12, 2009 at 8:14 PM, Mark Krenz m...@suso.org wrote:
  So there is my proof. Does anyone still want to dispute me that ereg is
 still heavily used and you'll make a lot of users angry if you don't
 give them the proper amount of time to make this transition?


Hello Mark Krenz,

please take the following steps:

1) Stop posting pointless junk to the lists as you are alienating all
the developers that could possibly help you in the future

2) Create a proper technical proposal on how to solve the Unicode
issues in ext/ereg.

3) Get someone to implement your proposal. Nothing helps your cause
like a proper patch.


Regards,
Mikko

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



[PHP-DEV] Multiple paths in PHP_INI_SCAN_DIR

2009-06-26 Thread Mikko Koppanen
Hi,

is there any objection on supporting multiple paths separated by path
separator in PHP_INI_SCAN_DIR value? The patch seems to be quite trivial
change in main/php_ini.c. Is this acceptable for 5.3 after the commit freeze
is over?

-- 
Mikko Koppanen


Re: [PHP-DEV] APM

2009-05-28 Thread Mikko Koppanen
On Thu, May 28, 2009 at 5:49 PM, Patrick ALLAERT
patrick.alla...@gmail.comwrote:


 The only thing I see now is the ability to make the extension active
 on a request basis rather than globally.


Hi,

looks like the extension overrides zend_error_cb. Is this affected by
set_error_handler in the userland? If I remember correctly (might be wrong)
set_error_handler overrides zend_error_cb as well and that would cause APM
not to work out of the box with all applications. Not sure if that is design
goal of this extension..

-- 
Mikko Koppanen


Re: [PHP-DEV] Re: Is it true that short_open_tag is deprecated in PHP 6?

2009-04-14 Thread Mikko Koppanen
On Tue, Apr 14, 2009 at 1:26 PM, Glen glen...@gmail.com wrote:

 I didn't say PHP tags were valid XML. I said short_open_tag conflicts
 with ?xml and other PIs.

 % is not valid XML either, but it doesn't conflict with processing
 instructions.

 Glen.



Hello Glen,

posting to mailing-lists is not a speed race so think about your answer
before sending it. There should be no need to send four emails in a row as
you can easily answer multiple persons / arguments in a single post. This
discussion belongs to internals list anymore, so please move it to
php-general mailing list.

CCing the correct list in this mail.

-- 
Mikko Koppanen


Re: [PHP-DEV] How expensive are function_exists() calls?

2009-03-04 Thread Mikko Koppanen
On Wed, Mar 4, 2009 at 1:07 PM, Kenan Sulayman kur...@kkooporation.dewrote:

 Hello Mike!

 Depending on how you'd define expensive, it may variate.
 Normally, on websites function_exists(x) ain't expensive.

 Altrought function_exists needed 0.77009201049805 seconds to execute.
 Do you think, that's pretty expensive ?


Please move this thread to the php-general mailing-list.


-- 
Mikko Koppanen


Re: [PHP-DEV] [RFC] APC/PHP Lazy Loading

2009-02-22 Thread Mikko Koppanen
On Sun, Feb 22, 2009 at 6:55 AM, shire sh...@tekrat.com wrote:


 Thanks for the feedback, and hopefully the above makes sense.  I don't want
 to encourage bad progarmming form and would definitely encourage avoiding
 this situation if possible, however I think many applications may find this
 optimization a necessity.


Hello,

I don't think this patch encourages bad programming any way. It just gives
more flexibility for the sites that need to focus on performance. I haven't
had the chance to check the patch yet but as a principle this is something I
would like to see in future versions of PHP / APC.

Good work!



-- 
Mikko Koppanen


Re: [PHP-DEV] Vote: allow_call_time_pass_reference value in production INI

2009-02-19 Thread Mikko Koppanen
2009/2/19 Eric Stewart ericleestew...@gmail.com


 allow_call_time_pass_reference = Off (Issue Warnings)


+1

-- 
Mikko Koppanen


Re: [PHP-DEV] Best/Proper way to process an extension-specific configuration (ini) file.

2009-02-13 Thread Mikko Koppanen
On Fri, Feb 13, 2009 at 7:31 PM, David M. Patterson 
dpatter...@dplhenterprises.com wrote:

 I am writing an extension that requires its own configuration file.

 I would prefer to not re-invent the parse a config file wheel and so, have
 been trying to use zend_parse_ini_file() function. Unfortunately, I have
 been unable to make this work, so far.

 If someone would either provide a code snippet for this or point me to one,
 I'd really appreciate it.


The normal way is to use PHP ini-entries. You can find examples in just
about every extension out there. Are you sure you need a separate
configuration file for your extension?


-- 
Mikko Koppanen


Re: [PHP-DEV] Call it: allow reserved words in a class or not?

2008-11-06 Thread Mikko Koppanen
On Thu, Nov 6, 2008 at 12:15 PM, Dan [EMAIL PROTECTED] wrote:
 Okay, I'm not going to sit and argue it... but to anyone looking at these
 issues from outside the PHP internals world (like I am), that argument is
 worthy of ridicule.

What argument? Due to top-posting you're kind of killing the ability
to follow the thread.

 PHP may be a hybrid language, but the fact is you're implementing object
 oriented functionality, and as such should be implementing it in a way that
 follows de-facto standards in object oriented language design. I should be
 able to overload your internal array object, and yes, arraysshould be
 objects.

Wouldn't this mean that also primitive types such as integer and
string should be objects? Doing something like this would break about
all the code out there without a major gain.

One of the strenghts of PHP is that it balances well between
procedural and object oriented approaches. There is ArrayObject,
ArrayAccess etc for people who wish to use OO and array for the people
who don't.

 Javascript would be a prime example of a non-standard object oriented
 approach, and yet that still manages to support the basics in a way that
 make sense.


I think you are missing a point here. PHP is not Javascript or .NET.


-- 
Mikko Koppanen

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



Re: [PHP-DEV] namespaces and alpha3

2008-10-14 Thread Mikko Koppanen
On Tue, Oct 14, 2008 at 2:27 PM, David Zülke
[EMAIL PROTECTED] wrote:
 Am 14.10.2008 um 14:10 schrieb Steph Fox:

  On 10 Oct 2008, at 06:03, Lukas Kahwe Smith wrote:
 
   1) rip them out
 
  I'm +1 on this. We simply don't have consensus, and I don't see anyway
   we
  can have consensus by the time 5.3 has to be frozen. Once namespaces 
  are in,
  we're gonna have to stick with whatever we choose, unless we totally 
  break
  BC.

 I'd agree with this, leave something with such a big impact to version
 6. At
 least it gives time to get it right.

 I'm +1 on ripping out and leaving til 6.0.

 +1 from me, too. Getting it right takes time. If that means 6.0, fine.

+1 for removal.

-- 
Mikko Koppanen

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



[PHP-DEV] Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard mail.c

2008-10-03 Thread Mikko Koppanen
 That Ilia's comment is bullshit. PHP_5_2 is not critical fixes only
 branch. It's normal bug fix branch til the day PHP 5.3 is released. We can
 reconsider it's status once there is 5.3.1 available.

Committed, closed bug and updated NEWS.


-- 
Mikko Koppanen

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



Re: [PHP-DEV] How to enable debug for my extension?

2008-09-03 Thread Mikko Koppanen
On Wed, Sep 3, 2008 at 6:36 AM, Hartmut Holzgraefe
[EMAIL PROTECTED] wrote:
 Mangol Smith wrote:

 I'm trying to debug my extension.It says that PHP is built with debug
 flag,
 but my not my extenison. I used --enable-debug for PHP build. But, in the
 extension I wrote I can't find any configure option associated with debug
 in
 ./configure --help. I tried using the options --enable-debug and
 --with-debug options, but no result. PHP is giving a startup error while
 loading my extension.

 the information whether to build a debug extension or not
 is fetched from the PHP installation you're building
 against, specifically from the ZEND_DEBUG definition in


Hello,

You should also note that before this change
http://cvs.php.net/viewvc.cgi/php-src/scripts/phpize.m4?r1=1.17.2.3.2.5.2.3r2=1.17.2.3.2.5.2.4
the shared extension is built with optimizations even if PHP is
configured with --enable-debug.

-- 
Mikko Koppanen

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



Re: [PHP-DEV] Re: Array syntax []

2008-01-11 Thread Mikko Koppanen
-1

-- 
Mikko Koppanen


Re: [PHP-DEV] Type hinting misunderstood

2008-01-06 Thread Mikko Koppanen

 Why I mean by:
Type HINTING is not type ENFORCEMENT.
 is that:
function foo(int $a) {}

foo(1); // OK

foo(1);   // OK - the string is juggled to an int when the
 function is called
// ENFORCEMENT would have (in some interpretations)
 caused this to
// FAIL since the function argument was a string.



I have not been following very closely this conversation so this might have
been answered already:


$b = '5';

function foo( int $a )
{
  echo gettype( $a );
}

foo( $b );

echo gettype( $b );


what is type of $b after the function call?


-- 
Mikko Koppanen


Re: [PHP-DEV] Re: Exceptions instead of Fatal Error when calling non existent method?

2007-12-31 Thread Mikko Koppanen
 Yes, I'm aware of call() but it's very slow. Also it's not feasible to
 have
 *all* my classes extend a base class with the a call containing a throw
 InvalidMethodException, and what if I need to use 3rd party libraries that
 make use of call in some other way. __call()  is a hack, that, at best,
 work
 50% of the time.



Calling methods without knowing that they exist sounds like a hack to me.
How about using abstract classes or interfaces?

-- 
Mikko Koppanen


Re: [PHP-DEV] How to integrate PHP with my homegrown server

2007-08-24 Thread Mikko Koppanen
On 8/24/07, Robert Cummings [EMAIL PROTECTED] wrote:

 On Fri, 2007-08-24 at 11:08 -0400, Steve Francisco wrote:
  Hi, as an experiment I have a simple Java based server that listens on
  port 80 and can serve files just fine.  I'd like to extend it to support
  PHP but am looking for guidance on how to do that.  Can someone point me
  to instructions?
 
  My first attempt was to just call the php.exe command line interface to
  launch the php interpreter, capture the html and send it back to the
  caller.  That works well, but I can't seem to figure out how to deal
  with parameters.  For example, if the url would be this on the server:
   http://some.server.com/mypage.php?parm1=Helloparm2=Goodbye
  and in mypage.php I do something like this:
   $echo $_GET[parm1];
  then how do I test this via the PHP command line?
 
  If the command line doesn't have a way to cause $_GET to be populated,
  then what other way of invoking PHP could I use?

 Sounds like you might need some glue. Have your PHP script run a
 function that synchs up the globals with what you want. So your Java
 server could populate a file or something with the appropriate data that
 it received and your glue function would read it and populate the global
 arrays.

 Cheers,
 Rob.
 --
 ...
 SwarmBuy.com - http://www.swarmbuy.com

 Leveraging the buying power of the masses!
 ...

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


You could take a look at implementing PHP support via CGI.


-- 
Mikko Koppanen


Re: [PHP-DEV] RIP PHP 4?

2007-07-06 Thread Mikko Koppanen

+1

--
Mikko Koppanen

On 7/6/07, Derick Rethans [EMAIL PROTECTED] wrote:


Ladies, Gentlemen, Kings and Princesses,

With the nice PHP 5 / PHP 6 unicode semantics thread under way I am
trying to gauge what people feel about dropping support for PHP 4 at the
end of this year. That does not mean that we will not fix security
issues, we have to as the install base is too large, but that would be
the only thing that would warrant a new release. I already sort of
mentioned this on april 1st, but I think we should come with a slightly
more official statement. Your votes please (only -1 and +1 are
allowed)!

regards,
Derick

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




[PHP-DEV] CVS Account Request: mkoppanen

2007-04-04 Thread Mikko Koppanen
Helping Scott MacVicar with Imagick extension.

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