freebeer-cvs Mailing List for The FreeBeer Project
Status: Alpha
Brought to you by:
rossta
You can subscribe to this list here.
2004 |
Jan
(1) |
Feb
|
Mar
(60) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(9) |
Sep
(48) |
Oct
(7) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ross S. <ro...@us...> - 2009-05-22 07:04:04
|
Update of /cvsroot/freebeer/CVSROOT In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18720 Added Files: passwd Log Message: added passwd file --- NEW FILE: passwd --- anonymous: |
From: Ross S. <ro...@us...> - 2009-05-22 06:59:50
|
Update of /cvsroot/freebeer/CVSROOT In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18118 Modified Files: avail Log Message: added anonymous user to avail Index: avail =================================================================== RCS file: /cvsroot/freebeer/CVSROOT/avail,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- avail 8 Mar 2004 04:33:03 -0000 1.1 +++ avail 22 May 2009 06:59:42 -0000 1.2 @@ -2,7 +2,7 @@ unavail -avail|rossta,ross +avail|rossta,anonymous # This file must end which a blank line. # Do not delete the following new line. |
From: Ross S. <ro...@us...> - 2005-04-07 23:37:06
|
Update of /cvsroot/freebeer/_freebeer/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26841 Modified Files: php.ini.php Log Message: Updated to PHP 5.0.4 Index: php.ini.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/bin/php.ini.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- php.ini.php 10 Sep 2004 03:14:26 -0000 1.4 +++ php.ini.php 7 Apr 2005 23:36:57 -0000 1.5 @@ -95,23 +95,23 @@ //exit; $excludes = array( + 'php_apd.dll' => 'Possibly buggy, research', + 'php_bcompiler.dll' => 'Possibly buggy, research', + 'php_blenc.dll' => 'PHP quits at startup', 'php_ifx.dll' => 'Requires external isqlt09a.dll', 'php_ingres.dll' => 'Requires external OIAPI.DLL', - 'php_notes.dll' => 'Requires external nNOTES.dll', - 'php_pspell.dll' => 'Requires external aspell-15.dll', - 'php_sybase_ct.dll' => 'Requires external libct.dll', - - 'php_snmp.dll' => 'Reports: Cannot find module (IP-..): At line 0 in (none)', - + 'php_maxdb.dll' => 'Requires external libSQLDBC_C.dll', 'php_netools.dll' => 'Requires external lcrzo.dll', + 'php_notes.dll' => 'Requires external nNOTES.dll', 'php_ntuser.dll' => 'Possibly buggy, research', + 'php_pdo_oci8.dll' => 'Invalid library', 'php_phpdoc.dll' => 'Possibly buggy, research', + 'php_pspell.dll' => 'Requires external aspell-15.dll', 'php_radius.dll' => 'Possibly buggy, research', + 'php_snmp.dll' => 'Reports: Cannot find module (IP-..): At line 0 in (none)', + 'php_sybase_ct.dll' => 'Requires external libct.dll', 'php_threads.dll' => 'Possibly buggy, research', 'php_tidy.dll' => 'Possibly buggy, research', - - 'php_apd.dll' => 'Possibly buggy, research', - 'php_bcompiler.dll' => 'Possibly buggy, research', // 'php_lzf.dll' => 'Appears ok', // 'php_oggvorbis.dll' => 'Appears ok', // 'php_sqlite.dll' => 'Appears ok', @@ -235,6 +235,9 @@ ), ); +$builtin['5.0.4'] = $builtin['5.0.0']; +$builtin['5.0.3'] = $builtin['5.0.0']; +$builtin['5.0.2'] = $builtin['5.0.0']; $builtin['5.0.1'] = $builtin['5.0.0']; $builtin['5.0.0b3'] = $builtin['5.0.0b2']; |
From: Ross S. <ro...@us...> - 2005-04-04 16:55:46
|
Update of /cvsroot/freebeer/_freebeer/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31633 Modified Files: _header.php Log Message: Index: _header.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/www/_header.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- _header.php 19 Mar 2004 07:59:08 -0000 1.4 +++ _header.php 4 Apr 2005 16:55:22 -0000 1.5 @@ -96,6 +96,8 @@ '_header.php', ); + $script_dir = dirname($_SERVER['SCRIPT_FILENAME']); + $hfiles = ''; foreach ($files as $file) { $bfile = basename($file); @@ -104,7 +106,15 @@ continue; } - $encfile = urlencode($file); + if (substr($file, 0, 1) != '/') { + $file = $script_dir . '/' . $file; + } + $rfile = realpath($file); + if (!$rfile) { + $bfile = "<blink><i>$bfile</i></blink>"; + } + $encfile = urlencode($rfile); + $hfiles .= sprintf("\n \n<a target='%s' href='%s/_source.php?file=%s'>%s</a>", $file, fbWeb::getWebRoot(), $encfile, $bfile); } @@ -112,7 +122,14 @@ foreach ($included_files as $file) { $bfile = basename($file); - $encfile = urlencode($file); + if (substr($file, 0, 1) != '/') { + $file = $script_dir . '/' . $file; + } + $rfile = realpath($file); + if (!$rfile) { + $bfile = "<blink><i>$bfile</i></blink>"; + } + $encfile = urlencode($rfile); $hfiles .= sprintf( "\n \n<a target='%s' href='%s/%s_source.php?file=%s'>%s</a>", $file, fbWeb::getWebRoot(), $path2, $encfile, $bfile); |
From: Ross S. <ro...@us...> - 2004-10-22 02:01:10
|
Update of /cvsroot/freebeer/_freebeer/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5098/lib Modified Files: Backport.php Log Message: Define STDIN if not defined (i.e., CLI version) Index: Backport.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/lib/Backport.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Backport.php 22 Oct 2004 01:58:28 -0000 1.5 +++ Backport.php 22 Oct 2004 02:00:59 -0000 1.6 @@ -20,12 +20,14 @@ dirname(dirname(__FILE__))); // CLI version doesn't define these -defined('STDIN') || define('STDIN', fopen('php://stdin', 'r')); -defined('STDOUT') || define('STDOUT', fopen('php://stdout', 'w')); -defined('STDERR') || define('STDERR', fopen('php://stderr', 'w')); -register_shutdown_function( - create_function('' , 'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;' ) -); +if (!defined('STDIN')) { + @define('STDIN', fopen('php://stdin', 'r')); + @define('STDOUT', fopen('php://stdout', 'w')); + @define('STDERR', fopen('php://stderr', 'w')); + register_shutdown_function( + create_function('' , '@fclose(STDIN); @fclose(STDOUT); @fclose(STDERR); return true;' ) + ); +} // 5.0.0b3 defined('E_STRICT') || define('E_STRICT', 2048); |
From: Ross S. <ro...@us...> - 2004-10-22 01:58:38
|
Update of /cvsroot/freebeer/_freebeer/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4616/etc Modified Files: freebeer.xml Log Message: Switched from mysqlt to mysql for the default DB connection Index: freebeer.xml =================================================================== RCS file: /cvsroot/freebeer/_freebeer/etc/freebeer.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- freebeer.xml 8 Mar 2004 07:17:44 -0000 1.2 +++ freebeer.xml 22 Oct 2004 01:58:27 -0000 1.3 @@ -11,11 +11,11 @@ --> <adodb> - <driver>mysqlt</driver> + <driver>mysql</driver> </adodb> <adodb_session> - <driver>mysqlt</driver> + <driver>mysql</driver> <host>localhost</host> <user>root</user> <password></password> @@ -32,6 +32,22 @@ <encryptionKey>Enter your own encryption key here</encryptionKey> --> </adodb_session> + + <adodb_mysql> + <host>localhost</host> + <user>root</user> + <password></password> + <database>test</database> + <!-- persist>1</persist --> + </adodb_mysql> + + <adodb_mysql_debug> + <host>localhost</host> + <user>root</user> + <password></password> + <database>test</database> + <!-- persist>1</persist --> + </adodb_mysql_debug> <adodb_mysqlt> <host>localhost</host> |
From: Ross S. <ro...@us...> - 2004-10-22 01:58:38
|
Update of /cvsroot/freebeer/_freebeer/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4616/tests Modified Files: Test_HMAC_Login.php index.php Log Message: Switched from mysqlt to mysql for the default DB connection Index: Test_HMAC_Login.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/tests/Test_HMAC_Login.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_HMAC_Login.php 8 Mar 2004 07:18:05 -0000 1.2 +++ Test_HMAC_Login.php 22 Oct 2004 01:58:28 -0000 1.3 @@ -26,7 +26,7 @@ $this->user = 'root'; $this->password = ''; $this->database = 'hmac_login'; - $this->driver = 'mysqlt'; + $this->driver = 'mysql'; } function tearDown() { Index: index.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/tests/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 8 Mar 2004 07:18:05 -0000 1.2 +++ index.php 22 Oct 2004 01:58:28 -0000 1.3 @@ -18,7 +18,7 @@ defined('FREEBEER_BASE') || define('FREEBEER_BASE', getenv('FREEBEER_BASE') ? getenv('FREEBEER_BASE') : dirname(dirname(__FILE__))); -if (phpversion() <= '5.0.0b3') { +if (phpversion() < '5.0.2') { include_once FREEBEER_BASE . '/lib/Backport.php'; // E_STRICT, fprintf, STDERR } |
From: Ross S. <ro...@us...> - 2004-10-22 01:58:37
|
Update of /cvsroot/freebeer/_freebeer/www/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4616/www/demo Modified Files: ADOdb.ADOdb.php ADOdb.adodb-session.php Hmac_Login.ADOdb.php adodb-session-demo.php Log Message: Switched from mysqlt to mysql for the default DB connection Index: ADOdb.adodb-session.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/www/demo/ADOdb.adodb-session.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ADOdb.adodb-session.php 8 Mar 2004 07:18:09 -0000 1.2 +++ ADOdb.adodb-session.php 22 Oct 2004 01:58:28 -0000 1.3 @@ -110,7 +110,7 @@ $defaults['oci805'] = $defaults['oracle']; $defaults['oci8po'] = $defaults['oracle']; -$driver = 'mysqlt'; +$driver = 'mysql'; extract($defaults[$driver]); Index: Hmac_Login.ADOdb.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/www/demo/Hmac_Login.ADOdb.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Hmac_Login.ADOdb.php 10 Sep 2004 02:34:32 -0000 1.3 +++ Hmac_Login.ADOdb.php 22 Oct 2004 01:58:28 -0000 1.4 @@ -25,7 +25,7 @@ $hmac_login = &new fbHMAC_Login_ADOdb(); /// \todo add as fields on from with a connect button -if (!$hmac_login->connect('localhost', 'root', '', 'hmac_login', 'mysqlt')) { +if (!$hmac_login->connect('localhost', 'root', '', 'hmac_login', 'mysql')) { echo $hmac_login->getLastError(); exit; } Index: adodb-session-demo.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/www/demo/adodb-session-demo.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- adodb-session-demo.php 14 Aug 2004 19:12:09 -0000 1.3 +++ adodb-session-demo.php 22 Oct 2004 01:58:28 -0000 1.4 @@ -214,7 +214,7 @@ $defaults['oci8po'] = $defaults['oracle']; $defaults['odbc_oracle'] = $defaults['oracle']; -$driver = 'mysqlt'; +$driver = 'mysql'; extract($defaults[$driver]); Index: ADOdb.ADOdb.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/www/demo/ADOdb.ADOdb.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ADOdb.ADOdb.php 8 Mar 2004 07:18:09 -0000 1.2 +++ ADOdb.ADOdb.php 22 Oct 2004 01:58:28 -0000 1.3 @@ -51,8 +51,9 @@ $defaults['oci8po'] = $defaults['oracle']; $defaults['mysqlt_debug'] = $defaults['mysql']; +$defaults['mysql_debug'] = $defaults['mysql']; -$driver = 'mysqlt'; +$driver = 'mysql; extract($defaults[$driver]); |
From: Ross S. <ro...@us...> - 2004-10-22 01:58:37
|
Update of /cvsroot/freebeer/_freebeer/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4616/lib Modified Files: Backport.php Log Message: Switched from mysqlt to mysql for the default DB connection Index: Backport.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/lib/Backport.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Backport.php 15 Mar 2004 08:42:14 -0000 1.4 +++ Backport.php 22 Oct 2004 01:58:28 -0000 1.5 @@ -19,6 +19,14 @@ defined('FREEBEER_BASE') || define('FREEBEER_BASE', getenv('FREEBEER_BASE') ? getenv('FREEBEER_BASE') : dirname(dirname(__FILE__))); +// CLI version doesn't define these +defined('STDIN') || define('STDIN', fopen('php://stdin', 'r')); +defined('STDOUT') || define('STDOUT', fopen('php://stdout', 'w')); +defined('STDERR') || define('STDERR', fopen('php://stderr', 'w')); +register_shutdown_function( + create_function('' , 'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;' ) +); + // 5.0.0b3 defined('E_STRICT') || define('E_STRICT', 2048); @@ -541,13 +549,6 @@ } } -defined('STDIN') || define('STDIN', fopen('php://stdin', 'r')); -defined('STDOUT') || define('STDOUT', fopen('php://stdout', 'w')); -defined('STDERR') || define('STDERR', fopen('php://stderr', 'w')); -register_shutdown_function( - create_function('' , 'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;' ) -); - // Generates a backtrace (PHP 4 >= 4.3.0) // array debug_backtrace ( void) |
From: Ross S. <ro...@us...> - 2004-10-20 01:55:54
|
Update of /cvsroot/freebeer/_freebeer/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1557/tests Modified Files: Test_Timer.php Log Message: Fixed sprintf issue in Timer class Index: Test_Timer.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/tests/Test_Timer.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Test_Timer.php 10 Sep 2004 03:14:27 -0000 1.4 +++ Test_Timer.php 20 Oct 2004 01:55:44 -0000 1.5 @@ -15,7 +15,6 @@ function _Test_Timer($name) { parent::__construct($name); - $this->_buggy_sprintf = version_compare(phpversion(), '4.3.8', '>='); // && version_compare(phpversion(), '5.0', '<'); } function setUp() { @@ -94,36 +93,24 @@ } function test_tostring_1() { - if ($this->_buggy_sprintf) { - trigger_error(sprintf('fbTimer::test_tostring_1() skipped as sprintf() is inconsistent in PHP %s', phpversion()), E_USER_WARNING); - } else { - $o = &new fbTimer(); - $expected = '0:00:00.0000000'; - $this->assertEquals($expected, $o->toString()); - $o->start(); - fbTimer::usleep(1000); - $this->assertTrue($expected !== $o->toString()); - } + $o = &new fbTimer(); + $expected = '0:00:00.0000000'; + $this->assertEquals($expected, $o->toString()); + $o->start(); + fbTimer::usleep(1000); + $this->assertTrue($expected !== $o->toString()); } function test_sprintf_2() { - if ($this->_buggy_sprintf) { - trigger_error(sprintf('fbTimer::test_sprintf_2() skipped as sprintf() is inconsistent in PHP %s', phpversion()), E_USER_WARNING); - } else { - $format = '%d:%02d:%02.3f'; - $expected = '0:00:000000.000'; - $this->assertEquals($expected, fbTimer::sprintf($format, 0)); - } + $format = '%d:%02d:%06.3f'; + $expected = '0:00:00.000'; + $this->assertEquals($expected, fbTimer::sprintf($format, 0)); } function test_sprintf_1() { - if ($this->_buggy_sprintf) { - trigger_error(sprintf('fbTimer::test_sprintf_1() skipped as sprintf() is inconsistent in PHP %s', phpversion()), E_USER_WARNING); - } else { - $format = '%d:%02d:%02.3f'; - $expected = '1:01:01.001'; - $this->assertEquals($expected, fbTimer::sprintf($format, 3661.001)); - } + $format = '%d:%02d:%06.3f'; + $expected = '1:01:01.001'; + $this->assertEquals($expected, fbTimer::sprintf($format, 3661.001)); } function test_usleep_1() { |
From: Ross S. <ro...@us...> - 2004-10-20 01:55:53
|
Update of /cvsroot/freebeer/_freebeer/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1557/lib Modified Files: Timer.php Log Message: Fixed sprintf issue in Timer class Index: Timer.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/lib/Timer.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Timer.php 9 Sep 2004 02:10:04 -0000 1.4 +++ Timer.php 20 Oct 2004 01:55:44 -0000 1.5 @@ -100,7 +100,7 @@ \return \c string */ function toString() { - return $this->sprintf('%d:%02d:%02.7f', $this->elapsed()); + return $this->sprintf('%d:%02d:%010.7f', $this->elapsed()); } /*! |
From: Ross S. <ro...@us...> - 2004-09-28 01:48:46
|
Update of /cvsroot/freebeer/_freebeer/www/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4142/demo Modified Files: lib.base64.php Log Message: Index: lib.base64.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/www/demo/lib.base64.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lib.base64.php 8 Mar 2004 07:18:09 -0000 1.2 +++ lib.base64.php 28 Sep 2004 01:48:29 -0000 1.3 @@ -22,7 +22,7 @@ } ?> -<script type="text/javascript" language="javascript1.2" src="/lib/Base64.js"> +<script type="text/javascript" language="javascript1.2" src="../lib/Base64.js"> </script> <script type="text/javascript" language="javascript1.2"> <!-- // <![CDATA[ |
From: Ross S. <ro...@us...> - 2004-09-28 01:47:37
|
Update of /cvsroot/freebeer/_freebeer/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3966 Modified Files: ISO639.php Locale.php Added Files: StrUtils.php Log Message: Misc. bug fixes Index: ISO639.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/lib/ISO639.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ISO639.php 10 Sep 2004 00:37:06 -0000 1.3 +++ ISO639.php 28 Sep 2004 01:47:26 -0000 1.4 @@ -17,6 +17,8 @@ include_once FREEBEER_BASE . '/lib/Backport.php'; // array_change_key_case } +require_once FREEBEER_BASE . '/lib/StrUtils.php'; // strtoupper + /*! \brief ISO 639 language code related functions \class fbISO639 @@ -295,7 +297,13 @@ } /// \todo make multibyte saavy - $name = strtoupper($name); + $name = fbString::strtoupper($name); +if (!isset($NAME_TO_ID_HASH_UC[$name])) { +print "<pre>"; +echo "name=$name\n"; +echo "NAME_TO_ID_HASH_UC="; +print_r($NAME_TO_ID_HASH_UC); +} return isset($NAME_TO_ID_HASH_UC[$name]) ? $NAME_TO_ID_HASH_UC[$name] : false; } @@ -308,7 +316,7 @@ function getLanguageName($id) { $ID_TO_NAME_HASH = &fbISO639::getIDToNameHash(); /// \todo make multibyte saavy - $id = strtoupper($id); + $id = fbString::strtoupper($id); return isset($ID_TO_NAME_HASH[$id]) ? $ID_TO_NAME_HASH[$id] : false; } @@ -321,7 +329,7 @@ function getLocalizedLanguageName($id) { $ID_TO_LOCALIZED_NAME_HASH = &fbISO639::getIDToLocalizedNameHash(); /// \todo make multibyte saavy - $id = strtoupper($id); + $id = fbString::strtoupper($id); return isset($ID_TO_LOCALIZED_NAME_HASH[$id]) ? $ID_TO_LOCALIZED_NAME_HASH[$id] : false; } Index: Locale.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/lib/Locale.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Locale.php 13 Aug 2004 19:39:59 -0000 1.3 +++ Locale.php 28 Sep 2004 01:47:26 -0000 1.4 @@ -21,6 +21,7 @@ require_once FREEBEER_BASE . '/lib/Debug.php'; require_once FREEBEER_BASE . '/lib/ISO639.php'; require_once FREEBEER_BASE . '/lib/ISO3166.php'; +require_once FREEBEER_BASE . '/lib/StrUtils.php'; if (preg_match('/^win/i', PHP_OS)) { include_once FREEBEER_BASE . '/lib/ISO639/Alpha3.php'; @@ -205,6 +206,7 @@ '1253' => 'ISO8859-1', /// \todo Determine correct charset for 1253 '1254' => 'ISO8859-9', '1257' => 'ISO8859-13', + '1252' => 'ISO885915', // I can't find this anywhere yet, but I think it's right ); if (is_null($locale)) { @@ -267,11 +269,11 @@ $language = $lang; } - $iso_locale = strtolower($language_id); + $iso_locale = fbString::strtolower($language_id); $country = fbISO3166::getCountryName($coun); if ($country) { - $country_id = strtoupper($coun); + $country_id = fbString::strtoupper($coun); } else { $country_id = fbISO3166::getCountryId($coun); if ($coun && !$country_id) { @@ -280,9 +282,10 @@ } } - $iso_locale .= '_' . strtoupper($country_id); + $iso_locale .= '_' . fbString::strtoupper($country_id); if ($charset) { + $charset = fbString::strtoupper($charset); if (isset($_codepage_to_charset_map[$charset])) { $codepage = $charset; $charset = $_codepage_to_charset_map[$charset]; @@ -302,11 +305,11 @@ return array( 'locale' => $iso_locale, - 'language_id' => strtoupper($language_id), + 'language_id' => fbString::strtoupper($language_id), 'language' => $language, - 'country_id' => strtoupper($country_id), + 'country_id' => fbString::strtoupper($country_id), 'country' => $country, - 'charset' => strtoupper($charset), + 'charset' => fbString::strtoupper($charset), 'codepage' => $codepage, ); } @@ -567,7 +570,7 @@ $language = fbISO639::getLanguageName($language_id); - $iso_locale = strtolower($language_id); + $iso_locale = fbString::strtolower($language_id); /// \todo Look up country_id using fbISO639_ISO3166_Map::getCountryID()? /// \todo default to ISO8559-1 charset? @@ -577,9 +580,9 @@ 'locale' => $iso_locale, 'language_id' => $language_id, 'language' => $language, - 'country_id' => '', // strtoupper($country_id), + 'country_id' => '', // fbString::strtoupper($country_id), 'country' => '', // $country, - 'charset' => '', // strtoupper($charset), + 'charset' => '', // fbString::strtoupper($charset), 'codepage' => '', // $codepage, ); } @@ -879,8 +882,8 @@ $underscore = strpos($language, '_'); if ($underscore !== false) { - $language = strtolower(substr($language, 0, $underscore)) . '_' . - strtoupper(substr($language, $underscore + 1)); + $language = fbString::strtolower(substr($language, 0, $underscore)) . '_' . + fbString::strtoupper(substr($language, $underscore + 1)); } $locales[] = $language; --- NEW FILE: StrUtils.php --- <?php // $CVSHeader: _freebeer/lib/System.php,v 1.2 2004/03/07 17:51:17 ross Exp $ // Copyright (c) 2002-2004, Ross Smith. All rights reserved. // Licensed under the BSD or LGPL License. See license.txt for details. /*! \file StrUtils.php \brief String related functions */ // defined('FREEBEER_BASE') || define('FREEBEER_BASE', getenv('FREEBEER_BASE') ? getenv('FREEBEER_BASE') : // dirname(dirname(__FILE__))); /*! \class fbString \brief String related functions \static */ class fbString { /*! \param $s \c string String to convert to upper case \return \c string Upper cased string \static */ function strtoupper($s) { static $lc = 'abcdefghijklmnopqrstuvwxyz'; static $uc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $l = strlen($s); for ($i = 0; $i < $l; ++$i) { $j = strpos($lc, $s{$i}); if ($j !== false) { $s{$i} = $uc{$j}; } } return $s; } /*! \param $s \c string String to convert to upper case \return \c string Lower cased string \static */ function strtolower($s) { static $lc = 'abcdefghijklmnopqrstuvwxyz'; static $uc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $l = strlen($s); for ($i = 0; $i < $l; ++$i) { $j = strpos($uc, $s{$i}); if ($j !== false) { $s{$i} = $lc{$j}; } } return $s; } } |
From: Ross S. <ro...@us...> - 2004-09-11 04:01:39
|
Update of /cvsroot/freebeer/_pear/data/Log In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24323/data/Log Log Message: Directory /cvsroot/freebeer/_pear/data/Log added to the repository |
From: Ross S. <ro...@us...> - 2004-09-11 02:07:06
|
Update of /cvsroot/freebeer/_pear/doc/XML_Parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24323/doc/XML_Parser Log Message: Directory /cvsroot/freebeer/_pear/doc/XML_Parser added to the repository |
From: Ross S. <ro...@us...> - 2004-09-10 21:36:49
|
Update of /cvsroot/freebeer/_pear/tests/Date/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24429/tests/Date/tests Added Files: bug967.php Log Message: Upgraded to latest pear --- NEW FILE: bug967.php --- <?php require_once 'Date.php'; $_DATE_TIMEZONE_DEFAULT = 'Pacific/Chatham'; $tz = Date_TimeZone::getDefault(); if ($tz->id!=$_DATE_TIMEZONE_DEFAULT && $tz->id!='Pacific/Chatham') { echo "setDefault Failed\n"; } Date_TimeZone::setDefault('CST'); $default = 'EST'; $tz = Date_TimeZone::getDefault(); if ($tz->id!=$_DATE_TIMEZONE_DEFAULT && $tz->id!='EST') { echo "setDefault Failed\n"; } ?> |
From: Ross S. <ro...@us...> - 2004-09-10 21:34:10
|
Update of /cvsroot/freebeer/_freebeer/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24041/tests Modified Files: Test_Timer.php Log Message: PHP 5.0.1 fixes Index: Test_Timer.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/tests/Test_Timer.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Test_Timer.php 8 Sep 2004 23:43:50 -0000 1.3 +++ Test_Timer.php 10 Sep 2004 03:14:27 -0000 1.4 @@ -11,15 +11,14 @@ class _Test_Timer extends fbTestCase { + var $_buggy_sprintf = null; + function _Test_Timer($name) { parent::__construct($name); + $this->_buggy_sprintf = version_compare(phpversion(), '4.3.8', '>='); // && version_compare(phpversion(), '5.0', '<'); } - var $_buggy_sprintf; - function setUp() { - $this->_buggy_sprintf = version_compare(phpversion(), '4.3.8', '>='); // && version_compare(phpversion(), '5.0', '<'); - } function tearDown() { @@ -96,7 +95,7 @@ function test_tostring_1() { if ($this->_buggy_sprintf) { - trigger_error(sprintf('test_tostring_1() skipped as sprintf is inconsistent in PHP %s', phpversion()), E_USER_WARNING); + trigger_error(sprintf('fbTimer::test_tostring_1() skipped as sprintf() is inconsistent in PHP %s', phpversion()), E_USER_WARNING); } else { $o = &new fbTimer(); $expected = '0:00:00.0000000'; @@ -109,7 +108,7 @@ function test_sprintf_2() { if ($this->_buggy_sprintf) { - trigger_error(sprintf('test_sprintf_2() skipped as sprintf is inconsistent in PHP %s', phpversion()), E_USER_WARNING); + trigger_error(sprintf('fbTimer::test_sprintf_2() skipped as sprintf() is inconsistent in PHP %s', phpversion()), E_USER_WARNING); } else { $format = '%d:%02d:%02.3f'; $expected = '0:00:000000.000'; @@ -119,7 +118,7 @@ function test_sprintf_1() { if ($this->_buggy_sprintf) { - trigger_error(sprintf('test_sprintf_1() skipped as sprintf is inconsistent in PHP %s', phpversion()), E_USER_WARNING); + trigger_error(sprintf('fbTimer::test_sprintf_1() skipped as sprintf() is inconsistent in PHP %s', phpversion()), E_USER_WARNING); } else { $format = '%d:%02d:%02.3f'; $expected = '1:01:01.001'; |
From: Ross S. <ro...@us...> - 2004-09-10 15:50:57
|
Update of /cvsroot/freebeer/_pear/XML/Parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24323/XML/Parser Log Message: Directory /cvsroot/freebeer/_pear/XML/Parser added to the repository |
From: Ross S. <ro...@us...> - 2004-09-10 05:12:22
|
Update of /cvsroot/freebeer/_pear/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24429/bin Added Files: pear.bat Log Message: Upgraded to latest pear --- NEW FILE: pear.bat --- @ECHO OFF REM ---------------------------------------------------------------------- REM PHP version 5 REM ---------------------------------------------------------------------- REM Copyright (c) 1997-2004 The PHP Group REM ---------------------------------------------------------------------- REM This source file is subject to version 3.0 of the PHP license, REM that is bundled with this package in the file LICENSE, and is REM available at through the world-wide-web at REM http://www.php.net/license/3_0.txt. REM If you did not receive a copy of the PHP license and are unable to REM obtain it through the world-wide-web, please send a note to REM li...@ph... so we can mail you a copy immediately. REM ---------------------------------------------------------------------- REM Authors: Alexander Merz (ale...@ph...) REM ---------------------------------------------------------------------- REM REM Last updated 3/13/2004 ($Id: pear.bat,v 1.1 2004/09/10 03:16:27 rossta Exp $ is not replaced if the file is binary) REM change this lines to match the paths of your system REM ------------------- @ECHO OFF :: Check PEAR global ENV, set them if they do not exist IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=S:\freebeer\bin\..\opt\pear" IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=S:\freebeer\bin\..\opt\pear\bin" IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\php\cli\php.exe" :: Check Folders and files IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2 IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR :: launch pearcmd GOTO RUN :PEAR_INSTALL_ERROR ECHO PHP_PEAR_INSTALL_DIR is not set correctly. ECHO Please fix it using your environment variable or modify ECHO the default value in pear.bat ECHO The current value is: ECHO %PHP_PEAR_INSTALL_DIR% GOTO END :PEAR_INSTALL_ERROR2 ECHO PHP_PEAR_INSTALL_DIR is not set correctly. ECHO pearcmd.php could not be found there. ECHO Please fix it using your environment variable or modify ECHO the default value in pear.bat ECHO The current value is: ECHO %PHP_PEAR_INSTALL_DIR% GOTO END :PEAR_BIN_ERROR ECHO PHP_PEAR_BIN_DIR is not set correctly. ECHO Please fix it using your environment variable or modify ECHO the default value in pear.bat ECHO The current value is: ECHO %PHP_PEAR_BIN_DIR% GOTO END :PEAR_PHPBIN_ERROR ECHO PHP_PEAR_PHP_BIN is not set correctly. ECHO Please fix it using your environment variable or modify ECHO the default value in pear.bat ECHO The current value is: ECHO %PHP_PEAR_PHP_BIN% GOTO END :RUN "%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d register_argc_argv=On -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9 :END @ECHO ON |
From: Ross S. <ro...@us...> - 2004-09-10 05:12:19
|
Update of /cvsroot/freebeer/_pear/PEAR In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24429/PEAR Added Files: ErrorStack.php Log Message: Upgraded to latest pear --- NEW FILE: ErrorStack.php --- <?php // // +----------------------------------------------------------------------+ // | PHP Version 5 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.php.net/license/3_0.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | li...@ph... so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Gregory Beaver <ce...@ph...> | // | | // +----------------------------------------------------------------------+ // // $Id: ErrorStack.php,v 1.1 2004/09/10 03:16:25 rossta Exp $ /** * Error Stack Implementation * * This is an incredibly simple implementation of a very complex error handling * facility. It contains the ability * to track multiple errors from multiple packages simultaneously. In addition, * it can track errors of many levels, save data along with the error, context * information such as the exact file, line number, class and function that * generated the error, and if necessary, it can raise a traditional PEAR_Error. * It has built-in support for PEAR::Log, to log errors as they occur * * Since version 0.2alpha, it is also possible to selectively ignore errors, * through the use of an error callback, see {@link pushCallback()} * * Since version 0.3alpha, it is possible to specify the exception class * returned from {@link push()} * @author Greg Beaver <ce...@ph...> * @version 0.6alpha * @package PEAR_ErrorStack * @category Debugging * @license http://www.php.net/license/3_0.txt PHP License v3.0 */ /** * Singleton storage * * Format: * <pre> * array( * 'package1' => PEAR_ErrorStack object, * 'package2' => PEAR_ErrorStack object, * ... * ) * </pre> * @access private * @global array $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] */ $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] = array(); /** * Global error callback (default) * * This is only used * @see PEAR_ErrorStack::setDefaultCallback() * @access private * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] */ $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] = false; /** * Global Log object (default) * * This is only used * @see PEAR_ErrorStack::setDefaultLogger() * @access private * @global array $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] */ $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = false; /**#@+ * One of four possible return values from the error Callback * @see PEAR_ErrorStack::_errorCallback() */ /** * If this is returned, then the error will be both pushed onto the stack * and logged. */ define('PEAR_ERRORSTACK_PUSHANDLOG', 1); /** * If this is returned, then the error will only be pushed onto the stack, * and not logged. */ define('PEAR_ERRORSTACK_PUSH', 2); /** * If this is returned, then the error will only be logged, but not pushed * onto the error stack. */ define('PEAR_ERRORSTACK_LOG', 3); /** * If this is returned, then the error is completely ignored. */ define('PEAR_ERRORSTACK_IGNORE', 4); /**#@-*/ /** * Error code for an attempt to instantiate a non-class as a PEAR_ErrorStack in * the singleton method. */ define('PEAR_ERRORSTACK_ERR_NONCLASS', 1); /** * Error code for an attempt to pass an object into {@link PEAR_ErrorStack::getMessage()} * that has no __toString() method */ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2); /** * Error Stack Implementation * * Usage: * <code> * // global error stack * $global_stack = &PEAR_ErrorStack::singleton('MyPackage'); * // local error stack * $local_stack = new PEAR_ErrorStack('MyPackage'); * </code> * @copyright 2004 Gregory Beaver * @package PEAR_ErrorStack * @license http://www.php.net/license/3_0.txt PHP License */ class PEAR_ErrorStack { /** * Errors are stored in the order that they are pushed on the stack. * @since 0.4alpha Errors are no longer organized by error level. * This renders pop() nearly unusable, and levels could be more easily * handled in a callback anyway * @var array * @access private */ var $_errors = array(); /** * Package name this error stack represents * @var string * @access protected */ var $_package; /** * Determines whether a PEAR_Error is thrown upon every error addition * @var boolean * @access private */ var $_compat = false; /** * If set to a valid callback, this will be used to generate the error * message from the error code, otherwise the message passed in will be * used * @var false|string|array * @access private */ var $_msgCallback = false; /** * If set to a valid callback, this will be used to generate the error * context for an error. For PHP-related errors, this will be a file * and line number as retrieved from debug_backtrace(), but can be * customized for other purposes. The error might actually be in a separate * configuration file, or in a database query. * @var false|string|array * @access protected */ var $_contextCallback = false; /** * If set to a valid callback, this will be called every time an error * is pushed onto the stack. The return value will be used to determine * whether to allow an error to be pushed or logged. * * The return value must be one an PEAR_ERRORSTACK_* constant * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @var false|string|array * @access protected */ var $_errorCallback = array(); /** * PEAR::Log object for logging errors * @var false|Log * @access protected */ var $_logger = false; /** * Class name to use for a PHP 5 exception that will be returned * @var string * @access protected */ var $_exceptionClass = 'Exception'; /** * Error messages - designed to be overridden * @var array * @abstract */ var $_errorMsgs = array(); /** * Set up a new error stack * * @param string $package name of the package this error stack represents * @param callback $msgCallback callback used for error message generation * @param callback $contextCallback callback used for context generation, * defaults to {@link getFileLine()} * @param boolean $throwPEAR_Error * @param string $exceptionClass exception class to instantiate if * in PHP 5 */ function PEAR_ErrorStack($package, $msgCallback = false, $contextCallback = false, $throwPEAR_Error = false, $exceptionClass = null) { $this->_package = $package; $this->setMessageCallback($msgCallback); $this->setContextCallback($contextCallback); $this->_compat = $throwPEAR_Error; // this allows child classes to simply redefine $this->_exceptionClass if (!is_null($exceptionClass)) { $this->_exceptionClass = $exceptionClass; } } /** * Return a single error stack for this package. * * Note that all parameters are ignored if the stack for package $package * has already been instantiated * @param string $package name of the package this error stack represents * @param callback $msgCallback callback used for error message generation * @param callback $contextCallback callback used for context generation, * defaults to {@link getFileLine()} * @param boolean $throwPEAR_Error * @param string $exceptionClass exception class to instantiate if * in PHP 5 * @param string $stackClass class to instantiate * @static * @return PEAR_ErrorStack */ function &singleton($package, $msgCallback = false, $contextCallback = false, $throwPEAR_Error = false, $exceptionClass = null, $stackClass = 'PEAR_ErrorStack') { if (isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; } if (!class_exists($stackClass)) { $trace = debug_backtrace(); PEAR_ErrorStack::staticPush('PEAR_ErrorStack', PEAR_ERRORSTACK_ERR_NONCLASS, 'exception', array('stackclass' => $stackClass), 'stack class "%stackclass%" is not a valid class name (should be like PEAR_ErrorStack)', false, $trace); } return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package] = &new $stackClass($package, $msgCallback, $contextCallback, $throwPEAR_Error, $exceptionClass); } /** * Internal error handler for PEAR_ErrorStack class * * Dies if the error is an exception (and would have died anyway) * @access private */ function _handleError($err) { if ($err['level'] == 'exception') { $message = $err['message']; if (isset($_SERVER['REQUEST_URI'])) { echo '<br />'; } else { echo "\n"; } var_dump($err['context']); die($message); } } /** * Set up a PEAR::Log object for all error stacks that don't have one * @param Log $log * @static */ function setDefaultLogger(&$log) { $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; } /** * Set up a PEAR::Log object for this error stack * @param Log $log */ function setLogger(&$log) { $this->_logger = &$log; } /** * Set an error code => error message mapping callback * * This method sets the callback that can be used to generate error * messages for any instance * @param array|string Callback function/method */ function setMessageCallback($msgCallback) { if (!$msgCallback) { $this->_msgCallback = array(&$this, 'getErrorMessage'); } else { if (is_callable($msgCallback)) { $this->_msgCallback = $msgCallback; } } } /** * Get an error code => error message mapping callback * * This method returns the current callback that can be used to generate error * messages * @return array|string|false Callback function/method or false if none */ function getMessageCallback() { return $this->_msgCallback; } /** * Sets a default callback to be used by all error stacks * * This method sets the callback that can be used to generate error * messages for a singleton * @param array|string Callback function/method * @static */ function setDefaultCallback($callback = false) { if (!is_callable($callback)) { $callback = false; } $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] = $callback; } /** * Set an error code => error message mapping callback * * This method sets the callback that can be used to generate error * messages for any PEAR_ErrorStack instance * @param array|string Callback function/method */ function setContextCallback($contextCallback) { if (!$contextCallback) { $this->_contextCallback = array(&$this, 'getFileLine'); } else { if (is_callable($contextCallback)) { $this->_contextCallback = $contextCallback; } } } /** * Set an error Callback * If set to a valid callback, this will be called every time an error * is pushed onto the stack. The return value will be used to determine * whether to allow an error to be pushed or logged. * * The return value must be one of the ERRORSTACK_* constants. * * This functionality can be used to emulate PEAR's pushErrorHandling, and * the PEAR_ERROR_CALLBACK mode, without affecting the integrity of * the error stack or logging * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @see popCallback() * @param string|array $cb */ function pushCallback($cb) { array_push($this->_errorCallback, $cb); } /** * Remove a callback from the error callback stack * @see pushCallback() * @return array|string|false */ function popCallback() { if (!count($this->_errorCallback)) { return false; } return array_pop($this->_errorCallback); } /** * Set an error Callback for every package error stack * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @see staticPopCallback(), pushCallback() * @param string|array $cb * @static */ function staticPushCallback($cb) { foreach($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $unused) { $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->pushCallback($cb); } } /** * Remove a callback from every error callback stack * @see staticPushCallback() * @return array|string|false * @static */ function staticPopCallback() { foreach($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $unused) { $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->popCallback(); } } /** * Add an error to the stack * * If the message generator exists, it is called with 2 parameters. * - the current Error Stack object * - an array that is in the same format as an error. Available indices * are 'code', 'package', 'time', 'params', 'level', and 'context' * * Next, if the error should contain context information, this is * handled by the context grabbing method. * Finally, the error is pushed onto the proper error stack * @param int $code Package-specific error code * @param string $level Error level. This is NOT spell-checked * @param array $params associative array of error parameters * @param string $msg Error message, or a portion of it if the message * is to be generated * @param array $repackage If this error re-packages an error pushed by * another package, place the array returned from * {@link pop()} in this parameter * @param array $backtrace Protected parameter: use this to pass in the * {@link debug_backtrace()} that should be used * to find error context * @return PEAR_Error|array|Exception * if compatibility mode is on, a PEAR_Error is also * thrown. If the class Exception exists, then one * is returned to allow code like: * <code> * throw ($stack->push(MY_ERROR_CODE, 'error', array('username' => 'grob'))); * </code> * * The errorData property of the exception class will be set to the array * that would normally be returned. If a PEAR_Error is returned, the userinfo * property is set to the array * * Otherwise, an array is returned in this format: * <code> * array( * 'code' => $code, * 'params' => $params, * 'package' => $this->_package, * 'level' => $level, * 'time' => time(), * 'context' => $context, * 'message' => $msg, * //['repackage' => $err] repackaged error array * ); * </code> */ function push($code, $level = 'error', $params = array(), $msg = false, $repackage = false, $backtrace = false) { $context = false; // grab error context if ($this->_contextCallback) { if (!$backtrace) { $backtrace = debug_backtrace(); } $context = call_user_func($this->_contextCallback, $code, $params, $backtrace); } // save error $time = explode(' ', microtime()); $time = $time[1] + $time[0]; $err = array( 'code' => $code, 'params' => $params, 'package' => $this->_package, 'level' => $level, 'time' => $time, 'context' => $context, 'message' => $msg, ); // set up the error message, if necessary if ($this->_msgCallback) { $msg = call_user_func_array($this->_msgCallback, array(&$this, $err)); $err['message'] = $msg; } if ($repackage) { $err['repackage'] = $repackage; } $push = $log = true; $callback = $this->popCallback(); if (is_callable($callback)) { $this->pushCallback($callback); switch(call_user_func($callback, $err)){ case PEAR_ERRORSTACK_IGNORE: return $err; break; case PEAR_ERRORSTACK_PUSH: $log = false; break; case PEAR_ERRORSTACK_LOG: $push = false; break; // anything else returned has the same effect as pushandlog } } elseif (is_callable($GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'])) { switch(call_user_func($GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'], $err)){ case PEAR_ERRORSTACK_IGNORE: return $err; break; case PEAR_ERRORSTACK_PUSH: $log = false; break; case PEAR_ERRORSTACK_LOG: $push = false; break; // anything else returned has the same effect as pushandlog } } if ($push) { array_unshift($this->_errors, $err); } if ($log) { if ($this->_logger || $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER']) { $this->_log($err); } } if ($this->_compat && $push) { return $this->raiseError($msg, $code, null, null, $err); } if (class_exists($this->_exceptionClass)) { $exception = $this->_exceptionClass; $ret = new $exception($msg, $code); $ret->errorData = $err; } return $err; } /** * Static version of {@link push()} * * @param string $package Package name this error belongs to * @param int $code Package-specific error code * @param string $level Error level. This is NOT spell-checked * @param array $params associative array of error parameters * @param string $msg Error message, or a portion of it if the message * is to be generated * @param array $repackage If this error re-packages an error pushed by * another package, place the array returned from * {@link pop()} in this parameter * @param array $backtrace Protected parameter: use this to pass in the * {@link debug_backtrace()} that should be used * to find error context * @return PEAR_Error|null|Exception * if compatibility mode is on, a PEAR_Error is also * thrown. If the class Exception exists, then one * is returned to allow code like: * <code> * throw ($stack->push(MY_ERROR_CODE, 'error', array('username' => 'grob'))); * </code> * @static */ function staticPush($package, $code, $level = 'error', $params = array(), $msg = false, $repackage = false, $backtrace = false) { $s = &PEAR_ErrorStack::singleton($package); if ($s->_contextCallback) { if (!$backtrace) { $backtrace = debug_backtrace(); } } return $s->push($code, $level, $params, $msg, $repackage, $backtrace); } /** * Log an error using PEAR::Log * @param array $err Error array * @param array $levels Error level => Log constant map * @access protected */ function _log($err, $levels = array( 'exception' => PEAR_LOG_CRIT, 'alert' => PEAR_LOG_ALERT, 'critical' => PEAR_LOG_CRIT, 'error' => PEAR_LOG_ERR, 'warning' => PEAR_LOG_WARNING, 'notice' => PEAR_LOG_NOTICE, 'info' => PEAR_LOG_INFO, 'debug' => PEAR_LOG_DEBUG)) { if (isset($levels[$err['level']])) { $level = $levels[$err['level']]; } else { $level = PEAR_LOG_INFO; } if ($this->_logger) { $this->_logger->log($err['message'], $level, $err); } else { $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER']->log($err['message'], $level, $err); } } /** * Pop an error off of the error stack * * @return false|array * @since 0.4alpha it is no longer possible to specify a specific error * level to return - the last error pushed will be returned, instead */ function pop() { return @array_shift($this->_errors); } /** * Determine whether there are any errors on the stack * @return boolean */ function hasErrors() { return count($this->_errors); } /** * Retrieve all errors since last purge * * @param boolean $purge set in order to empty the error stack * @return array */ function getErrors($purge = false) { if (!$purge) { return $this->_errors; } $ret = $this->_errors; $this->_errors = array(); return $ret; } /** * Determine whether there are any errors on any error stack * @return boolean * @static */ function staticHasErrors() { foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) { if ($obj->hasErrors()) { return true; } } return false; } /** * Get a list of all errors since last purge, organized by package * @param boolean $clearStack Set to purge the error stack of existing errors * @param boolean $merge Set to return a flat array, not organized by package * @param array $sortfunc Function used to sort a merged array - default * sorts by time, and should be good for most cases * @static * @return array */ function staticGetErrors($purge = false, $merge = false, $sortfunc = array('PEAR_ErrorStack', '_sortErrors')) { $ret = array(); if (!is_callable($sortfunc)) { $sortfunc = array('PEAR_ErrorStack', '_sortErrors'); } foreach ($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'] as $package => $obj) { $test = $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]->getErrors($purge); if ($test) { if ($merge) { $ret = array_merge($ret, $test); } else { $ret[$package] = $test; } } } if ($merge) { usort($ret, $sortfunc); } return $ret; } /** * Error sorting function, sorts by time * @access private */ function _sortErrors($a, $b) { if ($a['time'] == $b['time']) { return 0; } if ($a['time'] < $b['time']) { return 1; } return -1; } /** * Standard file/line number/function/class context callback * * This function uses a backtrace generated from {@link debug_backtrace()} * and so will not work at all in PHP < 4.3.0. The frame should * reference the frame that contains the source of the error. * @return array|false either array('file' => file, 'line' => line, * 'function' => function name, 'class' => class name) or * if this doesn't work, then false * @param array Results of debug_backtrace() * @param unused * @param integer backtrace frame. * @static */ function getFileLine($code, $params, $backtrace = null) { if ($backtrace === null) { return false; } $frame = 0; $functionframe = 1; if (!isset($backtrace[1])) { $functionframe = 0; } else { while (isset($backtrace[$functionframe]['function']) && $backtrace[$functionframe]['function'] == 'eval' && isset($backtrace[$functionframe + 1])) { $functionframe++; } } if (isset($backtrace[$frame])) { if (!isset($backtrace[$frame]['file'])) { $frame++; } $funcbacktrace = $backtrace[$functionframe]; $filebacktrace = $backtrace[$frame]; $ret = array('file' => $filebacktrace['file'], 'line' => $filebacktrace['line']); // rearrange for eval'd code or create function errors if (strpos($filebacktrace['file'], '(') && preg_match(';^(.*?)\((\d+)\) : (.*?)$;', $filebacktrace['file'], $matches)) { $ret['file'] = $matches[1]; $ret['line'] = $matches[2] + 0; } if (isset($funcbacktrace['function']) && isset($backtrace[1])) { if ($funcbacktrace['function'] != 'eval') { if ($funcbacktrace['function'] == '__lambda_func') { $ret['function'] = 'create_function() code'; } else { $ret['function'] = $funcbacktrace['function']; } } } if (isset($funcbacktrace['class']) && isset($backtrace[1])) { $ret['class'] = $funcbacktrace['class']; } return $ret; } return false; } /** * Standard error message generation callback * * This method may also be called by a custom error message generator * to fill in template values from the params array, simply * set the third parameter to the error message template string to use * * The special variable %__msg% is reserved: use it only to specify * where a message passed in by the user should be placed in the template, * like so: * * Error message: %msg% - internal error * * If the message passed like so: * * <code> * $stack->push(ERROR_CODE, 'error', array(), 'server error 500'); * </code> * * The returned error message will be "Error message: server error 500 - * internal error" * @param PEAR_ErrorStack * @param array * @param string|false Pre-generated error message template * @static * @return string */ function getErrorMessage(&$stack, $err, $template = false) { if ($template) { $mainmsg = $template; } else { $mainmsg = $stack->getErrorMessageTemplate($err['code']); } $mainmsg = str_replace('%__msg%', $err['message'], $mainmsg); if (count($err['params'])) { foreach ($err['params'] as $name => $val) { if (is_array($val)) { $val = implode(', ', $val); } if (is_object($val)) { if (method_exists($val, '__toString')) { $val = $val->__toString(); } else { PEAR_ErrorStack::staticPush('PEAR_ErrorStack', PEAR_ERRORSTACK_ERR_OBJTOSTRING, 'warning', array('obj' => get_class($val)), 'object %obj% passed into getErrorMessage, but has no __toString() method'); $val = 'Object'; } } $mainmsg = str_replace('%' . $name . '%', $val, $mainmsg); } } return $mainmsg; } /** * Standard Error Message Template generator from code * @return string */ function getErrorMessageTemplate($code) { if (!isset($this->_errorMsgs[$code])) { return '%__msg%'; } return $this->_errorMsgs[$code]; } /** * Set the Error Message Template array * * The array format must be: * <pre> * array(error code => 'message template',...) * </pre> * * Error message parameters passed into {@link push()} will be used as input * for the error message. If the template is 'message %foo% was %bar%', and the * parameters are array('foo' => 'one', 'bar' => 'six'), the error message returned will * be 'message one was six' * @return string */ function setErrorMessageTemplate($template) { $this->_errorMsgs = $template; } /** * emulate PEAR::raiseError() * * @return PEAR_Error */ function raiseError() { require_once 'PEAR.php'; $args = func_get_args(); return call_user_func_array(array('PEAR', 'raiseError'), $args); } } $stack = &PEAR_ErrorStack::singleton('PEAR_ErrorStack'); $stack->pushCallback(array('PEAR_ErrorStack', '_handleError')); ?> |
From: Ross S. <ro...@us...> - 2004-09-10 04:44:36
|
Update of /cvsroot/freebeer/_pear/tests/Log/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24429/tests/Log/tests Added Files: extract2.phpt sql_ident.phpt Log Message: Upgraded to latest pear --- NEW FILE: sql_ident.phpt --- --TEST-- Log: SQL setIdent() --FILE-- <?php require_once 'Log.php'; $ident = '12345678901234567890'; $logger = &Log::singleton('sql', 'log_table', $ident, array('dsn' => '')); echo $logger->getIdent() . "\n"; $logger->setIdent($ident); echo $logger->getIdent() . "\n"; --EXPECT-- 1234567890123456 1234567890123456 --- NEW FILE: extract2.phpt --- --TEST-- Log: _extractMessage() [Zend Engine 2] --SKIPIF-- <?php if (version_compare(zend_version(), "2.0.0", "<")) die('skip'); ?> --FILE-- <?php require_once 'Log.php'; $conf = array('lineFormat' => '%2$s [%3$s] %4$s'); $logger = &Log::singleton('console', '', 'ident', $conf); /* Logging a regular string. */ $logger->log('String'); /* Logging a bare object. */ class BareObject {} $logger->log(new BareObject()); /* Logging an object with a getMessage() method. */ class GetMessageObject { function getMessage() { return "getMessage"; } } $logger->log(new GetMessageObject()); /* Logging an object with a toString() method. */ class ToStringObject { function toString() { return "toString"; } } $logger->log(new ToStringObject()); /* Logging an object with a __toString() method using casting. */ class CastableObject { function __toString() { return "__toString"; } } $logger->log(new CastableObject()); /* Logging a PEAR_Error object. */ require_once 'PEAR.php'; $logger->log(new PEAR_Error('PEAR_Error object', 100)); /* Logging an array. */ $logger->log(array(1, 2, 'three' => 3)); --EXPECT-- ident [info] String ident [info] BareObject Object ( ) ident [info] getMessage ident [info] toString ident [info] Object id #2 ident [info] PEAR_Error object ident [info] Array ( [0] => 1 [1] => 2 [three] => 3 ) |
From: Ross S. <ro...@us...> - 2004-09-10 04:19:55
|
Update of /cvsroot/freebeer/_pear/doc/XML_Parser/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24392/doc/XML_Parser/examples Log Message: Directory /cvsroot/freebeer/_pear/doc/XML_Parser/examples added to the repository |
From: Ross S. <ro...@us...> - 2004-09-10 04:16:38
|
Update of /cvsroot/freebeer/_freebeer/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24041/bin Modified Files: php.ini.php Log Message: PHP 5.0.1 fixes Index: php.ini.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/bin/php.ini.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- php.ini.php 8 Sep 2004 23:42:54 -0000 1.3 +++ php.ini.php 10 Sep 2004 03:14:26 -0000 1.4 @@ -329,7 +329,9 @@ } if (phpversion() >= '5.0.0') { - $excludes['php_exif.dll'] = 'Unable to load'; + if (isset($extensions['php_exif.dll'])) { + $excludes['php_exif.dll'] = 'Requires php_mbstring.dll to be loaded first'; + } $excludes['php_iisfunc.dll'] = 'Segfaults PHP 5.0.1'; $excludes['php_yaz.dll'] = 'Entry point not found'; $excludes['php_imagick.dll'] = 'Entry point not found'; @@ -505,6 +507,14 @@ fputs($fpt, $line); } +if (isset($excludes['php_exif.dll']) && isset($extensions['php_mbstring.dll'])) { + $line = sprintf("\nextension = %-20s\t; %s\n", 'php_exif.dll', $excludes['php_exif.dll']); + $bytes = fputs($fpt, $line); + if ($bytes != strlen($line)) { + die(sprintf("Can't write to '%s': %s", $php_ini_tmp, $php_errormsg)); + } + +} fclose($fp); fclose($fpt); |
From: Ross S. <ro...@us...> - 2004-09-10 04:12:41
|
Update of /cvsroot/freebeer/_pear/data/Log/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24429/data/Log/misc Added Files: log.sql Log Message: Upgraded to latest pear --- NEW FILE: log.sql --- -- $Id: log.sql,v 1.1 2004/09/10 03:16:27 rossta Exp $ CREATE TABLE log_table ( id INT NOT NULL, logtime TIMESTAMP NOT NULL, ident CHAR(16) NOT NULL, priority INT NOT NULL, message VARCHAR(200), PRIMARY KEY (id) ); |
From: Ross S. <ro...@us...> - 2004-09-10 03:43:14
|
Update of /cvsroot/freebeer/_freebeer/lib/GeoIP/Free In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24041/lib/GeoIP/Free Modified Files: Ascii.php Log Message: PHP 5.0.1 fixes Index: Ascii.php =================================================================== RCS file: /cvsroot/freebeer/_freebeer/lib/GeoIP/Free/Ascii.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Ascii.php 8 Mar 2004 07:18:01 -0000 1.2 +++ Ascii.php 10 Sep 2004 03:14:26 -0000 1.3 @@ -33,7 +33,10 @@ if ($l == -1 && $ip != '255.255.255.255') { return false; } - + if ($l === false && $ip == '255.255.255.255') { + return $ip; + } + $tuple1 = $l >> 24; if ($tuple1 < 0) { $tuple1 += 256; |