2009年12月30日星期三

[fw-db] Zend_Db_Table_Row recursive cascade delete feature

Hi all,

In looking at the issue:
"Improve cascade delete functionality to support more then one cascade"

located at:
http://framework.zend.com/issues/browse/ZF-1103

it appears it's a feature that a lot of people want. I have created a
patch that adds this functionality, and have given it a brief testing.

I am still working on creating unit tests for this, but the attachment
in the issue adds support for "recursive cascade delete support".

This is an OPT-IN feature. To use it, instead of the 'onDelete' key of
the reference map set to self::CASCADE (or
Zend_Db_Table_Abstract::CASCADE), you would use self::CASCADE_RECURSE.

It should be noted that this is opt-in since it requires additional
selects to find the proper rows that need to be deleted.

I would like people who are interested in this feature to have a look at
it and let me know if it suits your needs. Not only does it suit your
needs, but also think about if there any conceivable issues that might
arise from this feature. If so, I see no reason why this cannot go into
1.10.

Thanks in advance & Happy New Year!
Ralph Schindler

Re: [fw-mvc] BaseUrl and subdomains

Interesting.

How would I split up the requests in this case? Part of what the CDN1,
CDN2, CDN3 did was to make sure the same image or resource got the same
static server each time (for caching - each one points somewhere
different)... I suppose I could pass that in here but seems like extra
work on the server for no real gain, at least in my case.

Thanks for any info

On 12/30/09 5:30 AM, Paul Court wrote:
> Hi Cristian,
>
>
> On Tue, Dec 29, 2009 at 10:51 AM, Cristian Bichis<contact@zftutorials.com> wrote:
>
>> Hi,
>>
>> I have one small problem while working on a ZF based website.
>>
>> The website is supposed to work on www.domain.com and some of the parts are working on subdomains as subdomain1.domain.com,subdomain2.domain.com, aso.
>>
>> I want to load the static resources (js, css, images) from the main domain, and not from the subdomains, because are the same, for both domain and subdomains. Purpose is obvious: to have the static resources loading from one single location, so it would cache (so everything load faster, no matter on which subdomain we are).
>>
>
> I will second Hector's suggestion...
>
> On 29 Dec 2009, at 19:03, Hector Virgen wrote:
>
>
>> I'd probably go with a custom view helper to keep from polluting the router with a server name that only applies to static resources.
>>
>> --
>> Hector
>>
> This way you are keeping all the logic for your CDN or whatever inside your baseUrl() helper. I use an extra parameter to signify if the resource is static or not, like this:-
>
> <?php
> class Zend_View_Helper_BaseUrl {
>
> public function baseUrl($static = false) {
> $fc = Zend_Controller_Front::getInstance();
> return $fc->getBaseUrl();
> }
> }
> ?>
>
> As you can see, at the moment it is just a standard baseUrl helper, but in the future I can change this block of code and modify the behaviour anyway I want without having to change anything else (unlike Bill's solution, which has CDN1,2,3 all over his view scripts!).
>
> Regards
> Paul
> (aka. Gargoyle on #zftalk)
>
>
>

Re: [fw-mvc] BaseUrl and subdomains

Hi Andreas,

lol.. Ignore the table aspect of this... we had no choice. I wish we
had an unlimited time / budget / no legacy code base / requirements...

ZF code conventions? Are you referring to the echo short tag? That was
a design decision... It's the only short tag dependent way we use them,
but we also don't have to worry about our code going outside our
company. I've checked and the running opinion is that these will be
continued when short tags go away. We stick to most of them -
sometimes it makes sense to go your own way for a bit. Makes for more
readable code IMO.

We debated a redo, but this was the obvious quick hit... We have
limited time and money, so... Those constants are the only superglobals
we use and we are good with that. We also had to reduce the load on our
pipe, the app serves a lot of static stuff so getting that out was easy.

Change it to a plugin if you want, all you are going to do is spend
cycles sticking in a variable... I think there is a time and place for
tableless design, but I wouldn't tackle it as a first fix without
knowing where the bottleneck is.

On 12/30/09 8:51 AM, Andreas Möller wrote:
>> All my references to anything are like
>>
>> <td background="<?=CDN1?>/styles/images/bg_t0_rightfade.jpg" width="375"
>> valign="top">
>
> Sorry, but this is no good. You are using tables for layout purposes,
> you are using constants ("superglobals"), you are not sticking to ZF
> code conventions (portability of your code?), you are not even using
> inline CSS - where do you want to go with this?
>
>> So during development and testing they can go to one place, then in
>> production the CDN1, etc get set to our Amazon content delivery domains.
>> I do CDN1, CDN2, CDN3 so the browser will do more at once, and in theory
>> render the page faster.Some browsers will only start 10 connections to
>> a single domain I've read, so this allows us to get 30 going quickly.
>> The constant also allows us to be flexible. I suppose you could do them
>> based on what resource they were... Heavy stuff moved off site
>> perhaps... It also works if your traffic goes way up... you can route
>> images from a server that does not do cookies or php, something light
>> and fast.
>
> Start with table-less designs, CSS, and then you can think about
> tweaking other stuff.
>
>> So we sort of round-robin them when assigning them. If the CDN is blank,
>> then it just goes to the root of the site its currently running from.
>>
>> Like I said, I am somewhat new to this, but a constant in there seems a
>> bit less complicated than messing with the controller...
>
> Nope. What about injecting stuff using plugins?
>
>
> Best regards,
>
> Andreas

Re: [fw-auth] redirect after login from restricted page

But it will only tell you whether the resource exists in the ACL, but not whether it actually exists.

So you you check whether the resource is listed in the ACL, but it's not, because the role the user is assigned does not have access to the resource and in the ACL, resources are white-listed.

So, either you have to have all resources that actually exist and all roles and all access rights (whether white or black) at hand when the plugin or an action method needs to access it, which on one hand can become either a tedious process (adding all resources manually), or less tedious up to elegant through the use of a cached and database driven ACL management, and DirectoryIterator and ReflectionClass instances to scan for modules, controllers and actions, which while thinking of it, is actually quite nice. But still, for the heck of whatever argument may come into place when thinking of optimization, I thought it would make sense to load only the ACL for the current role (as you may have lots of them, and lots of resources) and check whether the resource exists for any other role that might be granted access to that resource via the same means by which the resource was attempted to be accessed (e.g., a resource might exist, but authentication would only be processed when a certain API request is made, but not when a user is surfing your site, so instead of prompting for authentication, you want something different rendered). Does this seem weird? Should one load all resources and roles and access rights?


Best regards,

Andreas

Re: [fw-auth] redirect after login from restricted page

Thanks for your responses. To clarify what I am doing, I am using Zend_Auth:

class MemberController extends Zend_Controller_Action
{
public function init()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$this->view->identity = $auth->getIdentity();
} else {
$this->_redirect('/user/fail');
}
}
}

The above init() is in the MemberController and the redirect on fail sends
them to the UserController.

As an example if the email link sent to a registered member (who is not
logged in) is "http://localhost/member/index" they will be redirected to
'/user/fail' where they will be able to log in.

What I need help with is the best way to get them back to
"http://localhost/member/index" after they have successfully logged in.

So I'm thinking that I need to somehow attach the URL
("http://localhost/member/index") to the _redirect() and then somehow add it
to the $userForm->setAction().

Hopefully that helps - Thanks

--
View this message in context: http://n4.nabble.com/redirect-after-login-from-restricted-page-tp990697p991123.html
Sent from the Zend Auth mailing list archive at Nabble.com.

Re: [fw-auth] redirect after login from restricted page

Only to complement, yes, it is in the reference guide.



2009/12/30 Hector Virgen <djvirgen@gmail.com>
You can use Zend_Acl#has() to check if a resource exists. I'm not sure if it's documented in the reference guide but it's in the API documentation.

