Re: [PHP] Object Function-call handling in PHP5
Thorsten Suckow-Homberg wrote: In your case the __toString() method would be valuable... Beware! This bugs are related to __toString() method: 31766 Open printf and __toString 34286 Assigned __toString() behavior is inconsistent -- Ondrej Ivanič ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object Function-call handling in PHP5
Dmitry committed a path for improved __toString() support. However, im not sure if it will be PHP6 only... I know about this patch. I think, it will be PHP6 only. -- Ondrej Ivanic ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_dir paths
Jochem Maas wrote: what does the following output: var_dump (getcwd()); I have better question: what does the following output: var_dump (realpath(getcwd())); var_dump (realpath('temp')); var_dump (realpath(/lists/admin/temp)); -- Ondrej Ivanic ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_dir paths
Mark Rees wrote: That outputs (paths trimmed) string(56) C:\...\htdocs\lists\admin string(61) C:\...\htdocs\lists\admin\temp bool(false) var_dump (realpath(../../lists/admin/temp)); this outputs the same as var_dump (realpath('temp')); I am trying to check whether /lists/admin/temp exists (which it does). This dir doesn't exists. The '/' at the beginning of path means: path is from root (unix) or from e.g. c:\ (windows) Outputs from var_dump(realpath(../../lists/admin/temp)) var_dump(realpath('temp')); are same and thus you working directory is 'C:\...\htdocs\lists\admin'. If you need check existence of dir 'temp' in your current working directory you can try one of: is_dir('temp'); is_dir('./temp'); is_dir('C:\...\htdocs\lists\admin\temp'); IMHO every is_dir() return true. -- Ondrej Ivanč ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Intelligent session_destroy()
Ken Tozier wrote: I'm writing a bunch of scripts that will all use a common session and am a bit confused about when to manually destroy sessions and/or when php automatically destroys them for me. For example: If a user starts a session, leaves their computer on and goes home for the weekend, when they come back on Monday will their session still exist on the server? Could they pick right up where they left off? don't care and only sets session.gc_maxlifetime session.gc_divisor session.gc_probability to correct values. When you call session_start php sometimes runs garbage collector which remove old sessions. Probability is calculated by using gc_probability/gc_divisor e.g. 1/100 means there is a 1% chance that the GC process starts on each session_start(). If you set probability to 100% GC will run on every session_start(). This is good for testing but not for production environment (default value (1%) is enough). Sessions which is last modified (before php 4.2.? was used last access time) before current time minus gc_maxlifetime is a old session and will be deleted. -- Ondrej Ivanic ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php