php-general Digest 22 Oct 2012 14:06:35 -0000 Issue 8018
Topics (messages 319544 through 319554):
Re: User Timezone
319544 by: tamouse mailing lists
319545 by: Matijn Woudt
319546 by: Karl DeSaulniers
319548 by: tamouse mailing lists
Free LAPP stack
319547 by: Robert Stone
319549 by: tamouse mailing lists
RAM Disk
319550 by: Alan Hoffmeister
319552 by: Camilo Sperberg
319553 by: СÓãϺ
Table help needed - followup
319551 by: Chris Payne
Recommendation request: Use Magento or build my own eCommerce?
319554 by: Mark
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Sun, Oct 21, 2012 at 7:30 AM, Matijn Woudt <tijn...@gmail.com> wrote:
> On Sun, Oct 21, 2012 at 12:01 PM, Maciek Sokolewicz
> <maciek.sokolew...@gmail.com> wrote:
>> On 21-10-2012 01:11, Karl DeSaulniers wrote:
>>>>>
>>>>> Thanks for the response. Yes, for the US I plan on calculating by
>>>>> state, but
>>>>> this website is not geared to just the US.
>>>>> So I am looking for a solution that lets me also calculate by
>>>>> country/region.
>>>>> Was looking on google and found geoip, but not sure if this will do
>>>>> the job
>>>>> I am looking for.
>>>>> Anyone with experience on geoip that can send pointers?
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>> Best,
>>>>> Karl DeSaulniers
>>>>> Design Drumm
>>>>> http://designdrumm.com
>>>>
>>>>
>>>>
>>>> Geo IP is based on IP, and I must warn you that IP data is not always
>>>> accurate. Especially here in Europe, companies that are based in
>>>> multiple countries sometimes only register their IPs in a single
>>>> country, and share them between all the countries they are active in.
>>>> This will give you wrong data from GeoIP. The time difference will
>>>> only be 1 hour at max, but still.
>>>
>>>
>>>
>>> That was what my own suspicions were leading to.
>>> I am familiar with the fact that ips can be spoofed.
>>> Thanks for the corroboration.
>>>
>>> Best,
>>>
>>> Karl DeSaulniers
>>> Design Drumm
>>> http://designdrumm.com
>>>
>>
>> As Bart said, IP is not ideal for this situation.
>>
>> Since you do have information about the location of that person (as in
>> country and possible state), you can find out the timezone via a static
>> database.
>>
>> The HTML5 geolocation tool is nice, and would certainly help a lot! However,
>> be aware of the fact that it only works if there is the device on which the
>> browser runs actually has the ability to find out its location. Many
>> smartphones have GPS chips, but most PCs don't. Asking a PC "where are you
>> located?" the PC will answer "How should I know?".
>>
>> Luckily for you, the way of country and state is pretty easy. I've handed
>> you a list to find it in the USA. For most countries in the world, there's a
>> simple 1:1 mapping of timezone and country
>> (http://en.wikipedia.org/wiki/List_of_time_zones_by_country), there are
>> however 21 countries which have multiple timezones. In these cases, you'll
>> need extra information to be able to distinguish between them.
>>
>> For the USA, you already have a way.
>> For (ex-)colonical islands and such (such as for France), you could always
>> add them to the country list:
>> - France
>> - France (Marquesas Islands)
>> - France (Gambier)
>> etc.
>> Thus treating them as separate countries for your timezone db.
>>
>> In Russia, Canada, Australia, New Zealand, Brasil, Indonesia, Kiribati,
>> Mexico,Congo, Ecuador, Micronesia, Kazakhstan and Mongolia you'll need to
>> know their province / state to more accurately assess the ideal timezone.
>>
>> So for most countries, it's a simple 1:1 translation. For the above
>> countries, you'll need some extra info, and translate further based on that.
>> You should be able to find the info required yourself, it just takes a while
>> to collect it.
>>
>> Alternatively, and this is the most simple way; since you're asking people
>> for their country and such, simply also ask them about their timezone. Don't
>> bother automating and putting a heck of a lot of time into hard to realize
>> solutions, when you can ask a very simple and easy-to-answer question to the
>> browser instead. :)
>>
>> - Tul
>>
>
> Don't forget that some countries have DST, and some don't. And those
> that have DST, all use different dates.. So in to keep a static
> database you would also need to have DST info from all countries.
>
> - Matijn
Using the standard labels in /usr/share/zoneinfo should be able to
avoid having to keep track of who is and isn't in DST, *provided* you
find a way to map the user's address to one of those files.
--- End Message ---
--- Begin Message ---
On Sun, Oct 21, 2012 at 1:12 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
> Don't most browsers include this information in the HTTP headers?
Nope, you're probably confused with servers that return their time and date.
- Matijn
--- End Message ---
--- Begin Message ---
On Oct 21, 2012, at 5:11 PM, tamouse mailing lists wrote:
On Sun, Oct 21, 2012 at 7:30 AM, Matijn Woudt <tijn...@gmail.com>
wrote:
On Sun, Oct 21, 2012 at 12:01 PM, Maciek Sokolewicz
<maciek.sokolew...@gmail.com> wrote:
On 21-10-2012 01:11, Karl DeSaulniers wrote:
Thanks for the response. Yes, for the US I plan on calculating by
state, but
this website is not geared to just the US.
So I am looking for a solution that lets me also calculate by
country/region.
Was looking on google and found geoip, but not sure if this
will do
the job
I am looking for.
Anyone with experience on geoip that can send pointers?
Thanks,
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
Geo IP is based on IP, and I must warn you that IP data is not
always
accurate. Especially here in Europe, companies that are based in
multiple countries sometimes only register their IPs in a single
country, and share them between all the countries they are
active in.
This will give you wrong data from GeoIP. The time difference will
only be 1 hour at max, but still.
That was what my own suspicions were leading to.
I am familiar with the fact that ips can be spoofed.
Thanks for the corroboration.
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
As Bart said, IP is not ideal for this situation.
Since you do have information about the location of that person
(as in
country and possible state), you can find out the timezone via a
static
database.
The HTML5 geolocation tool is nice, and would certainly help a
lot! However,
be aware of the fact that it only works if there is the device on
which the
browser runs actually has the ability to find out its location. Many
smartphones have GPS chips, but most PCs don't. Asking a PC "where
are you
located?" the PC will answer "How should I know?".
Luckily for you, the way of country and state is pretty easy. I've
handed
you a list to find it in the USA. For most countries in the world,
there's a
simple 1:1 mapping of timezone and country
(http://en.wikipedia.org/wiki/List_of_time_zones_by_country),
there are
however 21 countries which have multiple timezones. In these
cases, you'll
need extra information to be able to distinguish between them.
For the USA, you already have a way.
For (ex-)colonical islands and such (such as for France), you
could always
add them to the country list:
- France
- France (Marquesas Islands)
- France (Gambier)
etc.
Thus treating them as separate countries for your timezone db.
In Russia, Canada, Australia, New Zealand, Brasil, Indonesia,
Kiribati,
Mexico,Congo, Ecuador, Micronesia, Kazakhstan and Mongolia you'll
need to
know their province / state to more accurately assess the ideal
timezone.
So for most countries, it's a simple 1:1 translation. For the above
countries, you'll need some extra info, and translate further
based on that.
You should be able to find the info required yourself, it just
takes a while
to collect it.
Alternatively, and this is the most simple way; since you're
asking people
for their country and such, simply also ask them about their
timezone. Don't
bother automating and putting a heck of a lot of time into hard to
realize
solutions, when you can ask a very simple and easy-to-answer
question to the
browser instead. :)
- Tul
Don't forget that some countries have DST, and some don't. And those
that have DST, all use different dates.. So in to keep a static
database you would also need to have DST info from all countries.
- Matijn
Using the standard labels in /usr/share/zoneinfo should be able to
avoid having to keep track of who is and isn't in DST, *provided* you
find a way to map the user's address to one of those files.
I am not familiar with this. Can you elaborate?
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---
--- Begin Message ---
On Sun, Oct 21, 2012 at 6:18 PM, Karl DeSaulniers <k...@designdrumm.com> wrote:
> On Oct 21, 2012, at 5:11 PM, tamouse mailing lists wrote:
>> Using the standard labels in /usr/share/zoneinfo should be able to
>> avoid having to keep track of who is and isn't in DST, *provided* you
>> find a way to map the user's address to one of those files.
>
> I am not familiar with this. Can you elaborate?
/usr/share/zoneinfo contains the time zone information in files and
subdirectories such as:
GMT
PST8PDT
America/Chicago
America/Los_Angeles
Europe/London
Europe/Rome
and so on, for all the various time zones.
You can use these names as strings in most time zone functions that
accept a time zone.
PHP knows about these; you'll find more info at
http://us1.php.net/manual/en/timezones.php
This doesn't help with the original question, finding out which time
zone a user is in, but once you find out, using the canonical names
will be useful without directly having to know if/when a particular
zone is in DST or not. You should never (ever!) have to deal with the
contents of these files; they contain binary data that is used in the
system to deal with figuring out that sort of thing.
--- End Message ---
--- Begin Message ---
Hello,
There are several sites offering free LAMP stacks but does anybody know of a
site that has free LAPP stacks available?
Please don't flame me for preferring PostgreSql.
It's to set-up a thin client application. Disk space required approx. 1.5Mb. I
need it to facilitate testing. Any suggestions welcome.
TIA,
Robert
--- End Message ---
--- Begin Message ---
On Sun, Oct 21, 2012 at 8:15 PM, Robert Stone <floripa...@yahoo.com.br> wrote:
> There are several sites offering free LAMP stacks but does anybody know of a
> site that has free LAPP stacks available?
If you already have a LAMP stack, adding Postgresql is really only a
matter of installing it.
If you're starting from scratch (bare metal kind of thing), you can
get a pretty minimal footprint LAPP stack from Turnkey Linux:
http://www.turnkeylinux.org/lapp
Similarly, BitNami has a LAPP stack: http://bitnami.org/stack/lappstack
> Please don't flame me for preferring PostgreSql.
There are several people of good repute that will castigate one for
using MySQL, so no flames here.
> It's to set-up a thin client application. Disk space required approx. 1.5Mb.
> I need it to facilitate testing. Any suggestions welcome.
Is that how much space is available on the client total? Or how much
is needed for the data base? or? If you are looking to embed a small,
low-volume web server+database+php, you could look at using
lighttpd+fastcgi+php+sqlite3.
... and let the flames commence!
--- End Message ---
--- Begin Message ---
Hello fellows.
Have anyone already tested PHP inside RAM disk with some Apache/nginx
accessing those files or even session files?
It's just for curiosity and performance analysis.
Thanks.
--
--
Att,
Alan Hoffmeister
--- End Message ---
--- Begin Message ---
On 22 okt. 2012, at 04:45, Alan Hoffmeister <alanhoffmeis...@gmail.com> wrote:
> Hello fellows.
> Have anyone already tested PHP inside RAM disk with some Apache/nginx
> accessing those files or even session files?
> It's just for curiosity and performance analysis.
>
> Thanks.
>
>
> --
> --
> Att,
> Alan Hoffmeister
I have not tested it but I think it wouldn't be much difference respecting APC
for example, maybe a tiny little bit faster reading sessions and other file
stuff because RAM have really small access times, but database connections and
stuff would still be your main bottleneck (I'm assuming you do).
I would install APC and set /tmp up into a RAM disc, mainly because not only do
MySQL write temporary files into /tmp (example: if MySQL decides to create a
temporary table which would be with almost any grouping you do), also apache
does and, if you haven't setted up the session routes, sessions will also write
itself to /tmp. Plus, if your machine happens to suddenly reboot, you won't
lose any important stuff.
Getting /var/log/ into an SSD or RAM disk should help too, but again: if
reliability is important to you, I wouldn't do that.
Greetings.
--- End Message ---
--- Begin Message ---
I have use RAM DISK in IIS7.5 and MYSQL.
PHP and MYSQL working in RAM DISK. faster...
------------------ Original ------------------
From: "Camilo Sperberg"<unrea...@gmail.com>;
Date: Mon, Oct 22, 2012 04:47 PM
To: "Alan Hoffmeister"<alanhoffmeis...@gmail.com>;
Cc: "php-general"<php-gene...@lists.php.net>;
Subject: Re: [PHP] RAM Disk
On 22 okt. 2012, at 04:45, Alan Hoffmeister <alanhoffmeis...@gmail.com> wrote:
> Hello fellows.
> Have anyone already tested PHP inside RAM disk with some Apache/nginx
> accessing those files or even session files?
> It's just for curiosity and performance analysis.
>
> Thanks.
>
>
> --
> --
> Att,
> Alan Hoffmeister
I have not tested it but I think it wouldn't be much difference respecting APC
for example, maybe a tiny little bit faster reading sessions and other file
stuff because RAM have really small access times, but database connections and
stuff would still be your main bottleneck (I'm assuming you do).
I would install APC and set /tmp up into a RAM disc, mainly because not only do
MySQL write temporary files into /tmp (example: if MySQL decides to create a
temporary table which would be with almost any grouping you do), also apache
does and, if you haven't setted up the session routes, sessions will also write
itself to /tmp. Plus, if your machine happens to suddenly reboot, you won't
lose any important stuff.
Getting /var/log/ into an SSD or RAM disk should help too, but again: if
reliability is important to you, I wouldn't do that.
Greetings.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi everyone,
First I want to say thank you to those of you that honestly replied to my
question about tables.
Now I won't be writing back to this group again, you see I suffer from
bi-polar Type 1 and take various medications which mess with my memory
which is why I needed table help with to beging with.
So, to end on a possible possitive note here's a link to my music I write -
the only thing I have any more.
http://www.youtube.com/watch?v=3dm1sbZLnIY&list=UUmMqRYs_h9PhF_1X0DeAQdw&index=2&feature=plcp
--- End Message ---
--- Begin Message ---
Hi,
I'm in a difficult situation here. I have a list of requirements for an
eCommerce system (Magento) where i'm getting mixed opinions about what to
do. Note: i do consider myself to be a quite experienced PHP programmer and
certainly have the skills to either make the extensions or make everything
from scratch. Both do require month of work! First - for the complete
picture - the list of requirements for the eCommerce system:
- (buld into magento) Multishop has to be possible
- Different payment modules have to be possible (buckaroo, afterpay, ...)
- Online chat (with for example zopim) has to be possible
- Advanced product permissions (magento only has "manage" not more specific
as in "edit")
- Setting pruduct margins
- Abandoned cart alerts
- One page checkout
- Some javascript/ajax things like "instant cart"
- A very specific order page (the "Booking and Reservations" plugin can do
that)
Thus far it's all oke. However, if i go to the magento irc channel i'm
getting really mixed opinions about what to use and what to create myself.
They basically say that i should prevent installing as much extensions as
possible and try to make most of the things myself. This is where i'm
getting really confused.
There are two possible routes to take here.
1. I can go for the magento route and just take the very steep learning
curve it has. It will be a slow process to make the modules required
(mainly the advanced permissions, setting product margins and a abandoned
cart extension). Two of those three are very difficult to make. Certainly
if you consider that i'm just starting developing in any eCommerce system.
2. Considering the steep learning curve of making extensions for Magento it
might be easier - in the long run - to build it all myself. In the
beginning that will be an even slower process then using Magento, but once
the structure is build it will be a much faster development process for any
extension.
I know it's usually a bad thing to reinvent the wheel and i am certainly
not intending that. However, right now i really get the impression that i'm
better of making it all myself. Both approaches take many months of
development where the self made version is going to pay off in development
time in the long run when compared to magento. I am just not sure what the
best solution might be.
So here is a list of pros and cons that i can think of for both approaches.
Pros/Cons for using magento
- [pro] a lot of existing extensions
- [pro] i don't need to worry about security updates since the come from
magento
- [pro] living community around it to help out if there are any issues
- [con] very steep learning curve
- [con] not straightforward to start developing in
- [con] takes a lot of time till you can even use the basics
Pros/Cons for self made
- [pro] Development will go a lot faster
- [pro] i can make it more specific for one goal
- [pro] a much easier extension model
- [con] security all depends on me
- [con] i have to make complicated extensions like buckaroo and afterpay
myself
- [con] no existing library of extensions to use
Again, i'm puzzled by this. If i follow the #magento (on freenode) list
then i should pick magento, but make every extension myself or only use the
really good ones. Thus that will require a lot of time to develop them. I
'm guessing about half a year. Then again, if i make it all from the ground
up it's probably also going to take half a year to develop (or slightly
more) but it will obviously be much easier to maintain since i know every
single line of it.
What is your recommendation? Build it myself? Use Magento? or another
option that i didn't even consider yet?
Kind regards,
Mark
--- End Message ---