--
Hector



On Wed, Dec 30, 2009 at 6:13 AM, Andreas Möller <localheinz@l8m.de> wrote:
You can use the flash messenger to record the request_uri, redirect to a
login form, and then check for it on valid login. If it exists,
redirect. Otherwise, serve the default protected screen.

Ok, so you start with a request object, and likely, you have a plugin that retrieves the role of the requesting client and compares the requested resource against a set of rules.

Hence, when the user has a certain role (e.g., "guest") he may not be granted access to a certain resource as it's not listed in the ACL.

So, maybe that resource exists, maybe it doesn't. How would you know?


Best regards,

Andreas





--
André de Camargo Fernandes


Re: [fw-auth] redirect after login from restricted page

You can use Zend_Acl#has() to check if a resource exists. I'm not sure if it's documented in the reference guide but it's in the API documentation.

--
Hector


On Wed, Dec 30, 2009 at 6:13 AM, Andreas Möller <localheinz@l8m.de> wrote:
You can use the flash messenger to record the request_uri, redirect to a
login form, and then check for it on valid login. If it exists,
redirect. Otherwise, serve the default protected screen.

Ok, so you start with a request object, and likely, you have a plugin that retrieves the role of the requesting client and compares the requested resource against a set of rules.

Hence, when the user has a certain role (e.g., "guest") he may not be granted access to a certain resource as it's not listed in the ACL.

So, maybe that resource exists, maybe it doesn't. How would you know?


Best regards,

Andreas


Re: [fw-auth] redirect after login from restricted page

> You can use the flash messenger to record the request_uri, redirect to a
> login form, and then check for it on valid login. If it exists,
> redirect. Otherwise, serve the default protected screen.

Ok, so you start with a request object, and likely, you have a plugin
that retrieves the role of the requesting client and compares the
requested resource against a set of rules.

Hence, when the user has a certain role (e.g., "guest") he may not be
granted access to a certain resource as it's not listed in the ACL.

So, maybe that resource exists, maybe it doesn't. How would you know?


Best regards,

Andreas

Re: [fw-mvc] BaseUrl and subdomains

> I'd probably go with a custom view helper to keep from polluting the
> router with a server name that only applies to static resources.

Static resources do not even go through the router.


Best regards,

Andreas

Re: [fw-mvc] BaseUrl and subdomains

> All my references to anything are like
>
> <td background="<?=CDN1?>/styles/images/bg_t0_rightfade.jpg" width="375"
> valign="top">

Sorry, but this is no good. You are using tables for layout purposes,
you are using constants ("superglobals"), you are not sticking to ZF
code conventions (portability of your code?), you are not even using
inline CSS - where do you want to go with this?

> So during development and testing they can go to one place, then in
> production the CDN1, etc get set to our Amazon content delivery domains.
> I do CDN1, CDN2, CDN3 so the browser will do more at once, and in theory
> render the page faster.Some browsers will only start 10 connections to
> a single domain I've read, so this allows us to get 30 going quickly.
> The constant also allows us to be flexible. I suppose you could do them
> based on what resource they were... Heavy stuff moved off site
> perhaps... It also works if your traffic goes way up... you can route
> images from a server that does not do cookies or php, something light
> and fast.

Start with table-less designs, CSS, and then you can think about
tweaking other stuff.

> So we sort of round-robin them when assigning them. If the CDN is blank,
> then it just goes to the root of the site its currently running from.
>
> Like I said, I am somewhat new to this, but a constant in there seems a
> bit less complicated than messing with the controller...

Nope. What about injecting stuff using plugins?


Best regards,

Andreas

Re: [fw-mvc] BaseUrl and subdomains

Hi Cristian,


On Tue, Dec 29, 2009 at 10:51 AM, Cristian Bichis <contact@zftutorials.com> wrote:
> Hi,
>
> I have one small problem while working on a ZF based website.
>
> The website is supposed to work on www.domain.com and some of the parts are working on subdomains as subdomain1.domain.com,subdomain2.domain.com, aso.
>
> I want to load the static resources (js, css, images) from the main domain, and not from the subdomains, because are the same, for both domain and subdomains. Purpose is obvious: to have the static resources loading from one single location, so it would cache (so everything load faster, no matter on which subdomain we are).


I will second Hector's suggestion...

On 29 Dec 2009, at 19:03, Hector Virgen wrote:

> I'd probably go with a custom view helper to keep from polluting the router with a server name that only applies to static resources.
>
> --
> Hector

This way you are keeping all the logic for your CDN or whatever inside your baseUrl() helper. I use an extra parameter to signify if the resource is static or not, like this:-

<?php
class Zend_View_Helper_BaseUrl {

public function baseUrl($static = false) {
$fc = Zend_Controller_Front::getInstance();
return $fc->getBaseUrl();
}
}
?>

