[PHP-DEV] Need some ZE2 functions exported.

2003-03-12 Thread l0t3k
im trying to do some namespace related experimentation but im getting the
following link errors :
i18n_util.obj : error LNK2001: unresolved external symbol
_zend_init_namespace
i18n_util.obj : error LNK2001: unresolved external symbol
_zend_initialize_class_data
i18n_util.obj : error LNK2001: unresolved external symbol
_zend_do_inheritance
i18n_util.obj : error LNK2001: unresolved external symbol
_zend_register_functions

any chance of exporting the offenders here ?  here's precisely the code im
using (modified from marcus):

/* {{{ register_interface */
/* You will have to alloc the pce before the call and namespace_entry must
be valid */
zend_class_entry* register_class(zend_namespace *namespace_entry,
zend_class_entry *parent_ce,
char *class_name,
zend_function_entry *functions
TSRMLS_DC)
{
 int name_length = strlen(class_name);
 char *lowercase_name = zend_strndup(class_name, name_length);

 zend_class_entry *pce = emalloc(sizeof(zend_class_entry));

 pce-type = ZEND_INTERNAL_CLASS;
 pce-name_length = name_length;
 pce-name = class_name;

 pce-parent = NULL;
 pce-num_interfaces = 0;

 zend_initialize_class_data(pce, 1 TSRMLS_CC);
 pce-ns = namespace_entry;

 if (functions) {
  zend_register_functions(pce, functions, pce-function_table,
MODULE_PERSISTENT TSRMLS_CC);
 }

 if (parent_ce) {
  zend_do_inheritance(pce, parent_ce);
 }

 zend_str_tolower(lowercase_name, name_length);
 zend_hash_add(namespace_entry-class_table, lowercase_name,
name_length+1, pce, sizeof(zend_class_entry *), NULL);
 free(lowercase_name);

 return pce;
}
/* }}} */

l0t3k





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



Re: [PHP-DEV] Need some ZE2 functions exported.

2003-03-12 Thread l0t3k
Marcus,
  i tried to use spl_functions.c and got the same errors. i think that
because im building php as shared that those symbols must be exported for my
code to work.

l0t3k

