Re: [fw-general] Zend_Search_Lucene and Hebrew

2009-04-08 Thread centralniak

Hi,


vince. wrote:
> 
> Hey,
> 
> Unfortunately, I havn't used Lucene with Hebrew letters yet. But one thing
> i
> would like to be sure about. You said it returns an empty array, I took a
> look at this line from you code:
> $results = $phrase ? $index->find($phrase) : array();
> 
> I assume $phrase is the user submitted search phrase, If it's empty then
> it
> will return an empty array from the ternary condition. Are you sure this
> is
> not the empty array your returning all the time from the $phrase being
> null?
> 

Yes, I'm sure about that :-(

I've even changed it to $results = $index->find($phrase); but problem
remains...

Regards,
Piotr
-- 
View this message in context: 
http://www.nabble.com/Zend_Search_Lucene-and-Hebrew-tp22938539p22944884.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] xhr upload

2009-04-08 Thread Giorgio Sironi
2009/4/7 antonis 

> I'm trying to make an ajax submission when uploading a file.
>

Because of the limitations of Xhr, I use an iframe styled as it was a part
of the page, that emulates the behaviour you want to create very well.

-- 
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://ossigeno.sourceforge.net


Re: [fw-general] Problems running a dojo example

2009-04-08 Thread Giorgio Sironi
2009/4/8 fab2008 

> 

Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread keith Pope
Accessing from controller is done via $this->getInvokeArg(), if you
use FC parameter.

You may want to look at why you want to have config, cache and locale
access in your view, generally this would happen in the Model or
controller.

If you do need to do this I would suggest using a view helper, this
way you encapsulate the access away from the main view scripts.

class Zend_View_Helper_MyViewHelper
{
public function MyViewHelper ()
{
$fc = Zend_Controller_Front::getInstance();
$fc->getParam('xxx');

// or
$config = Zend_Registry::get('Zend_Config')
}
}

There are of course many ways to do push stuff into views, in your
bootstrap you can set variables on the view, and you can use front
controller plugin, action helpers etc.

Just have a think to why you need to do this, it may be that this
should be handled in your Model.

Thx

Keith

2009/4/8 Elvin Şiriyev :
> 2. way sounds good. but how can i access frontController's params from
> controller and view script ?
> i dont like write that codes for each Action
> --
> $config = Zend_Registry::get('Zend_Config');
> $cache = Zend_Registry::get('Zend_Cache');
> $locale = Zend_Registry::get('Zend_Locale');
> ..
> .
> $this->view->config  = $config;
> $this->view->cache = $cache;
> $this->view->locale = $locale;
> ..
> .
> -
> 2009/4/8 keith Pope 
>>
>> Maybe use the registry for that, so have a bootstrap class resource
>> that fetches the plugin resources:
>>
>> protected _initRegistry()
>> {
>>    $this->bootstrap('db');
>>    Zend_Registry::set('dbResource', $this->getPluginResource('db'));
>> }
>>
>> Or you could pass them as params to the front controller, which would
>> make them accessible inside controllers:
>>
>> protected _initFrontControllerExtras()
>> {
>>    $this->bootstrap('frontcontroller');
>>    $this->frontController->setParam('x','xxx');
>>    // or
>>
>>  $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx');
>> }
>>
>> Hope this helps
>>
>> Keith
>>
>> 2009/4/8 Elvin Şiriyev :
>> > hi, i used Zend_Application with Zend_Application_Resource_*.
>> > how can i access to that objects from my Controller and view?
>> >
>> > for example is there any way to access Zend_Application_Resource_
>> > Navigation 's  getContainer() method from controller like
>> > $this->navigation->getContainer() or $this->db, $this->layout,
>> > $this->locale
>> > or another easy way ?
>> >
>> > thanks
>> >
>> > --
>> > Elvin Şiriyev
>> > http://elvin.siriyev.net
>> >
>> > --
>> > Elvin Şiriyev
>> > http://elvin.siriyev.net
>> >
>>
>>
>>
>> --
>> --
>> [MuTe]
>> --
>
>
>
> --
> Elvin Şiriyev
> http://elvin.siriyev.net
>



-- 
--
[MuTe]
--


[fw-general] Zend_Application Db resource in INI

2009-04-08 Thread Marko Korhonen

hi,

somehow my db resource is not registered automatically. I have declared the
db resource
in my INI file.

resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "username"
resources.db.params.password = "password"
resources.db.params.dbname = "database_name"
resources.db.isDefaultTableAdapter = true

I need to call this to get it working:
$this->bootstrap('db');


Any clues? frontController, view, modules and session are registered
correctly.

br, Marko
-- 
View this message in context: 
http://www.nabble.com/Zend_Application-Db-resource-in-INI-tp22947324p22947324.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Application Db resource in INI

2009-04-08 Thread keith Pope
Your config looks good, do you have any other resources called db?

I have:

resources.db.adapter = "PDO_MYSQL"
resources.db.isdefaulttableadapter = true
resources.db.params.dbname = "storefront"
resources.db.params.username = "root"
resources.db.params.password = "root"
resources.db.params.hostname = "localhost"
resources.db.params.driver_options.1002 = "SET NAMES UTF8;"

Which is working fine with the latest trunk.

2009/4/8 Marko Korhonen :
>
> hi,
>
> somehow my db resource is not registered automatically. I have declared the
> db resource
> in my INI file.
>
> resources.db.adapter = "pdo_mysql"
> resources.db.params.host = "localhost"
> resources.db.params.username = "username"
> resources.db.params.password = "password"
> resources.db.params.dbname = "database_name"
> resources.db.isDefaultTableAdapter = true
>
> I need to call this to get it working:
> $this->bootstrap('db');
>
>
> Any clues? frontController, view, modules and session are registered
> correctly.
>
> br, Marko
> --
> View this message in context: 
> http://www.nabble.com/Zend_Application-Db-resource-in-INI-tp22947324p22947324.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



