OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 28 Dec 2005 03:24:45 -0000 Issue 3874

php-general-digest-helplists.php.net
Date: Tue Dec 27 2005 - 21:24:45 CST


php-general Digest 28 Dec 2005 03:24:45 -0000 Issue 3874

Topics (messages 227886 through 227910):

Re: Infinite subcategories
        227886 by: Jochem Maas

Varchar "date" to real date?
        227887 by: William Stokes
        227888 by: Jim Moseby
        227889 by: Jim Moseby
        227891 by: Rosty Kerei

Re: PHP Frameworks
        227890 by: Scott DeMers
        227892 by: Petr Smith
        227893 by: Paul Scott

Default charset
        227894 by: Graziano Liberati
        227895 by: M. Sokolewicz
        227896 by: Graziano Liberati

load testing tools
        227897 by: Dan McCullough
        227898 by: Greg Donald
        227899 by: Jared Williams
        227900 by: John Meyer
        227901 by: tg-php.gryffyndevelopment.com

xmlspecialchars
        227902 by: Richard Lynch

Repost: GD/Freetype text problems with bold or size < 8
        227903 by: Jason Young

PhP
        227904 by: James Lumb
        227906 by: Al

Creating a new file (apologies to anybody on php-db who got this)
        227905 by: John Meyer

To the person who told me about HTMLdoc
        227907 by: John Meyer

Storing serialized data to DB
        227908 by: Sumit Chachra

how to create a php5 extensions on C/C++, reflecting php Class Api's ?
        227909 by: Edwin Barrios
        227910 by: Gustavo Narea

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Danny wrote:
> Hi All,
>
> Time ago, somebody sent a sample to the list about how to do an "infinite"
> subcategories, based on parent field. I´ve been googling, and searching my
> mail history, but cannot find it.....

probably your stuck because your not searching for the correct terms ...
you wouldn't be the first, I have had that problem quite often.

try this search to see if it gets you on track:
http://www.google.com/search?q=php+recursive+tree

>
> The objective is to create a tree with categories and subcategories of
> documents, but with no limit into the subcategory depth. Anybody remember
> that thread, or can point me to a solution?
>
> Thank you
> Regards
>
> --
> dpc
>

attached mail follows:


Hello,

This is propably a more of a MySQL question but here we go anyway...

