2010年4月30日星期五

[fw-auth] Zend_Auth and Active Dircetory

Hello all,
I'm currently using Zend_Auth_Adapter_Ldap to authentication to our Active Directory server and I'm running into a strange predicament. I was able to get it to a point where I can successfully authenticate a user, but it sets the Zend_Auth identity to "domain/username", where I would like it to return only "username". So in my config I set "accountCanonicalForm" to 2, but then it fails authentication. The only settings I can set for successful authentication is "3" and "4", but then the identity is returned as "domain/user" or "user@domain". Any one know what I can do to return only "username"?

-Henry

2010年4月29日星期四

[fw-gdata] Fusion tables api and zend framework

Hi working with zend with little success to access a fusion table. I am not able to get a list of tables i won, attached is the code,any one know what i am doing wrong

$client = Zend_Gdata_ClientLogin::getHttpClient($email, $passwd,'fusiontables');
$gdata = new Zend_Gdata_Gbase($client);
    $url = "http://tables.googlelabs.com/api/query?sql=SHOW TABLES";
    $query = new Zend_Gdata_Query('http://tables.googlelabs.com/api/query?sql=SHOW TABLES');
    $feed = $gdata->getFeed($query);

any pointers are greatly appreciated

--
Regards,

Jude Mwenda
Skype id: jmwenda

2010年4月28日星期三

Re: [fw-mvc] RE: Language in URL: always a particular case !

You should be able to satisfy all of those conditions with a single route. You can make trailing parameters optional by providing a default value.

The only problem is I don't know how to make the "module" parameter optional while still accepting controller/action parameters. For example, you probably want this to go to your admin module:

/en-us/admin/foo/bar

while this goes to your default module

/en-us/foo/bar

Unless I'm mistaken, the basic route can't handle this, so you may need to always provide the module in the URL:

/en-us/default/foo/bar

Also, the reason why your routes are not working is because they work in LIFO order (so from the bottom up). Once a route matches the request (that is, the url is in the expected format), then that route is used. The problem is you have two routes with the same parameter signature ":module/:controller" and ":controller/:action". The router does not know the difference between your named parameters, so as soon as the format looks right it will use that route.

--
Hector


On Wed, Apr 28, 2010 at 8:44 AM, dbenjamin <bd.webdev@gmail.com> wrote:

Hello,

Thanks for your help, it's almost ok but there is still a problem.
I don't know exactly the order to define routes.

For example, i've created a very simple app with two modules, front and
admin. Front module has a IndexController with an index action and Admin
module has a ContactController with an index action.

According to the ZF documentation i should have  :
[code]
resources.router.routes.m.route = "/:locale/:module"
resources.router.routes.m.defaults.module = front
resources.router.routes.m.defaults.controller = index
resources.router.routes.m.defaults.action = index
resources.router.routes.m.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.m.defaults.locale =

resources.router.routes.mc.route = "/:locale/:module/:controller"
resources.router.routes.mc.defaults.module = front
resources.router.routes.mc.defaults.controller = index
resources.router.routes.mc.defaults.action = index
resources.router.routes.mc.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.mc.defaults.locale =

resources.router.routes.ca.route = "/:locale/:controller/:action"
resources.router.routes.ca.defaults.module = front
resources.router.routes.ca.defaults.controller = index
resources.router.routes.ca.defaults.action = index
resources.router.routes.ca.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.ca.defaults.locale =

resources.router.routes.default.route =
"/:locale/:module/:controller/:action"
resources.router.routes.default.defaults.module = front
resources.router.routes.default.defaults.controller = index
resources.router.routes.default.defaults.action = index
resources.router.routes.default.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.default.defaults.locale =
[/code]

But with the url : http://local.cosplay-it-teasing.com/en-us/dsqdqs
I don't get a Invalid controller exception and
http://local.cosplay-it-teasing.com/en-us/index or
http://local.cosplay-it-teasing.com/en-us/index/index don't work either.

If i change order of routes i can obtain it, but :
http://local.cosplay-it-teasing.com/en-us/admin/contact
Throws an Invalid Controller exception when the module/controller exist.

Any idea ?

Except that i think that's a better way to redirect earlier from bootstrap
or application plugin resource rather than from a controller plugin.


Thanks.

Cdt,
Benjamin.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2072857.html
Sent from the Zend MVC mailing list archive at Nabble.com.


[fw-mvc] RE: Language in URL: always a particular case !

Hello,

Thanks for your help, it's almost ok but there is still a problem.
I don't know exactly the order to define routes.

For example, i've created a very simple app with two modules, front and
admin. Front module has a IndexController with an index action and Admin
module has a ContactController with an index action.

According to the ZF documentation i should have :
[code]
resources.router.routes.m.route = "/:locale/:module"
resources.router.routes.m.defaults.module = front
resources.router.routes.m.defaults.controller = index
resources.router.routes.m.defaults.action = index
resources.router.routes.m.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.m.defaults.locale =

resources.router.routes.mc.route = "/:locale/:module/:controller"
resources.router.routes.mc.defaults.module = front
resources.router.routes.mc.defaults.controller = index
resources.router.routes.mc.defaults.action = index
resources.router.routes.mc.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.mc.defaults.locale =

resources.router.routes.ca.route = "/:locale/:controller/:action"
resources.router.routes.ca.defaults.module = front
resources.router.routes.ca.defaults.controller = index
resources.router.routes.ca.defaults.action = index
resources.router.routes.ca.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.ca.defaults.locale =

resources.router.routes.default.route =
"/:locale/:module/:controller/:action"
resources.router.routes.default.defaults.module = front
resources.router.routes.default.defaults.controller = index
resources.router.routes.default.defaults.action = index
resources.router.routes.default.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.default.defaults.locale =
[/code]

But with the url : http://local.cosplay-it-teasing.com/en-us/dsqdqs
I don't get a Invalid controller exception and
http://local.cosplay-it-teasing.com/en-us/index or
http://local.cosplay-it-teasing.com/en-us/index/index don't work either.

If i change order of routes i can obtain it, but :
http://local.cosplay-it-teasing.com/en-us/admin/contact
Throws an Invalid Controller exception when the module/controller exist.

Any idea ?

Except that i think that's a better way to redirect earlier from bootstrap
or application plugin resource rather than from a controller plugin.


Thanks.

Cdt,
Benjamin.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2072857.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年4月27日星期二

RE: [fw-mvc] Language in URL: always a particular case !

ok - that is much better than our solution!

Viktor

