Re: [PHP-DEV] Environment variable solution to relative includes (will work for HTML too.)
There are better ways of doing this... snip What I always do, is using absolute paths ('/images/image3.png'), and in some init I define some constants that contain IMG_DIR, etc, so you can change it in one place. I wish I could do this but I'm designing a web site creation / management system with the ability to pull in files from anywhere as part of its templating engine. Your solution would work if it a site but I need the system to be as flexible as possible. I believe that the solution I proposed earlier: i.e., having an environment variable (eg. $PHP_CURRENT_INCLUDE or something) contain the path to the latest included file. That way the included page could decide how it wants to include other files *and* the variable could be used to link to elements (eg. images, etc.) in the same directory as the included file. Perhaps there could even be two variables (along the lines of $PHP_CURRENT_INCLUDE_PATH and $PHP_CURRENT_INCLUDE_URL), one the path to the include file and the other an absolute URL (e.g. the file could be included from another server). These two should cover anything that anyone might possibly want to do in an included file and offer complete flexibility without having to rewrite any functions. Should I submit this as a feature request? All my best, Aral :) __ ([EMAIL PROTECTED]) New Media Producer, Kismia, Inc. ([EMAIL PROTECTED]) Adj. Prof., American University ¯¯ __ ([EMAIL PROTECTED]) New Media Producer, Kismia, Inc. ([EMAIL PROTECTED]) Adj. Prof., American University ¯¯ -- 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] Preliminary patch for allowing relative includes
I don't have access to the PHP CVS at the moment (note to self: get a C compiler)... but I wanted to ask how this will affect (or will it?) HTML generated from within included PHP files. Eg. A is at web root and includes B in a subdirectory X. B generates HTML that calls for image C.gif in subdirectory X. Will src = C.gif work or will it still be src = X/C.gif or is this not affected at all? If it's not affected, is it possible to have an environment variable that contains the path to the subdirectory of the latest included file so that it can be accessed from within that file to refer to itself? I believe that this will be very useful for templating applications. Currently I've developed a templating solution that relies on regex to change all relative links (inc. those to images, embeded objects, etc. etc.) in included files to absolute ones but this is a rather convulted way of doing things. (I hope any of this makes sense!) Aral :) __ ([EMAIL PROTECTED]) New Media Producer, Kismia, Inc. ([EMAIL PROTECTED]) Adj. Prof., American University ¯¯ -- 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] Possible feature for current version of PHP or PHP 4.1/5.0.
If we choose to do it in Andi's way (no real drawbacks, considering it's downwards compatible for most practical purposes), we can do it within 4.0. This would be even better. To echo what Andrei said, the sooner the better :) I've personally been wishing for this for the longest time! Aral :) __ ([EMAIL PROTECTED]) New Media Producer, Kismia, Inc. ([EMAIL PROTECTED]) Adj. Prof., American University ¯¯ -- 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] Possible feature for current version of PHP or PHP 4.1/5.0.
How about #3 for 4.1 and #2 for 5.0? This would be wonderful! Aral :) __ ([EMAIL PROTECTED]) New Media Producer, Kismia, Inc. ([EMAIL PROTECTED]) Adj. Prof., American University ¯¯ -- 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] Possible feature for current version of PHP or PHP 4.1/5.0.
Does others also think it should wait for 4.1 or later? I for one would love to see it in 4.1 -- IMVHO This would be a very important feature and a great improvement! Aral :) __ ([EMAIL PROTECTED]) New Media Producer, Kismia, Inc. ([EMAIL PROTECTED]) Adj. Prof., American University ¯¯ -- 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] Bug #11826 Updated: Custom sessions handler using Metabase calls crashes Apache
ID: 11826 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Reproducible crash Operating System: WinMe, Linux PHP Version: 4.0.4 Assigned To: New Comment: It's interesting that in the last week this bug report has not gotten a single reply. It is an easily reproducable bug that Manuel Lemos (author of the Metabase database abstraction layer) believes is a problem with PHP. He has assured me that the problem is not with Metabase so, accordingly: There must be a bug with custom session handlers called using session_set_save_handler (on_session_start, on_session_end, on_session_read, on_session_write, on_session_destroy, on_session_gc); that is making it crash when Metabase calls are used in the start/end/read/write etc. functions. As Metabase is one of the best solutions out there for database abstraction with PHP (are there any others that allow database schema in XML and the range of type conversion options, etc? Or are as well documented?) I believe that this bug at least deserves a reply from the developer community. (Even if it is along the lines of: 'We don't care, fix it yourself' just so I know!) I have included a link to all code necessary to reproduce the crash in my original bug report and I've streamlined the code so that only logic necessary for the bug to be seen is present. Previous Comments: [] [2001-07-01 16:35:37] [EMAIL PROTECTED] This error has been reproduced on WinMe running Apache 1.3.19, PHP 4.04, MySQL 3.23.37 and Linux running Apache 1.3.12, PHP 4.0.3pl1, MySQL 3.23.6. When a custom session handler is set up that points to functions that use Manuel Lemos' Metabase database abstraction library to save session information in a database, Apace crashes randomly. When it does not crash, the code works as it is supposed to. For code necessary to recreate problem please download this file: http://www.aralbalkan.com/php_sessions_bug/metabase_sessions.zip It includes all necessary code (including the database schema, database schema installation script, the Metabase custom session handler functions and two small test scripts that use these to increment a variable. After you have installed the database schema (metatest1-schema-install.php) and entered the settings for you database in db_init.php please run nabsession_test.php and click on the link for the second page and try reloading. Randomly, your web server will crash. When it doesn't crash, the registered session variable will update correctly. Please don't hesitate to contact me if you need any further information. Manuel Lemos, the author of Metabase is aware of the problem and believes that the problem is with the PHP custom session handler code. When the Metabase calls are replaced with direct calls to MySLQ (to ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11826edit=2 -- 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] Bug #11826: Custom sessions handler using Metabase calls crashes Apache
From: [EMAIL PROTECTED] Operating system: WinMe, Linux PHP version: 4.0.4 PHP Bug Type: Reproducible crash Bug description: Custom sessions handler using Metabase calls crashes Apache This error has been reproduced on WinMe running Apache 1.3.19, PHP 4.04, MySQL 3.23.37 and Linux running Apache 1.3.12, PHP 4.0.3pl1, MySQL 3.23.6. When a custom session handler is set up that points to functions that use Manuel Lemos' Metabase database abstraction library to save session information in a database, Apace crashes randomly. When it does not crash, the code works as it is supposed to. For code necessary to recreate problem please download this file: http://www.aralbalkan.com/php_sessions_bug/metabase_sessions.zip It includes all necessary code (including the database schema, database schema installation script, the Metabase custom session handler functions and two small test scripts that use these to increment a variable. After you have installed the database schema (metatest1-schema-install.php) and entered the settings for you database in db_init.php please run nabsession_test.php and click on the link for the second page and try reloading. Randomly, your web server will crash. When it doesn't crash, the registered session variable will update correctly. Please don't hesitate to contact me if you need any further information. Manuel Lemos, the author of Metabase is aware of the problem and believes that the problem is with the PHP custom session handler code. When the Metabase calls are replaced with direct calls to MySLQ (to -- Edit Bug report at: http://bugs.php.net/?id=11826edit=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]