My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Older

  • Nov 10, 2009
    issue 17 (PHP problems with SL 10.6.2) commented on by p...@hillside.co.uk   -   Incidentally PHP expects you to set the timezone in php.ini - and so I don't think that Apple can really do that and retain world portability.
    Incidentally PHP expects you to set the timezone in php.ini - and so I don't think that Apple can really do that and retain world portability.
  • Nov 10, 2009
    issue 17 (PHP problems with SL 10.6.2) commented on by p...@hillside.co.uk   -   Here's my current date.php
    Here's my current date.php
  • Nov 10, 2009
    issue 17 (PHP problems with SL 10.6.2) commented on by p...@hillside.co.uk   -   I've been looking to see if there is a way of identifying the timezone from the system. It seems to be stored in a pllst - so if you replace the date_default_timezone_set('UTC') by this code, I think it should generate local times for people. I've attempted to make this as safe as possible - but it probably should be tested on several machines to see if works - seems to work here of course: // Use the .GlobalPreferences file to obtain the system timezone // There is probably some official API that allows the read of // the property list - but it seems just as easy to use the // standard system command 'defaults' $defaultTimezone = 'UTC'; $handle = @popen("/usr/bin/defaults read /Library/Preferences/.GlobalPreferences com.apple.TimeZonePref.Last_Selected_City", "r"); if ($handle) { $buffer = ""; while (!feof($handle)) { $buffer .= fread($handle, 8192); } pclose($handle); // this ought to be something that looks like //( // "51.500000", // "-0.166656", // 11, // "Europe/London", // GB, // London, // England, // London, // England // ) // and we need line 5 // $parse = explode(",", $buffer); if (count($parse) > 4) { $tz = trim($parse[3]); if (preg_match('/"([^"]*)"/', $tz, $ma)) { $defaultTimezone = $ma[1]; } } } if (!date_default_timezone_set($defaultTimezone)) { date_default_timezone_set("UTC"); }
    I've been looking to see if there is a way of identifying the timezone from the system. It seems to be stored in a pllst - so if you replace the date_default_timezone_set('UTC') by this code, I think it should generate local times for people. I've attempted to make this as safe as possible - but it probably should be tested on several machines to see if works - seems to work here of course: // Use the .GlobalPreferences file to obtain the system timezone // There is probably some official API that allows the read of // the property list - but it seems just as easy to use the // standard system command 'defaults' $defaultTimezone = 'UTC'; $handle = @popen("/usr/bin/defaults read /Library/Preferences/.GlobalPreferences com.apple.TimeZonePref.Last_Selected_City", "r"); if ($handle) { $buffer = ""; while (!feof($handle)) { $buffer .= fread($handle, 8192); } pclose($handle); // this ought to be something that looks like //( // "51.500000", // "-0.166656", // 11, // "Europe/London", // GB, // London, // England, // London, // England // ) // and we need line 5 // $parse = explode(",", $buffer); if (count($parse) > 4) { $tz = trim($parse[3]); if (preg_match('/"([^"]*)"/', $tz, $ma)) { $defaultTimezone = $ma[1]; } } } if (!date_default_timezone_set($defaultTimezone)) { date_default_timezone_set("UTC"); }
  • Nov 10, 2009
    issue 16 (No updated version history for version 1.0.1) changed by segdeha   -   Oops. Thanks for letting me know about this.
    Status: Accepted
    Owner: segdeha
    Labels: Priority-Low Priority-Medium
    Oops. Thanks for letting me know about this.
    Status: Accepted
    Owner: segdeha
    Labels: Priority-Low Priority-Medium
  • Nov 10, 2009
    issue 15 (Widget never initializes on first launch on G4 systems) Status changed by segdeha   -   The workaround for users on G4 systems is to download version 0.9.6 of the widget (the last known one to work on G4s) from http://andrew.hedges.name/widgets/#phpfr
    Status: WontFix
    The workaround for users on G4 systems is to download version 0.9.6 of the widget (the last known one to work on G4s) from http://andrew.hedges.name/widgets/#phpfr
    Status: WontFix
  • Nov 10, 2009
    issue 17 (PHP problems with SL 10.6.2) changed by segdeha   -   Thanks for alerting me to this. I expect Apple will fix this issue in a future OS release, but I will add your patch to the date parsing script in the meantime.
    Status: Accepted
    Owner: segdeha
    Thanks for alerting me to this. I expect Apple will fix this issue in a future OS release, but I will add your patch to the date parsing script in the meantime.
    Status: Accepted
    Owner: segdeha
  • Nov 10, 2009
    issue 17 (PHP problems with SL 10.6.2) commented on by p...@hillside.co.uk   -   Hmm. Perhaps work arounds from the authors are not speedy. I am in the UK and adding: date_default_timezone_set('UTC'); after the ); which terminates the constants array in ..home/Library/Widgets/PHPfr.wdgt/Assets/php/date.php works for me. If you are in another timezone, then you can do this by hand. See below for context. I had sort of expected that date_default_timezone_set(date_default_timezone_get()); would work - but it didn't. The code needs to look at the system to get the timezone, if Apple isn't prepared to get php configured 'properly', it probably needs to use some posix type lookups to get the system time and set the timezone correctly. However, I suggest that you use the widget and lookup date_default_timezone_set to find the timezone for you - then the quick and dirty hack will also work. Here's the context for the code change - replace UTC by your timezone. Old code: 'DATE_W3C' => DATE_W3C ); if (!isset($argv[1]) || '' == $argv[1]) { $return = ' '; New code: 'DATE_W3C' => DATE_W3C ); date_default_timezone_set('UTC'); if (!isset($argv[1]) || '' == $argv[1]) { $return = ' ';
    Hmm. Perhaps work arounds from the authors are not speedy. I am in the UK and adding: date_default_timezone_set('UTC'); after the ); which terminates the constants array in ..home/Library/Widgets/PHPfr.wdgt/Assets/php/date.php works for me. If you are in another timezone, then you can do this by hand. See below for context. I had sort of expected that date_default_timezone_set(date_default_timezone_get()); would work - but it didn't. The code needs to look at the system to get the timezone, if Apple isn't prepared to get php configured 'properly', it probably needs to use some posix type lookups to get the system time and set the timezone correctly. However, I suggest that you use the widget and lookup date_default_timezone_set to find the timezone for you - then the quick and dirty hack will also work. Here's the context for the code change - replace UTC by your timezone. Old code: 'DATE_W3C' => DATE_W3C ); if (!isset($argv[1]) || '' == $argv[1]) { $return = ' '; New code: 'DATE_W3C' => DATE_W3C ); date_default_timezone_set('UTC'); if (!isset($argv[1]) || '' == $argv[1]) { $return = ' ';
  • Nov 10, 2009
    issue 17 (PHP problems with SL 10.6.2) reported by p...@hillside.co.uk   -   What steps will reproduce the problem? 1. Click on the little calendar icon 2. Enter 'Y' into the date selection box 3. See: Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead in /Users/pc/Library/Widgets/PHPfr.wdgt/Assets/php/date.php on line 26 2009 What is the expected output? 2009 What do you see instead? as above What version of the product are you using? 1.0.1 On what operating system? SL 10.6.2 Please provide any additional information below.
    What steps will reproduce the problem? 1. Click on the little calendar icon 2. Enter 'Y' into the date selection box 3. See: Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead in /Users/pc/Library/Widgets/PHPfr.wdgt/Assets/php/date.php on line 26 2009 What is the expected output? 2009 What do you see instead? as above What version of the product are you using? 1.0.1 On what operating system? SL 10.6.2 Please provide any additional information below.
  • Nov 02, 2009
    issue 16 (No updated version history for version 1.0.1) reported by j.r.schumacher   -   What steps will reproduce the problem? 1. Click "Version History" on home screen What is the expected output? What do you see instead? No version information is displayed for version 1.0.1 What version of the product are you using? On what operating system? 1.0.1
    What steps will reproduce the problem? 1. Click "Version History" on home screen What is the expected output? What do you see instead? No version information is displayed for version 1.0.1 What version of the product are you using? On what operating system? 1.0.1
  • Nov 26, 2008
    issue 15 (Widget never initializes on first launch on G4 systems) commented on by co...@burn-murdoch.com   -   I just had this same issue on a MacBook Pro running 10.5. I managed to fix it manually though. To fix at terminal: cd ~/Library/Widgets/PHPfr.wdgt/php_manual php ./first_run.php <run_command_output_by_above_command> killall Dock Done.
    I just had this same issue on a MacBook Pro running 10.5. I managed to fix it manually though. To fix at terminal: cd ~/Library/Widgets/PHPfr.wdgt/php_manual php ./first_run.php <run_command_output_by_above_command> killall Dock Done.
 
Hosted by Google Code