-- 
--
[MuTe]
--


[fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
hi, i used Zend_Application with Zend_Application_Resource_*.
how can i access to that objects from my Controller and view?

for example is there any way to access Zend_Application_Resource_ Navigation
's  getContainer() method from controller like
$this->navigation->getContainer() or $this->db, $this->layout, $this->locale
or another easy way ?

thanks

--
Elvin Şiriyev
http://elvin.siriyev.net


-- 
Elvin Şiriyev
http://elvin.siriyev.net


[fw-general] ViewScript decorator

2009-04-08 Thread keith Pope
Can you pass extra data to the partial it creates?

Thx

Keith


[fw-general] integer null record problem

2009-04-08 Thread helderfelipe

im trying to do this

$qry = $cidadeModel->createRow();
$qry->id_estado = $formData['id_estado'];
$qry->cidade = $formData['cidade'];
$qry->cod_ibge = $formData['cod_ibge'];
$qry->save(); 

the field cod_ibge have null allowed in the database, but this error
happens: "...Incorrect integer value..."
if i set $qry->cod_ibge = 0 it works
what can i do ?

*im using mysql 5.0.67
-- 
View this message in context: 
http://www.nabble.com/integer-null-record-problem-tp22948674p22948674.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread keith Pope
Maybe use the registry for that, so have a bootstrap class resource
that fetches the plugin resources:

protected _initRegistry()
{
$this->bootstrap('db');
Zend_Registry::set('dbResource', $this->getPluginResource('db'));
}

Or you could pass them as params to the front controller, which would
make them accessible inside controllers:

protected _initFrontControllerExtras()
{
$this->bootstrap('frontcontroller');
$this->frontController->setParam('x','xxx');
// or

$this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx');
}

Hope this helps

Keith

2009/4/8 Elvin Şiriyev :
> hi, i used Zend_Application with Zend_Application_Resource_*.
> how can i access to that objects from my Controller and view?
>
> for example is there any way to access Zend_Application_Resource_
> Navigation 's  getContainer() method from controller like
> $this->navigation->getContainer() or $this->db, $this->layout, $this->locale
> or another easy way ?
>
> thanks
>
> --
> Elvin Şiriyev
> http://elvin.siriyev.net
>
> --
> Elvin Şiriyev
> http://elvin.siriyev.net
>



-- 
--
[MuTe]
--


Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
2. way sounds good. but how can i access frontController's params from
controller and view script ?
i dont like write that codes for each Action
--
$config = Zend_Registry::get('Zend_Config');
$cache = Zend_Registry::get('Zend_Cache');
$locale = Zend_Registry::get('Zend_Locale');
..
.
$this->view->config  = $config;
$this->view->cache = $cache;
$this->view->locale = $locale;
..
.
-
2009/4/8 keith Pope 

> Maybe use the registry for that, so have a bootstrap class resource
> that fetches the plugin resources:
>
> protected _initRegistry()
> {
>$this->bootstrap('db');
>Zend_Registry::set('dbResource', $this->getPluginResource('db'));
> }
>
> Or you could pass them as params to the front controller, which would
> make them accessible inside controllers:
>
> protected _initFrontControllerExtras()
> {
>$this->bootstrap('frontcontroller');
>$this->frontController->setParam('x','xxx');
>// or
>
>  
> $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx');
> }
>
> Hope this helps
>
> Keith
>
> 2009/4/8 Elvin Şiriyev :
> > hi, i used Zend_Application with Zend_Application_Resource_*.
> > how can i access to that objects from my Controller and view?
> >
> > for example is there any way to access Zend_Application_Resource_
> > Navigation 's  getContainer() method from controller like
> > $this->navigation->getContainer() or $this->db, $this->layout,
> $this->locale
> > or another easy way ?
> >
> > thanks
> >
> > --
> > Elvin Şiriyev
> > http://elvin.siriyev.net
> >
> > --
> > Elvin Şiriyev
> > http://elvin.siriyev.net
> >
>
>
>
> --
> --
> [MuTe]
> --
>



-- 
Elvin Şiriyev
http://elvin.siriyev.net


Re: [fw-general] integer null record problem

2009-04-08 Thread Brenton Alker
helderfelipe wrote:
> im trying to do this
> 
> $qry = $cidadeModel->createRow();
> $qry->id_estado = $formData['id_estado'];
> $qry->cidade = $formData['cidade'];
> $qry->cod_ibge = $formData['cod_ibge'];
> $qry->save(); 
> 
> the field cod_ibge have null allowed in the database, but this error
> happens: "...Incorrect integer value..."
> if i set $qry->cod_ibge = 0 it works
> what can i do ?
> 
> *im using mysql 5.0.67

What is the value of $formData['cod_ibge'] ? is it an empty string or an
actual null value (var_dump it). My guess is an empty string.

Try,

$qry->cod_ibge = empty($formData['cod_ibge']) ? null :
$formData['cod_ibge'];

This could also be handled in your filtering before you get to this stage.

-- 

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/



signature.asc
Description: OpenPGP digital signature


Re: [fw-general] Zend_Application Db resource in INI

2009-04-08 Thread Marko Korhonen

False alarm,

I did my test call to db from module bootstrap _iniModule.. So the db
resource was not yet registered...

br, Marko


keith Pope-4 wrote:
> 
> Your config looks good, do you have any other resources called db?
> 
> I have:
> 
> resources.db.adapter = "PDO_MYSQL"
> resources.db.isdefaulttableadapter = true
> resources.db.params.dbname = "storefront"
> resources.db.params.username = "root"
> resources.db.params.password = "root"
> resources.db.params.hostname = "localhost"
> resources.db.params.driver_options.1002 = "SET NAMES UTF8;"
> 
> Which is working fine with the latest trunk.
> 
> 2009/4/8 Marko Korhonen :
>>
>> hi,
>>
>> somehow my db resource is not registered automatically. I have declared
>> the
>> db resource
>> in my INI file.
>>
>> resources.db.adapter = "pdo_mysql"
>> resources.db.params.host = "localhost"
>> resources.db.params.username = "username"
>> resources.db.params.password = "password"
>> resources.db.params.dbname = "database_name"
>> resources.db.isDefaultTableAdapter = true
>>
>> I need to call this to get it working:
>> $this->bootstrap('db');
>>
>>
>> Any clues? frontController, view, modules and session are registered
>> correctly.
>>
>> br, Marko
>> --
>> View this message in context:
>> http://www.nabble.com/Zend_Application-Db-resource-in-INI-tp22947324p22947324.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --
> [MuTe]
> --
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Application-Db-resource-in-INI-tp22947324p22947637.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Date Problems

2009-04-08 Thread hardik82

Hello, can anyone tell me how i can get current date in format[-MM-dd
HH:mm:ss]

milesap wrote:
> 
> Hello,
> 
> I'm fairly new to Zend Framework, so forgive me if this is a really easy
> question. I have been looking everywhere for a solution. I am trying to
> get the difference between the current date and a persons birthday to see
> how old they are.
> 
> $date = new Zend_Date();
>   $date->sub('April 3, 1980');
>   
>   print $date->toString('Y');
> 
> The following prints 28, however the correct age would be 29, as the
> persons birthday was a few days ago. Does it not take the month and day
> into account when it subs the date? Or a better question would be what am
> I doing wrong?
> 
> I have set my default timezone correctly.
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Date-Problems-tp22921295p22950241.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Date Problems

2009-04-08 Thread Chris MacPherson

You can use the ->toString() method to output custom date formats like this:

$date = new Zend_Date(); // Passing no params sets to current date.
$date->toString('-MM-dd HH:mm:ss');

See http://framework.zend.com/manual/en/zend.date.constants.html#zend.date.constants.selfdefinedformats for date part specifiers. 





hardik82 wrote:

Hello, can anyone tell me how i can get current date in format[-MM-dd
HH:mm:ss]

milesap wrote:
  

Hello,

I'm fairly new to Zend Framework, so forgive me if this is a really easy
question. I have been looking everywhere for a solution. I am trying to
get the difference between the current date and a persons birthday to see
how old they are.

$date = new Zend_Date();
$date->sub('April 3, 1980');

print $date->toString('Y');

The following prints 28, however the correct age would be 29, as the
persons birthday was a few days ago. Does it not take the month and day
into account when it subs the date? Or a better question would be what am
I doing wrong?

I have set my default timezone correctly.




  


Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
another question for layout.
for
http://www.w3.org/1999/xhtml";
xml:lang="translate->getLocale()?>"
lang="translate->getLocale()?>">

i solved it like
abstract App_Controller_Action extends Zend_Controller_Action {
 function init(){
   parent::init();
   $this->translate = Zend_Registry::get('');
   $this->view->translate = $this->translate;
   ...
   ..
   . (user, acl, navigation etc.)
 }
}
but i didn't like that way.

and i need $user object (ex. Zend_DbTable_Row), or Zend_Acl at lot of view
scripts

PS. sorry for my english.

2009/4/8 keith Pope 

> Accessing from controller is done via $this->getInvokeArg(), if you
> use FC parameter.
>
> You may want to look at why you want to have config, cache and locale
> access in your view, generally this would happen in the Model or
> controller.
>
> If you do need to do this I would suggest using a view helper, this
> way you encapsulate the access away from the main view scripts.
>
> class Zend_View_Helper_MyViewHelper
> {
>public function MyViewHelper ()
>{
>$fc = Zend_Controller_Front::getInstance();
>$fc->getParam('xxx');
>
>// or
> $config = Zend_Registry::get('Zend_Config')
>}
> }
>
> There are of course many ways to do push stuff into views, in your
> bootstrap you can set variables on the view, and you can use front
> controller plugin, action helpers etc.
>
> Just have a think to why you need to do this, it may be that this
> should be handled in your Model.
>
> Thx
>
> Keith
>
> 2009/4/8 Elvin Şiriyev :
> > 2. way sounds good. but how can i access frontController's params from
> > controller and view script ?
> > i dont like write that codes for each Action
> > --
> > $config = Zend_Registry::get('Zend_Config');
> > $cache = Zend_Registry::get('Zend_Cache');
> > $locale = Zend_Registry::get('Zend_Locale');
> > ..
> > .
> > $this->view->config  = $config;
> > $this->view->cache = $cache;
> > $this->view->locale = $locale;
> > ..
> > .
> > -
> > 2009/4/8 keith Pope 
> >>
> >> Maybe use the registry for that, so have a bootstrap class resource
> >> that fetches the plugin resources:
> >>
> >> protected _initRegistry()
> >> {
> >>$this->bootstrap('db');
> >>Zend_Registry::set('dbResource', $this->getPluginResource('db'));
> >> }
> >>
> >> Or you could pass them as params to the front controller, which would
> >> make them accessible inside controllers:
> >>
> >> protected _initFrontControllerExtras()
> >> {
> >>$this->bootstrap('frontcontroller');
> >>$this->frontController->setParam('x','xxx');
> >>// or
> >>
> >>
>  
> $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx');
> >> }
> >>
> >> Hope this helps
> >>
> >> Keith
> >>
> >> 2009/4/8 Elvin Şiriyev :
> >> > hi, i used Zend_Application with Zend_Application_Resource_*.
> >> > how can i access to that objects from my Controller and view?
> >> >
> >> > for example is there any way to access Zend_Application_Resource_
> >> > Navigation 's  getContainer() method from controller like
> >> > $this->navigation->getContainer() or $this->db, $this->layout,
> >> > $this->locale
> >> > or another easy way ?
> >> >
> >> > thanks
> >> >
> >> > --
> >> > Elvin Şiriyev
> >> > http://elvin.siriyev.net
> >> >
> >> > --
> >> > Elvin Şiriyev
> >> > http://elvin.siriyev.net
> >> >
> >>
> >>
> >>
> >> --
> >> --
> >> [MuTe]
> >> --
> >
> >
> >
> > --
> > Elvin Şiriyev
> > http://elvin.siriyev.net
> >
>
>
>
> --
> --
> [MuTe]
> --
>



-- 
Elvin Şiriyev
http://elvin.siriyev.net


[fw-general] Login with Auth and Cookies

2009-04-08 Thread PHPScriptor

Hello,

Is it possible to make a login with zend auth and cookies. Problem now: when
the user close the browser, he needs to re-login.
Anyone knows a good tutorial / example?

-
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Login-with-Auth-and-Cookies-tp22951436p22951436.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Date Problems

2009-04-08 Thread Thomas VEQUAUD
+1 : I have the same problem with the age calculation


On Tue, Apr 7, 2009 at 7:24 PM, Daryl Handley wrote:

> milesap wrote:
>
>> Hello,
>>
>> I'm fairly new to Zend Framework, so forgive me if this is a really easy
>> question. I have been looking everywhere for a solution. I am trying to
>> get
>> the difference between the current date and a persons birthday to see how
>> old they are.
>>
>>$date = new Zend_Date();
>>$date->sub('April 3, 1980');
>>
>>print $date->toString('Y');
>>
>> The following prints 28, however the correct age would be 29, as the
>> persons
>> birthday was a few days ago. Does it not take the month and day into
>> account
>> when it subs the date? Or a better question would be what am I doing
>> wrong?
>>
>> I have set my default timezone correctly.
>>
>>
> I'm no Zend_Date expert, but I've been looking at this for a bit mostly
> because I am interested in how Zend_Date works. The behaviour of ->sub seems
> a bit erratic. I would expect the following 2 code fragments to output the
> same thing.
>
>   $date = new Zend_Date('April 7, 2009');
>   $date->sub('April 3, 1980');
>   print $date->toString() . "\n";
> $date = new Zend_Date('April 7, 2009');
>   $date->sub(new Zend_Date('April 3, 1980'));
>   print $date->toString() . "\n";
>
> but they don't. The output is
>
> Dec 6, 0028 3:00:00 PM
> Jan 4, 1999 3:00:00 PM
>
> I also experiment with 'y' vs 'Y' as suggested by Thomas and still got 28.
> Gotta go do some other stuff, may take a look again later.
>
> Daryl
>
>
>
>


-- 
Thomas VEQUAUD  http://thomas.vequaud.free.fr/
Expert EPITECH en Ingénierie Informatique
Tél : +33(0)6.50.39.28.10  Fax: +33(0)9.58.46.10.07


Re: [fw-general] View helper: Add JavaScript only once

2009-04-08 Thread Thomas VEQUAUD
Just a little more

In the bootstrap
// Head Script
$headScript = new Zend_View_Helper_HeadScript();
$headScript->appendFile(BASE_URL.'/public/scripts/calc.js',
'text/javascript');
$headScript->appendFile(BASE_URL.'/public/scripts/countAreaChars.js',
'text/javascript');

In your layout or view script:

headMeta()."\n"); ?>
headTitle()."\n"); ?>
headLink()."\n"); ?>
headScript()."\n"); ?>