As you can see, at the moment it is just a standard baseUrl helper, but in the future I can change this block of code and modify the behaviour anyway I want without having to change anything else (unlike Bill's solution, which has CDN1,2,3 all over his view scripts!).

Regards
Paul
(aka. Gargoyle on #zftalk)

2009年12月29日星期二

Re: [fw-mvc] BaseUrl and subdomains


Let me clarify that I set the CDN in my .htaccess file for each site.  The index.php or bootstrap grabs them and sets the constants, and if they are not there it does set a default.


On 12/30/09 12:27 AM, Bill Chmura wrote:

Hi Cristian,

I am somewhat new to ZF, so I am not sure I know why you are doing all that...  If you are just doing the static web stuff, just code for the url...  One of our projects I defined some environmental variables for CDN1, CDN2, CDN3 and set them to different locations.  My bootstrap checks for them and if they are not there they get set to basically "".

All my references to anything are like

<td background="<?=CDN1?>/styles/images/bg_t0_rightfade.jpg" width="375" valign="top">

So during development and testing they can go to one place, then in production the CDN1, etc get set to our Amazon content delivery domains.  I do CDN1, CDN2, CDN3 so the browser will do more at once, and in theory render the page faster.  Some browsers will only start 10 connections to a single domain I've read, so this allows us to get 30 going quickly.  The constant also allows us to be flexible.  I suppose you could do them based on what resource they were... Heavy stuff moved off site perhaps...  It also works if your traffic goes way up... you can route images from a server that does not do cookies or php, something light and fast.

So we sort of round-robin them when assigning them.  If the CDN is blank, then it just goes to the root of the site its currently running from.

Like I said, I am somewhat new to this, but a constant in there seems a bit less complicated than messing with the controller... 

I don't know if that helps - but if its crazy, I'd also like to hear about it :)

Bill


On 12/29/09 1:51 PM, Cristian Bichis wrote:
Hi,

I have one small problem while working on a ZF based website.

The website is supposed to work on www.domain.com and some of the parts are working on subdomains as subdomain1.
domain.com, subdomain2.domain.com, aso.

I want to load the static resources (js, css, images) from the main domain, and not from the subdomains, because are the same, for both domain and subdomains. Purpose is obvious: to have the static resources loading from one single location, so it would cache (so everything load faster, no matter on which subdomain we are).

Now: so the resources are loaded from the www.domain.com i'we set the base Url to:

resources.frontcontroller.baseUrl = "http://www.domain.com/"

And the resources are loaded from one location (sample:
http://www.domain.com/images/img1.png), no matter on what subdomain we are... Great...

But there is one problem: seems all the requests for URL's (pages, not static content) are now dispatched to module=default, controller=index, action=index...

As far as i checked the problem is the baseUrl is used also at dispatch.

I have found some workarounds:
1. Use my own helper to point all static resources to the www.domain.com
2. Into a preDispatch i set the baseUrl to http://
www.domain.com/

Both solutions are fine, but i am wondering if there is one more elegant solution...

--  Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com


Re: [fw-mvc] BaseUrl and subdomains


Hi Cristian,

I am somewhat new to ZF, so I am not sure I know why you are doing all that...  If you are just doing the static web stuff, just code for the url...  One of our projects I defined some environmental variables for CDN1, CDN2, CDN3 and set them to different locations.  My bootstrap checks for them and if they are not there they get set to basically "".

All my references to anything are like

<td background="<?=CDN1?>/styles/images/bg_t0_rightfade.jpg" width="375" valign="top">

So during development and testing they can go to one place, then in production the CDN1, etc get set to our Amazon content delivery domains.  I do CDN1, CDN2, CDN3 so the browser will do more at once, and in theory render the page faster.  Some browsers will only start 10 connections to a single domain I've read, so this allows us to get 30 going quickly.  The constant also allows us to be flexible.  I suppose you could do them based on what resource they were... Heavy stuff moved off site perhaps...  It also works if your traffic goes way up... you can route images from a server that does not do cookies or php, something light and fast.

So we sort of round-robin them when assigning them.  If the CDN is blank, then it just goes to the root of the site its currently running from.

Like I said, I am somewhat new to this, but a constant in there seems a bit less complicated than messing with the controller... 

I don't know if that helps - but if its crazy, I'd also like to hear about it :)

Bill


On 12/29/09 1:51 PM, Cristian Bichis wrote:
Hi,

I have one small problem while working on a ZF based website.

The website is supposed to work on www.domain.com and some of the parts are working on subdomains as subdomain1.
domain.com, subdomain2.domain.com, aso.

I want to load the static resources (js, css, images) from the main domain, and not from the subdomains, because are the same, for both domain and subdomains. Purpose is obvious: to have the static resources loading from one single location, so it would cache (so everything load faster, no matter on which subdomain we are).

Now: so the resources are loaded from the www.domain.com i'we set the base Url to:

resources.frontcontroller.baseUrl = "http://www.domain.com/"

And the resources are loaded from one location (sample:
http://www.domain.com/images/img1.png), no matter on what subdomain we are... Great...

But there is one problem: seems all the requests for URL's (pages, not static content) are now dispatched to module=default, controller=index, action=index...

As far as i checked the problem is the baseUrl is used also at dispatch.

I have found some workarounds:
1. Use my own helper to point all static resources to the www.domain.com
2. Into a preDispatch i set the baseUrl to http://
www.domain.com/

Both solutions are fine, but i am wondering if there is one more elegant solution...

--  Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

Re: [fw-auth] redirect after login from restricted page

You can use the flash messenger to record the request_uri, redirect to a login form, and then check for it on valid login. If it exists, redirect. Otherwise, serve the default protected screen.
- pw

On Tue, Dec 29, 2009 at 5:03 PM, blorriman <bob@strataserve.ca> wrote:

I am working on a site that registered users can input comments which are
then emailed to other registered users - the email includes a link to the
comment - but users must be logged in to read the comment.

What I want is for the user to click the link (from the email) - if they are
not logged in they will go to a fail page that allows them to log in - when
they log in, they will be redirected to the page from the email link.

Can someone give me some direction on how I would do this redirection?
--
View this message in context: http://n4.nabble.com/redirect-after-login-from-restricted-page-tp990697p990697.html
Sent from the Zend Auth mailing list archive at Nabble.com.


Re: [fw-auth] redirect after login from restricted page

You can simply store the requested url in a query variable, and store it in your form. Something like this:

/mysite/login?url=comment/85

Then in your form store that url in a hidden field. After submitting the form, redirect to that url

On Tue, Dec 29, 2009 at 8:03 PM, blorriman <bob@strataserve.ca> wrote:

I am working on a site that registered users can input comments which are
then emailed to other registered users - the email includes a link to the
comment - but users must be logged in to read the comment.

What I want is for the user to click the link (from the email) - if they are
not logged in they will go to a fail page that allows them to log in - when
they log in, they will be redirected to the page from the email link.

Can someone give me some direction on how I would do this redirection?
--
View this message in context: http://n4.nabble.com/redirect-after-login-from-restricted-page-tp990697p990697.html
Sent from the Zend Auth mailing list archive at Nabble.com.


[fw-auth] redirect after login from restricted page

I am working on a site that registered users can input comments which are
then emailed to other registered users - the email includes a link to the
comment - but users must be logged in to read the comment.

What I want is for the user to click the link (from the email) - if they are
not logged in they will go to a fail page that allows them to log in - when
they log in, they will be redirected to the page from the email link.

Can someone give me some direction on how I would do this redirection?
--
View this message in context: http://n4.nabble.com/redirect-after-login-from-restricted-page-tp990697p990697.html
Sent from the Zend Auth mailing list archive at Nabble.com.

Re: [fw-mvc] BaseUrl and subdomains

I'd probably go with a custom view helper to keep from polluting the router with a server name that only applies to static resources.

--
Hector


On Tue, Dec 29, 2009 at 10:51 AM, Cristian Bichis <contact@zftutorials.com> wrote:
Hi,

I have one small problem while working on a ZF based website.

The website is supposed to work on www.domain.com and some of the parts are working on subdomains as subdomain1.
domain.com, subdomain2.domain.com, aso.

I want to load the static resources (js, css, images) from the main domain, and not from the subdomains, because are the same, for both domain and subdomains. Purpose is obvious: to have the static resources loading from one single location, so it would cache (so everything load faster, no matter on which subdomain we are).

Now: so the resources are loaded from the www.domain.com i'we set the base Url to:

resources.frontcontroller.baseUrl = "http://www.domain.com/"

And the resources are loaded from one location (sample:
http://www.domain.com/images/img1.png), no matter on what subdomain we are... Great...

But there is one problem: seems all the requests for URL's (pages, not static content) are now dispatched to module=default, controller=index, action=index...

As far as i checked the problem is the baseUrl is used also at dispatch.

I have found some workarounds:
1. Use my own helper to point all static resources to the www.domain.com
2. Into a preDispatch i set the baseUrl to http://
www.domain.com/

Both solutions are fine, but i am wondering if there is one more elegant solution...

--  Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

[fw-mvc] BaseUrl and subdomains

Hi,

I have one small problem while working on a ZF based website.

The website is supposed to work on www.domain.com and some of the parts are working on subdomains as subdomain1.
domain.com, subdomain2.domain.com, aso.

I want to load the static resources (js, css, images) from the main domain, and not from the subdomains, because are the same, for both domain and subdomains. Purpose is obvious: to have the static resources loading from one single location, so it would cache (so everything load faster, no matter on which subdomain we are).

Now: so the resources are loaded from the www.domain.com i'we set the base Url to:

resources.frontcontroller.baseUrl = "http://www.domain.com/"

And the resources are loaded from one location (sample:
http://www.domain.com/images/img1.png), no matter on what subdomain we are... Great...

But there is one problem: seems all the requests for URL's (pages, not static content) are now dispatched to module=default, controller=index, action=index...

As far as i checked the problem is the baseUrl is used also at dispatch.

I have found some workarounds:
1. Use my own helper to point all static resources to the www.domain.com
2. Into a preDispatch i set the baseUrl to http://
www.domain.com/

Both solutions are fine, but i am wondering if there is one more elegant solution...

--  Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

[fw-gdata] Retrieving 200 groups only Provisioning API with retrieveAllEmailLists()

Hello everyone.

We have a problem trying to get all groups in a domain. In the control panel
of Google Apps shows 354 groups, but when I use the Provisioning API
(retrieveAllEmailLists()) I can only get 200.

What could be happening?

Thanks in advance.

Hugo


--
View this message in context: http://n4.nabble.com/Retrieving-200-groups-only-Provisioning-API-with-retrieveAllEmailLists-tp990465p990465.html
Sent from the Zend gdata mailing list archive at Nabble.com.

2009年12月23日星期三

[fw-db] Re: Re: Re[fw-db] s: Parsing through large result sets

> Hi and thanks for the reply.
>
> However that wouldn't make it work the way I want and if I want to iterate
> through a very large set of data, then that should be possible without
> using limits.
>
> It can be done without any problems whatsoever if I use the "builtin"
> mysql*-functions.
> It takes a second or so to execute the <code>$res =
> mysql_query($sql);</code> command and then I can easily and > without any
> big memory consumption do a <code>while ($row = mysql_fetch_assoc($res)) {
> ... }</code> on that result set.
>
> I am looking for the very same thing as that, however I would very much
> like to keep using the Zend Framework.'
>
> Best regards,
> Jan


Hello Users,

i got the same problem with Zend_Db Statements. It looks like Zend_Db by
default will use buffered results and give the user neither a possibility to
deactivate as in for example PDO::MYSQL_USE_BUFFERED_RESULT = false nor to
free a result without closing database (I'm checking currently). I've tried
several ours and the best way that i got is to write my own driver (just in
progress now).
Help on using Zend_Db with unbuffered results is very welcome.

With Best regards
Sven

--
View this message in context: http://n4.nabble.com/Res-Parsing-through-large-result-sets-tp674360p977782.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

We're always looking for translations so you can let me know. The HTML and PDF are generated from one set of files. The PDF will be available sometime next year before the Summer - since it's a free book we can afford to take our time moving it along ;).
 
Pádraic Brady

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



From: Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com>
To: Pádraic Brady <padraic.brady@yahoo.com>
Cc: Zend Framework MVC <fw-mvc@lists.zend.com>
Sent: Wed, December 23, 2009 11:18:21 AM
Subject: Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Hello Padraic,

Thanks for the info. I will give it a try and let you know. For now I leave the code as it is. As soon as I start clear up the application, I will take a look. I put it in my task list.

By the way, when are you going to publish survivingthedeep in pdf? I can not wait to translate it in Turkish:)

Regards and merry christmas.
E

2009/12/23 Pádraic Brady <padraic.brady@yahoo.com>
That function should have read mb_strtolower() ;)
 
Pádraic Brady

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



From: Pádraic Brady <padraic.brady@yahoo.com>
To: "erdal.yazicioglu@gmail.com" <erdal.yazicioglu@gmail.com>
Cc: "fw-mvc@lists.zend.com" <fw-mvc@lists.zend.com>
Sent: Wed, December 23, 2009 7:41:12 AM
Subject: Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Try using a unicode safe method for lowercasing like iconv_strtolower. The base function is only useful for US ASCII.

Paddy

Sent from my iPhone

On 22 Dec 2009, at 12:43, Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com> wrote:

Hello all

I have a really very strange problem withthe Turkish characters.

I have a form where alumni registers itself. I am trying to convert all
data to lowercase and then write to database.

In the model I create a function

public function toLowerCase($input)
  {   
  return strtolower(strtr($input,'ĞÜŞIİÖÇ','ğüşıiöç'));
  }

After a successful admission I write the data to database in model as
follows.

function registerAlumni($alumniName,$alumniLastName,$alumniGraduateDate)
  {
      $data = array('alumni_Name'=>$this->toLowerCase($alumniName),
                  'alumni_LastName'=>$this->toLowerCase($alumniLastName),
                  'alumni_GraduateDate'=>$alumniGraduateDate);
      $this->insert($data);
  }

Up to here everything seems to be OK. But when I run the database query,
the characters that are entered in turkish are not written into
database.

I really do not know, if it is Zend or Mysql itself. I use UTF-8 as
character encoding and if I do not use toLowerCase method, it writes to
database without problem.

Any ideas are more than welcome.

E

mysql> select alumni_Name,alumni_LastName,alumni_GraduateDate from
gbhl_alumni order by alumni_ID desc
  -> ;
+---------------------+-----------------+---------------------+
| alumni_Name        | alumni_LastName | alumni_GraduateDate |
+---------------------+-----------------+---------------------+
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
| mmmmmmmmmmmmmmmm    | mmmmmmmmmmm    |                1991 |
|                    |                |                1991 |
|                    |                |                1991 |








--

Erdal YAZICIOGLU
Field Project Engineer Manager
Page Europa S.R.L - General Dynamics
www.pageuropa.it
Office - Rome : +39 0650395292
Mobile -Rome : +39 3490787196
Mobile -Istanbul: +90 536 3447989

Re: [fw-mvc] Zend Cache Apc troubles

This code works:
$bar = 'BAR';
apc_add('foo', $bar);
var_dump(apc_fetch('foo'));
echo "\n";
$bar = 'NEVER GETS SET';
apc_add('foo', $bar);
var_dump(apc_fetch('foo'));
echo "\n";

Bye.

whisher wrote:
>
> <p>Hi Pieter,</p>
> <p>Next time I'll clicking 'reply all' I swear to you :)</p>
> <p>so the nitty-gritty</p>
> <p>I've run the apc.php on the server </p>
> <h2>General Cache Information</h2>
> <table cellspacing="0"><tbody>
> <tr class="tr-0"><td class="td-0">APC Version</td><td>3.0.19</td></tr>
> <tr class="tr-1"><td class="td-0">PHP
> Version</td><td>5.2.6-1+lenny4</td></tr><tr class="tr-0"><td
> class="td-0">APC Host</td><td>xxxxxxx (xxxxx) (92.xxxxx)</td></tr>
> <tr class="tr-1"><td class="td-0">Server Software</td><td>Apache/2.2.9
> (Debian)</td></tr>
>
> <tr class="tr-0"><td class="td-0">Shared Memory</td><td>1 Segment(s)
> with 30.0 MBytes
> <br> (mmap memory, pthread mutex locking)
> </td></tr><tr class="tr-1"><td class="td-0">Start
> Time</td><td>2009/12/22 19:49:05</td></tr><tr class="tr-0"><td
> class="td-0">Uptime</td><td> 0 minutes</td></tr><tr class="tr-1"><td
> class="td-0">File Upload Support</td><td>1</td></tr> </tbody></table>
> </div>
>
> <div class="info div1"><h2>File Cache Information</h2>
> <table cellspacing="0"><tbody>
> <tr class="tr-0"><td class="td-0">Cached Files</td><td>1 (288.3
> KBytes)</td></tr>
> <tr class="tr-1"><td class="td-0">Hits</td><td>1</td></tr>
> <tr class="tr-0"><td class="td-0">Misses</td><td>1</td></tr>
>
> <tr class="tr-1"><td class="td-0">Request Rate (hits,
> misses)</td><td>2.00 cache requests/second</td></tr>
> <tr class="tr-0"><td class="td-0">Hit Rate</td><td>1.00 cache
> requests/second</td></tr>
> <tr class="tr-1"><td class="td-0">Miss Rate</td><td>1.00 cache
> requests/second</td></tr>
> <tr class="tr-0"><td class="td-0">Insert Rate</td><td>1.00 cache
> requests/second</td></tr>
> <tr class="tr-1"><td class="td-0">Cache full count</td><td>0</td></tr>
>
> </tbody></table>
> </div>
>
> <div class="info div1"><h2>User Cache Information</h2>
> <table cellspacing="0"><tbody>
> <tr class="tr-0"><td class="td-0">Cached Variables</td><td>0 ( 0.0
> Bytes)</td></tr>
> <tr class="tr-1"><td class="td-0">Hits</td><td>0</td></tr>
>
> <tr class="tr-0"><td class="td-0">Misses</td><td>0</td></tr>
> <tr class="tr-1"><td class="td-0">Request Rate (hits,
> misses)</td><td>0.00 cache requests/second</td></tr>
> <tr class="tr-0"><td class="td-0">Hit Rate</td><td>0.00 cache
> requests/second</td></tr>
> <tr class="tr-1"><td class="td-0">Miss Rate</td><td>0.00 cache
> requests/second</td></tr>
> <tr class="tr-0"><td class="td-0">Insert Rate</td><td>0.00 cache
> requests/second</td></tr>
>
> <tr class="tr-1"><td class="td-0">Cache full count</td><td>0</td></tr>
>
> </tbody></table>
> <h2>Runtime Settings</h2><table cellspacing="0"><tbody><tr
> class="tr-0"><td class="td-0">apc.cache_by_default</td><td>1</td></tr>
> <tr class="tr-1"><td class="td-0">apc.coredump_unmap</td><td>0</td></tr>
>
> <tr class="tr-0"><td class="td-0">apc.enable_cli</td><td>0</td></tr>
> <tr class="tr-1"><td class="td-0">apc.enabled</td><td>1</td></tr>
> <tr class="tr-0"><td
> class="td-0">apc.file_update_protection</td><td>2</td></tr>
> <tr class="tr-1"><td class="td-0">apc.filters</td><td></td></tr>
> <tr class="tr-0"><td class="td-0">apc.gc_ttl</td><td>3600</td></tr>
> <tr class="tr-1"><td
> class="td-0">apc.include_once_override</td><td>0</td></tr>
>
> <tr class="tr-0"><td class="td-0">apc.max_file_size</td><td>1M</td></tr>
> <tr class="tr-1"><td class="td-0">apc.mmap_file_mask</td><td></td></tr>
> <tr class="tr-0"><td
> class="td-0">apc.num_files_hint</td><td>1000</td></tr>
> <tr class="tr-1"><td
> class="td-0">apc.report_autofilter</td><td>0</td></tr>
> <tr class="tr-0"><td class="td-0">apc.rfc1867</td><td>0</td></tr>
> <tr class="tr-1"><td class="td-0">apc.rfc1867_freq</td><td>0</td></tr>
>
> <tr class="tr-0"><td
> class="td-0">apc.rfc1867_name</td><td>APC_UPLOAD_PROGRESS</td></tr>
> <tr class="tr-1"><td
> class="td-0">apc.rfc1867_prefix</td><td>upload_</td></tr>
> <tr class="tr-0"><td class="td-0">apc.shm_segments</td><td>1</td></tr>
> <tr class="tr-1"><td class="td-0">apc.shm_size</td><td>30</td></tr>
> <tr class="tr-0"><td class="td-0">apc.slam_defense</td><td>0</td></tr>
> <tr class="tr-1"><td class="td-0">apc.stat</td><td>1</td></tr>
>
> <tr class="tr-0"><td class="td-0">apc.stat_ctime</td><td>0</td></tr>
> <tr class="tr-1"><td class="td-0">apc.ttl</td><td>0</td></tr>
> <tr class="tr-0"><td
> class="td-0">apc.user_entries_hint</td><td>4096</td></tr>
> <tr class="tr-1"><td class="td-0">apc.user_ttl</td><td>0</td></tr>
> <tr class="tr-0"><td class="td-0">apc.write_lock</td><td>1</td></tr>
> </tbody></table>
>
>
>
> <p>It seems that APC caching is enabled, doesn't it ?</p>
> <p>I never used APC so I don't know which way to turn.
> Regards.
> Whisher
>
>
> Pieter Kokx wrote:
>>
>> Are you sure that APC caching is enabled? Does APC caching without
>> Zend_Cache work (like described in http://php.net/apc )?
>>
>> And next time, would you bother clicking on 'reply all', so the mailing
>> list is also added?
>>
>> --
>> Best Regards,
>>
>> Pieter Kokx
>> PHP Developer
>> Zend Framework developer
>>
>>
>>
>> whisher@mp4.it schreef:
>>> Hi Pieter,
>>> Well actually it doesn't cache anything :(
>>> if I use Apc while it works (do cache)
>>> with File.
>>> Regards,
>>> Bye.
>>>
>>>
>>> --- Messaggio originale ---
>>> Hi,
>>>
>>> How exactly do you mean with 'this doesn't work'? Doesn't it cache
>>> anything or what?
>>>
>>> Regards,
>>>
>>> Pieter Kokx
>>> PHP Developer
>>> Zend Framework developer
>>>
>>>
>>>
>>> whisher schreef:
>>> > Hi.
>>> > I don't understand why this works with File
>>> > doesn't work with with Apc
>>> > protected function _initCache()
>>> > {
>>> > $dir = Zend_Registry::get('dir');
>>> > $frontendOptions = array(
>>> > 'caching'=> true,
>>> > 'cache_id_prefix' => null,
>>> > 'lifetime' => 7200,
>>> > 'logging' => false,
>>> > 'write_control'=> true,
>>> > 'automatic_serialization' => true,
>>> > 'automatic_cleaning_factor' => 10,
>>> > 'ignore_user_abort'=> false,
>>> > );
>>> > $backendOptions = array(
>>> > 'cache_dir' => $dir->cache
>>> > );
>>> > $cache = Zend_Cache::factory('Core', 'File', $frontendOptions,
>>> > $backendOptions);
>>> > //$cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions);
>>> > Zend_Registry::set('cache', $cache);
>>> >
>>> > }
>>> >
>>> > In the model
>>> > public function fetchItems($lang)
>>> > {
>>> > $cache = Zend_Registry::get('cache');
>>> > if(!$data = $cache->load('RightFetchTags')) {
>>> > // do select
>>> > $data = $table->fetchAll($select)->toArray();
>>> > $cache->save($data, 'RightFetchTags');
>>> > }
>>> > return $data;
>>> > }
>>> >
>>> > Bye
>>> >
>>>
>>>
>>>
>>>
>>> --- Dada Music Movement <http://www.dada.it />, tutta la musica che
>>> vuoi! ---
>>
>>
>
>

--
View this message in context: http://n4.nabble.com/Zend-Cache-Apc-troubles-tp976493p977758.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] What 'layers' does Doctrine replace?

I think you can see the doctrine record classes like the 'Default_Model_Guestbook' classes, while the mapper should use Doctrine to retrieve data.
Best Regards,  Pieter Kokx PHP Developer Zend Framework developer 


Abraham Block schreef:
Doctrine replaces the persistence layer. 
On Wed, Dec 23, 2009 at 7:25 AM, Colin Johnson <colin.johnson@kickfinish.com> wrote:

Hi

I am contemplating using Doctrine for my next project.  Would anyone be able
to provide any advice on where it should sit in the architecture.  If I take
the Zend Framework quick start guide as some example code, does it replace
the data mapper code (e.g. Default_Model_GuestbookMapper) and everything
from that to the database?

So, I would create a 'Default_Model_Guestbook' class which uses Doctrine to
'set' and 'get' data on the database?

Thanks, in advance for any help.

Colin

--
View this message in context: http://n4.nabble.com/What-layers-does-Doctrine-replace-tp977734p977734.html
Sent from the Zend MVC mailing list archive at Nabble.com.


Re: [fw-mvc] What 'layers' does Doctrine replace?

Doctrine replaces the persistence layer. 
On Wed, Dec 23, 2009 at 7:25 AM, Colin Johnson <colin.johnson@kickfinish.com> wrote:

Hi

I am contemplating using Doctrine for my next project.  Would anyone be able
to provide any advice on where it should sit in the architecture.  If I take
the Zend Framework quick start guide as some example code, does it replace
the data mapper code (e.g. Default_Model_GuestbookMapper) and everything
from that to the database?

So, I would create a 'Default_Model_Guestbook' class which uses Doctrine to
'set' and 'get' data on the database?

Thanks, in advance for any help.

Colin

--
View this message in context: http://n4.nabble.com/What-layers-does-Doctrine-replace-tp977734p977734.html
Sent from the Zend MVC mailing list archive at Nabble.com.


[fw-mvc] What 'layers' does Doctrine replace?

Hi

I am contemplating using Doctrine for my next project. Would anyone be able
to provide any advice on where it should sit in the architecture. If I take
the Zend Framework quick start guide as some example code, does it replace
the data mapper code (e.g. Default_Model_GuestbookMapper) and everything
from that to the database?

So, I would create a 'Default_Model_Guestbook' class which uses Doctrine to
'set' and 'get' data on the database?

Thanks, in advance for any help.

Colin

--
View this message in context: http://n4.nabble.com/What-layers-does-Doctrine-replace-tp977734p977734.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Hello Padraic,

Thanks for the info. I will give it a try and let you know. For now I leave the code as it is. As soon as I start clear up the application, I will take a look. I put it in my task list.

By the way, when are you going to publish survivingthedeep in pdf? I can not wait to translate it in Turkish:)

Regards and merry christmas.
E

2009/12/23 Pádraic Brady <padraic.brady@yahoo.com>
That function should have read mb_strtolower() ;)
 
Pádraic Brady

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



From: Pádraic Brady <padraic.brady@yahoo.com>
To: "erdal.yazicioglu@gmail.com" <erdal.yazicioglu@gmail.com>
Cc: "fw-mvc@lists.zend.com" <fw-mvc@lists.zend.com>
Sent: Wed, December 23, 2009 7:41:12 AM
Subject: Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Try using a unicode safe method for lowercasing like iconv_strtolower. The base function is only useful for US ASCII.

Paddy

Sent from my iPhone

On 22 Dec 2009, at 12:43, Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com> wrote:

Hello all

I have a really very strange problem withthe Turkish characters.

I have a form where alumni registers itself. I am trying to convert all
data to lowercase and then write to database.

In the model I create a function

public function toLowerCase($input)
  {   
  return strtolower(strtr($input,'ĞÜŞIİÖÇ','ğüşıiöç'));
  }

After a successful admission I write the data to database in model as
follows.

function registerAlumni($alumniName,$alumniLastName,$alumniGraduateDate)
  {
      $data = array('alumni_Name'=>$this->toLowerCase($alumniName),
                  'alumni_LastName'=>$this->toLowerCase($alumniLastName),
                  'alumni_GraduateDate'=>$alumniGraduateDate);
      $this->insert($data);
  }

Up to here everything seems to be OK. But when I run the database query,
the characters that are entered in turkish are not written into
database.

I really do not know, if it is Zend or Mysql itself. I use UTF-8 as
character encoding and if I do not use toLowerCase method, it writes to
database without problem.

Any ideas are more than welcome.

E

mysql> select alumni_Name,alumni_LastName,alumni_GraduateDate from
gbhl_alumni order by alumni_ID desc
  -> ;
+---------------------+-----------------+---------------------+
| alumni_Name        | alumni_LastName | alumni_GraduateDate |
+---------------------+-----------------+---------------------+
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
| mmmmmmmmmmmmmmmm    | mmmmmmmmmmm    |                1991 |
|                    |                |                1991 |
|                    |                |                1991 |








--

Erdal YAZICIOGLU
Field Project Engineer Manager
Page Europa S.R.L - General Dynamics
www.pageuropa.it
Office - Rome : +39 0650395292
Mobile -Rome : +39 3490787196
Mobile -Istanbul: +90 536 3447989

Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

That function should have read mb_strtolower() ;)
 
