Re: [fw-general] Escape, stripslashes and html entities

2010-02-19 Thread Pádraic Brady
>I try to figure out what the best option is to escape my data. I have an UTF-8 
>website so actually it's fine to work with the original 
characters (and no need for htmlentities() or 
>htmlspecialchars()).

I'm going to assume you just worded that badly because otherwise there are red 
flags exploding in my head. To clarify (if even needed), there are three 
strategies for escaping output. Strategy 1 is no escaping. This WILL result in 
XSS vulnerabilities. Strategy 2 is htmlspecialchars(). This escapes characters 
potentially interpreted as HTML (e.g. angle brackets, ampersands, etc.). If 
left intact these are what can be manipulated via input tampering to create XSS 
exploits (and we just got over fixing misuses of this across the framework in 
the last 1.9 release). Strategy 3 is htmlentities(). This should be used 
sparingly, and is typical of English oriented output (non-UTF8) in order to 
enable display of characters not supported by the current character set 
encoding. For example the UTF-8 á character can be including in non-UTF8 text 
by encoding it as the entity á.

Since you state your output (and presumably this carries back to input and 
persistence encoding) is UTF-8 the ONLY valid escaping mechanism is 
htmlspecialchars(). The function call MUST include the correct encoding as a 
parameter. htmlentities() on UTF-8 is overkill since UTF-8 natively supports 
almost any imaginable character without needing entities.

>Nevertheless all my data comes from a database and the data is inserted 
with all quotes escaped. That means by display the texts I need for 
every variable a 
>stripslashes().

It sounds a lot like double escaping, e.g. calling addslashes() before data is 
sent to a database adapter for writing. Can also happen if input is 
auto-slashed, e.g. magic quotes. This should be disabled/reversed before the 
database write - most adapters can natively escape correctly. PDO has prepared 
statements but manually even mysql(i) has its mysql(i)_real_escape_string 
functions. Slashes via a PHP procedure are never sufficient for database 
escaping - so I would recommend checking how this is occurring because frankly 
it's a major red flag for potential SQL Injection vulnerabilities if proper 
escaping is not being employed.

>Stripslashes() everywhere is very ugly and gives cluttered code in all 
my view scripts. What's the best option to strip the slashes 
automatically? Replace the escape function by 
>stripslashes() replaces 
the problem by another: $this->escape() everywhere instead of 
stripslashes(). Is it better to escape the variables automatically by 
overriding the __set() 
>from Zend_View_Abstract? Another (fail prove) 
systems to have a smart system to escape my data?

Almost impossible to avoid with ZF - 2.0 will carry a method for automatically 
escaping output variables, but it's a tricky proposition to implement. If you 
can ascertain the double escaping is innocent in nature, you could work up a 
replacement setter for Zend_View which accepts a context parameter. Still not 
pretty, but would force the repetitive stripslashes back to the controllers (or 
Model accessing helpers) instead of contaminating the View. Remember, valid 
un-slashed data should not be subject to stripslashes(), so adding it to 
Zend_View is more difficult than it appears at first glance.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Jurian Sluiman 
To: fw-general@lists.zend.com
Sent: Fri, February 19, 2010 10:33:06 PM
Subject: [fw-general] Escape, stripslashes and html entities

Hi all,
I try to figure out what the best option is to escape my data. I have an UTF-8 
website so actually it's fine to work with the original characters (and no need 
for htmlentities() or htmlspecialchars()). Nevertheless all my data comes from 
a database and the data is inserted with all quotes escaped. That means by 
display the texts I need for every variable a stripslashes().

Stripslashes() everywhere is very ugly and gives cluttered code in all my view 
scripts. What's the best option to strip the slashes automatically? Replace the 
escape function by stripslashes() replaces the problem by another: 
$this->escape() everywhere instead of stripslashes(). Is it better to escape 
the variables automatically by overriding the __set() from Zend_View_Abstract? 
Another (fail prove) systems to have a smart system to escape my data?

Thanks in advance,
Jurian

Re: [fw-general] Dynamic Text Replacement