See online documentation about Zend_View_Helpers :
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.headscript


On Sat, Apr 4, 2009 at 3:44 AM, Matthew Weier O'Phinney wrote:

> -- Innocentus  wrote
> (on Friday, 03 April 2009, 11:39 PM +0200):
> > I have a custom view helper which adds tooltips to a view.
> > JavaScript is needed for these tooltips so I need to add an external
> > JavaScript-file.
> > This I want to do when the view helper is called the first time -
> > because otherwise it is unnecessary.
> > Because I want to add more than only one tooltip I need to prevent
> > that this JavaScript-file is added multiple times.
> >
> > The JavaScript-file responsible for the tooltips should be added only
> > when the tooltip view helper is called and this only once.
> > Successive calls of the view helper shouldn't result in adding the
> > JavaScript-file multiple times.
> >
> > Now I don't know if there is already a mechanism for custom
> > view-helpers for doing so.
> > Maybe there is already something I could rely on.
>
> Take a look at the placeholders, and how the Dojo and jQuery view
> helpers work, as they give you exactly this type of functionality.
>
> What I would suggest is using the headScript() view helper within your
> custom view helper, as headScript() also has this built into its
> functionality.
>
> --
> Matthew Weier O'Phinney
> Software Architect  | matt...@zend.com
> Zend Framework  | http://framework.zend.com/
>