> -----Original Message-----
> From: Hector Virgen [mailto:djvirgen@gmail.com]
> Sent: Tuesday, April 27, 2010 7:14 PM
> To: dbenjamin
> Cc: fw-mvc@lists.zend.com
> Subject: Re: [fw-mvc] Language in URL: always a particular case !
>
> Have you tried specifying a regex requirement for the :lang parameter?
>
>
> resources.router.routes.default.type = "Zend_Controller_Router_Route"
> resources.router.routes.default.route = ":lang/:controller/:action/*"
> resources.router.routes.default.defaults.lang = "en-gb"
> resources.router.routes.default.defaults.module = "default"
> resources.router.routes.default.defaults.controller = "index"
> resources.router.routes.default.defaults.action = "index"
> resources.router.routes.default.reqs.lang = "[a-z]{2}-[a-z]{2}"
>
> Then, in your lang plugin, check the request early (like in
> routeShutdown) to see if the request matched a route. If not,
> you know the user didn't provide a valid language pattern,
> and you can forward or redirect to a valid page (maybe
> redirect to the same URL but prefixed with "en-gb/").
>
> --
> Hector
>
>
>
> On Tue, Apr 27, 2010 at 5:54 AM, dbenjamin
> <bd.webdev@gmail.com> wrote:
>
>
> Hi, The same subject again and again. Adding the locale
> into URL to simulate a "one folder per language" structure
> with MVC. Just like the official Zend website does, but how
> exactly ? :) It's really complicated to add this behaviour
> with Zend routes and by browsing forums i never found a
> viable solution. The solution that comes up most often is : -
> redefine default routes - a plugin to get lang param and
> initialize Zend_Locale/Zend_Translate But that's not enough !
> We need to handle the following cases : - the lang param is
> not valid - the lang param is missing (ex.
> http://www.my-website.com/contact has to be redirected to
> http://www.my-website.com/defaultlang/contact) Let's assume
> an user enter the following url :
> http://www.my-website.com/dsqdsq, we have to return a 404
> error page, handled by the ErrorHandler plugin. But that's
> not possible, in our plugin we will get "dsqdsq" as the lang
> param value and throwing manually a 404 error from within a
> plugin is not handled by the ErrorHandler. Plus, we will
> maybe have to redirect automatically the user to :
> "http://www.my-website.com/en-gb/dsqdsq", but "dsqdsq" is a
> module ? a controller ? an action ? Who knows and how to
> redirect to a good url. In other words, if the first param is
> not a valid lang, we have to add the default language to the
> url and shift all the parts of the url (complicated). I'm
> wasting a loooot of precious time with that stuff ! :) Is
> there a solution that works for all cases ? Maybe with apache
> rewrite rules ? Thanks. (and sorry if my english is sometimes
> hard :p) Cdt, Benjamin.
>
> ________________________________
>
> View this message in context: Language in URL: always a
> particular case !
> <http://zend-framework-community.634137.n4.nabble.com/Language
> -in-URL-always-a-particular-case-tp2067501p2067501.html>
> Sent from the Zend MVC mailing list archive
> <http://zend-framework-community.634137.n4.nabble.com/Zend-MVC
> -f663775.html> at Nabble.com.
>
>
>
>

RE: [fw-mvc] Language in URL: always a particular case !

Hi,

I think it is pretty easy to solve this. We call a method to handle this from the bootstrap before the routing process begins.
We have an xml-config-file that has the langauge informations for the site, it looks like this:

<?xml version="1.0"?>
<languages>
<enable>1</enable>
<route>true</route>
<default>de</default>
<lang>en</lang>
<lang>fr</lang>
<lang>es</lang>
<lang>nl</lang>
</languages>

The method we call from bootstrap looks like this:

<?php
public static function setLanguage()
{
$oLanguageConfig = Zend_Registry::get('config')->languages;
$sCurrentLang = $oLanguageConfig->default;

if ($oLanguageConfig->enable == 1) {
$bLangHit = false;
preg_match('@/[^/]*@', $_SERVER['REQUEST_URI'], $aUrlMatches);
if (!empty($aUrlMatches)) {
$sUrlMatch = substr($aUrlMatches[0], 1);
$aLangs = $oLanguageConfig->lang;
if (is_string($aLangs)) {
$aLangs = array($aLangs);
}
foreach($aLangs as $sLang) {
if ($sLang == $sUrlMatch) {
$bLangHit = true;
$sCurrentLang = $sLang;
$_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],
(strlen($sLang) + 1));
break;
}
}
}
if (false == $bLangHit && true == $oLanguageConfig->route) {
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/'
. $sCurrentLang . $_SERVER['REQUEST_URI']);
exit();
}
}
Zend_Registry::set('currentLang', $sCurrentLang);
}
?>

In the config file you can enable or disable multi-langauge support.
You can chose if you want the default language forced to be included into URLs. (route = true)

The function only handles the langauge stuff, so the zf-router still can look for modules, controllers and actions and call the
error controller if the route can not be resolved.

Regards Viktor


> -----Original Message-----
> From: dbenjamin [mailto:bd.webdev@gmail.com]
> Sent: Tuesday, April 27, 2010 2:55 PM
> To: fw-mvc@lists.zend.com
> Subject: [fw-mvc] Language in URL: always a particular case !
>
> Hi, The same subject again and again. Adding the locale into
> URL to simulate a "one folder per language" structure with
> MVC. Just like the official Zend website does, but how
> exactly ? :) It's really complicated to add this behaviour
> with Zend routes and by browsing forums i never found a
> viable solution. The solution that comes up most often is : -
> redefine default routes - a plugin to get lang param and
> initialize Zend_Locale/Zend_Translate But that's not enough !
> We need to handle the following cases : - the lang param is
> not valid - the lang param is missing (ex.
> http://www.my-website.com/contact has to be redirected to
> http://www.my-website.com/defaultlang/contact) Let's assume
> an user enter the following url :
> http://www.my-website.com/dsqdsq, we have to return a 404
> error page, handled by the ErrorHandler plugin. But that's
> not possible, in our plugin we will get "dsqdsq" as the lang
> param value and throwing manually a 404 error from within a
> plugin is not handled by the ErrorHandler. Plus, we will
> maybe have to redirect automatically the user to :
> "http://www.my-website.com/en-gb/dsqdsq", but "dsqdsq" is a
> module ? a controller ? an action ? Who knows and how to
> redirect to a good url. In other words, if the first param is
> not a valid lang, we have to add the default language to the
> url and shift all the parts of the url (complicated). I'm
> wasting a loooot of precious time with that stuff ! :) Is
> there a solution that works for all cases ? Maybe with apache
> rewrite rules ? Thanks. (and sorry if my english is sometimes
> hard :p) Cdt, Benjamin.
>
> ________________________________
>
> View this message in context: Language in URL: always a
> particular case !
> <http://zend-framework-community.634137.n4.nabble.com/Language
> -in-URL-always-a-particular-case-tp2067501p2067501.html>
> Sent from the Zend MVC mailing list archive
> <http://zend-framework-community.634137.n4.nabble.com/Zend-MVC
> -f663775.html> at Nabble.com.
>
>

Re: [fw-mvc] Language in URL: always a particular case !

Have you tried specifying a regex requirement for the :lang parameter?