I have a DB that has dates stored in a table. The date field type is Varchar
(don't ask why... :( The dates are stored using european date format
DD.MM.YYYY. I need somehow convert the dates to the format MySQL uses
(YYYY-MM-DD) and re-store them to a table which has a real date column for
them.

I think I need some help/ideas with this...

If I can get this done how can I still display the dates in european format
at my web page? Do I have to break the date to pieces and some how
re-arrange it to the DD.MM.YYYY format or is the some clever function for
this that can automatically do this?

Thanks
-Will

attached mail follows:


>
> Hello,
>
> This is propably a more of a MySQL question but here we go anyway...
>
> I have a DB that has dates stored in a table. The date field
> type is Varchar
> (don't ask why... :( The dates are stored using european date format
> DD.MM.YYYY. I need somehow convert the dates to the format MySQL uses
> (YYYY-MM-DD) and re-store them to a table which has a real
> date column for
> them.
>
> I think I need some help/ideas with this...
>
> If I can get this done how can I still display the dates in
> european format
> at my web page? Do I have to break the date to pieces and some how
> re-arrange it to the DD.MM.YYYY format or is the some clever
> function for
> this that can automatically do this?
>
> Thanks
> -Will
>

function eurodate_to_mysqldate($date){
  $parts=explode('.',$date);
  $day=$parts[0];
  $month=$parts[1];
  $year=$parts[2];
  return($year.'-'.$month.'-'.$day);
}

This (untested) function will take the varchar date you described and
convert it to a date that mysql will like.

JM

attached mail follows:


> > I think I need some help/ideas with this...
> >
> > If I can get this done how can I still display the dates in
> > european format
> > at my web page? Do I have to break the date to pieces and some how
> > re-arrange it to the DD.MM.YYYY format or is the some clever
> > function for
> > this that can automatically do this?

I neglected to answer the second part of your question. Once you get the
dates into a proper mysql date column, you can use mysql's DATE_FORMAT
function to arrange it to any way you want.

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

JM

attached mail follows:


You should better store your dates in unix timestamp, integer format and
then display it on your web site with using date(), or smarty date_format
function in any format you wish.

Sincerely,
Rosty Kerei <rosty.kereigmail.com>

""William Stokes"" <kallesoperamail.com> wrote in message
news:66.02.28258.F3941B34pb1.pair.com...
> Hello,
>
> This is propably a more of a MySQL question but here we go anyway...
>
> I have a DB that has dates stored in a table. The date field type is
> Varchar (don't ask why... :( The dates are stored using european date
> format DD.MM.YYYY. I need somehow convert the dates to the format MySQL
> uses (YYYY-MM-DD) and re-store them to a table which has a real date
> column for them.
>
> I think I need some help/ideas with this...
>
> If I can get this done how can I still display the dates in european
> format at my web page? Do I have to break the date to pieces and some how
> re-arrange it to the DD.MM.YYYY format or is the some clever function for
> this that can automatically do this?
>
> Thanks
> -Will

attached mail follows:


I've tried mvc, Cake, and Prado. Each is a port of a framework for a
different language (Java struts, ruby rails and asp.net
respectively). Of the three, my favorite has been Prado, because of
its emphasis on the user interface of the web app. My choice isn't
based on any metrics, i just think UI is cool, and once I wrapped my
head around the concept of components, I found it the easy to use.

Scott

On Dec 23, 2005, at 3:27 PM, Shawn McKenzie wrote:

> Thanks. I searched on "Zend PHP Framework" because I had seen it
> referenced somewhere, however I can just find plans and objectives and
> no usable "framework".
>
> Thanks!
> -Shawn
>
> Zareef Ahmed wrote:
>> Hi,
>> There are a lot of PHP frameworks like Mojavi, Phrame,
>> php.MVC,
>> phpwebtk, Horde.
>>
>> My choice is Mojavi.
>>
>> BTW Zend is also doing some great work on it.
>>
>> Zareef Ahmed
>>
>>
>>
>> ----- Original Message -----
>> From: "Shawn McKenzie" <nospammckenzies.net>
>> To: <php-generallists.php.net>
>> Sent: Friday, December 23, 2005 2:57 PM
>> Subject: [PHP] PHP Frameworks
>>
>>
>>
>>> Is there a good recent article on PHP Frameworks, or do people
>>> here has
>>> a predominant one that outshines the others?
>>>
>>> I'm looking for something that is easy to use, fast and stable.
>>>
>>> Thanks!
>>> -Shawn
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>>
>> ====================================================
>> PHP Expert Consultancy in Development http://www.indiaphp.com
>> Yahoo! : consultant_php MSN : consultancyindiaphp.com
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Scott DeMers
Web Coordinator
International Studies and Programs
demerss1msu.edu

attached mail follows:


Simon Reye wrote:
> I'm moving away from Cold Fusion and am considering java or php. I've
> mucked around with Struts and Coccoon on the java side and think they
> are great. There does not however seem to be any well backed projects
> similar to these for php.
>
> Can anyone point me to a good php MVC framework?
>

What about http://www.symfony-project.com/ ?? Anyone using it?

attached mail follows:


On Tue, 2005-12-27 at 17:49 +0100, Petr Smith wrote:
> >
> > Can anyone point me to a good php MVC framework?

> What about http://www.symfony-project.com/ ?? Anyone using it?
>

There is also a relatively new application framework, out of Africa,
called KINKY. http://avoir.uwc.ac.za/projects/nextgen
http://kngforge.uwc.ac.za/ http://fsiu.uwc.ac.za

It makes use of a great MVC architecture, and many of the pear
components which make it easy to use. It is also multilingual and
skinnable, as well as excellent code documentation.

--Paul

attached mail follows:


Hi, I need to set the default charset for my application to UTF-8 instead of
the default one of the webserver that is ISO-8859-1.
I've tried to change the value of default_charset in php.ini and all it's ok,
but I need to set the value only for one application so I've tried to use the
ini_set function in this way:
ini_set('default_charset','utf-8');

The problem is that that the ini_set function seems to be ignored, I don't
have the same effect of changing the php.ini configuration file, with the
ini_set function the default charset is still ISO-8859-1.

Someone can help me?

Regards.
--
Graziano 'FreeJay' Liberati
---------------------------
Main developer of ZNF http://znf.zeronotice.com

Contacts
web: http://www.freejay.it
e-mail: freejayfreejay.it
icq: 98659824
msn: freejayfreejay.it

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBDsXptwrli1BP8ELoRArsEAJ40TACiptMtjAo9tke/j0NN7J5bsACeMi7Y
asJezUiNJ0htpgtewDsqIUQ=
=MDDr
-----END PGP SIGNATURE-----

attached mail follows:


at the top of your script you could add a:
header('Content-Type: text/html; charset=UTF-8');
that would work aswell (according to RFC 2616:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17)

;)

- tul

Graziano Liberati wrote:

> Hi, I need to set the default charset for my application to UTF-8 instead of
> the default one of the webserver that is ISO-8859-1.
> I've tried to change the value of default_charset in php.ini and all it's ok,
> but I need to set the value only for one application so I've tried to use the
> ini_set function in this way:
> ini_set('default_charset','utf-8');
>
> The problem is that that the ini_set function seems to be ignored, I don't
> have the same effect of changing the php.ini configuration file, with the
> ini_set function the default charset is still ISO-8859-1.
>
> Someone can help me?
>
> Regards.

attached mail follows:


At Tuesday 27 December 2005 19:36, M. Sokolewicz you wrote:
> at the top of your script you could add a:
> header('Content-Type: text/html; charset=UTF-8');
> that would work aswell (according to RFC 2616:
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17)
>
> ;)
>
> - tul

I want to set only the default_charset because I don't know which kind of
content type I'll have, for example with a PDF document text/html is not the
correct one.

Regards.
--
Graziano 'FreeJay' Liberati
---------------------------
Main developer of ZNF http://znf.zeronotice.com

Contacts
web: http://www.freejay.it
e-mail: freejayfreejay.it
icq: 98659824
msn: freejayfreejay.it

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBDsZDTwrli1BP8ELoRAo9AAJ9DFv8GX/OLeKAW7RcXXIjvYdD4YwCfcZeD
0tKjOVsiwbVByzAP7L123lY=
=DPPb
-----END PGP SIGNATURE-----

attached mail follows:


Anyone have any opinions or suggestions on cheap/free load testing
tools for dynamic sites?

attached mail follows:


On 12/27/05, Dan McCullough <dan.mcculloughgmail.com> wrote:
> Anyone have any opinions or suggestions on cheap/free load testing
> tools for dynamic sites?

Apache Bench:
/usr/sbin/ab on this particular box.

Curl:
/usr/bin/curl

To test dynamic or protected pages you can use curl to get a session
id/cookie, then pass it back with ab using -C.

And if those won't do:
http://opensourcetesting.org/performance.php

--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

attached mail follows:


> Anyone have any opinions or suggestions on cheap/free load
> testing tools for dynamic sites?

Microsoft WAST

http://www.microsoft.com/technet/archive/itsolutions/intranet/downloads/webstres.mspx
 
Jared

attached mail follows:


On Tuesday 27 December 2005 12:45 pm, Jared Williams wrote:
> > Anyone have any opinions or suggestions on cheap/free load
> > testing tools for dynamic sites?
>
> Microsoft WAST
>
> http://www.microsoft.com/technet/archive/itsolutions/intranet/downloads/web
>stres.mspx
>
> Jared

You violated one of the Ten Open Source Commandments. Thou shalt not take the
name of Microsoft in good!

--
Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar?
Fletch: I don't know. I don't have any.
Dr. Joseph Dolan: No children?
Fletch: No, elephant books.

attached mail follows:


Oh boy.. here we go.. hah.. can we refrain from a giant anti-Microsoft war type thing?

I'll use whatever does the job. MS actually has some good free tools for certain things. And then they have a lot of retarded stuff (why is it that I can't use my mouse wheel in ANY VBA editing window? I read I could if I had an Intellimouse... now THAT'S retarded).

Anyway... know the beast... the name of the beast.. and use the beast to your advantage if you can. Pro-linux/opensource/whatever doesn't mean you HAVE to be anti-Microsoft.

-TG

= = = Original message = = =

On Tuesday 27 December 2005 12:45 pm, Jared Williams wrote:
> > Anyone have any opinions or suggestions on cheap/free load
> > testing tools for dynamic sites?
>
> Microsoft WAST
>
> http://www.microsoft.com/technet/archive/itsolutions/intranet/downloads/web
>stres.mspx
>
> Jared

You violated one of the Ten Open Source Commandments. Thou shalt not take the
name of Microsoft in good!

--
Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar?
Fletch: I don't know. I don't have any.
Dr. Joseph Dolan: No children?
Fletch: No, elephant books.

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


I'm creating some XML data, but not using any of the built-in PHP XML
functions, as they are not necessarily available on all servers.

I need to encode Data (CDATA) such as URLs etc.

htmlspecialchars() works on all my test cases so far, but is it
"right"?...

Please cc: me on replies -- I'm way behind on PHP General reading... :-(

--
Like Music?
http://l-i-e.com/artists.htm

attached mail follows:


Is anyone able to assist with this? I need to have 6 point fonts looking
like they should, instead of all scrunched up.
Paid consultation okay, if that's what's stopping an answer.

What needs to be changed in the bundled GD source to make these fonts
look decent?

Thank you.

Jason Young wrote:
> Just to followup on this,
>
> I was able to install PHP 5.1.1 with its embedded GD library, and it
> turns out that GD is definitely the cause of the issues.
>
> So my question now is what changes to the source can be made to ensure
> the highest-quality fonts in smaller sizes? As I've said, I've been on
> hosts with very smooth rendering of smaller text (size < 8, assuming 96
> pixel resolution), but my current build looks horrible.
> http://card.mygamercard.net/mini/Morgon.jpg is what it looks like now -
> all text is 6 point aside from the bold text at the top, which is 8.
> This is the 5.0.4 install.
>
> http://data.mygamercard.net/test.png is an image I created using a
> built-but-not-installed version of PHP 5.1.1.
> I changed the GD_RESOLUTION to 72 point font, so to compensate, these
> are a font size of 9.
>
> What I would like is for the fonts to look similar to what would really
> be displayed, had this been standard system fonts in a browser or other
> application.
>
> If anyone has had experience with rendering text, I would really
> appreciate some hints on how to tweak GD to make things look proper.
>
> Thanks
>
> Jason Young wrote:
>> Currently, I'm running PHP 5.0.4 (only because it's the only one I can
>> get to work on my FC4 x64 install!), but for some reason, using pixel
>> sizes under 8, or using bold fonts, makes the text look horrible.
>> My old host (1&1 in case anyone else has them..) had this working
>> well, but I have no idea what their settings were.
>>
>> I've heard that editing the gd.h file to change the resolution from 96
>> to 72 helps, but I'm assuming I'd have to recompile something for that
>> to take effect, and I can't find a PHP-GD Source RPM for my arch.
>>
>> What must I do to get everything smooth again?
>>
>> Fedora Core 4, x64
>> PHP 5.0.4
>> PHP-GD module (separate RPM install)
>> Freetype 2.1
>> gd-2.0.33
>>
>> Thank you.