-- 
Thomas VEQUAUD  http://thomas.vequaud.free.fr/
Expert EPITECH en Ingénierie Informatique
Tél : +33(0)6.50.39.28.10  Fax: +33(0)9.58.46.10.07


[fw-general] Problem with Zend_Session_SaveHandler_DbTable while testing

2009-04-08 Thread Goran Juric

I have a problem testing controllers that use Zend_Session_SaveHandler.

In my Bootstrap, I have something like this:

$config = array(
'name'   => 'sessions',
'primary'=> 'id',
'modifiedColumn' => 'modified',
'dataColumn' => 'data',
'lifetimeColumn' => 'lifetime'
);
Zend_Session::setSaveHandler(new
Zend_Session_SaveHandler_DbTable($config));

and from the model I am setting Session lifetime like this:

Zend_Session::rememberMe($sessionLifetime);
$saveHandler = Zend_Session::getSaveHandler();
$saveHandler->setLifetime($sessionLifetime)
->setOverrideLifetime(true);

and everything works like a charm. But when I am running controller tests
Zend_Session::getSaveHandler() returns NULL instead of the
Zend_Session_SaveHandler_DbTable object and because of that I get an error
"Call to a member function setLifetime() on a non-object".

I have tried setting up Zend_Session::$_unitTestEnabled = true; (although I
do not know what it is used for), but it didn't help.