Pádraic Brady

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



From: Pádraic Brady <padraic.brady@yahoo.com>
To: "erdal.yazicioglu@gmail.com" <erdal.yazicioglu@gmail.com>
Cc: "fw-mvc@lists.zend.com" <fw-mvc@lists.zend.com>
Sent: Wed, December 23, 2009 7:41:12 AM
Subject: Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Try using a unicode safe method for lowercasing like iconv_strtolower. The base function is only useful for US ASCII.

Paddy

Sent from my iPhone

On 22 Dec 2009, at 12:43, Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com> wrote:

Hello all

I have a really very strange problem withthe Turkish characters.

I have a form where alumni registers itself. I am trying to convert all
data to lowercase and then write to database.

In the model I create a function

public function toLowerCase($input)
  {   
  return strtolower(strtr($input,'ĞÜŞIİÖÇ','ğüşıiöç'));
  }

After a successful admission I write the data to database in model as
follows.

function registerAlumni($alumniName,$alumniLastName,$alumniGraduateDate)
  {
      $data = array('alumni_Name'=>$this->toLowerCase($alumniName),
                  'alumni_LastName'=>$this->toLowerCase($alumniLastName),
                  'alumni_GraduateDate'=>$alumniGraduateDate);
      $this->insert($data);
  }

Up to here everything seems to be OK. But when I run the database query,
the characters that are entered in turkish are not written into
database.

