php-general Digest 29 Jan 2010 23:54:39 -0000 Issue 6565
Topics (messages 301649 through 301665):
Re: Do you use a public framework or roll your own?
301649 by: Teus Benschop
301651 by: Phpster
301653 by: Nathan Rixham
Re: Good source for sample data?
301650 by: Michael Kubler
301652 by: Bob McConnell
301656 by: Jerry Schwartz
301664 by: Brian Dunning
Re: Creating an Entire .html page with PHP
301654 by: Raman .
301655 by: Ashley Sheridan
301657 by: Robert Cummings
Sessions across subdomains
301658 by: Ben Miller
imap4 search criteria
301659 by: Dominik Gehl
301661 by: Richard
Ideas please -- take query results --- output to image
301660 by: Haig Davis
301662 by: Rene Veerman
301663 by: Rene Veerman
In need of PHP to JS collapsable array printing routine?
301665 by: Daevid Vincent
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
What could help a developer is to plunder the available open-source
frameworks and use the loot in his own code. At times these frame-works
are well thought out, and some of their classes are clean, and can
easily be moved into other contexts. Teus.
On Fri, 2010-01-29 at 03:30 -0800, Tom Sparks wrote:
> "Do you use a public framework or roll your own?"
> http://www.rapidpoll.net/8opnt1e
--- End Message ---
--- Begin Message ---
I converted one that was originally in classic ASP. It's terrible,
with poor design and large overhead. Used for a few projects, but now
use codeigniter. It's the easiest to adapt without many of the
restrictions of th larger frameworks.
Bastien
Sent from my iPod
On Jan 29, 2010, at 5:08 AM, "Michael A. Peters" <[email protected]>
wrote:
Michael A. Peters wrote:
Daevid Vincent wrote:
I'm not looking to start a holy war here or re-hash the tired
debate. I just want some hard cold numbers to look at.
"Do you use a public framework or roll your own?"
http://www.rapidpoll.net/8opnt1e
And for those interested, here are the results of the last poll:
"To add the final ?> in PHP or not..."
http://www.rapidpoll.net/show.aspx?id=arc1opy
I'm relieved to know I'm in the majority (almost 2:1) who close
their
opening PHP tags. :)
I roll my own, partially from classes I wrote and partially from
classes at phpclasses.org and partially from neat stuff I find on
the web.
Not sure you could call it framework though, just a loose
collection of independent classes.
Just spent a couple days bringing that loose collection together
along with CSS templates from http://www.freecsstemplates.org/ and
now actually have my own (not quite finished) CMS.
And it looks / works a hell of a lot better than anything I've done
before (er, other than it not quite being finished ...)
Making my classes work together specifically to make a generic CMS
exposed a lot of bugs and poor design decisions in them that are now
largely fixes (er, well, we'll see ...)
Last few days have been like an epiphany for me.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Michael A. Peters wrote:
> Michael A. Peters wrote:
>> Daevid Vincent wrote:
>>>
>>> I'm not looking to start a holy war here or re-hash the tired debate.
>>> I just want some hard cold numbers to look at.
>>>
>>> "Do you use a public framework or roll your own?"
>>> http://www.rapidpoll.net/8opnt1e
>>>
>>>
>>> And for those interested, here are the results of the last poll:
>>>
>>> "To add the final ?> in PHP or not..."
>>> http://www.rapidpoll.net/show.aspx?id=arc1opy
>>>
>>> I'm relieved to know I'm in the majority (almost 2:1) who close their
>>> opening PHP tags. :)
>>>
>>>
>>
>> I roll my own, partially from classes I wrote and partially from
>> classes at phpclasses.org and partially from neat stuff I find on the
>> web.
>>
>> Not sure you could call it framework though, just a loose collection
>> of independent classes.
>>
>
> Just spent a couple days bringing that loose collection together along
> with CSS templates from http://www.freecsstemplates.org/ and now
> actually have my own (not quite finished) CMS.
>
> And it looks / works a hell of a lot better than anything I've done
> before (er, other than it not quite being finished ...)
>
> Making my classes work together specifically to make a generic CMS
> exposed a lot of bugs and poor design decisions in them that are now
> largely fixes (er, well, we'll see ...)
>
> Last few days have been like an epiphany for me.
great to hear; I've done this with pretty much every project for the
last 5 years and in most cases I can apple it [1] - also find it
beneficial to see coding styles over the years and refactor previous
work - strangest thing is that as time goes on, the number of classes &
lines of code I need for each application seems to drop!
[1] "got a class for that"
--- End Message ---
--- Begin Message ---
Agree'd.
I've done this a couple of times. Usually best is to grab a couple of
free online dictionary lists. One for peoples names, another for
business names, then just randomly pull the data from the dictionaries.
Addresses, websites, phone numbers, and zip codes can all be randomly
generated, or you can use the GEONames database
<http://www.geonames.org/> to generate actual locations.
Also, wasn't there some test data available by MySQL? I think it was the
Sakila <http://dev.mysql.com/doc/sakila/en/sakila.html>database
<http://forums.mysql.com/list.php?121>.
--
Michael Kubler
I believe in a better world. I support the Zeitgeist Movement
Shawn McKenzie wrote:
Brian Dunning wrote:
Hey all -
I need a few million sample contact records - name, company, address, email,
web, phone, fax. ZIP codes and area codes and street addresses should be
correct and properly formatted, but preferably not real people or companies or
email addresses. But they'd work if you did address validation or mapping.
Anyone have a suggestion?
- Brian
It should be easy to code a routine to generate random data. Maybe 20 -
30 lines of code. Obviously you may have a name like Dgidfgq Xcvbop and
company Wsdkn, but it shouldn't matter if testing is your purpose.
--- End Message ---
--- Begin Message ---
The US Census Bureau has lists of first names and surnames online with a
breakdown of their frequency within the US population. It was very
simple to extract just the names into arrays. We found it quite useful
for generating database records for testing. YMMV.
Bob McConnell
-----Original Message-----
From: james stojan [mailto:[email protected]]
Sent: Thursday, January 28, 2010 8:38 PM
To: TG
Cc: Brian Dunning; [email protected]; [email protected]
Subject: Re: [PHP] Good source for sample data?
Fakenamegenerator.com is pretty good for these kinds of records, alot of
variety and can change order/formating for them but they do limit free
orders to 50k records.
http://www.fakenamegenerator.com/order.php
On Thu, Jan 28, 2010 at 8:06 PM, TG <[email protected]>
wrote:
> I remembered a coworker found an online resource that generated sample
data
> for you. I hit google and I think I found it:
>
> http://www.generatedata.com/
>
> I I found it on a list of resources for data generation:
>
> http://www.webresourcesdepot.com/test-sample-data-generators/
>
>
> I've never used any of these, but once again.. Google is your friend.
>
> -TG
>
> ----- Original Message -----
> From: Brian Dunning <[email protected]>
> To: [email protected], [email protected]
> Date: Thu, 28 Jan 2010 15:52:41 -0800
> Subject: [PHP] Good source for sample data?
>
> > Hey all -
> >
> > I need a few million sample contact records - name, company,
address,
> email, web, phone, fax. ZIP codes and area codes and street addresses
> should be correct and properly formatted, but preferably not real
people
> or companies or email addresses. But they'd work if you did address
> validation or mapping. Anyone have a suggestion?
> >
> > - Brian
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
If you need "verifiable" mailing addresses (actual street/city/state/zip
combinations), you should look at some of the databases the USPS (usps.com)
has available. They are mostly for tracking delivery statistics, and the like,
but as a side effect they list streets all over the USA. The only thing you
won't have are street numbers and names, but you can easily generate random
combinations there.
By the way, if you need real-sounding names you can get a pile of first names
from http://www.socialsecurity.gov/OACT/babynames/decades/names2000s.html; I
used that information as part of security screening for a registration system.
Regards,
Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
www.the-infoshop.com
>-----Original Message-----
>From: Shawn McKenzie [mailto:[email protected]]
>Sent: Thursday, January 28, 2010 7:20 PM
>To: Brian Dunning
>Cc: [email protected]; [email protected]
>Subject: Re: Good source for sample data?
>
>Brian Dunning wrote:
>> Hey all -
>>
>> I need a few million sample contact records - name, company, address,
>> email,
>web, phone, fax. ZIP codes and area codes and street addresses should be
>correct and properly formatted, but preferably not real people or companies
>or
>email addresses. But they'd work if you did address validation or mapping.
>Anyone have a suggestion?
>>
>> - Brian
>
>It should be easy to code a routine to generate random data. Maybe 20 -
>30 lines of code. Obviously you may have a name like Dgidfgq Xcvbop and
>company Wsdkn, but it shouldn't matter if testing is your purpose.
>
>--
>Thanks!
>-Shawn
>http://www.spidean.com
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe: http://lists.mysql.com/mysql?unsub=jschwa...@the-
>infoshop.com
--- End Message ---
--- Begin Message ---
Thanks for the suggestions but I couldn't find any that suited my needs, so I
made my own. Feel free to download if you can use them, I made files with up to
a million unique records.
Name, Company, Address, Phone, Email, etc., all are fake but are real addresses
with correct area codes, zips, exchange, so will work for mapping, phone or
address validation, whatever your needs are. Hope someone find it useful.
http://www.briandunning.com/sample-data/
On Jan 28, 2010, at 3:52 PM, Brian Dunning wrote:
> I need a few million sample contact records - name, company, address, email,
> web, phone, fax. ZIP codes and area codes and street addresses should be
> correct and properly formatted, but preferably not real people or companies
> or email addresses. But they'd work if you did address validation or mapping.
> Anyone have a suggestion?
--- End Message ---
--- Begin Message ---
you can use Apache mod rewrite to create html pages having all programing
saved in .php pages. I have never tried generating .html pages with this but
have successfully generated .htm pages..
Hope this works..
On Tue, Jan 26, 2010 at 6:30 AM, [email protected] <[email protected]>wrote:
> Hi Folks,
>
> I would like to create an entire .html page gathered from database content
> mixed with html etc. and be able to save the page...
>
>
> like:
>
> --- save all this pre made content as .html page....
>
> <html>
> <head>
> ... stuff
> </head>
> <body>
> ... stuff
> ... stuff with database query results...
> ... stuff
> </body>
> </html>
>
> Q: Is there a function that might help with saving the whole content as
> .html page?
>
>
>
> Thanks,
> [email protected]
> [db-10]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
http://www.kingzones.org/
--- End Message ---
--- Begin Message ---
On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
> you can use Apache mod rewrite to create html pages having all programing
> saved in .php pages. I have never tried generating .html pages with this but
> have successfully generated .htm pages..
>
> Hope this works..
>
> On Tue, Jan 26, 2010 at 6:30 AM, [email protected] <[email protected]>wrote:
>
> > Hi Folks,
> >
> > I would like to create an entire .html page gathered from database content
> > mixed with html etc. and be able to save the page...
> >
> >
> > like:
> >
> > --- save all this pre made content as .html page....
> >
> > <html>
> > <head>
> > ... stuff
> > </head>
> > <body>
> > ... stuff
> > ... stuff with database query results...
> > ... stuff
> > </body>
> > </html>
> >
> > Q: Is there a function that might help with saving the whole content as
> > .html page?
> >
> >
> >
> > Thanks,
> > [email protected]
> > [db-10]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
You still have to create .php pages, mod_rewrite just masks what the
user is requesting through their browser. You can set Apache to
parse .html pages as PHP, but I wouldn't recommend it, as any html pages
that don't contain PHP code still have to be parsed as if they did,
which is slower.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
you can use Apache mod rewrite to create html pages having all programing
saved in .php pages. I have never tried generating .html pages with this but
have successfully generated .htm pages..
Hope this works..
On Tue, Jan 26, 2010 at 6:30 AM, [email protected] <[email protected]>wrote:
Hi Folks,
I would like to create an entire .html page gathered from database content
mixed with html etc. and be able to save the page...
like:
--- save all this pre made content as .html page....
<html>
<head>
... stuff
</head>
<body>
... stuff
... stuff with database query results...
... stuff
</body>
</html>
Q: Is there a function that might help with saving the whole content as
.html page?
Thanks,
[email protected]
[db-10]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You still have to create .php pages, mod_rewrite just masks what the
user is requesting through their browser. You can set Apache to
parse .html pages as PHP, but I wouldn't recommend it, as any html pages
that don't contain PHP code still have to be parsed as if they did,
which is slower.
You can also do the following:
AddType application/x-httpd-php .php .html .htm
And then rewrite is unnecessary.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
Hi, I've always thought that session data was subdomain specific and would
not carry over between http://www.mydomain.com and
https://secure.mydomain.com, but it seems to be working for me now. Can I
rely on this and post from http://www.mydomain.com to
https://secure.mydomain.com and simply pass a hidden input containing
PHPSESSID, or do I need to pass each key=>value pair that _SESSION contains
at www. and reset them as _SESSION vars at secure.
<https://secure.mydomain.com> ?
Thanks in advance,
Ben
--- End Message ---
--- Begin Message ---
Hi,
I noticed that the imap extension seems to support only IMAP2 search criteria.
This is caused by the fact that in ext/imap/php_imap.c, the imap_search
function uses a call to mail_criteria. And
the University of Washington IMAP toolkit mentions in docs/internal.txt:
SEARCHPGM *mail_criteria (char *criteria);
criteria IMAP2-format search criteria string
This function accepts an IMAP2-format search criteria string and
parses it. If the parse is successful, it returns a search program
suitable for use in mail_search_full().
WARNING: This function does not accept IMAP4 search criteria.
Is there any specific reason why PHP uses this mail_criteria call ? It really
would be nice to be able to use IMAP4 search criteria !
Thanks,
Dominik
--- End Message ---
--- Begin Message ---
Hi,
> ...
You might have more joy with this on the php-dev list.
--
Richard Heyes
HTML5 canvas graphing: RGraph - http://www.rgraph.net (updated 23rd January)
Lots of PHP and Javascript code - http://www.phpguru.org
--- End Message ---
--- Begin Message ---
Good Day All,
The headscratcher of the day for me is as follows:
I'm busy designing a scheduling page in a table form (actually series of
floating css divs) showing days of week across/ rooms down. thats the easy
part and bookings in each cell. I know I can take the results of a query
call it expanded booking details start_ob output to html save to file/
image etc, that way on mouse over the date I can use CSS to explode the
image file displaying the results. Here's my question.
Any hints can I do all of this on the fly yet not display the HTML query
results that are created until mouse over ..... I'm sure this is easy with
javascript my problem is my client does has disabled javascript/ active X
scripts.
Been scratching my head for a while and it's starting to bleed.
Thanks and have a great weekend.
Cheers
Haig
--- End Message ---
--- Begin Message ---
flash(develop.org) perhaps? or does that also fall under their
no-active-x policy?
On Fri, Jan 29, 2010 at 9:17 PM, Haig Davis <[email protected]> wrote:
> Good Day All,
>
> The headscratcher of the day for me is as follows:
>
> I'm busy designing a scheduling page in a table form (actually series of
> floating css divs) showing days of week across/ rooms down. thats the easy
> part and bookings in each cell. I know I can take the results of a query
> call it expanded booking details start_ob output to html save to file/
> image etc, that way on mouse over the date I can use CSS to explode the
> image file displaying the results. Here's my question.
>
> Any hints can I do all of this on the fly yet not display the HTML query
> results that are created until mouse over ..... I'm sure this is easy with
> javascript my problem is my client does has disabled javascript/ active X
> scripts.
>
> Been scratching my head for a while and it's starting to bleed.
>
> Thanks and have a great weekend.
>
> Cheers
>
> Haig
>
--- End Message ---
--- Begin Message ---
other idea: <iframe>s, and plain old links.
On Fri, Jan 29, 2010 at 10:32 PM, Rene Veerman <[email protected]> wrote:
> flash(develop.org) perhaps? or does that also fall under their
> no-active-x policy?
>
> On Fri, Jan 29, 2010 at 9:17 PM, Haig Davis <[email protected]> wrote:
>> Good Day All,
>>
>> The headscratcher of the day for me is as follows:
>>
>> I'm busy designing a scheduling page in a table form (actually series of
>> floating css divs) showing days of week across/ rooms down. thats the easy
>> part and bookings in each cell. I know I can take the results of a query
>> call it expanded booking details start_ob output to html save to file/
>> image etc, that way on mouse over the date I can use CSS to explode the
>> image file displaying the results. Here's my question.
>>
>> Any hints can I do all of this on the fly yet not display the HTML query
>> results that are created until mouse over ..... I'm sure this is easy with
>> javascript my problem is my client does has disabled javascript/ active X
>> scripts.
>>
>> Been scratching my head for a while and it's starting to bleed.
>>
>> Thanks and have a great weekend.
>>
>> Cheers
>>
>> Haig
>>
>
--- End Message ---
--- Begin Message ---
I'm wondering if anyone has a PHP debug-type routine that will take a PHP
array and output it to the web page, but make all the dimensions of the
array collapsable, ideally showing each sub-key (or index) as the name to
click to expand it again.
I'm dealing with some rather huge datasets in multi-dimensional hashes and
printing them out with a beautified print_r() is just not cutting it
anymore. I need to collapse them down to wrap my head around them. Some of
them have 6 or more dimensions!
I use jQuery for JS if that helps (in case your routine requires that too).
--- End Message ---