2010-02-19 Thread Hector Virgen
A plugin would be nice because it's one of those things that you just set up
once and forget about. Another option would be to use a view helper, but you
have to remember to call it for each one of your headers:

headerTag('I am an H1', 1) ?>

 I use a plugin on my website that doesn't quite do what you're looking for
but it scans the response body for  tags to add syntax highlighting. It
might be useful to help you get started on your plugin. You can take a look
at it here:

http://www.virgentech.com/code/view/id/2

--
Hector


On Fri, Feb 19, 2010 at 1:14 PM, notrub225 wrote:

>
> I would like to integrate dynamic text replacement into one of my web
> sites.
> Here is an article about it on A List Apart:
> http://www.alistapart.com/articles/dynatext/
>
> Basically it will dynamically replace  tags with an image in the font I
> have chosen. What do you readers suggest I encapsulate this script as? I
> was
> thinking of making it a Plugin class...but how would I call it?
>
> Michael
> --
> View this message in context:
> http://n4.nabble.com/Dynamic-Text-Replacement-tp1562263p1562263.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Using SSL for certain controllers

2010-02-19 Thread Hector Virgen
Maybe you should go with an action controller helper that checks the request
and, if not SSL, redirects the user to the same page but with HTTPS.

You can then invoke your custom helper from within any controller that needs
it, probably something like this:

public function preDispatch()
{
$this->_helper->ssl->requireSsl();
}

When called, your SSL helper would analyze the request and if necessary
perform the redirect.

--
Hector


On Fri, Feb 19, 2010 at 1:57 PM, Stephan Stapel wrote:

> Hi!
>
> I'm searching for a solution to implement SSL redirection within Zend
> Framework applications.
>
> I've already found this posting:
>
> http://www.mail-archive.com/fw-general@lists.zend.com/msg10878.html
>
> but wondered if someone has a solution for controlling the SSL enforcement
> on a per controller basis.
>
> Regards,
>
> Stephan
>


Re: [fw-general] Escape, stripslashes and html entities

2010-02-19 Thread Hector Virgen
You shouldn't have to call stripslashes on data coming out of the database,
unless you somehow double-escaped it when being inserted. To be sure, your
SQL query should look something like this (in MySQL):

INSERT INTO table SET lastname = 'O\'Reilly';

If you accidentally are double-escaping, your query would look like this:

INSERT INTO table SET lastname = 'O\\\'Reilly';

When you pull the data back out of the database, you should not have any
slashes except when they are actually part of the data. This means all you
have to do is use $this->escape() on them from within your templates.

If you are double-escaping, the first thing I would check is to make sure
magic_quotes is OFF, and then manually escape the data going into the
database using Zend_Db#quote().

--
Hector


On Fri, Feb 19, 2010 at 2:33 PM, Jurian Sluiman  wrote:

> Hi all,
> I try to figure out what the best option is to escape my data. I have an
> UTF-8 website so actually it's fine to work with the original characters
> (and no need for htmlentities() or htmlspecialchars()). Nevertheless all my
> data comes from a database and the data is inserted with all quotes escaped.
> That means by display the texts I need for every variable a stripslashes().
>
> Stripslashes() everywhere is very ugly and gives cluttered code in all my
> view scripts. What's the best option to strip the slashes automatically?
> Replace the escape function by stripslashes() replaces the problem by
> another: $this->escape() everywhere instead of stripslashes(). Is it better
> to escape the variables automatically by overriding the __set() from
> Zend_View_Abstract? Another (fail prove) systems to have a smart system to
> escape my data?
>
> Thanks in advance,
> Jurian
>


[fw-general] Escape, stripslashes and html entities

2010-02-19 Thread Jurian Sluiman
Hi all,
I try to figure out what the best option is to escape my data. I have an
UTF-8 website so actually it's fine to work with the original characters
(and no need for htmlentities() or htmlspecialchars()). Nevertheless all my
data comes from a database and the data is inserted with all quotes escaped.
That means by display the texts I need for every variable a stripslashes().