I really do not know, if it is Zend or Mysql itself. I use UTF-8 as
character encoding and if I do not use toLowerCase method, it writes to
database without problem.

Any ideas are more than welcome.

E

mysql> select alumni_Name,alumni_LastName,alumni_GraduateDate from
gbhl_alumni order by alumni_ID desc
  -> ;
+---------------------+-----------------+---------------------+
| alumni_Name        | alumni_LastName | alumni_GraduateDate |
+---------------------+-----------------+---------------------+
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
|                    | mmmmmmmmmmm    |                1991 |
| mmmmmmmmmmmmmmmm    | mmmmmmmmmmm    |                1991 |
|                    |                |                1991 |
|                    |                |                1991 |





[fw-gdata] RE: fw-gdata@lists.zend.com Hello

Good Day...

I was wondering if you might like to chat with me?
I found your profile online and would like to get to know you better.
Please email me back Georgia@mailbox-email.com

[fw-formats] RE: fw-formats@lists.zend.com Hello

Good Day...

I was wondering if you might like to chat with me?
I found your profile online and would like to get to know you better.
Please email me back Georgia@mailbox-email.com

2009年12月22日星期二

Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Also you can pass the string into that function without any other replacement beforehand.

Sent from my iPhone

On 22 Dec 2009, at 12:43, Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com> wrote:

Hello all

I have a really very strange problem withthe Turkish characters.

I have a form where alumni registers itself. I am trying to convert all
data to lowercase and then write to database.

In the model I create a function

public function toLowerCase($input)
{
return strtolower(strtr($input,'ĞÜŞIİÖÇ','ğüşıiöç'));
}

After a successful admission I write the data to database in model as
follows.

function registerAlumni($alumniName,$alumniLastName,$alumniGraduateDate)
{
$data = array('alumni_Name'=>$this->toLowerCase($alumniName),
'alumni_LastName'=>$this->toLowerCase($alumniLastName),
'alumni_GraduateDate'=>$alumniGraduateDate);
$this->insert($data);
}

Up to here everything seems to be OK. But when I run the database query,
the characters that are entered in turkish are not written into
database.

I really do not know, if it is Zend or Mysql itself. I use UTF-8 as
character encoding and if I do not use toLowerCase method, it writes to
database without problem.

Any ideas are more than welcome.

E

mysql> select alumni_Name,alumni_LastName,alumni_GraduateDate from
gbhl_alumni order by alumni_ID desc
-> ;
+---------------------+-----------------+---------------------+
| alumni_Name | alumni_LastName | alumni_GraduateDate |
+---------------------+-----------------+---------------------+
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| mmmmmmmmmmmmmmmm | mmmmmmmmmmm | 1991 |
| | | 1991 |
| | | 1991 |

Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

Try using a unicode safe method for lowercasing like iconv_strtolower. The base function is only useful for US ASCII.

Paddy

Sent from my iPhone

On 22 Dec 2009, at 12:43, Erdal YAZICIOGLU <erdal.yazicioglu@gmail.com> wrote:

Hello all

I have a really very strange problem withthe Turkish characters.