Any ideas would be more than helpful.

Regards,

Goran Juric
http://gogs.info/
-- 
View this message in context: 
http://www.nabble.com/Problem-with-Zend_Session_SaveHandler_DbTable-while-testing-tp22951745p22951745.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend Framework 1.8 Preview Release is Now Available!

2009-04-08 Thread Wil Sinclair
It obviously wasn't enough for us to release Zend Server
  today, we've

also made the Zend Framework 1.8 Preview Release available at: 

 

http://framework.zend.com/download/latest

 

While 1.8PR is not a feature complete release in the 1.8 series, it 

nevertheless contains some very important features scheduled for the 1.8


production release: 

 

* Zend_Tool, contributed by Ralph Schindler

* Zend_Application, contributed by Ben Scholzen and Matthew Weier
O'Phinney

* Zend_Navigation, contributed by Robin Skoglund

* Zend_CodeGenerator, by Ralph Schindler

* Zend_Reflection, Ralph Schindler and Matthew Weier O'Phinney

* Zend Server backend for Zend_Cache, contributed by Alexander Veremyev

* Zend_Service_Amazon_Ec2, contributed by Jon Whitcraft

* Zend_Service_Amazon_S3, Justin Plock and Stas Malyshev

* Zend_Filter_Encrypt, contributed by Thomas Weidner

* Zend_Filter_Decrypt, contributed by Thomas Weidner

* Support for file upload progress support in Zend_File_Transfer,

contributed by Thomas Weidner

* Translation-aware routes, contributed by Ben Scholzen

* Zend_Json expression support, contributed by Benjamin Eberlei

* Zend_Http_Client_Adapter_Curl, contributed by Benjamin Eberlei

* SOAP input and output header support, contributed by Alexander
Veremyev

* Support for keyword field search using query strings,

contributed by Alexander Veremyev

* Support for searching across multiple indexes in Zend_Search_Lucene,

contributed by Alexander Veremyev

* Support for page scaling, shifting and skewing in Zend_Pdf,

contributed by Alexander Veremyev

* Locale support in Zend_Validate_Int and Zend_Validate_Float,

contributed by Thomas Weidner

* Phonecode support in Zend_Locale, contributed by Thomas Weidner

* Zend_Validate_Iban, contributed by Thomas Weidner

* Zend_Validate_File_WordCount, contributed by Thomas Weidner

 

This obviously marks a very important step towards a high-quality, well 

tested 1.8 production release. Thanks to everyone who has contributed to


this release in any way: with patches/check ins,
documentation/translations,

and bug reports. 

But our work is not yet over! Let's put this release through testing 

hell, while continuing to make progress on other features scheduled for 

the production release of 1.8. Please remember to provide feedback on 

our issue tracker   and ask any
questions on the appropriate mailing list. 

 

Again, the Zend Framework community does NOT recommend this release for 

production use. We do, however, recommend evaluating new features in 

this release with existing and new applications. 

 

Enjoy the 1.8 Preview Release, and see you around! 

 

,Wil 

 



Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Thomas VEQUAUD
You'd better use Zend_View_Helper :

*Just a little example*
1. In /application/views/script/helpers/ControllerName.php
class Zend_View_Helper_ControllerName
{
function controllerName()
{
// Controller name
$fc = Zend_Controller_Front::getInstance();
$request = $fc->getRequest();
$controllerName = strtolower($request->getControllerName());
return ($controllerName);
}
}

2. Then, you can call this method wherever you want
in a controller : $this->view->controllerName()
in a view script : $this->controllerName()


2009/4/8 Elvin Şiriyev 