attached mail follows:


Hi,
Does anyway know whether there is a PHP function which creates a new file? i
know there is fwrite, fopen etc but is there any way of creating a new file?
Thanks,
James

_________________________________________________________________
Are you using the latest version of MSN Messenger? Download MSN Messenger
7.5 today! http://messenger.msn.co.uk

attached mail follows:


James Lumb wrote:
> Hi,
> Does anyway know whether there is a PHP function which creates a new
> file? i know there is fwrite, fopen etc but is there any way of creating
> a new file?
> Thanks,
> James
>
> _________________________________________________________________
> Are you using the latest version of MSN Messenger? Download MSN
> Messenger 7.5 today! http://messenger.msn.co.uk

The on-line manual is your friend. Most popular are fopen and touch.

attached mail follows:


On Tuesday 27 December 2005 4:07 pm, James Lumb wrote:
> Hi,
> Does anyway know whether there is a PHP function which creates a new file?
> i know there is fwrite, fopen etc but is there any way of creating a new
> file? Thanks,
> James
>

fopen() will create a new file if you open it for writing and it does not
exist, as per these modes:

'w'   Open for writing only; place the file pointer at the beginning of the
file and truncate the file to zero length. If the file does not exist,
attempt to create it.
  'w+'   Open for reading and writing; place the file pointer at the beginning