Marcus Börger [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 At 15:54 12.03.2003, l0t3k wrote:
 im trying to do some namespace related experimentation but im getting the


 Have a look at spl (http://marcus-boerger.de/php/ext/spl/) how that works
 without modyfing the engine.

 regards
 marcus




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



[PHP-DEV] New constants proposal

2003-03-11 Thread l0t3k
i suggest that we implement the constants NaN, as well as INFINITY (pos and
neg if the RTL supports it). i have need of them in an extension, but they
should be implemented in core or ext/standard.

l0t3k



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



Re: [PHP-DEV] Namespaces

2003-03-08 Thread l0t3k
Derick,
  is this planned then ? it would make no sense not to support it. actually
i should clarify that i want the extension to define its own namespace into
which all its classes, consts and vars go (as opposed to inserting into a
preexisting one).

Derick Rethans [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Sat, 8 Mar 2003, l0t3k wrote:

  this may be a bit premature, but how do i inject the classes, functions
and
  constants in my extension into a namespace ?

 You can't do that.

 Derick

 --
 my other box is your windows PC
 -
  Derick Rethans http://derickrethans.nl/
  PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
 -



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



Re: [PHP-DEV] Namespaces

2003-03-08 Thread l0t3k
You, sir, are a gentleman and a scholar ;-) i assume that given your
familiarity and recent work with ZE2 that this will be merged ? i can live
with a locally patched tree for the moment..

 i assume i ZE2 cleans all this up for me after MSHUTDOWN (i.e. i dont need
to worry about doing so manually)?

l0t3k
Marcus Börger [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 At 08:10 08.03.2003, l0t3k wrote:
 this may be a bit premature, but how do i inject the classes, functions
and
 constants in my extension into a namespace ?
 
 l0t3k
 

 See below :-)





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



[PHP-DEV] Re: iterating objects with interfaces

2003-03-08 Thread l0t3k
you're not campaigning for sainthood, are you ;-)
ive been reading python docs today, and their iterators and sequences are
one of the things that make it so powerful yet simple because of their
consistency throughout.

what do you mean you didnt have to modify the engine ? did you mess with the
opcode handlers ?

l0t3k
btw - im currently marooned on windoze until my mdk box is fixed, so could
you post a tar.gz ? bz2 gives PowerArchiver the hiccups.

Marcus Börger [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,

  i've just done the first step for a new extension which shall make use
of interfaces newly implemented in ZE2.

currently the extension implements the namespace spl and the
interfaces spl_foreach, spl_forward and spl_key. A class that
implements these can be used in a foreach() call. This work without
even modifying the engine, i simply hook on the necessary calls.

References:

The documentation of the interfaces and their usage:
http://marcus-boerger.de/php/ext/spl/spl.phps

The extension code:
http://marcus-boerger.de/php/ext/spl/spl-20030309.tar.bz2

And a testfile to demonstrate it works (beside shutdown):
http://marcus-boerger.de/php/ext/spl/tests/foreach.phpt

Of corse i am curious about other meanings :-)
Otherwise i wouldn`t have posted here, would i?

regards
marcus



--
--
Marcus Börger - Looking for all sorts of freelance work - just ask...

Did i help you? Consider a gift:
http://www.amazon.de/exec/obidos/wishlist/ho722v0rg1u0
--




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



[PHP-DEV] Specifying pass-by-ref parameters

2003-03-07 Thread l0t3k
im a bit rusty, so could someone explain how i would set up a function to
accept a byref parameter ? no zend api documentation i ran across is clear
on this issue.

l0t3k



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



[PHP-DEV] Namespaces

2003-03-07 Thread l0t3k
this may be a bit premature, but how do i inject the classes, functions and
constants in my extension into a namespace ?

l0t3k



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



[PHP-DEV] Namespaces

2003-03-07 Thread l0t3k
this may be a bit premature, but how do i inject the classes, functions and
constants in my extension into a namespace ?

l0t3k





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



[PHP-DEV] Re: Announcement: Next generation ext_skel

2003-02-25 Thread l0t3k
Hartmut,
  will this also generate zend_parse_parameters calls based on prototype ?

l0t3k
Hartmut Holzgraefe [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 i've just added the first working results of a replacement for the good
 old ext_skel script in php/scripts/ext_skel_ng




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



Re: [PHP-DEV] OO in PHP5 (was zend_API.c on php-dev)

2003-02-05 Thread l0t3k
Timm,

 Conclusion: Don't even try to write exception classes for PHP5 in C. You
 will never please all of the users' needs - so simply leave it up to
 them.

im curious about why you take such a strong exception g to built-in
exceptions. are you suggesting that all C based objects use zend_error and
leave it to the user to convert errors to exceptions if need be ?
could your objections be limited to classes designed to be inherited ?
im asking because ive already created a slew (well actually a few) PHP5 C
classes which raise exceptions derived from a base exception type defined in
the module. for the most part (except for programming incompetence on my
end), there would not be a need to inherit from them

l0t3k





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




[PHP-DEV] Re: how build komplex array

2003-01-10 Thread l0t3k
Johannes,
could you perhaps show a bit of the schema and your expected array
output in print_r format ?

Johannes G. Arlt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello all,

I need a very complex array from a mysql-statement like DB::getAssoc but
more
complex.




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




[PHP-DEV] Re: Win32 Build Quirks

2002-12-29 Thread l0t3k
it also seems as if we need to link against zlibstat.lib, but zlib.lib is
given in the MSVC project (php4dllts) as the library to link against.


Sebastian Bergmann [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
   For a long time I could use the following commands to build PHP on
   Windows

 msdev php4ts.dsw /MAKE php4ts - Release_TS_inline /REBUILD
 msdev php4ts.dsw /MAKE php4ts_cli - Release_TS_inline




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




Re: [PHP-DEV] Location of getopt function

2002-12-16 Thread l0t3k
Markus,
  thanks for the link, but i was looking for the implementation of the PHP
function as documented here
http://www.php.net/manual/en/function.getopt.php

i searched for PHP_FUNCTION(getopt) but got no hits...

l0t3k

Markus Fischer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sun, Dec 15, 2002 at 03:21:04PM -0500, l0t3k wrote :
  i've checked LXR, but i cant locate the implementation of getopt in CVS.
im
  trying to provide a Windows implementation.

 HTH: http://lxr.php.net/find?string=getopt



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




Re: [PHP-DEV] Location of getopt function

2002-12-16 Thread l0t3k
Thanks Kjartan (and all who responded).

give me a few days and i'll report back on the win32 version.

Kjartan Mannes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Monday, December 16, 2002, 5:07:52 PM, l0t3k wrote:
  Markus,
thanks for the link, but i was looking for the implementation of the
PHP
  function as documented here
  http://www.php.net/manual/en/function.getopt.php

 It is defined in:
   ext/standard/basic_functions.c
   ext/standard/basic_functions.h

 There is a C implementation of getopt() in sapi/cli/ that could be used.

 --
 Kjartan [EMAIL PROTECTED] (http://natrak.net/)
 :: If you wish to be loved, show more of your faults than your
 virtues. - Edward Bulwer-Lytton




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




Re: [PHP-DEV] PHP-4.3.0RC3 Windows - getopt function

2002-12-15 Thread l0t3k
i took a look at the man pages and php docs. seems straight forward. give me
a few days and i'll report back to the list. actually the code that i have
can handle long as well as short args e.g.  -f or --foo , as well as being
able to specify whether an argument is optional or required. the code is
plain vanilla C so it can be used for all supported platforms.

l0t3k

Hartmut Holzgraefe [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Kjartan Mannes wrote:
  The NEWS file mentions a new function getopt(), but I can not get this
  to work under windows.
 
Fatal error: Call to undefined function:  getopt()
 
  My guess is that getopt() isn't a standard system function, but PHP
  mimics the function as it handles command line arguments. Is this
  intentional or just an oversight?

 for now it is Unix-only

 ( Actualy it is protected by #if HAVE_GETOPT and configure
deals with it checking for getopt() in libc.
On Windows there is nothing like configure so this has
to be solved in a different way. )

 any Win32 volunteers?

 --
 Six Offene Systeme GmbH http://www.six.de/
 i.A. Hartmut Holzgraefe
 Email: [EMAIL PROTECTED]
 Tel.:  +49-711-99091-77




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




[PHP-DEV] Location of getopt function

2002-12-15 Thread l0t3k
i've checked LXR, but i cant locate the implementation of getopt in CVS.  im
trying to provide a Windows implementation.

l0t3k



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




Re: [PHP-DEV] Reusing PHP string value pointers

2002-11-28 Thread l0t3k
if you have the option of using  ZE2, make the thing an object and use  the
property get/set handlers to take care of things for you

Marshall A. Greenblatt [EMAIL PROTECTED] wrote in message
000d01c296fe$b0ff82f0$6601a8c0@Marshall">news:000d01c296fe$b0ff82f0$6601a8c0@Marshall...
 From: Zeev Suraski [EMAIL PROTECTED]
  When a PHP string variable is changed via a PHP script, such as:
  
  $foo = 'new value';
  
  what happens to the `value.str.val' pointer internally?  Is it possible
 to
  have the new value assigned to the same `value.str.val' pointer that
the
  variable is currently using instead of having that pointer replaced by
a
  pointer to the new value?
 
  No, it's not possible (not in a reliable way anyway).

 What about being able to register a callback function for variable
 assignment?  That way I can keep track of the pointer myself and copy the
 new value to it when the variable value is changed in the PHP script.
Would
 anybody else be interested in this functionality?

 
  Zeev
 

 Thanks,
   Marshall




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




[PHP-DEV] Re: ZE2 object constructor question

2002-11-13 Thread l0t3k
To answer myself...

i just did the following :

*return_value = *(getThis());
zval_copy_ctor(return_value);

and everything seems to be working ok...

L0t3k [EMAIL PROTECTED] wrote in message
news:20021112210753.3233.qmail;pb1.pair.com...
 im creating some classes in an extension and i have a question.
 im following instructions in the OBJECTS2_HOWTO, and have managed to get
the
 engine to call my constructor. in the constructor i can retrieve the
object
 created with the create_object_handler, which means getThis() already
 contains my object.
   the question is , do i still  have to explicitly set return_value, given
 that getThis() is already a valid object zval ?

 l0t3k





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




[PHP-DEV] ZE2 object constructor question

2002-11-12 Thread l0t3k
im creating some classes in an extension and i have a question.
im following instructions in the OBJECTS2_HOWTO, and have managed to get the
engine to call my constructor. in the constructor i can retrieve the object
created with the create_object_handler, which means getThis() already
contains my object.
  the question is , do i still  have to explicitly set return_value, given
that getThis() is already a valid object zval ?

l0t3k



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




Re: [PHP-DEV] Can't build PHP 4.2.3-RC2 on Windows

2002-09-02 Thread l0t3k

hear, hear..
my Linux box is perpetually broken, and the Visual Studio debugger is very
nice...

Zeev Suraski [EMAIL PROTECTED] wrote in message
5.1.0.14.2.20020902182321.0387b4b0@localhost">news:5.1.0.14.2.20020902182321.0387b4b0@localhost...
 I still object because I use them every once in a while to check/debug the
 non TS build under Windows.  I do maintain them every other year :)

 At 18:11 02/09/2002, Edin Kadribasic wrote:
 So why not nuke them?
 
 No objections here to nuking non-ts project files and workspaces on
 windows.
 
 Edin
 
 
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php




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




[PHP-DEV] Possible leak in zend_llist ?

2002-08-27 Thread l0t3k

hi,
 im reviewing the source code of zend_llist.c and it appears there may be an
inconsistency in the way deletions are handled which may cause leaks.
  in particular the macro DEL_LLIST_ELEMENT only releases memory for a node
if a destructor is specified for the zend_llist, whereas memory is always
allocated for the node when an insert is performed.
this macro is used only in zend_llist_apply_with_del and
zend_llist_del_element. note that
no other code in the file assumes that the destructor function is
responsible for the deallocation of the _node_

compare DEL_LLIST_ELEMENT (snippet)

   if ((l)-dtor) {\
(l)-dtor((current)-data);\
pefree((current), (l)-persistent);\
   }\

with zend_llist_destroy

  if (l-dtor) {
   l-dtor(current-data);
  }
  pefree(current, l-persistent);


l0t3k



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




[PHP-DEV] ZE2 and object destruction ...

2002-08-27 Thread l0t3k

i've noticed that in ZE2 that object autodestruction (ala
zend_objects_store_call_destructors) happens _after_ a module's RSHUTDOWN,
which causes some interesting lifetime management issues in an extension im
writing. in particular, the Zend objects wrap some in-memory structures from
a library which handles its own cleanup (the cleanup function is called in
RSHUTDOWN).
 forgive me if this reveals my ignorance of engine internals, but shouldnt
the object destruction sequence precede a module's request shutdown ?

l0t3k



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




[PHP-DEV] [PHP-Dev] ZE2 Favour..

2002-08-14 Thread l0t3k

Andi,
  along the lines of my previous request, is it possible to also export
zend_register_functions ? actually a more general request would be to
evaluate the codebase to determine which functions are likely candidates...

thanks,
l0t3k
BTW - i'll try again to subscribe to the ZE2 mailing list...



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




[PHP-DEV] Re: INTERNAL FEATURE request

2002-07-19 Thread l0t3k

Sam,
i dont know if this will happen in ZE1, but it exists already in ZE2.

my workaround was to prepend a header containing a resource id and the
corresponding ZVAL wrapper to all my structs, and use some funky macros. its
ugly, but it works.


Sam Liddicott [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Please can we have a magic cookie resource value or zval associated with
 PHP objects accessable via the C API?

 This would be used when the PHP class it wrapping a C++ class (such as one
 linked in via swig ( www.swig.org http://www.swig.org )) so there was a
 cheap way to find which C++ object the php object was wrapping.

 Currently we use _cPtr element of the wrapped object but it is open to
 freakery by user scripts.

 Thanks

 SAm
   _


 Samuel Liddicott
 Support Consultant
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 Direct Dial: +44 (0)113 367 4523
 Fax: +44 (0)113 367 4680
 Switchboard: +44 (0)113 367 4600

 Ananova Limited
 Marshall Mill
 Marshall Street
 Leeds
 LS11 9YJ

 http://www.ananova.com

 Registered Office:
 St James Court
 Great Park Road
 Almondsbury Park
 Bradley Stoke
 Bristol BS32 4QJ
 Registered in England No.2858918

 The information transmitted is intended only for the person or entity to
 which it is addressed and may contain confidential and/or privileged
 material. Any review, retransmission, dissemination or other use of, or
 taking of any action in reliance upon, this information by persons or
 entities other than the intended recipient is prohibited. If you receive
 this in error, please contact the sender and delete the material from any
 computer.









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




[PHP-DEV] [ZE2] clone_obj function and __clone method

2002-07-17 Thread l0t3k

A quick question about the above...
what is the relationship between the clone_obj handler and the __clone
method. For instance, if i define the clone_obj handler, do i need to define
the a __clone method on the same object ? is clone_obj for a shallow and
__clone for deep copying ?

l0t3k



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




[PHP-DEV] Re: Registering Classes Into a Namespace

2002-07-05 Thread l0t3k

i think ive discovered a lead. in zend_execute.c there is a function
create_nested_class which may be drafted for this purpose. unfortunately,
its declared as static. can we please make this function visible to the
outside world ?

L0t3k [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 hi,
  im converting a working ZE1 extension to ZE2 and id like to associate a
 class with a particular Namespace. any hints as to how i can do this ?

 l0t3k





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




[PHP-DEV] ZE2 and Exceptions - One for Zeev/Andi

2002-06-11 Thread l0t3k

ive been looking over the ZE2 alpha release code for clues on porting my OO
extension over to the new engine, but a few things are not clicking yet
how do i raise an exception from C. last time i asked, Andi said that it
would be sufficient to do a

EG(exception) = error_object_i_created;

but looking through zend_execute.c there seems to be no explicit check
for (NULL != EG(exception)) in the main interpreter loop

one other (unrelated) thing : there seems to be an overlap between members
of the zend_object_handlers struct and the zend_class_entry stuct (function
pointers for property access and method calls). is the current state
transitional (i.e. should all code going forward use only the
zend_object_handlers way ?) then again i guess thats what macros and such
are for

l0t3k




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




[PHP-DEV] Re: RFI: Request for Interfaces

2002-04-23 Thread l0t3k

Wez,
   im +2^LONG_MAX-1 on the idea. the one possible addition is that in 
addition to resouces, i'd like objects to support interfaces as well (i 
havent given though to implementations as yet, though).


 


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




Re: [PHP-DEV] streams and options

2002-04-19 Thread l0t3k

Wez,
  scream at me if it seems dumb, but in my never-finished extension, 
each  plugin accepts an option hash in the init callback which is used 
to set up the object. the framework also stores this hash as an member 
of the object, and there are accessor methods to query the options.
  this keeps it simple for me..

Wez Furlong wrote:

 Hi Derick,
 
 I'm leading up to be able to do this sort of thing, but want/need to
 discuss/brainstorm it here before I do much more to it.
 

 
 Any comments?
 
 --Wez.
 
 On 19/04/02, Derick Rethans [EMAIL PROTECTED] wrote:
 
Hey Wez,

I wonder if it is possible to set options after a stream has been opened. 
Something like:

$fp = fopen (crypt.des://secretfile.des, r);
stream_option ($fp, key, very secret key);

And if it's there, is there an example in the source of it?

regards,
Derick


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

 
 
 


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




Re: [PHP-DEV] ZendEngine 2

2002-04-01 Thread l0t3k

Andi  Stas,
since were on the subject, will the preview release have the code for
the rewritten Java extension. i'd like to use it as a guide for some code im
working on





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




Re: [PHP-DEV] Advice on design issues (long)...

2002-03-25 Thread l0t3k


John Lim [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I have always wondered, how do you pronounce L0t3k?
actually low-tech. most days i dream of woodworking g

 Seriously, if you are duplicating Metabase's effort, but in C,
 why not work with the Manuel Lemos then? This will fix any speed issues
 that Metabase has, and you will get his feedback.
the DB abstraction problem is a much larger one, which Manuel (and yourself)
have been struggling against with serious handicaps. for instance, one of
the reasons Manuel had to put so much work into Metabase is that the
original extension writers did not provide metadata which is readily
available from the database itself, or the metadata supplied is inconsistent
across back-ends.

the current database extensions were written as needed, so there was no
over-arching and unifiying design.
im attempting to consolidate and refactor the code in the existing
extensions into a framework which makes driver development much easier and a
lot more flexible. the upshot is that features can be implemented in the
core that
are immediately available across DB backends (like disconnected resultsets,
resultset serialization, and XML import/export which is nearly done).  in
addition, features like connection management can be handled consistently
across supported backends.

 Many db abstraction classes I have seen are skewed towards
mysql/postgresql,
 so prove to be useless when migrating to mssql or oracle.
ive done quite a lot of legwork on this, and i think i have a framework
which accomodates everything from MySQL to Oracle. i did MySQL first because
1) the API is simple 2) i needed to quickly write a driver to test some
basic design decisions (navigation and bulk-fetching).

Manuel really
 knows a lot about databases and can teach everyone a lot about these
issues.

 Or if you or anyone else would like to port ADOdb to a C extension,
 let me know.
i actually wrote to Manuel about this last summer, but he was (justifiably)
skeptical about the doability of the project and the prospects of its
adoption, given its scope and the fact that most people were comfortably
either using the base extensions, or something like Metabase, PEAR or ADODB.
instead of long discussions, i decided to wait until i had something
tangible to demonstrate. im very near to that point right now.

note that i dont think that Metabase or ADOdb will necessarily go away if
this extension works out. there are things that you and Manuel do that i
think belong in user-space and not in an extension. for instance your
sequence emulation code modifies the DB schema, which crosses the line of an
access layer. also Manuel's schema abstraction and transformation is another
example. i only really care at this point about data and metadata acess
abstraction. what it means though, is that your PHP code will be
considerably smaller and faster ( i think i can eliminate the need for at
least 65% of Metabase's code).

l0t3k



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




Re: [PHP-DEV] Advice on design issues (long)...

2002-03-25 Thread l0t3k


Lukas Smith [EMAIL PROTECTED] wrote in message
008a01c1d2fb$952b4630$4d00a8c0@vandal">news:008a01c1d2fb$952b4630$4d00a8c0@vandal...

 There is currently an effort underway to merge Metabase with PEAR DB.
 I have just commited the first code into the pear cvs (package is called
 MDB for now). The merge is still not complete. But the idea was that
 this merged DB abstraction layer could down the road be ported to C ...
 the sooner the better.
ive downloaded alreay. i keep track of development of PEAR::DB, Metabase and
ADOdb.


 In terms of how to abstract things, its quite obvious that Metabase is
 very far ahead (is there even something similar in other languages?). So
 I guess Metabase, or MDB when its ready, will be the best place to turn
 to if you seek this knowledge for a C Extension.
the abstraction work is primarily done, the blob spec is the main thing
pending. the hard part now is producing a set of test drivers.

 Anyways if you are interested then you may want to join the discussion
 on this new package. All discussion goes to the binarycloud, metabase
 and pear-dev mailinglists, since there is no dedicated mailinglist for
 this project, but all of the above the mailinglists are participating.
im an active lurker on the binarycloud and metabase lists. i throw my $0.02
in periodically.

l0t3k




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




[PHP-DEV] Advice on design issues (long)...

2002-03-22 Thread l0t3k

im looking for opinions on two OOP related design issues for code im
targeting to PHP5.

(1) im writing (actually porting) a DateTime class which matches the
functionality of the Java Date class. it actually does much more, and that's
the issue. in looking at the Javadocs reference page for Date, a lot of what
i have scheduled for my class has been deprecated in Date for various
reasons. in specific, display formatting, parsing and interval math are
moved into other classes.
what do you think about having this functionality in one class or
splitting. i agree somewhat in a separation of concerns, but one reason i
tend not to like Java for web development is the fact that there can be too
many classes involved in getting basic things accomplished.

(2) im working on a database access abstraction, again inspired by Java and
JDBC (MySQL driver is written and works, BTW). in Java you have the
Resultset.getXXX methods which gets the value of a given column as a
particular type. Java of course is strongly typed, whereas PHP is not. Is it
useful to implement the getXXX methods natively. i lean toward it primarily
because 1) folks coming from Java will be right at home 2) sometimes you
need to enforce a particular return type coming from a column 3) Metabase
does it for portability, and although it can be done in PHP, its more
efficient to do it in the extension. On the downside there is the issue of
bloat.


BTW : is there sufficient interest in starting a new newsgroup to discuss
PHP5 ?

l0t3k



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




[PHP-DEV] Re: user-space streams ?

2002-03-18 Thread l0t3k

Wez,
+2e32-1
you read my mind ! but does this also entails having an OO interface to
the streams as they are. it would be very annoying to have a cool stream
abstraction interface, but then have to check for every resource list entry
under the sun to access the stream_ops (le_ftp, le_file, le_xxx, etc).


Wez Furlong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I thought it might be nice to allow people writing class
 libraries in PHP/PEAR to be able to roll-their-own streams using
 PHP code.

 It would be implemented something like the user-mode session module
 handler, but a bit more OO; they would declare a class (see below)
 and register it as a wrapper using a new user-space function called
 file_register_wrapper(string $protocol, string $classname).

 file_register_wrapper would fail if the wrapper is already registered.

 The php_stream_open_wrapper function would create an instance of the
 class and then call it's methods when the equivalent methods in
 the php_stream_ops structure are called.

 This would allow some really cool things, like defining a custom
 protocol and then passing that custom URL around to all sorts of
 PHP functions (fopen(), copy(), extension functions that use wrappers)
 and have them handle it without even noticing that it's implemented
 in PHP code.

 Comments please!

 --Wez.


 class my_stream {
function open($path, $mode, $options, $opened_path)
{
   return true/false;
}
function read($count)
{
   return false on error;
   else return string;
}
function write($data)
{
   return false on error;
   else return count written;
}
function close()
{
}
function flush()
{
}
 /* these are optional */
function seek($offset, $whence)
{
}
function gets($size)
{
   return false on error;
   else return string;
}
 }





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




[PHP-DEV] Re: php_copy_file

2002-03-15 Thread l0t3k

+1
i need this for stuff im doing anyway...

Wez Furlong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Any objections to stream enabling the php_copy_file function;
 this will allow copying to/from anything that can be accessed
 by the stream fopen wrappers?

 --Wez.




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




[PHP-DEV] Re: php_copy_file

2002-03-15 Thread l0t3k

Wez,
i keep forgetting to ask you to add a standard stream copy function
(perhaps using a configurable buffer). that way, i can write me a simple
streamer by fopening my favorite MP3 and copying it to a socket g


Wez Furlong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Any objections to stream enabling the php_copy_file function;
 this will allow copying to/from anything that can be accessed
 by the stream fopen wrappers?

 --Wez.




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




Re: [PHP-DEV] Re: php_copy_file

2002-03-15 Thread l0t3k


 Howzat?
you da man ! i owe you a beer if ever we meet..


Wez Furlong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Well, we have this:

 php_stream_copy_to_stream(srcstream, deststream, maxlen)

 that does that kind of thing :-)
 If maxlen is 0 it copies until EOF.
 It has some sense to use mmap when the source is a plain file too.

 Howzat?

 --Wez.


 On 16/03/02, l0t3k [EMAIL PROTECTED] wrote:
  Wez,
  i keep forgetting to ask you to add a standard stream copy
function
  (perhaps using a configurable buffer). that way, i can write me a simple
  streamer by fopening my favorite MP3 and copying it to a socket g
 
 
  Wez Furlong [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Any objections to stream enabling the php_copy_file function;
   this will allow copying to/from anything that can be accessed
   by the stream fopen wrappers?
  
   --Wez.
  
 
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php






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




[PHP-DEV] Re: freeing zvals

2002-03-06 Thread l0t3k

Klaus,
anything zval * put in a symboltable is automatically managed.

 Currently it looks to me, that I don't need to free zvals which I have
 exported to a symbol table, because PHP already frees the zval on module
 shutdown. Is that correct? Or do I need to remove the zval from the symbol
 table and then free the zval manually? How it is done correctly?

 --
 Bye, K http://www.ailis.de/~k/
 [A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
 (Finger [EMAIL PROTECTED] to get public key)



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




[PHP-DEV] Re: Get object name

2002-03-04 Thread l0t3k

you can do this only with a not-so nice hack. essentially you have to
manually search the active symbol table stack for a zval * which equals your
variable. zend_hash_find wont help you, since you're doing a reverse
lookup. so the process is something like (totally OTTOMH)

HashTable *table = EG(active_symbol_table);
char *name_im_looking_for = NULL;

while (table  !name_im_looking_for) {
if (name_im_looking_for = find_name(table, zval
*zval_ptr_im_looking_for)) break;
table = get_prev_symbol_table(); /* you're on your own here - i have
no idea how to do this*/
}


static char *find_name(HashTable * table, zval *zval_ptr_im_looking_for)
{
zval **entry;

 zend_hash_internal_pointer_reset(table);
 while (zend_hash_get_current_data( hash, (void**)entry) == SUCCESS) {
if (*entry = zval_ptr_im_looking_for) {
  char *string_key;
  ulong num_key, key_len;

  if (HASH_KEY_IS_STRING ==
zend_hash_get_current_key_ex(hash, string_key, key_len, num_key, 0,
NULL)) {
return string_key:
   }

 }
zend_hash_move_forward(hash);
}   /* while */
return NULL;
}

- Original Message -
From: Klaus Reimer [EMAIL PROTECTED]
Newsgroups: php.dev
To: [EMAIL PROTECTED]
Sent: Monday, March 04, 2002 3:11 PM
Subject: Get object name


 Hi,

 I need to acces the name of an object in a class method written in C. How
can
 I do this? Example:

 I have the following PHP code

   $Test=new CMyClass();
   $Test-print_obj_name();

 and I have the following print_obj_name()-method written in C:

   ZEND_NAMED_FUNCTION(cmyclass_print_obj_name) {
 zend_printf(%s\n,doSomethingMagic());
   }

 How can I do the doSomethingMagic() part so my method prints the object
name
 (Test)? I can access the CLASS name with

   getThis()-value.obj.ce-name

 but I need the variable name of the class instance (Test in this case).
How
 can I do this?

 --
 Bye, K http://www.ailis.de/~k/
 [A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
 (Finger [EMAIL PROTECTED] to get public key)
Klaus Reimer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 Hi,

 I need to acces the name of an object in a class method written in C. How
can
 I do this? Example:

 I have the following PHP code

   $Test=new CMyClass();
   $Test-print_obj_name();

 and I have the following print_obj_name()-method written in C:

   ZEND_NAMED_FUNCTION(cmyclass_print_obj_name) {
 zend_printf(%s\n,doSomethingMagic());
   }

 How can I do the doSomethingMagic() part so my method prints the object
name
 (Test)? I can access the CLASS name with

   getThis()-value.obj.ce-name

 but I need the variable name of the class instance (Test in this case).
How
 can I do this?

 --
 Bye, K http://www.ailis.de/~k/
 [A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
 (Finger [EMAIL PROTECTED] to get public key)



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




[PHP-DEV] CRC32

2002-02-20 Thread l0t3k

could someone with karma please move the CRC32 macro and crc table to a
header so it can be generally accessible to modules ?

id hate to duplicate it.



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




Re: [PHP-DEV] PHP Executable

2002-02-19 Thread l0t3k

RE: [PHP-DEV] PHP ExecutableBTW - with the current CVS version there's also
a CLI (command line interface) version, perfect for shell scripting and
such..

Ray Hunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Thanks, I will try that.  I am new to php and have a question:
What is the difference between cgi and sapi or the other ways to compile
php?
Ray Hunter
Firmware Engineer
ENTERASYS NETWORKS





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




[PHP-DEV] Re: Nuking issock - PHP Streams

2002-02-14 Thread l0t3k

Wez,
if you include your memory stream in the TODO list, i'd be mucho happy
... and i completely agree that the streams interface is the way to go in
PHP5..

Wez Furlong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All,


 I'd like to see streams enabled as the default option for PHP 5 :-)

 TODO: revisit fsock.c, make SSL aware version of socket streams,
 port http and any other url fopen wrappers to streams,
 ensure that all extensions that use File-Handles are streams aware (
 just the network aware extensions to do, IIRC),

 --Wez.





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




[PHP-DEV] Re: global HashTables

2002-02-14 Thread l0t3k

Brad,

[snip]
/* {{{ php_test_init_globals
 */
static void php_test_init_globals(zend_test_globals *test_globals)
{
 test_globals-global_hash = emalloc(sizeof(HashTable));
 zend_hash_init(test_globals-global_hash, 0, NULL, delete_friggin_type, 0);

 zend_hash_add(test_globals-global_hash, mykey, strlen(mykey),
myvalue, strlen(myvalue), NULL);
}
/* }}} */

[snip]

shouldnt module globals be malloc'ed as opposed to emalloc'ed.all
emalloced memory is automagically reclaimed at the end of a request.


Brad Lafountain [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sorry i forgot to attach the extension

 __
 Do You Yahoo!?
 Send FREE Valentine eCards with Yahoo! Greetings!
 http://greetings.yahoo.com



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




Re: [PHP-DEV] Re: global HashTables

2002-02-14 Thread l0t3k

Brad,

 Techincally i don't need to call efree() cause it will do it for me??
 now that i know that i can be lazy with all of my emallocs :)

technically, probably... but to me its always good form to match allocations
with deallocations.




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




Re: [PHP-DEV] PHP 4.2.0 / PHP 5.0.0-alpha

2002-02-04 Thread l0t3k


Andi Gutmans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

However, I
 really want to get the object overloading stuff into the Zend Engine 2
 before this happens (hopefully this week). It pretty much abstracts all
 object manipulation making it possible to write some cool object
 overloading extensions.

this is _sweet_. i have something nice in the works that needs this badly
(im currently misappropriating andrei's overload code as a stop-gap
measure.)




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




[PHP-DEV] [PHP-Dev] semi-advanced question re timers

2002-01-30 Thread l0t3k

im writing an extension that manages a set of persistent resources. to be
resource friendly, i want to do garbage collection on resources that have
been idle for a configurable period of time. id really prefer not to use
cron  such, since the extension should be just plun-n-play.
  in the course of investigation i came across the timeout code in
zend_execute_api.c, and im wondering if its safe to use a similar method in
my extension to harvest stale resources.

l0t3k



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: Bug #15095: use of references in arguments with defaults

2002-01-18 Thread l0t3k

i think it was recently added to the Zend cvs for ZE2. in other words, its
likely to be in PHP5


[EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 From: [EMAIL PROTECTED]
 Operating system: linux
 PHP version:  4.1.1
 PHP Bug Type: Feature/Change Request
 Bug description:  use of references in arguments with defaults

 I would like to be able to define a function with a
 referenced argument as well as give it a default value.

 function foo($bar = NULL) {}

 So, what will it reference, you ask? Nothing. I just want
 the argument to be optional, but to reference if there is
 an argument supplied. So, it's less of a default that's
 needed for references, more the ability to have the
 argument be optional.

 This would make me so happy.

 --
 Edit bug report at: http://bugs.php.net/?id=15095edit=1




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Preview of PHP 5

2002-01-18 Thread l0t3k

Jan Lehnardt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 On Fri, 18 Jan 2002 18:18:26 +0200 (IST)
 Andi Gutmans [EMAIL PROTECTED] wrote:

  I agree. I think alpha is better.
 what about pre-alpha to make things re-al-ly clear?

 Jan

++1;




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] [Php-Dev] One Bug Down..

2002-01-04 Thread l0t3k

i can reliably report that Bug #4769 can be expired (the author made the
appropriate changes in the code itself).







-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] multiple inheritance ext

2001-12-08 Thread l0t3k

asbestos_suit
if you need a name, use bless() for perl consistency
/asbestos_suit

Be careful with the function names, as bind() is already being used by the
sockets extension. See:

http://www.php.net/manual/en/function.bind.php

 I believe the new sockets extension names it socket_bind(), but anyway..






-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: HOW2 on making C++ extensions in 4.1.0 (and 4.0.6?)

2001-12-04 Thread l0t3k

Lars,
check out ext/satellite, and also the author's site. he has an
upcoming? framework for producing PHP extensions in C++

Lars Knudsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone have some (WORKING!) howto's on using C++ in extensions.  I've
 tried for a couple of days now, and it's starting to bug me ;-)
 Why isn't there a C++ extension/demo in the package?

 - Lars Knudsen
 Developer (well... having 2nd thoughts now ;-) )





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Zend Hash Question

2001-12-04 Thread l0t3k

something that has confused me for a second is the use of HashTables to
store a user defined type. the constructor is fine, its just insertion and
querying that's mildly confusing. for instance, it seems as if
zend_hash_add takes sizeof(struct) as an argument as opposed to
sizeof(struct *) when i assume that generally we only store pointers in the
hash.

suppose i have a struct of type widget_t which gets allocated on the heap.
what's the general practice of inserting and retrieving widget from the hash
table ?



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP Manual

2001-11-30 Thread l0t3k

i just downloaded the Windows PHP manual, and all i can say is

-- DAMN --

are you sure no one gets paid to do this G ???

kudos to the doc team for what has to be the finest user docs in open
source.

l0t3k



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Class Struggle

2001-11-27 Thread l0t3k


im having a tough time getting PHP to execute a method of a function defined
in an extension. the extension compiles fine, shows up in phpinfo(), and
calling get_declared_classes() returns the class names as expected.

in addition, calling get_class_methods(class_name) lists the method im
interested in calling. the error i get is

Fatal error: Call to undefined function:  bar() in
C:\Inetpub\wwwroot\php\fubar.php on line 26

the function call is static, e.g   $barbara = foo::bar($baz)

i was able to track the message to zend_execute.c in the switch tag to
handle ZEND_INIT_FCALL_BY_NAME.

im stumped as to why get_class_methods can find the function but zend can't.

do i get to wear the dunce cap, or should i file a bug report ?

BTW
php-4.07 dev CGI , PWS 4.0, WinMe






-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Class Struggle

2001-11-27 Thread l0t3k

Andrei,
  i tried your suggestion, and it promptly crashed PHP, so i think you're
onto something g

anyone have some PHP  debugging tips for MSVC++. i want to be able to step
through my extension code when a request is executed?

thanks

- Original Message -
From: Andrei Zmievski [EMAIL PROTECTED]
Newsgroups: php.dev
To: l0t3k [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, November 27, 2001 9:21 AM
Subject: Re: [PHP-DEV] Class Struggle



 Did you name all your classes and methods as lowercase ones when
 declaring them?

 -Andrei





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: PHP 4.1.0RC2 - can we roll?

2001-11-12 Thread l0t3k

Make it so, Number One !! g

damn, ive wanted to say that for a while...


Zeev Suraski [EMAIL PROTECTED] wrote in message
5.1.0.14.2.2003012523.05456108@localhost">news:5.1.0.14.2.2003012523.05456108@localhost...
 I'm going to roll PHP 4.1.0RC2 in an hour if nobody shouts.

 Zeev




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: Bug #13700: Database Abstraction API

2001-10-29 Thread l0t3k

Manuel,
  part of the effort to write an abstraction layer is to factor out common
code and patterns and move this into a common base so that higher level
development becomes easier. a good example of this is persistent connections
handling, which is handled almost identically in all the db extensions.
another example is code implementing the different varieties of fetching
(fetch_array et al).
At the PHP level there are common patterns of use which may be aided by
support at lower levels. bulk fetches and resultset iteration to construct
markup and resultset caching are examples. in addition there are features
which when implemented at a core level, creates value which is automatically
available to users of each backend. while they can be implemented in PHP
itself, but make better sense as core functionality from a performance
standpoint. also, there is functionality not covered by the existing APIs,
hence unavailable totally to PHP ( eg fetching multiple resultsets from the
same query ).

  in other words, i dont see the development of an abstraction layer in C
and PHP as competing propositions. the C layer just allows PHP developers to
be more productive and focus on higher levels of application development.
the current PHP abstractions fill the need not only of functionality, but of
code/work style and aesthetic preference. that need will persist whatever
happens at engine level.

One of the biggest pluses of PHP is that implementation of new
functionality is magnitudes faster than in C. if a necessary feature is
needed, we dont have to depend on the release cycle of PHP to have it
included in a distribution. things in this business happens too quickly. and
on a personal/ideological level, many of the features included in Metabase
belong at the engine level (not that theyre not necessary). for instance, i
think anything touching automatic schema modification or generation should
absolutely be in user-space. use of PHP or standard extensions should not
automatically impose a methodology on a user. i like the work you did with
Metabase and think that the work being done on a new extension will make
your work easier by being able to focus more on portability issues, which is
Metabase's strength (imo) and which should be dealt with in PHP.


l0t3k






Manuel Lemos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hello,

 Markus Fischer wrote:
 
  On Sat, Oct 27, 2001 at 12:29:48PM -0200, Manuel Lemos wrote :
   I am afraid that will never happen.
 
  A project for db abstraction as an extension is already in the
  works. History discussions about it can be found on pear-dev
  archiv.

 What I meant that it would never happen is the adoption of an existing
 database abstraction package.



 Regards,
 Manuel Lemos



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] mysql prepared statements

2001-10-26 Thread l0t3k

im working on this. contact me via email if you'd like to help...

Andrew Watson [EMAIL PROTECTED] wrote in message
5.1.0.14.0.20011026220832.00a20c40@pop-server">news:5.1.0.14.0.20011026220832.00a20c40@pop-server...

 for example in PERL DBD::mysql you can prepare statements like so:

 $sql = update user_list set first_name = ? where id = ?
 $han = $dbh-prepare($sql);

 $han-execute('andrew',1);
 $han-execute('bill',2);
 

 this is a very useful thing that's implemented in a lot of different
 languages (PERL, Java... )and i thought people might get a lot of use out
 of it in php...
 it abstracts the details of escaping strings, enclosing them in single
 quotes, and type checking from the developer to make things easier.  it
 also speeds up execution in some circumstances.





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] expat and Namespaces

2001-10-24 Thread l0t3k

Does the bundled expat handle namespaces ?

l0t3k



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] For Wez : Stream Abstraction over a String

2001-10-23 Thread l0t3k

Andrei,

 Perhaps I'm missing something, but can you explain how this is better
 than what we have now?
the power of abstraction g

i'll give you an example of why i want it. im working on resultset caching
in a DB astraction layer, and im giving the user the option of saving to XML
or a more compact format. i'd like to give the user options as to how and
where the data is stored. if the user has file system access and wants to do
it that way, then fine. if however, they want to use the session mechanism
and stick it into a zval string, then its gravy. the point is to allow for
flexibility.
   in any case, its a pain to have to write two sets of code to write to a
'proper' stream (file or sockets) , and to write another set of routines to
store to a string. with a unified approach, you get the flexibility you need
all for free.

l0t3k

Andrei Zmievski [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tue, 23 Oct 2001, Wez Furlong wrote:
  Yep, or something like it.
 




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] For Wez : Stream Abstraction over a String

2001-10-22 Thread l0t3k

Wez,
  im not sure if you had planned to do so, but it would be ultra nice to
have a stream implemented over an expandable string (for instance wrapping
Sascha's smart-strings). its one of the niceties i like in Delphi - you can
do something like this :

InitialString := 'This is some data';
str := TStringStream.Create(InitialString);
str.Write(hello, sizeof('hello'));
fileStream := TFileStream.Create('license.txt',fmOpenRead);
str.CopyFrom( fileStream, fileStream.Size );
fileStream.free;
output := str.DataString;
writeln( output );

etc.

this would be helpful for an extension im working on. i'd rather have only
one 'logical' way of generating output, as opposed to having two separate
methods for files and strings.

l0t3k



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]