Stripslashes() everywhere is very ugly and gives cluttered code in all my
view scripts. What's the best option to strip the slashes automatically?
Replace the escape function by stripslashes() replaces the problem by
another: $this->escape() everywhere instead of stripslashes(). Is it better
to escape the variables automatically by overriding the __set() from
Zend_View_Abstract? Another (fail prove) systems to have a smart system to
escape my data?

Thanks in advance,
Jurian


Re: [fw-general] Continuing On SubDomains

2010-02-19 Thread Paul

Currently i have them setup like the following:

project
application
public
admin
index.php
www
index.php
blog
index.php

each index.php has its own bootstrapper which defines its own 
application bootstrap class, and possibly use multiple configs, very 
similar to ZFPlanet demo.


On 2/19/2010 3:10 PM, Mark Wright wrote:

They look like 3 distinctly different sites so why not use different
public roots? I am currently working on a site with a .com and .com.au
domain where aside from some locale and some translation between us/uk
english (like color vs colour) the sites are the same so I use the
same document root. I have 2 virtual hosts which set an environment
variable indicating the country.



Mark

On Fri, Feb 19, 2010 at 11:54 AM, Paul  wrote:
   

Similar to the question asked earlier to subdomains... does it always make
sense to have all entries into an application be from within the public
folder?

An example of this would be a site with 3 subdomains - www.mydomain.com,
admin.mydomain.com, and blog.mydomain.com.

I think it make sense for some of these, in particular, the admin, to have
its own application bootstrap.  Something similar to Patraic Brady's
ZFPlanet, where the cli interface had its own bootstrap.

Would it make sense to alter the apache .htaccess file to look at the host..
or have 3 different document roots.

Trying to prevent duplication, yet give each entry it's own meaning /
context.

Also what would you call these, sites, portals, applications, etc?

Thanks,
Paul

 



   


[fw-general] Using SSL for certain controllers

2010-02-19 Thread Stephan Stapel

Hi!

I'm searching for a solution to implement SSL redirection within Zend 
Framework applications.


I've already found this posting:

http://www.mail-archive.com/fw-general@lists.zend.com/msg10878.html

but wondered if someone has a solution for controlling the SSL 
enforcement on a per controller basis.


Regards,

Stephan


[fw-general] Dynamic Text Replacement

2010-02-19 Thread notrub225

I would like to integrate dynamic text replacement into one of my web sites.
Here is an article about it on A List Apart:
http://www.alistapart.com/articles/dynatext/

Basically it will dynamically replace  tags with an image in the font I
have chosen. What do you readers suggest I encapsulate this script as? I was
thinking of making it a Plugin class...but how would I call it?

Michael
-- 
View this message in context: 
http://n4.nabble.com/Dynamic-Text-Replacement-tp1562263p1562263.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Custom view helper in Zend_Form

2010-02-19 Thread Shaun Farrell
jörg,

You can create your own view helper.  Check out this article
http://devzone.zend.com/article/3412


Shaun



On Fri, Feb 19, 2010 at 3:35 PM, pankraz  wrote:

>
> hi,
>
> i (zf newbie) am trying to implement an own view helper for my radio
> buttons.
>
> my problem: i am not able to integrate it in my form.
> my question: how/where do i overwrite the standard viewhelper
> ("FormRadio")?
>
> regards
> jörg
> --
> View this message in context:
> http://n4.nabble.com/Custom-view-helper-in-Zend-Form-tp1562204p1562204.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


[fw-general] Custom view helper in Zend_Form

2010-02-19 Thread pankraz

hi,

i (zf newbie) am trying to implement an own view helper for my radio
buttons. 

my problem: i am not able to integrate it in my form. 
my question: how/where do i overwrite the standard viewhelper ("FormRadio")?

regards
jörg
-- 
View this message in context: 
http://n4.nabble.com/Custom-view-helper-in-Zend-Form-tp1562204p1562204.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Continuing On SubDomains

2010-02-19 Thread Mark Wright
They look like 3 distinctly different sites so why not use different
public roots? I am currently working on a site with a .com and .com.au
domain where aside from some locale and some translation between us/uk
english (like color vs colour) the sites are the same so I use the
same document root. I have 2 virtual hosts which set an environment
variable indicating the country.



Mark