of the file and truncate the file to zero length. If the file does not exist,
attempt to create it.
  'a'   Open for writing only; place the file pointer at the end of the file.
If the file does not exist, attempt to create it.
  'a+'   Open for reading and writing; place the file pointer at the end of
the file. If the file does not exist, attempt to create it.
'x'   Create and open for writing only; place the file pointer at the
beginning of the file. If the file already exists, the fopen() call will fail
by returning FALSE and generating an error of level E_WARNING. If the file
does not exist, attempt to create it. This is equivalent to specifying
O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is
supported in PHP 4.3.2 and later, and only works for local files.
  'x+'   Create and open for reading and writing; place the file pointer at
the beginning of the file. If the file already exists, the fopen() call will
fail by returning FALSE and generating an error of level E_WARNING. If the
file does not exist, attempt to create it. This is equivalent to specifying
O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is
supported in PHP 4.3.2 and later, and only works for local files.
--
Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar?
Fletch: I don't know. I don't have any.
Dr. Joseph Dolan: No children?
Fletch: No, elephant books.

attached mail follows:


Do I run it as htmldoc -f pdfmanual.pdf --book in that directory with the HTML
files, or what? And secondly, do I use the multiple pages or the continuous
one page?

attached mail follows:


hi all,

Not very php specific so please pardon me if I am posting in the wrong
forum.