> another question for layout.
> for
> http://www.w3.org/1999/xhtml";
> xml:lang="translate->getLocale()?>"
> lang="translate->getLocale()?>">
>
> i solved it like
> abstract App_Controller_Action extends Zend_Controller_Action {
>  function init(){
>parent::init();
>$this->translate = Zend_Registry::get('');
>$this->view->translate = $this->translate;
>...
>..
>. (user, acl, navigation etc.)
>  }
> }
> but i didn't like that way.
>
> and i need $user object (ex. Zend_DbTable_Row), or Zend_Acl at lot of view
> scripts
>
> PS. sorry for my english.
>
>
> 2009/4/8 keith Pope 
>
>> Accessing from controller is done via $this->getInvokeArg(), if you
>> use FC parameter.
>>
>> You may want to look at why you want to have config, cache and locale
>> access in your view, generally this would happen in the Model or
>> controller.
>>
>> If you do need to do this I would suggest using a view helper, this
>> way you encapsulate the access away from the main view scripts.
>>
>> class Zend_View_Helper_MyViewHelper
>> {
>>public function MyViewHelper ()
>>{
>>$fc = Zend_Controller_Front::getInstance();
>>$fc->getParam('xxx');
>>
>>// or
>> $config = Zend_Registry::get('Zend_Config')
>>}
>> }
>>
>> There are of course many ways to do push stuff into views, in your
>> bootstrap you can set variables on the view, and you can use front
>> controller plugin, action helpers etc.
>>
>> Just have a think to why you need to do this, it may be that this
>> should be handled in your Model.
>>
>> Thx
>>
>> Keith
>>
>> 2009/4/8 Elvin Şiriyev :
>> > 2. way sounds good. but how can i access frontController's params from
>> > controller and view script ?
>> > i dont like write that codes for each Action
>> > --
>> > $config = Zend_Registry::get('Zend_Config');
>> > $cache = Zend_Registry::get('Zend_Cache');
>> > $locale = Zend_Registry::get('Zend_Locale');
>> > ..
>> > .
>> > $this->view->config  = $config;
>> > $this->view->cache = $cache;
>> > $this->view->locale = $locale;
>> > ..
>> > .
>> > -
>> > 2009/4/8 keith Pope 
>> >>
>> >> Maybe use the registry for that, so have a bootstrap class resource
>> >> that fetches the plugin resources:
>> >>
>> >> protected _initRegistry()
>> >> {
>> >>$this->bootstrap('db');
>> >>Zend_Registry::set('dbResource', $this->getPluginResource('db'));
>> >> }
>> >>
>> >> Or you could pass them as params to the front controller, which would
>> >> make them accessible inside controllers:
>> >>
>> >> protected _initFrontControllerExtras()
>> >> {
>> >>$this->bootstrap('frontcontroller');
>> >>$this->frontController->setParam('x','xxx');
>> >>// or
>> >>
>> >>
>>  
>> $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx');
>> >> }
>> >>
>> >> Hope this helps
>> >>
>> >> Keith
>> >>
>> >> 2009/4/8 Elvin Şiriyev :
>> >> > hi, i used Zend_Application with Zend_Application_Resource_*.
>> >> > how can i access to that objects from my Controller and view?
>> >> >
>> >> > for example is there any way to access Zend_Application_Resource_
>> >> > Navigation 's  getContainer() method from controller like
>> >> > $this->navigation->getContainer() or $this->db, $this->layout,
>> >> > $this->locale
>> >> > or another easy way ?
>> >> >
>> >> > thanks
>> >> >
>> >> > --
>> >> > Elvin Şiriyev
>> >> > http://elvin.siriyev.net
>> >> >
>> >> > --
>> >> > Elvin Şiriyev
>> >> > http://elvin.siriyev.net
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> --
>> >> [MuTe]
>> >> --
>> >
>> >
>> >
>> > --
>> > Elvin Şiriyev
>> > http://elvin.siriyev.net
>> >
>>
>>
>>
>> --
>> --
>> [MuTe]
>> --
>>
>
>
>
> --
> Elvin Şiriyev
> http://elvin.siriyev.net
>



-- 
Thomas VEQUAUD  http://thomas.vequaud.free.fr/
Expert EPITECH en Ingénierie Informatique
Tél : +33(0)6.50.39.28.10  Fax: +33(0)9.58.46.10.07


Re: [fw-general] New proposal Zend_View_Helper_Currency

2009-04-08 Thread Thomas VEQUAUD
Great idea!


On Tue, Apr 7, 2009 at 10:33 PM, Thomas Weidner wrote:

> Hy all,
>
> there is a new proposal for a Currency View Helper.
>
> http://framework.zend.com/wiki/display/ZFPROP/Zend_View_Helper_Currency+-+Thomas+Weidner
>
> Review and comments appreciated
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>



-- 
Thomas VEQUAUD  http://thomas.vequaud.free.fr/
Expert EPITECH en Ingénierie Informatique
Tél : +33(0)6.50.39.28.10  Fax: +33(0)9.58.46.10.07


Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
i know view helpers. but i think this is expensive and there must be an
other (pre defined) ways. whatever.

thank a lot


2009/4/8 Thomas VEQUAUD 