On Fri, Feb 19, 2010 at 11:54 AM, Paul  wrote:
> Similar to the question asked earlier to subdomains... does it always make
> sense to have all entries into an application be from within the public
> folder?
>
> An example of this would be a site with 3 subdomains - www.mydomain.com,
> admin.mydomain.com, and blog.mydomain.com.
>
> I think it make sense for some of these, in particular, the admin, to have
> its own application bootstrap.  Something similar to Patraic Brady's
> ZFPlanet, where the cli interface had its own bootstrap.
>
> Would it make sense to alter the apache .htaccess file to look at the host..
> or have 3 different document roots.
>
> Trying to prevent duplication, yet give each entry it's own meaning /
> context.
>
> Also what would you call these, sites, portals, applications, etc?
>
> Thanks,
> Paul
>



-- 
Have fun or die trying - but try not to actually die.


Re: [fw-general] the reference guide is really getting on my nerves

2010-02-19 Thread Mark Wright
I am getting a 200 / empty page. In response to monkeboy, I get this
at work and from home (2 different ISPs) so I don't think that it is a
problem on my end. And neither my home nor office network has changed
in the last few weeks just prior to this problem popping up.



Mark

On Fri, Feb 19, 2010 at 11:19 AM, Ralph Schindler
 wrote:
> I will be adding some logging to the site to see what the problem could be,
> are you just getting a 200 / empty page? or is it a 404 or 500 error?
>
> -ralph
>
> Jason Austin wrote:
>>
>> I, too, am experiencing similar issues on ff3.6 on osx.  It seems to
>> have only happened since the commenting system was put into place, if
>> that helps.  It wasn't just a blank page for me either.  Once I did
>> get something to load, it was incredibly slow.
>>
>> - Jason
>>
>> On Mon, Feb 15, 2010 at 6:55 PM, Mark Wright 
>> wrote:
>>>
>>> I emptied my cache so it no longer happens with every page, but it
>>> still happens about a quarter of the time. I am using ff 3.6 on osx
>>> 10.6.2. There is nothing special about my browser settings.
>>>
>>>
>>>
>>> Mark
>>>
>>> On Mon, Feb 15, 2010 at 9:15 AM, Matthew Weier O'Phinney
>>>  wrote:

 -- Mark Wright  wrote
 (on Friday, 12 February 2010, 02:39 PM -0700):
>
> Every time I go to a page in the reference guide that I have not
> already been to I just get a blank page. Sometimes it happens even if
> I have already been to that page, like when hitting the back button. I
> know that a reload will fix it (sometimes it takes two or three
> reloads), but why on earth do have have to do that with every single
> page?

 Are you still experiencing this? If so, what browser and operating
 system are you using, so we can try and reproduce the issue?

 I have personally tried FF 3.5 and Chrome 4 on Linux with no problems;
 I'd try Windows, but my current network setup prevents my WinXP vm from
 reaching the outside world.

 --
 Matthew Weier O'Phinney
 Project Lead            | matt...@zend.com
 Zend Framework          | http://framework.zend.com/
 PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

>>>
>>>
>>> --
>>> Have fun or die trying - but try not to actually die.
>>>
>>
>>
>>
>



-- 
Have fun or die trying - but try not to actually die.


[fw-general] Continuing On SubDomains

2010-02-19 Thread Paul
Similar to the question asked earlier to subdomains... does it always 
make sense to have all entries into an application be from within the 
public folder?


An example of this would be a site with 3 subdomains - www.mydomain.com, 
admin.mydomain.com, and blog.mydomain.com.


I think it make sense for some of these, in particular, the admin, to 
have its own application bootstrap.  Something similar to Patraic 
Brady's ZFPlanet, where the cli interface had its own bootstrap.


Would it make sense to alter the apache .htaccess file to look at the 
host.. or have 3 different document roots.


Trying to prevent duplication, yet give each entry it's own meaning / 
context.


Also what would you call these, sites, portals, applications, etc?

Thanks,
Paul


Re: [fw-general] Zend_Locale overhead

2010-02-19 Thread Thomas Weidner