I have a form where alumni registers itself. I am trying to convert all
data to lowercase and then write to database.

In the model I create a function

public function toLowerCase($input)
{
return strtolower(strtr($input,'ĞÜŞIİÖÇ','ğüşıiöç'));
}

After a successful admission I write the data to database in model as
follows.

function registerAlumni($alumniName,$alumniLastName,$alumniGraduateDate)
{
$data = array('alumni_Name'=>$this->toLowerCase($alumniName),
'alumni_LastName'=>$this->toLowerCase($alumniLastName),
'alumni_GraduateDate'=>$alumniGraduateDate);
$this->insert($data);
}

Up to here everything seems to be OK. But when I run the database query,
the characters that are entered in turkish are not written into
database.

I really do not know, if it is Zend or Mysql itself. I use UTF-8 as
character encoding and if I do not use toLowerCase method, it writes to
database without problem.

Any ideas are more than welcome.

E

mysql> select alumni_Name,alumni_LastName,alumni_GraduateDate from
gbhl_alumni order by alumni_ID desc
-> ;
+---------------------+-----------------+---------------------+
| alumni_Name | alumni_LastName | alumni_GraduateDate |
+---------------------+-----------------+---------------------+
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| mmmmmmmmmmmmmmmm | mmmmmmmmmmm | 1991 |
| | | 1991 |
| | | 1991 |

Re: [fw-mvc] Zend Cache Apc troubles

Hi Pieter,

Next time I'll clicking 'reply all' I swear to you :)

so the nitty-gritty

I've run the apc.php on the server

General Cache Information

APC Version3.0.19
PHP Version5.2.6-1+lenny4
APC Hostxxxxxxx (xxxxx) (92.xxxxx)
Server SoftwareApache/2.2.9 (Debian)
Shared Memory1 Segment(s) with 30.0 MBytes
(mmap memory, pthread mutex locking)
Start Time2009/12/22 19:49:05
Uptime 0 minutes
File Upload Support1

File Cache Information

Cached Files1 (288.3 KBytes)
Hits1
Misses1
Request Rate (hits, misses)2.00 cache requests/second
Hit Rate1.00 cache requests/second
Miss Rate1.00 cache requests/second
Insert Rate1.00 cache requests/second
Cache full count0

User Cache Information

Cached Variables0 ( 0.0 Bytes)
Hits0
Misses0
Request Rate (hits, misses)0.00 cache requests/second
Hit Rate0.00 cache requests/second
Miss Rate0.00 cache requests/second
Insert Rate0.00 cache requests/second
Cache full count0

Runtime Settings

It seems that APC caching is enabled, doesn't it