> You'd better use Zend_View_Helper :
>
> *Just a little example*
> 1. In /application/views/script/helpers/ControllerName.php
> class Zend_View_Helper_ControllerName
> {
> function controllerName()
> {
> // Controller name
> $fc = Zend_Controller_Front::getInstance();
> $request = $fc->getRequest();
> $controllerName = strtolower($request->getControllerName());
> return ($controllerName);
> }
> }
>
> 2. Then, you can call this method wherever you want
> in a controller : $this->view->controllerName()
> in a view script : $this->controllerName()
>
>
>
> 2009/4/8 Elvin Şiriyev 
>
>> another question for layout.
>> for
>> http://www.w3.org/1999/xhtml";
>> xml:lang="translate->getLocale()?>"
>> lang="translate->getLocale()?>">
>>
>> i solved it like
>> abstract App_Controller_Action extends Zend_Controller_Action {
>>  function init(){
>>parent::init();
>>$this->translate = Zend_Registry::get('');
>>$this->view->translate = $this->translate;
>>...
>>..
>>. (user, acl, navigation etc.)
>>  }
>> }
>> but i didn't like that way.
>>
>> and i need $user object (ex. Zend_DbTable_Row), or Zend_Acl at lot of view
>> scripts
>>
>> PS. sorry for my english.
>>
>>
>> 2009/4/8 keith Pope 
>>
>>> Accessing from controller is done via $this->getInvokeArg(), if you
>>> use FC parameter.
>>>
>>> You may want to look at why you want to have config, cache and locale
>>> access in your view, generally this would happen in the Model or
>>> controller.
>>>
>>> If you do need to do this I would suggest using a view helper, this
>>> way you encapsulate the access away from the main view scripts.
>>>
>>> class Zend_View_Helper_MyViewHelper
>>> {
>>>public function MyViewHelper ()
>>>{
>>>$fc = Zend_Controller_Front::getInstance();
>>>$fc->getParam('xxx');
>>>
>>>// or
>>> $config = Zend_Registry::get('Zend_Config')
>>>}
>>> }
>>>
>>> There are of course many ways to do push stuff into views, in your
>>> bootstrap you can set variables on the view, and you can use front
>>> controller plugin, action helpers etc.
>>>
>>> Just have a think to why you need to do this, it may be that this
>>> should be handled in your Model.
>>>
>>> Thx
>>>
>>> Keith
>>>
>>> 2009/4/8 Elvin Şiriyev :
>>> > 2. way sounds good. but how can i access frontController's params from
>>> > controller and view script ?
>>> > i dont like write that codes for each Action
>>> > --
>>> > $config = Zend_Registry::get('Zend_Config');
>>> > $cache = Zend_Registry::get('Zend_Cache');
>>> > $locale = Zend_Registry::get('Zend_Locale');
>>> > ..
>>> > .
>>> > $this->view->config  = $config;
>>> > $this->view->cache = $cache;
>>> > $this->view->locale = $locale;
>>> > ..
>>> > .
>>> > -
>>> > 2009/4/8 keith Pope 
>>> >>
>>> >> Maybe use the registry for that, so have a bootstrap class resource
>>> >> that fetches the plugin resources:
>>> >>
>>> >> protected _initRegistry()
>>> >> {
>>> >>$this->bootstrap('db');
>>> >>Zend_Registry::set('dbResource', $this->getPluginResource('db'));
>>> >> }
>>> >>
>>> >> Or you could pass them as params to the front controller, which would
>>> >> make them accessible inside controllers:
>>> >>
>>> >> protected _initFrontControllerExtras()
>>> >> {
>>> >>$this->bootstrap('frontcontroller');
>>> >>$this->frontController->setParam('x','xxx');
>>> >>// or
>>> >>
>>> >>
>>>  
>>> $this->getPluginResource('frontController')->getFrontController()->setParam('x','xxx');
>>> >> }
>>> >>
>>> >> Hope this helps
>>> >>
>>> >> Keith
>>> >>
>>> >> 2009/4/8 Elvin Şiriyev :
>>> >> > hi, i used Zend_Application with Zend_Application_Resource_*.
>>> >> > how can i access to that objects from my Controller and view?
>>> >> >
>>> >> > for example is there any way to access Zend_Application_Resource_
>>> >> > Navigation 's  getContainer() method from controller like
>>> >> > $this->navigation->getContainer() or $this->db, $this->layout,
>>> >> > $this->locale
>>> >> > or another easy way ?
>>> >> >
>>> >> > thanks
>>> >> >
>>> >> > --
>>> >> > Elvin Şiriyev
>>> >> > http://elvin.siriyev.net
>>> >> >
>>> >> > --
>>> >> > Elvin Şiriyev
>>> >> > http://elvin.siriyev.net
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> --
>>> >> [MuTe]
>>> >> --
>>> >
>>> >
>>> >
>>> > --
>>> > Elvin Şiriyev
>>> > http://elvin.siriyev.net
>>> >
>>>
>>>
>>>
>>> --
>>> --
>>> [MuTe]
>>> -

[fw-general] Zend_Acl for MVC ?

2009-04-08 Thread Elvin Şiriyev
is there any example code about Zend_Acl for MVC (defining and controlling).