No, because Zend_Locale forces you to use a cache.
You can select the overhead from loading locale infos by the time the cache 
is active.


Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - 
From: "keith Pope" 

To: "Zend Framework" 
Sent: Friday, February 19, 2010 6:14 PM
Subject: [fw-general] Zend_Locale overhead



Hi,

I am working on an application that allows the user to input text in
many languages, I was thinking of using Zend_Locale inside my Language
objects so I could easily get left-to-right info etc, however would
this be a large overhead having many locale objects instantiated all
using different locales?

Thx

Keith 




Re: [fw-general] the reference guide is really getting on my nerves

2010-02-19 Thread Ralph Schindler
I will be adding some logging to the site to see what the problem could 
be, are you just getting a 200 / empty page? or is it a 404 or 500 error?


-ralph

Jason Austin wrote:

I, too, am experiencing similar issues on ff3.6 on osx.  It seems to
have only happened since the commenting system was put into place, if
that helps.  It wasn't just a blank page for me either.  Once I did
get something to load, it was incredibly slow.

- Jason

On Mon, Feb 15, 2010 at 6:55 PM, Mark Wright  wrote:

I emptied my cache so it no longer happens with every page, but it
still happens about a quarter of the time. I am using ff 3.6 on osx
10.6.2. There is nothing special about my browser settings.



Mark

On Mon, Feb 15, 2010 at 9:15 AM, Matthew Weier O'Phinney
 wrote:

-- Mark Wright  wrote
(on Friday, 12 February 2010, 02:39 PM -0700):

Every time I go to a page in the reference guide that I have not
already been to I just get a blank page. Sometimes it happens even if
I have already been to that page, like when hitting the back button. I
know that a reload will fix it (sometimes it takes two or three
reloads), but why on earth do have have to do that with every single
page?

Are you still experiencing this? If so, what browser and operating
system are you using, so we can try and reproduce the issue?

I have personally tried FF 3.5 and Chrome 4 on Linux with no problems;
I'd try Windows, but my current network setup prevents my WinXP vm from
reaching the outside world.

--
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc




--
Have fun or die trying - but try not to actually die.







[fw-general] Zend_Locale overhead

2010-02-19 Thread keith Pope
Hi,

I am working on an application that allows the user to input text in
many languages, I was thinking of using Zend_Locale inside my Language
objects so I could easily get left-to-right info etc, however would
this be a large overhead having many locale objects instantiated all
using different locales?

Thx

Keith


Re: [fw-general] Easy way to page generation times

2010-02-19 Thread Nicolas Grevet

By the way, some Apache configurations already include the REQUEST_MICROTIME 
parameter


Errr... I mean, REQUEST_TIME.

Regards,
- Nicolas

Nicolas Grevet wrote:

[...] but a simple timer could be build as a
Zend_Controller_Plugin where in the routeStartup() you set a parameter
to the value of microtime and then at the end of your layout, subtract
the value from routeStartup() from the current value of microtime().


Yeah, except that the routeStartup() is called after the Bootstrap, 
which excludes a (sometimes) important part of the page from the loading 
time. You should put this directly in the index.php, on the first line. 
By the way, some Apache configurations already include the 
REQUEST_MICROTIME parameter, we stuffed our own microtime() in there.


Regards,
- Nicolas

Brad Griffith wrote:

If you're looking to detect slow database queries so that you know
where to target further profiling efforts, you should probably start
by looking Zend_Db_Profiler.  It will allow you to time each query and
optionally filter the results so you only display those that pass a
specified time threshold or are a specific type of query (e.g. SELECTs
only, not database connections themselves, etc.).  You can configure
the Zend_Db_Profiler to display inside Firebug for easy access during
development, write out to a log file, etc.

For actual page profiling I'd recommend using the profiling facilities
in Xdebug or Zend Profiler, but a simple timer could be build as a
Zend_Controller_Plugin where in the routeStartup() you set a parameter
to the value of microtime and then at the end of your layout, subtract
the value from routeStartup() from the current value of microtime().
That would get you a rough idea of page load times, but wouldn't be
completely accurate because it wouldn't include the very beginning of
the request.  That shouldn't be a problem, though, because that
portion of the request should be minimal and very consistent.