I have a chunk of data which I am trying to cache. I serialize this data
using the serialize() function in php. I am wondering what would be a good
attribute type in my DB to store such (potentially long) strings? Some types
have 4000 character limits and hence I get JDBC exceptions. I am using
Oracle DB.

thanks!
Sumit.

attached mail follows:


Hi,I'm a PHP web programing, but i wanna learn how to develop php5
extensions on C/C++. I found php5 a good language to apply Objects
programing, and it has very usefull examples of OO extensions as SimpleXML,
DOM, Sqlite; for this reason i wanna develope my extension following those
styles of API's .
I've read some docs about creating a php extension that appears as new
functions on PHP, but i can't find info to develop extensions that appear as
classes on PHP .

Thanks for your help. I'm really interested on this topic, especially to
collaborate in PHP extension projects as wxPHP.

attached mail follows:


Hello, Edwin.

Edwin Barrios wrote:
> Hi,I'm a PHP web programing, but i wanna learn how to develop php5
> extensions on C/C++. I found php5 a good language to apply Objects
> programing, and it has very usefull examples of OO extensions as SimpleXML,
> DOM, Sqlite; for this reason i wanna develope my extension following those
> styles of API's .
> I've read some docs about creating a php extension that appears as new
> functions on PHP, but i can't find info to develop extensions that appear as
> classes on PHP .

I think that in chapter #15 of "PHP 5 Power Programming" you're going to
find what you are looking for.

Saludos!

--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.