resources.router.routes.default.type = "Zend_Controller_Router_Route"
resources.router.routes.default.route = ":lang/:controller/:action/*"
resources.router.routes.default.defaults.lang = "en-gb"
resources.router.routes.default.defaults.module = "default"
resources.router.routes.default.defaults.controller = "index"
resources.router.routes.default.defaults.action = "index"
resources.router.routes.default.reqs.lang = "[a-z]{2}-[a-z]{2}"

Then, in your lang plugin, check the request early (like in routeShutdown) to see if the request matched a route. If not, you know the user didn't provide a valid language pattern, and you can forward or redirect to a valid page (maybe redirect to the same URL but prefixed with "en-gb/").

--
Hector


On Tue, Apr 27, 2010 at 5:54 AM, dbenjamin <bd.webdev@gmail.com> wrote:
Hi, The same subject again and again. Adding the locale into URL to simulate a "one folder per language" structure with MVC. Just like the official Zend website does, but how exactly ? :) It's really complicated to add this behaviour with Zend routes and by browsing forums i never found a viable solution. The solution that comes up most often is : - redefine default routes - a plugin to get lang param and initialize Zend_Locale/Zend_Translate But that's not enough ! We need to handle the following cases : - the lang param is not valid - the lang param is missing (ex. http://www.my-website.com/contact has to be redirected to http://www.my-website.com/defaultlang/contact) Let's assume an user enter the following url : http://www.my-website.com/dsqdsq, we have to return a 404 error page, handled by the ErrorHandler plugin. But that's not possible, in our plugin we will get "dsqdsq" as the lang param value and throwing manually a 404 error from within a plugin is not handled by the ErrorHandler. Plus, we will maybe have to redirect automatically the user to : "http://www.my-website.com/en-gb/dsqdsq", but "dsqdsq" is a module ? a controller ? an action ? Who knows and how to redirect to a good url. In other words, if the first param is not a valid lang, we have to add the default language to the url and shift all the parts of the url (complicated). I'm wasting a loooot of precious time with that stuff ! :) Is there a solution that works for all cases ? Maybe with apache rewrite rules ? Thanks. (and sorry if my english is sometimes hard :p) Cdt, Benjamin.

View this message in context: Language in URL: always a particular case !
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Language in URL: always a particular case !

Hi, The same subject again and again. Adding the locale into URL to simulate a "one folder per language" structure with MVC. Just like the official Zend website does, but how exactly ? :) It's really complicated to add this behaviour with Zend routes and by browsing forums i never found a viable solution. The solution that comes up most often is : - redefine default routes - a plugin to get lang param and initialize Zend_Locale/Zend_Translate But that's not enough ! We need to handle the following cases : - the lang param is not valid - the lang param is missing (ex. http://www.my-website.com/contact has to be redirected to http://www.my-website.com/defaultlang/contact) Let's assume an user enter the following url : http://www.my-website.com/dsqdsq, we have to return a 404 error page, handled by the ErrorHandler plugin. But that's not possible, in our plugin we will get "dsqdsq" as the lang param value and throwing manually a 404 error from within a plugin is not handled by the ErrorHandler. Plus, we will maybe have to redirect automatically the user to : "http://www.my-website.com/en-gb/dsqdsq", but "dsqdsq" is a module ? a controller ? an action ? Who knows and how to redirect to a good url. In other words, if the first param is not a valid lang, we have to add the default language to the url and shift all the parts of the url (complicated). I'm wasting a loooot of precious time with that stuff ! :) Is there a solution that works for all cases ? Maybe with apache rewrite rules ? Thanks. (and sorry if my english is sometimes hard :p) Cdt, Benjamin.

View this message in context: Language in URL: always a particular case !
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年4月26日星期一

Re: [fw-mvc] Navigation, sidebar blocks, etc...

I'm using a front controller plugin to generate the sidebar in my application.


The plugin simply renders a view into a "sidebar" placeholder, which ends up getting rendered in the layout:

You can make that view script do whatever you want, like call a view helper to pull a random product.

The nice thing about this is I don't need to dispatch an action (which is relatively expensive) and I don't have to modify my existing actions to use the sidebar.

--
Hector


On Mon, Apr 26, 2010 at 3:22 AM, <ludwig.prepoint@gmail.com> wrote:
Hi,
 
I use a sidebar on my current app, displaying random ads, products and stuff. I use an action helper to choose what will be displayed on the sidebar, all 'global logic' is done in the helper and it render the result in a response segment called 'sidebar'.
 
Then, I just echo $this->layout()->sidebar in my layout.
 
That's not perfect, I need to call the helper in every action where I want to see something in the sidebar (but it could use a postdispatch hook for mandatory items in sidebar) and the result of the action helper is never used in the action method (it mismatch the purpose of action helpers).
 
If I have to do that again, I'll use a custom view helper similar to the placeholder but specialised, with a default output and methods to choose what will be displayed in the sidebar and how.
 
I would use it like that :
 
//in layout
 
echo $this->sidebar();
 
//in actions methods where the sidebar needs to output something else than default
 
$this->view->sidebar()->setContent(/* array of ordered criteria */);
$this->view->sidebar()->append(/* array of ordered criteria */);
$this->view->sidebar()->prepend(/* array of ordered criteria */);

Sent: Monday, April 26, 2010 10:13 AM
Subject: [fw-mvc] Navigation, sidebar blocks, etc...

Hi,

 

I'm looking for the best way to include 'sidebar content' into my Zend Framework application.

 

I fixed the navigation problem, by setting it up in the bootstrap (ZFv1.10.2) and adding it to the Zend_Navigation registry.

But now I want to add random product blocks in the sidebar of pages, linking to the actual product page in the application.

 

I've used a custom Zend_Controller_Action class, where I've put 'global logic', and used the ActionStack to forward the request to a navigation action, but that doesn't feel right.

 

Is the postDispatch hook (helper) the correct place for this?

 

Regards,

 

Jachim Coudenys


Re: [fw-mvc] view helper

Zend_View uses a plugin loader to autoload helpers. If you want to add your own custom namespace for your helpers, add this line to your application.ini (assuming you're using Zend_Application):

resources.view.helperPath.My_View_Helper = APPLICATION_PATH "/views/helpers"

Just change "My_View_Helper" to whatever class name prefix you want. I usually prefix everything in the default module with "Default_", including my view helpers.

--
Hector


On Mon, Apr 26, 2010 at 4:55 AM, Yaroslav Vorozhko <vorozhko@gmail.com> wrote:
Yes.
Will it be loaded automaticlly?

2010/4/23 holografix . <holografix@gmail.com <mailto:holografix@gmail.com>>


   Hi

   You can name you view helper Zend_View_Helper_Xxxxxx and put the
   file in that folder.

   cheers
   holo

   2010/4/23 huajun qi <qihjun@gmail.com <mailto:qihjun@gmail.com>>


       Got it.

       But why there is a 'helpers' folder there?





--
Location:


--
Yaroslav Vorozhko . Web Developer
web . http://pro100pro.com twi . http://twitter.com/vorozhko
skp . yarik0083

Re: [fw-mvc] view helper

Yes.
> Will it be loaded automaticlly?
>
> 2010/4/23 holografix . <holografix@gmail.com
> <mailto:holografix@gmail.com>>
>
> Hi
>
> You can name you view helper Zend_View_Helper_Xxxxxx and put the
> file in that folder.
>
> cheers
> holo
>
> 2010/4/23 huajun qi <qihjun@gmail.com <mailto:qihjun@gmail.com>>
>
> Got it.
>
> But why there is a 'helpers' folder there?
>
>
>
>
>
> --
> Location:


--
Yaroslav Vorozhko . Web Developer
web . http://pro100pro.com
twi . http://twitter.com/vorozhko
skp . yarik0083

Re: [fw-mvc] Navigation, sidebar blocks, etc...

Hi,
 
I use a sidebar on my current app, displaying random ads, products and stuff. I use an action helper to choose what will be displayed on the sidebar, all 'global logic' is done in the helper and it render the result in a response segment called 'sidebar'.
 
Then, I just echo $this->layout()->sidebar in my layout.
 
That's not perfect, I need to call the helper in every action where I want to see something in the sidebar (but it could use a postdispatch hook for mandatory items in sidebar) and the result of the action helper is never used in the action method (it mismatch the purpose of action helpers).
 
If I have to do that again, I'll use a custom view helper similar to the placeholder but specialised, with a default output and methods to choose what will be displayed in the sidebar and how.
 
I would use it like that :
 
//in layout
 
echo $this->sidebar();
 
//in actions methods where the sidebar needs to output something else than default
 
$this->view->sidebar()->setContent(/* array of ordered criteria */);
$this->view->sidebar()->append(/* array of ordered criteria */);
$this->view->sidebar()->prepend(/* array of ordered criteria */);
Sent: Monday, April 26, 2010 10:13 AM
Subject: [fw-mvc] Navigation, sidebar blocks, etc...

Hi,

 

I'm looking for the best way to include 'sidebar content' into my Zend Framework application.

 

I fixed the navigation problem, by setting it up in the bootstrap (ZFv1.10.2) and adding it to the Zend_Navigation registry.

But now I want to add random product blocks in the sidebar of pages, linking to the actual product page in the application.

 

I've used a custom Zend_Controller_Action class, where I've put 'global logic', and used the ActionStack to forward the request to a navigation action, but that doesn't feel right.

 

Is the postDispatch hook (helper) the correct place for this?

 

Regards,

 

Jachim Coudenys

[fw-mvc] Navigation, sidebar blocks, etc...

Hi,

 

I’m looking for the best way to include ‘sidebar content’ into my Zend Framework application.

 

I fixed the navigation problem, by setting it up in the bootstrap (ZFv1.10.2) and adding it to the Zend_Navigation registry.

But now I want to add random product blocks in the sidebar of pages, linking to the actual product page in the application.

 

I’ve used a custom Zend_Controller_Action class, where I’ve put ‘global logic’, and used the ActionStack to forward the request to a navigation action, but that doesn’t feel right.

 

Is the postDispatch hook (helper) the correct place for this?

 

Regards,

 

Jachim Coudenys

Re: [fw-db] Combine two one-to-many relationship

Hi,
You can use select to run sql queries:
return $this->fetchAll(
$this->select("Select * from institions as i where i.country_id in
(select c.country_id from countries as c where c.continent_id = 1)")
);

Ting Wang wrote:
>
> Hi,
>
> Is there any way I can combine two one-to-many relationship?
>
> For example, a world region has many countries, a country has many
> institutions. How could I find all cities in a world region?
>
> What I am doing now is find all countries in a world region, then find
> the institutions in every country, then merge these institutions together.
>
> I don't think this is a elegant way.
>
> Of course I can using the following SQL to find all institutions. My
> Question is there a Zend_Db_Tables way to do it?
>
> Select * from institions as i where i.country_id in (select
> c.country_id from countries as c where c.continent_id = 1)
>
> ------------- code to find all institions in a continents
> ------------------------------------------
>
> public function getAllInstitutionsInCountry(Application_Model_Country
> $country){
>
> return $country->findDependentRowset( 'Application_Model_Institutions'
> )->toArray();
>
> }
>
> public function
> getAllInstitutionsInContinent(Application_Model_Continent $continent)
>
> {
>
> $institutions = new Application_Model_Institutions();
>
> $countires = new Application_Model_Countries();
>
> $countries = $countires->getAllContiresInContinent($continent);
>
> $allInstitutions = array();
>
> foreach ($countries as $country) {
>
> $allInstitutions = array_merge($allInstitutions,
> $institutions->getAllInstitutionsInCountry($country));
>
> }
>
> return $allInstitutions;
>
> }
>
> Thanks
>
> Ting
>


--
Yaroslav Vorozhko . Web Developer
web . http://pro100pro.com
twi . http://twitter.com/vorozhko
skp . yarik0083

[fw-db] Combine two one-to-many relationship

Hi,

 

 

Is there any way I can combine two one-to-many relationship?

For example, a world region has many countries, a country has many institutions. How could I find all cities in a world region?

What I am doing now is find all countries in a world region, then find the institutions in every country, then merge these institutions together.

I don’t think this is a elegant way.

 

Of course I can using the following SQL to find all institutions. My Question is there a Zend_Db_Tables way to do it?

 

Select * from institions as i where i.country_id in (select c.country_id from countries as c where c.continent_id = 1)

 

 

 

------------- code to find all institions in a continents ------------------------------------------

 

            public function getAllInstitutionsInCountry(Application_Model_Country $country){

                        return $country->findDependentRowset( 'Application_Model_Institutions' )->toArray();

            }

public function getAllInstitutionsInContinent(Application_Model_Continent $continent)

            {

                        $institutions = new Application_Model_Institutions();

            $countires = new Application_Model_Countries();

                        $countries $countires->getAllContiresInContinent($continent);

                        $allInstitutions = array();

                        foreach ($countries as $country) {

                                    $allInstitutions = array_merge($allInstitutions, $institutions->getAllInstitutionsInCountry($country));

                        }

                        return $allInstitutions;

}

 

 

 

 

Thanks

 

 

Ting       

2010年4月25日星期日

Re: [fw-mvc] the version of the framework

got it

2010/4/26 Hector Virgen <djvirgen@gmail.com>
10 > 9

As in "one point ten" not "one point one oh".

--
Hector



On Sun, Apr 25, 2010 at 9:27 PM, huajun qi <qihjun@gmail.com> wrote:
why it goes back to 1.10?

2010/4/26 Bill Chmura <Bill@explosivo.com>


1.9.7 was the last release before 1.10 if I recall...  1.9.8 came out later.

Lot of new stuff in 1.10


On 4/26/10 12:06 AM, huajun qi wrote:
I don't understand why the zend framework version goes from 1.9.2 to 1.10, what happened?

--
Location:




--
Location:




--
Location:

Re: [fw-mvc] the version of the framework

10 > 9

As in "one point ten" not "one point one oh".

--
Hector


On Sun, Apr 25, 2010 at 9:27 PM, huajun qi <qihjun@gmail.com> wrote:
why it goes back to 1.10?

2010/4/26 Bill Chmura <Bill@explosivo.com>


1.9.7 was the last release before 1.10 if I recall...  1.9.8 came out later.

Lot of new stuff in 1.10


On 4/26/10 12:06 AM, huajun qi wrote:
I don't understand why the zend framework version goes from 1.9.2 to 1.10, what happened?

--
Location:




--
Location:

Re: [fw-mvc] the version of the framework

why it goes back to 1.10?

2010/4/26 Bill Chmura <Bill@explosivo.com>

1.9.7 was the last release before 1.10 if I recall...  1.9.8 came out later.

Lot of new stuff in 1.10


On 4/26/10 12:06 AM, huajun qi wrote:
I don't understand why the zend framework version goes from 1.9.2 to 1.10, what happened?

--
Location:




--
Location:

Re: [fw-mvc] the version of the framework

1.9.7 was the last release before 1.10 if I recall... 1.9.8 came out later.

Lot of new stuff in 1.10

On 4/26/10 12:06 AM, huajun qi wrote:
> I don't understand why the zend framework version goes from 1.9.2 to
> 1.10, what happened?
>
> --
> Location:

[fw-mvc] the version of the framework

I don't understand why the zend framework version goes from 1.9.2 to 1.10, what happened?

--
Location:

Re: [fw-mvc] view helper

Will it be loaded automaticlly?

2010/4/23 holografix . <holografix@gmail.com>
Hi

You can name you view helper Zend_View_Helper_Xxxxxx and put the file in that folder.

cheers
holo

2010/4/23 huajun qi <qihjun@gmail.com>

Got it.

But why there is a 'helpers' folder there?




--
Location:

2010年4月23日星期五

Re: [fw-mvc] view helper

Hi

You can name you view helper Zend_View_Helper_Xxxxxx and put the file in that folder.

cheers
holo

2010/4/23 huajun qi <qihjun@gmail.com>
Got it.

But why there is a 'helpers' folder there?

Re: [fw-mvc] view helper

huajun qi wrote:
> Got it.
>
> But why there is a 'helpers' folder there?
I don't know, but may be it is for helpers templates (views).


--
Yaroslav Vorozhko . Web Developer
web . http://pro100pro.com
twi . http://twitter.com/vorozhko
skp . yarik0083

Re: [fw-mvc] view helper

Got it.

But why there is a 'helpers' folder there?

Re: [fw-mvc] view helper

huajun qi wrote:
> There is a 'helpers' folder under application/views/ , I write a view
> helper extending Zend_View_Helper_Abstract, but I do not know how to
> use it?
>
> How to make application autoload it?
>
> --
> Location:
You need to put helper in the library folder for example.
But, before you should have a specific file structure in library folder
for your custom helpers.
Like:
class name My_View_Helper_Test
so, for this class name file structure should be:
library/My/View/Helper/
and file Test.php should contain this class.

Also in application/configs/application.ini you should add Your
namespace "My" for autoloading.
autoloadernamespaces[] = My

--
Yaroslav Vorozhko . Web Developer
web . http://pro100pro.com
twi . http://twitter.com/vorozhko
skp . yarik0083

[fw-mvc] view helper

There is a 'helpers' folder under application/views/ ,  I write a view helper extending Zend_View_Helper_Abstract, but I do not know how to use it?

How to make application autoload it?

--
Location:

2010年4月22日星期四

Re: [fw-auth] Zend_Auth with single field

What about an approach of public and private API key, where the public
key represents the identity and the private key represents the
credential?

The other approach would be to write your own adapter, like it was
mentioned before.

Am 22.04.2010 um 20:41 schrieb Laura Dean <ldean@saleamp.com>:

>
> I want to use Zend_Auth for authenticating a web service. For human
> authentication, I use the standard username/password, but for machine
> authentication I want to use a single field, an API key, which will be
> stored in the database.
>
> As far as I can tell, Zend_Auth_Adapter_DbTable needs two pieces of
> information, identity and credential. What is the best way to use
> Zend_Auth
> with a database table and a single API key?
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Auth-with-single-field-tp2020996p2020996.html
> Sent from the Zend Auth mailing list archive at Nabble.com.
>

Re: [fw-auth] Zend_Auth with single field

The API key alone is not enough to authenticate a user (or machine). Usually the API key is attached to a domain name or user account, so you may need the user (or machine) to provide both their identity (domain name, username, etc.) and their credential (the API key).

--
Hector


On Thu, Apr 22, 2010 at 11:41 AM, Laura Dean <ldean@saleamp.com> wrote:

I want to use Zend_Auth for authenticating a web service.  For human
authentication, I use the standard username/password, but for machine
authentication I want to use a single field, an API key, which will be
stored in the database.

As far as I can tell, Zend_Auth_Adapter_DbTable needs two pieces of
information, identity and credential.  What is the best way to use Zend_Auth
with a database table and a single API key?

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Auth-with-single-field-tp2020996p2020996.html
Sent from the Zend Auth mailing list archive at Nabble.com.


Re: [fw-auth] Zend_Auth with single field

You can write your own adapter

On Thu, Apr 22, 2010 at 2:41 PM, Laura Dean <ldean@saleamp.com> wrote:

I want to use Zend_Auth for authenticating a web service.  For human
authentication, I use the standard username/password, but for machine
authentication I want to use a single field, an API key, which will be
stored in the database.

As far as I can tell, Zend_Auth_Adapter_DbTable needs two pieces of
information, identity and credential.  What is the best way to use Zend_Auth
with a database table and a single API key?

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Auth-with-single-field-tp2020996p2020996.html
Sent from the Zend Auth mailing list archive at Nabble.com.


[fw-auth] Zend_Auth with single field

I want to use Zend_Auth for authenticating a web service. For human
authentication, I use the standard username/password, but for machine
authentication I want to use a single field, an API key, which will be
stored in the database.

As far as I can tell, Zend_Auth_Adapter_DbTable needs two pieces of
information, identity and credential. What is the best way to use Zend_Auth
with a database table and a single API key?

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Auth-with-single-field-tp2020996p2020996.html
Sent from the Zend Auth mailing list archive at Nabble.com.

[fw-webservices] Re: Debugging Zend_XmlRpc_Server

The other thing that helps even more is to turn on xdebug.collect_params and
xdebug.collect_return, then you can see the document that SimpleXMLElement
is choking on.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Debugging-Zend-XmlRpc-Server-tp2019242p2020887.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

[fw-webservices] Re: Debugging Zend_XmlRpc_Server

I was able to get decent debugging information by wrapping my server call in
xdebug trace calls, like such:

xdebug_start_trace($config->framework->log_dir . '/xdebug_trace.txt');
$response = $server->handle();
xdebug_stop_trace();

This should be sufficient to move forward.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Debugging-Zend-XmlRpc-Server-tp2019242p2020773.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

Re: [fw-mvc] Re: Trailing slashes

'SCRIPT_FILENAME', 'SCRIPT_NAME', 'ORIG_SCRIPT_NAME', 'PHP_SELF',
'REQUEST_URI' server variables are involved in dispatching process,
and they vary on different web-servers. The logic complex and I am not
explored this in the details, but you can look at
Zend\Controller\Request\Http.php

I found the topic about not the same but similar problem on the
internet, after that a created a special fastcgi_params version for
this host, where the line "fastcgi_param  SCRIPT_NAME
$fastcgi_script_name;" is just commented, so $_SERVER['SCRIPT_NAME']
is null now. That helped.

Folks, if i missed something and ZF can be configured to rely on nginx
default server variables content without adjusting nginx
fastcgi_params, please let me know. I will very appreciate this.


On Thu, Apr 22, 2010 at 10:47 AM, sina miandashti <[hidden email]> wrote:

>
> how?
>
> that was apache config problem?
>
> --
> ________________
> Sincerely
> Sina Miandashti
> MuSicBasE.ir & InvisionPower.ir Admin



--
Eduard Bareev
[hidden email]


View this message in context: Re: [fw-mvc] Re: Trailing slashes
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年4月21日星期三

[fw-webservices] Re: Debugging Zend_XmlRpc_Server

Thank you for your response, Matthew.  I keep running into your articles and forum threads while trying to figure this out and never would have gotten this far without them.  I believe the docblocks are set up correctly.

For instance, here is the method:

    /**
    * Get one contact
    *
    * @param string $contacts_email
    * @return string
    *
    */
    function getContactInfo($contacts_email) {
        $acl = Zend_Registry::get('acl');
        $clientDb = Zend_Registry::get('client_db');
       
        $contact = DatabaseObject_Contact($clientDb);
        //$contact->load($contacts_email, 'contacts_email');
       
        return $contacts_email . ' back from server <br>';
    }

Here is the call from the client:

$token = '1';
$arg1 = [hidden email]';
print_r($client->call('service.getContactInfo', array($token, $arg1)));

I used your advice in another thread to set up a custom Response object for Acl authentication, so that strips out the $token parameter.  For Zend_Registry, 'acl' is set in the bootstrap and 'client_db' is set in the custom Response object.  If I echo out client_db, it looks correct.

If I comment out the line $contact = DatabaseObject_Contact($clientDb); then I get the expected response (it echos "[hidden email] back from server").

Thanks,
~Laura


On Wed, 2010-04-21 at 09:04 -0800, weierophinney [via Zend Framework Community] wrote:
-- Laura Dean <[hidden email]> wrote
(on Wednesday, 21 April 2010, 08:32 AM -0800):

> I have my server and client both basically working on a "hello world" level.
> Now I'm trying to add the good stuff.  The problem is that I'll change
> something in my web service, and get an exception like this:
>
> ( ! ) Warning: SimpleXMLElement::__construct()
> [function.SimpleXMLElement---construct]: Entity: line 2: parser error :
> Extra content at the end of the document in
> /data/lib/Zend/ZendFramework-1.10.2/library/Zend/XmlRpc/Response.php on line
> 180
> Call Stack
> # Time Memory Function Location
> 1 0.0003 60988 {main}( ) ../xmlrpc_test.php:0
> 2 0.1881 10109712 Zend_XmlRpc_Client->call( ) ../xmlrpc_test.php:24
> 3 0.9383 10836620 Zend_XmlRpc_Client->doRequest( ) ../Client.php:364
> 4 1.6136 10845916 Zend_XmlRpc_Response->loadXml( ) ../Client.php:300
> 5 1.6137 10845916 SimpleXMLElement->__construct( ) ../Response.php:180
>
> When I print_r on $response from within the loadXml() function, it looks
> like this:
>
> faultCode623faultStringCalling parameters do not match signature

Two things to look at:

 * Have you created your method docblock correctly? I.e., have you
   created @param and @return annotations? And do they specify the
   correct variable types?

 * Assuming the answers to the above questions are "yes", do the types
   you're passing in your client request match those in the docblock?

As an example, if you have the following method:

    function foo(array $bar, $flag) {}

then you want to make sure it has a docblock, which might look like
this:

    /**
     * @param  array $bar
     * @param  bool $flag
     * @return string
     */
    function foo(array $bar, $flag) {}

When you make your request, you'd want to ensure that the parameters you
send are an array and a boolean, respectively.

Check this information, and then report back to the list what you find.

> But if I take out the offending line of code then it doesn't complain about
> parameters.  I am trying to create a DatabaseObject, which is my custom
> "interface with mySQL" class.  There might be an error creating the
> DatabaseObject (maybe the database isn't configured correctly or something
> else), but that's the error I need to see, not "Calling parameters do not
> match signature"
>
> I tried the advice from this thread,
> http://osdir.com/ml/php.zend.framework.general/2007-06/msg00383.html , but
> it looks like the exception is thrown before I can get any useful
> information into the log.
>
> Any suggestions for me?

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



View message @ http://n4.nabble.com/Debugging-Zend-XmlRpc-Server-tp2019242p2019301.html
To unsubscribe from Debugging Zend_XmlRpc_Server, click here.



View this message in context: Re: Debugging Zend_XmlRpc_Server
Sent from the Zend Web Services mailing list archive at Nabble.com.

Re: [fw-webservices] Debugging Zend_XmlRpc_Server

-- Laura Dean <ldean@saleamp.com> wrote
(on Wednesday, 21 April 2010, 08:32 AM -0800):
> I have my server and client both basically working on a "hello world" level.
> Now I'm trying to add the good stuff. The problem is that I'll change
> something in my web service, and get an exception like this:
>
> ( ! ) Warning: SimpleXMLElement::__construct()
> [function.SimpleXMLElement---construct]: Entity: line 2: parser error :
> Extra content at the end of the document in
> /data/lib/Zend/ZendFramework-1.10.2/library/Zend/XmlRpc/Response.php on line
> 180
> Call Stack
> # Time Memory Function Location
> 1 0.0003 60988 {main}( ) ../xmlrpc_test.php:0
> 2 0.1881 10109712 Zend_XmlRpc_Client->call( ) ../xmlrpc_test.php:24
> 3 0.9383 10836620 Zend_XmlRpc_Client->doRequest( ) ../Client.php:364
> 4 1.6136 10845916 Zend_XmlRpc_Response->loadXml( ) ../Client.php:300
> 5 1.6137 10845916 SimpleXMLElement->__construct( ) ../Response.php:180
>
> When I print_r on $response from within the loadXml() function, it looks
> like this:
>
> faultCode623faultStringCalling parameters do not match signature

Two things to look at:

* Have you created your method docblock correctly? I.e., have you
created @param and @return annotations? And do they specify the
correct variable types?

* Assuming the answers to the above questions are "yes", do the types
you're passing in your client request match those in the docblock?

As an example, if you have the following method:

function foo(array $bar, $flag) {}

then you want to make sure it has a docblock, which might look like
this:

/**
* @param array $bar
* @param bool $flag
* @return string
*/
function foo(array $bar, $flag) {}

When you make your request, you'd want to ensure that the parameters you
send are an array and a boolean, respectively.

Check this information, and then report back to the list what you find.

> But if I take out the offending line of code then it doesn't complain about
> parameters. I am trying to create a DatabaseObject, which is my custom
> "interface with mySQL" class. There might be an error creating the
> DatabaseObject (maybe the database isn't configured correctly or something
> else), but that's the error I need to see, not "Calling parameters do not
> match signature"
>
> I tried the advice from this thread,
> http://osdir.com/ml/php.zend.framework.general/2007-06/msg00383.html , but
> it looks like the exception is thrown before I can get any useful
> information into the log.
>
> Any suggestions for me?

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

[fw-webservices] Debugging Zend_XmlRpc_Server

I have my server and client both basically working on a "hello world" level.
Now I'm trying to add the good stuff. The problem is that I'll change
something in my web service, and get an exception like this:

( ! ) Warning: SimpleXMLElement::__construct()
[function.SimpleXMLElement---construct]: Entity: line 2: parser error :
Extra content at the end of the document in
/data/lib/Zend/ZendFramework-1.10.2/library/Zend/XmlRpc/Response.php on line
180
Call Stack
# Time Memory Function Location
1 0.0003 60988 {main}( ) ../xmlrpc_test.php:0
2 0.1881 10109712 Zend_XmlRpc_Client->call( ) ../xmlrpc_test.php:24
3 0.9383 10836620 Zend_XmlRpc_Client->doRequest( ) ../Client.php:364
4 1.6136 10845916 Zend_XmlRpc_Response->loadXml( ) ../Client.php:300
5 1.6137 10845916 SimpleXMLElement->__construct( ) ../Response.php:180

When I print_r on $response from within the loadXml() function, it looks
like this:

faultCode623faultStringCalling parameters do not match signature

But if I take out the offending line of code then it doesn't complain about
parameters. I am trying to create a DatabaseObject, which is my custom
"interface with mySQL" class. There might be an error creating the
DatabaseObject (maybe the database isn't configured correctly or something
else), but that's the error I need to see, not "Calling parameters do not
match signature"

I tried the advice from this thread,
http://osdir.com/ml/php.zend.framework.general/2007-06/msg00383.html , but
it looks like the exception is thrown before I can get any useful
information into the log.

Any suggestions for me?
--
View this message in context: http://n4.nabble.com/Debugging-Zend-XmlRpc-Server-tp2019242p2019242.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

[fw-webservices] Re: Zend XMLRPC Server without Zend (glue?)

as_lh wrote:
>
> Can i create a Request Object myself and give it to the Server Object?
> If possible: How?
>

I don't know if this helps, still trying to wrap my own head around XmlRpc
Server, but I did find this piece:

$request = new My_XmlRpc_Request(); // extended from Zend_XmlRpc_Request
$server->setRequest($request);


--
View this message in context: http://n4.nabble.com/Zend-XMLRPC-Server-without-Zend-glue-tp1745099p2019227.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

[fw-mvc] Re: Trailing slashes

Solved by tuning nginx fastcgi_params.
--
View this message in context: http://n4.nabble.com/Trailing-slashes-tp2018854p2018956.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Re: trailing slashes

>Have you tried removind last slash from route? Like this :
> $route = new Zend_Controller_Router_Route(
> 'news/:name',
> array(
> 'controller' => 'news',
> 'action' => 'showOne'
> )
> );

Yes Rafał, but results are the same.
This problem is not related especially to additional routes. Behavior I
mentioned is common in my deployment, even without registering any special
routes:
"/news" - match news controller, index action
"/news/" - does not
--
View this message in context: http://n4.nabble.com/Trailing-slashes-tp2018854p2018891.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] trailing slashes

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

iEYEARECAAYFAkvO9GAACgkQadOAzz84lo82QQCeODcuB5ejSVESVePvuqkyxUZM
7GsAn12TBVptIYdaHVgbjsNHG1ggGjnI
=5glJ
-----END PGP SIGNATURE-----
Have you tried removind last slash from route? Like this :

$route = new Zend_Controller_Router_Route(
'news/:name',
array(
'controller' => 'news',
'action' => 'showOne'
)
);
--
Rafał (ert16) Trójniak
WEB : http://trojniak.net/
m@il : ert256@gmail.com
Jid : ert256@gmail.com
GPG key-ID : 3F38968F
4711 E3BC B674 C841 BED8
0F8F 69D3 80CF 3F38 968F


Eduard <eduard@bareev.ru>
[Wed, 21 Apr 2010 04:40:16 -0800 (PST)] :

>
> In my current ZF (svn):
>
> "/news" - match news controller, index action
> "/news/" - does not
>
> And route:
> $route = new Zend_Controller_Router_Route(
> 'news/:name/',
> array(
> 'controller' => 'news',
> 'action' => 'showOne'
> )
> );
>
> Match "/news/opening2010",
> but not the "/news/opening2010/"
>
> It is expected behavior?
> How to override it? As for me, presence or absence of trailing slash
> should make no difference.
>
> Thanks in advance, any comments appreciated.

[fw-mvc] trailing slashes

In my current ZF (svn):

"/news" - match news controller, index action
"/news/" - does not

And route:
$route = new Zend_Controller_Router_Route(
'news/:name/',
array(
'controller' => 'news',
'action' => 'showOne'
)
);

Match "/news/opening2010",
but not the "/news/opening2010/"

It is expected behavior?
How to override it? As for me, presence or absence of trailing slash should
make no difference.

Thanks in advance, any comments appreciated.
--
View this message in context: http://n4.nabble.com/trailing-slashes-tp2018854p2018854.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年4月20日星期二

[fw-webservices] Re: Problem with Zend_XmlRpc_Client

I got the client working with my own Zend_XmlRpc_Server after a while, but in
case anyone else is looking for something to test a client against, there
are some ideas in this thread:

http://framework.zend.com/issues/browse/ZF-2978

--
View this message in context: http://n4.nabble.com/Problem-with-Zend-XmlRpc-Client-tp675682p2018053.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

Re: [fw-auth] authentication timing out by default?



On Mon, Apr 19, 2010 at 6:58 PM, Simon Griffiths <simon.griffiths@tenenbaum.co.uk> wrote:

I had the same issue as well and instead of changing php settings machine wide did this to only affect the ZF app in question.

 

phpSettings.session.gc_maxlifetime = 86400

 

in my application/application.ini

 

This gives my sessions a life of 24 hours which is plenty for this apps needs.

 

Hope this helps,

 

Thanks Simon

I realized that my old php.ini had been inadvertently blown away in the course of a backup/disk replacement/restore operation, so I was getting the rather conservative default that comes with Ubuntu -- session.gc_maxlifetime = 1440 seconds -- and it seems my idle sessions were getting garbage-collected for that reason.


--

Support real health care reform:
http://phimg.org/

--
David Mintz
http://davidmintz.org/


2010年4月19日星期一

RE: [fw-auth] authentication timing out by default?

I had the same issue as well and instead of changing php settings machine wide did this to only affect the ZF app in question.

 

phpSettings.session.gc_maxlifetime = 86400

 

in my application/application.ini

 

This gives my sessions a life of 24 hours which is plenty for this apps needs.

 

Hope this helps,

 

Si.

[snip]


>Gentlemen:

>
>Thanks. I will try these suggestions.
>
>--
>Support real health care reform:
>http://phimg.org/
>
>--
>David Mintz
>http://davidmintz.org/

2010年4月18日星期日

[fw-mvc] Re: problem in netbeans

Netbeans has a query browser, so you can write and test your queries.
It also does SQL code completion when writing sql in php.
for an example, see:
http://blogs.sun.com/netbeansphp/entry/sql_code_completion_improved

I don't use the feature much though. I tend to use MySQL Workbench for most
of my sql stuff.

Cheers,
David
--
View this message in context: http://n4.nabble.com/problem-in-netbeans-tp1971952p2015360.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年4月17日星期六

[fw-webservices] Re: Problem with Zend_XmlRpc_Client

Rolando Espinoza La Fuente wrote:
>
> On Thu, Jan 22, 2009 at 2:35 AM, anz_nabble <anz@feathersoft.de> wrote:
>>
>> I had set up an XML-RPC client for using a demo service of the XML-RPC
>> server
>> on the Zend Framework website, and I instantiated it and use the call()
>> instance method.
>>
>> What I had done is given below
> [...]
>>
>> What's wrong in my code, pls help ....
>
> There is nothing wrong with your code. There isn't a xmlrpc
> server at framework.zend.com/xmlrpc
>
> Try another webservice, e.g. freshmeat.net
>
> $client = new Zend_XmlRpc_Client('http://freshmeat.net/xmlrpc/');
> $result = $client->call('fetch_available_licenses');
> var_dump($result);
>
>
> Regards,
>
> --
> Rolando Espinoza La fuente
> Pro Soft Resources Inc.
> www.prosoftpeople.com
>
>

Rolando Espinoza La Fuente wrote:
>
> On Thu, Jan 22, 2009 at 2:35 AM, anz_nabble <anz@feathersoft.de> wrote:
>>
>> I had set up an XML-RPC client for using a demo service of the XML-RPC
>> server
>> on the Zend Framework website, and I instantiated it and use the call()
>> instance method.
>>
>> What I had done is given below
> [...]
>>
>> What's wrong in my code, pls help ....
>
> There is nothing wrong with your code. There isn't a xmlrpc
> server at framework.zend.com/xmlrpc
>
> Try another webservice, e.g. freshmeat.net
>
> $client = new Zend_XmlRpc_Client('http://freshmeat.net/xmlrpc/');
> $result = $client->call('fetch_available_licenses');
> var_dump($result);
>

I copied the code and got a similar result:

Zend_XmlRpc_Client_HttpException: Not Found in
/data/lib/Zend/ZendFramework-1.10.2/library/Zend/XmlRpc/Client.php on line
288

I tried with both the Zend XmlRpc server from the documentation (is it
really not there?) and the freshmeat example above, but no good response. I
am new to XmlRpc, any suggestions of other servers I could try? I just want
to see the client working so I can debug my own Zend_XmlRpc_Server
component.

Thanks,
Laura

--
View this message in context: http://n4.nabble.com/Problem-with-Zend-XmlRpc-Client-tp675682p2014605.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

Re: [fw-mvc] problem in netbeans

sorry

another question

in netBeans  when we set Database Connection actually what changed?
what is the usage of declaring DB connection in netbeans?

--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin

[fw-webservices] Zend_Uri with long URI made Apache to crash

Hi,

In one of my project, I'm using Zend_Rest_Client to call a webservice
and this call made Apache crash (only happen on Windows).

After some analysis I found the issue :

Line 633 : "$status = @preg_match($pattern, $query);" in
Zend_Uri_Http::validateQuery($query = null) called with a very long
query string creates a stackoverflow in Apache (the pattern matching
each char).

This is a known issue http://bugs.php.net/bug.php?id=47689 but IMO the
proposed solution isn't a good solution.

Right now, I have to override Zend_Uri_Http::valid() in order to
suppress the validateQuery() call but it's a very poor workarround.

Is there any possibility to use a more memory effective regexp to
validate the query ?

Thanks for your comments,

PS :
$query =
"id=5055671,5043821,43718,5040579,5043177,1804001,5055602,8849,5001901,5039536,336481,5000145,38863,5010085,692614,5037669,5003404,5035540,5038331,39231,690949,5037926,44400,5035825,690028,28133,5009032,5012210,5034533,5025474,33404,48122,5042203,695314,5041796,5013147,46451,25312,690951,46766,5012566,602766,41686,694744,5038016,5038276,5040088,5042757,15463,5041183,5021371,40121,5036192,336592,5009097,5034641,46867,5001512,5036270,39511,41466,5036173,695881,5055569,5019073,5034986,5034940,5034680,45218,5042898,48768,5042763,5001458,38404,5041164,5040721,5037143,5042012,5040568,1090475,39369,5039376,336506,5055619,9442,5039741,5021534,5021652,5002264,5050153,5034865,47431,5055663,5034653,5038207,5037996,46781,5043001,27226,40363,40623,5043102,5000080,694667,3050105,5027726,5034872,5042046,23280,4015463,5037615,5025088,5040637,5032419,24515,5043530,5002758,20287,5043718,41139,5037409,5041925,5034927,28134,5042795,5039893,5042526,5039644,5032573,5040374,5034996,5008820,5034934
,5022130,46897,18262";

--
Jean-Sébastien H.
au-fil-du.net

2010年4月16日星期五

Re: [fw-db] Re: aggregete joins failing, looking for a workaround

You need to wrap your subquery in a Zend_Db_Expr object:

->join(array('licenses' => new Zend_Db_Expr('( [subquery] )'));

--
Hector


On Fri, Apr 16, 2010 at 2:19 PM, MikeD <dambrogia@gmail.com> wrote:

decided to bypass the use of select() and just pass the straight query to a
zend_db object:

$sql = "select * from table";

$config = new Zend_Config_Ini( APPLICATION_PATH . DIRECTORY_SEPARATOR .
'configs' . DIRECTORY_SEPARATOR . 'application.ini',
getenv('APPLICATION_ENV'));
$db = Zend_Db::factory($config->resources->db->adapter,
$config->resources->db->params);
$db->getConnection();
return $db->fetchAll($sql);

returns an array of rows.  not perfect but works
--
View this message in context: http://n4.nabble.com/aggregete-joins-failing-looking-for-a-workaround-tp2013446p2013595.html
Sent from the Zend DB mailing list archive at Nabble.com.