Hope that helps.

On Mon, Feb 15, 2010 at 11:09 PM, Ross Little  
wrote:

Hi Guys

I'm developing a web app using the Zend Framework and want to be able to
measure my page load times so that I can tweak my database queries and
caching to maximum effect.

Essentially, all I'm looking for is a string at the bottom of every page
saying: page generated in 

Cheers guys

Ross
--
View this message in context: 
http://n4.nabble.com/Easy-way-to-page-generation-times-tp1556938p1556938.html 


Sent from the Zend Framework mailing list archive at Nabble.com.











Re: [fw-general] Easy way to page generation times

2010-02-19 Thread Nicolas Grevet

[...] but a simple timer could be build as a
Zend_Controller_Plugin where in the routeStartup() you set a parameter
to the value of microtime and then at the end of your layout, subtract
the value from routeStartup() from the current value of microtime().


Yeah, except that the routeStartup() is called after the Bootstrap, 
which excludes a (sometimes) important part of the page from the loading 
time. You should put this directly in the index.php, on the first line. 
By the way, some Apache configurations already include the 
REQUEST_MICROTIME parameter, we stuffed our own microtime() in there.


Regards,
- Nicolas

Brad Griffith wrote:

If you're looking to detect slow database queries so that you know
where to target further profiling efforts, you should probably start
by looking Zend_Db_Profiler.  It will allow you to time each query and
optionally filter the results so you only display those that pass a
specified time threshold or are a specific type of query (e.g. SELECTs
only, not database connections themselves, etc.).  You can configure
the Zend_Db_Profiler to display inside Firebug for easy access during
development, write out to a log file, etc.

For actual page profiling I'd recommend using the profiling facilities
in Xdebug or Zend Profiler, but a simple timer could be build as a
Zend_Controller_Plugin where in the routeStartup() you set a parameter
to the value of microtime and then at the end of your layout, subtract
the value from routeStartup() from the current value of microtime().
That would get you a rough idea of page load times, but wouldn't be
completely accurate because it wouldn't include the very beginning of
the request.  That shouldn't be a problem, though, because that
portion of the request should be minimal and very consistent.

Hope that helps.

On Mon, Feb 15, 2010 at 11:09 PM, Ross Little  wrote:

Hi Guys

I'm developing a web app using the Zend Framework and want to be able to
measure my page load times so that I can tweak my database queries and
caching to maximum effect.

Essentially, all I'm looking for is a string at the bottom of every page
saying: page generated in 

Cheers guys

Ross
--
View this message in context: 
http://n4.nabble.com/Easy-way-to-page-generation-times-tp1556938p1556938.html
Sent from the Zend Framework mailing list archive at Nabble.com.







[fw-general] Zend_Log possible security issue

2010-02-19 Thread Nick Pack
Hi All,

Wondering if anyone has seen this (I know the article itself is related to
PHPIDS, but includes ZF):
https://www.sektioneins.de/en/advisories/advisory-022009-phpids-unserialize-
vulnerability/index.html

It highlights some possible exploitable flaws in Zend_Log and
Zend_Log_Writer_Mail ­ do these need looking at?


Re: [fw-general] Easy way to page generation times

2010-02-19 Thread Brad Griffith
If you're looking to detect slow database queries so that you know
where to target further profiling efforts, you should probably start
by looking Zend_Db_Profiler.  It will allow you to time each query and
optionally filter the results so you only display those that pass a
specified time threshold or are a specific type of query (e.g. SELECTs
only, not database connections themselves, etc.).  You can configure
the Zend_Db_Profiler to display inside Firebug for easy access during
development, write out to a log file, etc.

For actual page profiling I'd recommend using the profiling facilities
in Xdebug or Zend Profiler, but a simple timer could be build as a
Zend_Controller_Plugin where in the routeStartup() you set a parameter
to the value of microtime and then at the end of your layout, subtract
the value from routeStartup() from the current value of microtime().
That would get you a rough idea of page load times, but wouldn't be
completely accurate because it wouldn't include the very beginning of
the request.  That shouldn't be a problem, though, because that
portion of the request should be minimal and very consistent.