i mean "ACL for MVC" is :
example: guest can't see /default[module]/user[controller]/*[action] but
only administrator can access /manage/*/*


thx

-- 
Elvin Şiriyev
http://elvin.siriyev.net


[fw-general] Combobox not populating

2009-04-08 Thread wacind

Hi 

I am fairly new to using the zend fw and am having trouble populating a
combo box such as a 'states' drop down list. I have looked through the zend
and dojo toolkit reference guides but my combo box doesnt seem to work. this
is the code i have

$this->addElement('ComboBox','comboboxremote',
array('label' => 'ComboBox',
'storeId' => 'stateStore',
'storeType' => 'dojo.data.ItemFileReadStore',
'storeParams' => array(
'url' =>
'http://www.dojotoolkit.org/files/states.txt',
),
'dijitParams' => array(
'searchAttr' => 'name',

 ),
) 
);
I have tried to use /js/states.txt as the file store but that doesnt seem to
work either. I have been able to build a regular combo box using an array
but cant seem to make the file store work. 
Am i missing anything?

Thanks
-- 
View this message in context: 
http://www.nabble.com/Combobox-not-populating-tp22953039p22953039.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Login with Auth and Cookies

2009-04-08 Thread Vadim Gabriel
You could store a cookie to reflect the members information. Session expires
when the browser closes (usualy)



On Wed, Apr 8, 2009 at 4:17 PM, PHPScriptor  wrote:

>
> Hello,
>
> Is it possible to make a login with zend auth and cookies. Problem now:
> when
> the user close the browser, he needs to re-login.
> Anyone knows a good tutorial / example?
>
> -
> visit my website at  http://www.phpscriptor.com/
> http://www.phpscriptor.com/
> --
> View this message in context:
> http://www.nabble.com/Login-with-Auth-and-Cookies-tp22951436p22951436.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.


Re: [fw-general] Problem with Zend_Session_SaveHandler_DbTable while testing

2009-04-08 Thread Goran Juric



Goran Juric wrote:
> 
> I have a problem testing controllers that use Zend_Session_SaveHandler.
> ...
> 
> 

As always, the problem gets solver right after you post for help on the net
:)

The problem was that when you run tests Zend_Session::$_unitTestEnabled is
automatically set to true and everything regarding Session save handlers iz
ignored and they are not used at all.

I don't really know why is this so (I guess there is a good reason), but It
doesn't work for me. I just wish this was better documented.

Regards,

Goran Juric
http://gogs.info/

-- 
View this message in context: 
http://www.nabble.com/Problem-with-Zend_Session_SaveHandler_DbTable-while-testing-tp22951745p22959237.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Open Source Applications using Zend Framework?

2009-04-08 Thread Yannick Mortier
Hello!

I have got a question for the list... I hope it wasn't asked
already... (I googled around a little bit but didn't find much.)

I wanted to ask if there are some finished open source applications
that use Zend Framework. Because I really need to look into the code
deeper to get a bigger picture how some real-life applications are
built with Zend Framework. The tutorials and blog posts always only
treat an atomic part and I really want to learn the "Zend Way" like
where to put functions that validate inputs that came from the users
etc. I know there is Zend Validate but it seems like it should only be
used for forms. And I need to verify the same thing for every method
of the model. Copy and Paste is of course no option. But where to put
the validation? A function in the model? But I want to use it in other
models, too? An extra class? I don't know!

Such are my probles right now and it would be great to have a code
base of some bigger projects that I can use until I stand on my feet
firmly.

Thanks a lot in advance!

Yannick Mortier

-- 
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me on twitter!
http://twitter.com/moortier


[fw-general] Zend_Cache - Size of SQLite and journal files

2009-04-08 Thread Mary Nicole Hicks

I am using Zend_Cache with SQLite. All the config options are the defaults.
My problem is that although my SQLite file (cache.sqlite) is only 73 MB the
folder it is in is 1.8 GB. The rest of this space is made up of 80 files.
These 80 files come in pairs such as a
cache.sqlite-ttobps1yxcgf7ci6bfkc-journal file and a
cache.sqlite-ttobps1yxcgf7ci6bfkc file. The *-journal files tend to be only
20 Bytes but the other files are 50 MB to 100 MB.

Some of these pairs of files were created in January (3 months ago).

Why are these files lying around?
How can I safely get rid of them?
Can I run some PHP code to get rid of them safely or compact all the files
into one again?

Thank you,
Mary
-- 
View this message in context: 
http://www.nabble.com/Zend_Cache---Size-of-SQLite-and-journal-files-tp22962946p22962946.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Cache - Size of SQLite and journal files

2009-04-08 Thread Fabien MARTY
Hi,

Sqlite Zend_Cache backend use only one file ("cache.sqlite" in your
example). Other files seems to be internal files made by Sqlite itself
?

I will try to make a Zend_Cache object with the following backend option :

"automatic_vacuum_factor" => 1
(to force a vacuum after the clean())

and I will call

$cache->clean("old");

Regards


On Thu, Apr 9, 2009 at 3:28 AM, Mary Nicole Hicks
 wrote:
>
> I am using Zend_Cache with SQLite. All the config options are the defaults.
> My problem is that although my SQLite file (cache.sqlite) is only 73 MB the
> folder it is in is 1.8 GB. The rest of this space is made up of 80 files.
> These 80 files come in pairs such as a
> cache.sqlite-ttobps1yxcgf7ci6bfkc-journal file and a
> cache.sqlite-ttobps1yxcgf7ci6bfkc file. The *-journal files tend to be only
> 20 Bytes but the other files are 50 MB to 100 MB.
>
> Some of these pairs of files were created in January (3 months ago).
>
> Why are these files lying around?
> How can I safely get rid of them?
> Can I run some PHP code to get rid of them safely or compact all the files
> into one again?
>
> Thank you,
> Mary
> --
> View this message in context: 
> http://www.nabble.com/Zend_Cache---Size-of-SQLite-and-journal-files-tp22962946p22962946.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



-- 
Fabien MARTY
fabien.ma...@gmail.com


Re: [fw-general] Open Source Applications using Zend Framework?

2009-04-08 Thread Robert W. Castley
You can take a look at jotBug it is not finished but it is functional http://jotbug.org 
 and http://jotbug.googlecode.com


Robert

Sent from my iPhone

On 8 Apr 2009, at 22:26, Yannick Mortier   
wrote:



Hello!

I have got a question for the list... I hope it wasn't asked
already... (I googled around a little bit but didn't find much.)

I wanted to ask if there are some finished open source applications
that use Zend Framework. Because I really need to look into the code
deeper to get a bigger picture how some real-life applications are
built with Zend Framework. The tutorials and blog posts always only
treat an atomic part and I really want to learn the "Zend Way" like
where to put functions that validate inputs that came from the users
etc. I know there is Zend Validate but it seems like it should only be
used for forms. And I need to verify the same thing for every method
of the model. Copy and Paste is of course no option. But where to put
the validation? A function in the model? But I want to use it in other
models, too? An extra class? I don't know!

Such are my probles right now and it would be great to have a code
base of some bigger projects that I can use until I stand on my feet
firmly.

Thanks a lot in advance!

Yannick Mortier

--
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me on twitter!
http://twitter.com/moortier