Pieter Kokx wrote:
Are you sure that APC caching is enabled? Does APC caching without Zend_Cache work (like described in http://php.net/apc )? And next time, would you bother clicking on 'reply all', so the mailing list is also added? -- Best Regards, Pieter Kokx PHP Developer Zend Framework developer whisher@mp4.it schreef: > Hi Pieter, > Well actually it doesn't cache anything :( > if I use Apc while it works (do cache) > with File. > Regards, > Bye. > > > --- Messaggio originale --- > Hi, > > How exactly do you mean with 'this doesn't work'? Doesn't it cache > anything or what? > > Regards, > > Pieter Kokx > PHP Developer > Zend Framework developer > > > > whisher schreef: > > Hi. > > I don't understand why this works with File > > doesn't work with with Apc > > protected function _initCache() > > { > > $dir = Zend_Registry::get('dir'); > > $frontendOptions = array( > > 'caching'=> true, > > 'cache_id_prefix' => null, > > 'lifetime' => 7200, > > 'logging' => false, > > 'write_control'=> true, > > 'automatic_serialization' => true, > > 'automatic_cleaning_factor' => 10, > > 'ignore_user_abort'=> false, > > ); > > $backendOptions = array( > > 'cache_dir' => $dir->cache > > ); > > $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, > > $backendOptions); > > //$cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions); > > Zend_Registry::set('cache', $cache); > > > > } > > > > In the model > > public function fetchItems($lang) > > { > > $cache = Zend_Registry::get('cache'); > > if(!$data = $cache->load('RightFetchTags')) { > > // do select > > $data = $table->fetchAll($select)->toArray(); > > $cache->save($data, 'RightFetchTags'); > > } > > return $data; > > } > > > > Bye > > > > > > > --- Dada Music Movement , tutta la musica che > vuoi! ---


View this message in context: Re: Zend Cache Apc troubles
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Zend Cache Apc troubles

Are you sure that APC caching is enabled? Does APC caching without Zend_Cache work (like described in http://php.net/apc )?

And next time, would you bother clicking on 'reply all', so the mailing list is also added?
-- Best Regards,  Pieter Kokx PHP Developer Zend Framework developer 


whisher@mp4.it schreef:
Hi Pieter,
Well actually it doesn't cache anything :(
if I use Apc while it works (do cache)
with File.
Regards,
Bye.


--- Messaggio originale ---
Hi,

How exactly do you mean with 'this doesn't work'? Doesn't it cache
anything or what?

Regards,

Pieter Kokx
PHP Developer
Zend Framework developer



whisher schreef:
> Hi.
> I don't understand why this works with File
> doesn't work with with Apc
> protected function _initCache()
> {
> $dir = Zend_Registry::get('dir');
> $frontendOptions = array(
> 'caching'=> true,
> 'cache_id_prefix' => null,
> 'lifetime' => 7200,
> 'logging' => false,
> 'write_control'=> true,
> 'automatic_serialization' => true,
> 'automatic_cleaning_factor' => 10,
> 'ignore_user_abort'=> false,
> );
> $backendOptions = array(
> 'cache_dir' => $dir->cache
> );
> $cache = Zend_Cache::factory('Core', 'File', $frontendOptions,
> $backendOptions);
> //$cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions);
> Zend_Registry::set('cache', $cache);
>
> }
>
> In the model
> public function fetchItems($lang)
> {
> $cache = Zend_Registry::get('cache');
> if(!$data = $cache->load('RightFetchTags')) {
> // do select
> $data = $table->fetchAll($select)->toArray();
> $cache->save($data, 'RightFetchTags');
> }
> return $data;
> }
>
> Bye
>




--- Dada Music Movement, tutta la musica che vuoi! ---

Re: [fw-mvc] Problem: Turkish Characters can not be saved to database

On Tue, 2009-12-22 at 15:24 +0330, sina miandashti wrote:
> $db = Zend_Db::factory ( $dbConfig ['adapter'], $dbConfig ['db'] );
>
> try {
> $db->query("SET NAMES 'utf8'");
>
> } catch ( Zend_Exception $e ) {
> die ( $e->getMessage () );
> }
>
As I mentioned they are all set in my.cnf file.

[fw-mvc] Problem: Turkish Characters can not be saved to database

Hello all

I have a really very strange problem withthe Turkish characters.

I have a form where alumni registers itself. I am trying to convert all
data to lowercase and then write to database.

In the model I create a function

public function toLowerCase($input)
{
return strtolower(strtr($input,'ĞÜŞIİÖÇ','ğüşıiöç'));
}

After a successful admission I write the data to database in model as
follows.

function registerAlumni($alumniName,$alumniLastName,$alumniGraduateDate)
{
$data = array('alumni_Name'=>$this->toLowerCase($alumniName),
'alumni_LastName'=>$this->toLowerCase($alumniLastName),
'alumni_GraduateDate'=>$alumniGraduateDate);
$this->insert($data);
}

Up to here everything seems to be OK. But when I run the database query,
the characters that are entered in turkish are not written into
database.

I really do not know, if it is Zend or Mysql itself. I use UTF-8 as
character encoding and if I do not use toLowerCase method, it writes to
database without problem.

Any ideas are more than welcome.

E

mysql> select alumni_Name,alumni_LastName,alumni_GraduateDate from
gbhl_alumni order by alumni_ID desc
-> ;
+---------------------+-----------------+---------------------+
| alumni_Name | alumni_LastName | alumni_GraduateDate |
+---------------------+-----------------+---------------------+
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| | mmmmmmmmmmm | 1991 |
| mmmmmmmmmmmmmmmm | mmmmmmmmmmm | 1991 |
| | | 1991 |
| | | 1991 |

Re: [fw-mvc] Zend_Exception breaking changes since 19661

Yeah, sorry about this. We're currently iterating over the trunk in one
of our project and it kinda irritated us to see that nothing was working
anymore when we woke up this day. I guess we missed the point at that
time; but now, we totally understand the move behind this and fixed our
code to handle the change anyway.

Maybe you should have warned though, because this was a major backward
incompatible move and a lot of us are working on the trunk on a daily
basis. But then again, I also fully understand that the trunk isn't
really supposed to be stable in the first place.

Regards,
-- Nicolas


Matthew Weier O'Phinney a écrit :
> -- Nicolas GREVET <ngrevet@alteo.fr> wrote
> (on Friday, 18 December 2009, 04:52 PM +0100):
>> I *really* hope this gets fixed soon.
>> I don't know how we're supposed to try/catch our own code if the
>> Zend Framework now only throws Zend_Controller_Exception for
>> everything that's thrown out of the code.
>
> Patience, everyone -- this is why the change is happening in a _minor_
> release cycle -- where we have a number of chances to correct issues
> prior to the stable release.
>
> This is corrected in trunk, and reflected in the 1.10.0alpha1 package
> released today.
>
>
>> Емил Иванов / Emil Ivanov a écrit :
>>> Thank you!
>>>
>>> Here is the issue: http://framework.zend.com/issues/browse/ZF-8558
>>>
>>> Cheers
>>>
>>> 2009/12/16 Matthew Weier O'Phinney <matthew@zend.com>:
>>>> -- Емил Иванов / Emil Ivanov <emil.vladev@gmail.com> wrote
>>>> (on Wednesday, 16 December 2009, 05:58 PM +0200):
>>>>> Thank you for the response, Mathew.
>>>>>
>>>>> Let me try to explain it with some code:
>>>>>
>>>>> Application dispatching:
>>>>>
>>>>> $front = Zend_Controller_Front::getInstance();
>>>>> try {
>>>>> $front->dispatch();
>>>>> } catch (My_Controller_Outcome_Result $e) {
>>>>> $front->getResponse()->sendResponse();
>>>>> // Ignore
>>>>> }
>>>>>
>>>>> My_Controller_Outcome_Result exceptions usually indicate a redirect
>>>>> (or other event that should stop the execution)
>>>>>
>>>>> Prior to 19661 I was actually getting a My_Controller_Outcome_Result
>>>>> exception, but after that the instance is Zend_Controller_Exception,
>>>>> so the catch fails.
>>>> Ah, okay, that makes sense... can you open an issue requesting that this
>>>> particular change be reverted? It was one I was actually initially
>>>> unsure of anyways.
>>>>
>>>> Thanks!
>>>>
>>>>> I managed to locate the change in ZF:
>>>>>
>>>>> Zend_Controller_Dispatcher_Standard, line 300.
>>>>>
>>>>> Old code just does
>>>>>
>>>>> throw $e;
>>>>>
>>>>> while now:
>>>>>
>>>>> throw new Zend_Controller_Exception($e->getMessage(), $e->getCode(), $e);
>>>>>
>>>>> One possible solution that comes to mind is to catch the
>>>>> Zend_Exception and traverse all the previous exceptions until I get to
>>>>> one of mine, but it seems kind of hacky.
>>>>>
>>>>> Regards,
>>>>> Emil
>>>>>
>>>>> 2009/12/16 Matthew Weier O'Phinney <matthew@zend.com>:
>>>>>> -- Емил Иванов / Emil Ivanov <emil.vladev@gmail.com> wrote
>>>>>> (on Wednesday, 16 December 2009, 03:13 PM +0200):
>>>>>>> Problem:
>>>>>>> In 19661 (trunk) Mathew has committed a workaround for php's odd
>>>>>>> behavior of swallowing stack traces when re-throwing an exception. But
>>>>>>> the fix is by throwing the special Zend_Exception - effectively
>>>>>>> swallowing the old exception for consumption.
>>>>>>>
>>>>>>> Use case:
>>>>>>> I implemented a custom redirecting machinery that relies on exceptions
>>>>>>> to work - the reason is that when a redirect happens in stock ZF the
>>>>>>> execution is not terminated (I should call return in the action - but
>>>>>>> what about redirects not in the action method, but some other helper
>>>>>>> function?).
>>>>>>> What I did is throw a special exception, then wrap the call to
>>>>>>> Zend_Controller_Front::dispatch() in try/catch and wait for this
>>>>>>> exception. If caught - redirect and terminate. (Yes, I had to
>>>>>>> monkey-patch Zend_Test_PHPUnit_ControllerTestCase::dispatch() so set
>>>>>>> the FC::throwExceptions(true)).
>>>>>>>
>>>>>>> With the new change this is no longer possible.
>>>>>> The change is actually part of this proposal:
>>>>>>
>>>>>> http://framework.zend.com/wiki/display/ZFPROP/previous+Exception+on+Zend_Exception+-+Marc+Bennewitz
>>>>>>
>>>>>> Its basic premise is to provide forward-compatibility with PHP 5.3
>>>>>> exceptions, which allow passing a "previous" exception as the third
>>>>>> argument to the constructor:
>>>>>>
>>>>>> try {
>>>>>> } catch (Exception $e) {
>>>>>> throw new Foo_Exception('Something failed', 0, $e);
>>>>>> }
>>>>>>
>>>>>> This provides the ability to see the original exception (and nest
>>>>>> exceptions) during debugging.
>>>>>>
>>>>>> When I merged the support to trunk, the only changes I made were to look
>>>>>> for places where exceptions were re-thrown, and to pass the third
>>>>>> argument. In a few cases, the original exception is rethrown (which is
>>>>>> really kind of a ridiculous practice), and I threw a new component
>>>>>> exception so that the full stack trace could be seen.
>>>>>>
>>>>>> >From your description, I'm really not sure what particular part of the
>>>>>> changeset is affecting you. Could you provide the customizations that
>>>>>> you have? That may help me better identify what has changed -- and how
>>>>>> you may need to adapt your code to accomodate the new exception
>>>>>> signature (which, again, is what the signature is in 5.3 and above).
>>>>>>
>>>>>> --
>>>>>> Matthew Weier O'Phinney
>>>>>> Project Lead | matthew@zend.com
>>>>>> Zend Framework | http://framework.zend.com/
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> My place to share my ideas:
>>>>> http://bolddream.com (now live :)
>>>>>
>>>> --
>>>> Matthew Weier O'Phinney
>>>> Project Lead | matthew@zend.com
>>>> Zend Framework | http://framework.zend.com/
>>>>
>>>
>>>
>

 
apc.cache_by_default1
apc.coredump_unmap0
apc.enable_cli0
apc.enabled1
apc.file_update_protection2
apc.filters
apc.gc_ttl3600
apc.include_once_override0
apc.max_file_size1M
apc.mmap_file_mask
apc.num_files_hint1000
apc.report_autofilter0
apc.rfc18670
apc.rfc1867_freq0
apc.rfc1867_nameAPC_UPLOAD_PROGRESS
apc.rfc1867_prefixupload_
apc.shm_segments1
apc.shm_size30
apc.slam_defense0
apc.stat1
apc.stat_ctime0
apc.ttl0
apc.user_entries_hint4096
apc.user_ttl0
apc.write_lock1