Hope that helps.

On Mon, Feb 15, 2010 at 11:09 PM, Ross Little  wrote:
>
> Hi Guys
>
> I'm developing a web app using the Zend Framework and want to be able to
> measure my page load times so that I can tweak my database queries and
> caching to maximum effect.
>
> Essentially, all I'm looking for is a string at the bottom of every page
> saying: page generated in 
>
> Cheers guys
>
> Ross
> --
> View this message in context: 
> http://n4.nabble.com/Easy-way-to-page-generation-times-tp1556938p1556938.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: [fw-mvc] How can I run a single zf application on different subdomains?

2010-02-19 Thread Daniel Latter
You will also probably need to enable wild card sub-domains? no?

Thanks
Dan




On 19 February 2010 14:23, Rob Keplin  wrote:

>  I would look into Zend_Controller_Router_Route_Hostname for this:
> http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.hostname
>
> This way, you can route the page to a specific controller/action when a
> subdomain is present, and retrieve what language they want as if it were
> part of the query string.
>
> Rob
>
>
>
> Laurens van Vliet wrote:
>
> I have a website that I made with ZF and it is running on a server. Because
> I want this website to be multilanguage, I made some subdomains for the
> different languages on the webserver.
> Lets say the site is running now on en.mywebsite.com. In this directory
> all the application code, data and library is located.
> I also have on the same server these es.mywebsite.com and 
> fr.mywebsite.comdirectories. My idea was to put the files that are normally 
> in the /public
> directory of a zf application in these subdomain dirs. And by pointing the
> Application_path in the index.php files to the
> en.mywebsite.com/application I thought I could run the application on the
> subdomains.
>
> When I open the es.mywebsite.com in my browser I get a error message like
> this:
> Fatal error:  Uncaught exception 'Zend_Config_Exception' with message
> 'parse_ini_file(../application/configs/application.ini) [ href='function.parse-ini-file'>function.parse-ini-file]: failed to open
> stream: No such file or directory' in
> /var/www/zend/ZendFramework-1.9.7-minimal/library/Zend/Config/Ini.php:184
>
> Is my approach correct to run a single application on different subdomains
> and how can I solve this?
> Can someone help me with this problem? Thanks!
>
>  Regards,
>
>  Laurens van Vliet
>
>
>
>


[fw-general] Re: [fw-mvc] How can I run a single zf application on different subdomains?

2010-02-19 Thread Rob Keplin
I would look into Zend_Controller_Router_Route_Hostname for this: 
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.hostname


This way, you can route the page to a specific controller/action when a 
subdomain is present, and retrieve what language they want as if it were 
part of the query string.


Rob


Laurens van Vliet wrote:
I have a website that I made with ZF and it is running on a server. 
Because I want this website to be multilanguage, I made some 
subdomains for the different languages on the webserver.
Lets say the site is running now on en.mywebsite.com 
. In this directory all the application code, 
data and library is located.
I also have on the same server these es.mywebsite.com 
 and fr.mywebsite.com 
 directories. My idea was to put the files 
that are normally in the /public directory of a zf application in 
these subdomain dirs. And by pointing the Application_path in the 
index.php files to the en.mywebsite.com/application 
 I thought I could run the 
application on the subdomains.


When I open the es.mywebsite.com  in my 
browser I get a error message like this:
Fatal error:  Uncaught exception 'Zend_Config_Exception' with message 
'parse_ini_file(../application/configs/application.ini) [href='function.parse-ini-file'>function.parse-ini-file]: failed to 
open stream: No such file or directory' in 
/var/www/zend/ZendFramework-1.9.7-minimal/library/Zend/Config/Ini.php:184


Is my approach correct to run a single application on different 
subdomains and how can I solve this?

Can someone help me with this problem? Thanks!

Regards,

Laurens van Vliet





Re: [fw-general] How can I run a single zf application on different subdomains?

2010-02-19 Thread Aleksey Zapparov
Hello,

Can you show your index.php?


2010/2/19 Laurens van Vliet :
> I have a website that I made with ZF and it is running on a server. Because
> I want this website to be multilanguage, I made some subdomains for the
> different languages on the webserver.
> Lets say the site is running now on en.mywebsite.com. In this directory all
> the application code, data and library is located.
> I also have on the same server these es.mywebsite.com and fr.mywebsite.com
> directories. My idea was to put the files that are normally in the /public
> directory of a zf application in these subdomain dirs. And by pointing the
> Application_path in the index.php files to the en.mywebsite.com/application
> I thought I could run the application on the subdomains.
>
> When I open the es.mywebsite.com in my browser I get a error message like
> this:
> Fatal error:  Uncaught exception 'Zend_Config_Exception' with message
> 'parse_ini_file(../application/configs/application.ini) [ href='function.parse-ini-file'>function.parse-ini-file]: failed to open
> stream: No such file or directory' in
> /var/www/zend/ZendFramework-1.9.7-minimal/library/Zend/Config/Ini.php:184
>
> Is my approach correct to run a single application on different subdomains
> and how can I solve this?
> Can someone help me with this problem? Thanks!
> Regards,
> Laurens van Vliet
>
>
>



-- 
Sincerely yours,
Aleksey V. Zapparov A.K.A. ixti
FSF Member #7118
Mobile Phone: +34 617 179 344
Homepage: http://www.ixti.ru
JID: zappa...@jabber.ru

*Origin: Happy Hacking!


[fw-general] How can I run a single zf application on different subdomains?

2010-02-19 Thread Laurens van Vliet
I have a website that I made with ZF and it is running on a server. Because I 
want this website to be multilanguage, I made some subdomains for the different 
languages on the webserver.
Lets say the site is running now on en.mywebsite.com. In this directory all the 
application code, data and library is located.
I also have on the same server these es.mywebsite.com and fr.mywebsite.com 
directories. My idea was to put the files that are normally in the /public 
directory of a zf application in these subdomain dirs. And by pointing the 
Application_path in the index.php files to the en.mywebsite.com/application I 
thought I could run the application on the subdomains.

When I open the es.mywebsite.com in my browser I get a error message like this:
Fatal error:  Uncaught exception 'Zend_Config_Exception' with message 
'parse_ini_file(../application/configs/application.ini) [function.parse-ini-file]: failed to open 
stream: No such file or directory' in 
/var/www/zend/ZendFramework-1.9.7-minimal/library/Zend/Config/Ini.php:184

Is my approach correct to run a single application on different subdomains and 
how can I solve this?
Can someone help me with this problem? Thanks!

Regards,

Laurens van Vliet





Re: [fw-general] PDO or Mysqli?

2010-02-19 Thread Nicolas Grevet

I guess this was the interesting part:


In terms of the general use cases [...] you will see no discernible difference.


Regards,
- Nicolas


Саша Стаменковић wrote:

So, which one is better in terms of performances?

Regards,
Saša Stamenković


On Thu, Feb 18, 2010 at 7:37 PM, Ralph Schindler 
mailto:ralph.schind...@zend.com>> wrote:


In terms of the general use cases (anything documented in the
manual, Zend_Db_Table, Zend_Db_Select) - you will see no discernible
difference. The only time you'll see any differences is if you are
using extension specific features.

I suggest you have a look at the chart at the bottom of this page:

http://us3.php.net/manual/en/mysqli.overview.php

This will give you a better idea for what goes on under the hood in
Zend_Db_Adapter_Mysqli and Zend_Db_Adapter_Pdo_Mysql.

Beyond that, both extensions are as available on all platforms I've
seen, so either choice is good, and generally, switching in
mid-stream is a piece of cake.

-ralph


Ross Little wrote:

Hi Guys

I'm relatively new to ZF, but it seems that just about every
tutorial out
there uses the Mysqli adapter but everywhere else, I read about
how much
more secure and efficient the PDO adapter is.  Is this true?

In order to take advantage of PDO, do I only need to change my
resources.db.adapter in my application.ini file?  I tried this
and I didn't
notice any difference. I mean, i don't imagine it'll make a
discernable
difference on my development version of the code, but it didn't
break
anything.  
Any thoughts?


Ross