Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-25 Thread Саша Стаменковић
Ah, yes, ok. I was afraid it does not close.

Regards,
Saša Stamenković


On Tue, May 25, 2010 at 8:21 PM, Bill Karwin  wrote:

> The default case is for unknown or unsupported fetch modes.  This throws an
> exception.
>
> It's good to close the cursor before throwing an exception, because it's
> likely that the statement will be aborted and without closing a cursor,
> statement handles accumulate in the DB server and cause a garbage collection
> problem.
>
> Setting a valid fetch mode should not close the cursor, it only changes the
> fetch mode for subsequent fetches.  I.e. you can (in theory) change the
> fetch mode several times as you fetch rows from the same result set.
>
> Regards,
> Bill Karwin
>
>
> On May 25, 2010, at 10:57 AM, Саша Стаменковић wrote:
>
> Zend_Db_Statement in setFetchMode() calls $this->closeCursor(); only in
> default case for $mode, why not in other cases?!
>
>
>


Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-25 Thread Саша Стаменковић
Oh my, if I would have no limits on shared hosting, we would never find out!

Switched to PDO.

Спасибо Алексей!

Regards,
Saša Stamenković


On Tue, May 25, 2010 at 10:01 PM, Aleksey Zapparov wrote:

> Suddenly I have changed my mind ;)) It's not a problem of framework at all.
> It's a problem in mysqli itself. Seems like my browser cached data, so I've
> found that mysqli.php (from previous message) is hanging server too (!)
>
> Anyway I think Zend_Db_Statement_Mysqli needs a simple destructor:
>
> public function __destruct()
> {
>$this->close();
> }
>
> Unfortunately it will not help anyway. I'm going to bug report to PHP as
> it's
> a problem with mysqli extension.
>
>
> 2010/5/25 Aleksey Zapparov :
> > Yes. You are right! That's the problem and it's not :))
> >
> > I have tested it with very dummy test (see attachment mysqli.php.gz) and
> > it works like a charm (against stormer provided before). So I have
> discovered
> > that the problem is in framework.
> >
> > The problem is that result cursor is never closed. Here's what happens in
> > sample application provided by me in one of previous messages. We have
> > following code:
> >
> > $news = new Automobili_Model_Table_News();
> > $news->fetchAll($news->select());
> >
> > In other words it can be written like this (to better understand):
> >
> > /** Zend_Db_Table_Abstract */
> > $news = new Automobili_Model_Table_News();
> > /** Zend_Db_Table_Select */
> > $select = $news->select();
> >
> > $news->fetchAll($select);
> >
> > The most interesting part here is fetchAll() which internally
> > calls protected method _fetch() which is clean enough:
> >
> > 1503 protected function _fetch(Zend_Db_Table_Select $select)
> > 1504 {
> > 1505 $stmt = $this->_db->query($select);
> > 1506 $data = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
> > 1507 return $data;
> > 1508 }
> >
> > Now, what we have here. This code creates a new object ($stmt) of
> > Zend_Db_Statement_Mysqli calls it's fetchAll() and returns it's result
> > (array of rows). And that's where all problems began. Statement
> > grabs results with standard mysqli functions, but it does not close
> > cursor automatically!
> >
> > After I spend another hour trying to implement some easy workarounds,
> > I found that there are no "easy" workaround at all. Except making some
> > modifications to Zend_Db_Adapter_Mysqli and Zend_Db_Adapter_Statement.
> >
> > Of course there's one easy workaround (and I'm pretty sure that some of
> > developers will say that it's a feature) - you can first, replace that
> > small code
> > for rows retrievement with something like this:
> >
> >$news   = new Automobili_Model_Table_News();
> >$select = $news->select();
> >$stmt   = $news->getAdapter()->query($select);
> >
> >$this->view->assign('rows', $stmt->fetchAll(Zend_Db::FETCH_OBJ));
> >$stmt->closeCursor();
> >$stmt->close();
> >
> > and then add postDispatch hook with closing db handler:
> >
> >Zend_Db_Table_Abstract::getDefaultAdapter()->closeConnection();
> >
> >
> > Unfortunatelly even this caused sample application (from previous post)
> > to hang server up after 130 requests. I'm gonna try to make some changes
> > to the Zend_Db_Adapter_Mysqli and Zend_Db_Statement_Mysqli today
> > or tomorrow and will share my investigation results :))
> >
> >
> > 2010/5/25 Саша Стаменковић :
> >> Zend_Db_Statement in setFetchMode() calls $this->closeCursor(); only in
> >> default case for $mode, why not in other cases?!
> >>
> >> Regards,
> >> Saša Stamenković
> >>
> >>
> >> On Tue, May 25, 2010 at 4:37 PM, Aleksey Zapparov 
> >> wrote:
> >>>
> >>> I'll prepare a dummy test with direct mysqli opertating - without using
> >>> Zend Framework at all - just to make sure that it's not a framework's
> >>> error. I'm pretty sure it's not but still want to have solid
> approvements.
> >>>
> >>>
> >>> 2010/5/25 Aleksey Zapparov :
> >>> > Forgotten trace and profiler info.
> >>> >
> >>> > 2010/5/25 Aleksey Zapparov :
> >>> >> Hello everybody again,
> >>> >>
> >>&

[fw-general] Sharing same session accross subdomains

2010-05-26 Thread Саша Стаменковић
Hi.

I want to translate site http://automobi.li/ to other languages, and I'm
thinking about best practices on how to do it for best seo, user expirience
and architecture.

First of all, in order to have google indexing it on different languages, I
will create subdomains http://en.automobi.li/,
http://ru.automobi.li/ ...
for each language.

And there, the first problem occured :

*Sharing same session accrosss subdomains*.

I tried adding Zend_Session::start(array('cookie_domain' => '.domain.com'));
in my bootstrap, but it didnt help. Then I tried php_value
session.cookie_domain ".domain.com" (
http://www.jontodd.com/2006/08/10/php-session-cookie-multiple-domains/) but
still no results. That is the first question.

Now, when I setup sharing same session, I need to get language from domain
name, anything in zend framework to help here (if not it can be easily
parsed in native PHP).

I already have Zend_From set translated error messages

$translate = new Zend_Translate( Zend_Translate::AN_ARRAY,
realpath(APPLICATION_PATH . '/../data/languages/sr/Zend_Validate.php'),
Zend_Registry::get('Zend_Locale') );
Zend_Form::setDefaultTranslator($translate);

I'm planing to add one more translation file (array) for labels, is there a
way to add separate file to Zend_Translate? And one more po file for view
scripts. Or one po file for form labels and view scripts if poedit can be
set to extract translation from my forms, which are written with factory
methods, like:

$this->addElement(
'uiText',
'name',
 array(
'label' => 'Ime:',
'id' => 'contact_name',
 'filters' => array('StringTrim'),
'required' => true,
 'validators' => array(array('Alpha', false, true))
)

I don't think poedit can parse this. Or?
So, question is: I have validation messages (Array), labels and view
scripts, I want to translate and automate parsing new translation strings as
much as possible, poedit looks like the best way to go. But must keep
validation messages (and labels) separated in some way.

So, there is a language, and one more global parameter will be a country
where user is located. This can be some global param stored in session, and
maybe switch it to new value when changing language, but still allow changin
country separate from language and having default country for each language
(subdomain). What do you think?

What are your patterns and best practices, tools...when internationalizing
zf powered website?

Regards,
Saša Stamenković


[fw-general] Re: Sharing same session accross subdomains

2010-05-26 Thread Саша Стаменковић
Sorry, I forgot to change subject.

One more question regarding internationalization.

Serbian language have 2 official alphabets (I'm so ashamed, we should use
cyrilic, but...) cyrilic
<http://en.wikipedia.org/wiki/Serbian_Cyrillic_alphabet>and
latin<http://en.wikipedia.org/wiki/Gaj's_Latin_Alphabet>.
So, for locale sr_RS I need 2 different languages, separate translation
files..

What locale should I use, maybe take some unused?

Supported locales are

 Serbian sr --- sr_BA Bosnia and Herzegovina sr_CS Serbia and
Montenegrosr_MEMontenegrosr_RSSerbiasr_YUSerbia

but all of them use sr language.

Regards,
Saša Stamenković


On Wed, May 26, 2010 at 11:41 AM, Саша Стаменковић wrote:

> Hi.
>
> I want to translate site http://automobi.li/ to other languages, and I'm
> thinking about best practices on how to do it for best seo, user expirience
> and architecture.
>
> First of all, in order to have google indexing it on different languages, I
> will create subdomains http://en.automobi.li/, 
> http://ru.automobi.li/<http://en.automobi.li/> ...
> for each language.
>
> And there, the first problem occured :
>
> *Sharing same session accrosss subdomains*.
>
> I tried adding Zend_Session::start(array('cookie_domain' => '.domain.com'));
> in my bootstrap, but it didnt help. Then I tried php_value
> session.cookie_domain ".domain.com" (
> http://www.jontodd.com/2006/08/10/php-session-cookie-multiple-domains/) but
> still no results. That is the first question.
>
> Now, when I setup sharing same session, I need to get language from domain
> name, anything in zend framework to help here (if not it can be easily
> parsed in native PHP).
>
> I already have Zend_From set translated error messages
>
> $translate = new Zend_Translate( Zend_Translate::AN_ARRAY,
> realpath(APPLICATION_PATH . '/../data/languages/sr/Zend_Validate.php'),
> Zend_Registry::get('Zend_Locale') );
> Zend_Form::setDefaultTranslator($translate);
>
> I'm planing to add one more translation file (array) for labels, is there a
> way to add separate file to Zend_Translate? And one more po file for view
> scripts. Or one po file for form labels and view scripts if poedit can be
> set to extract translation from my forms, which are written with factory
> methods, like:
>
> $this->addElement(
> 'uiText',
> 'name',
>  array(
> 'label' => 'Ime:',
> 'id' => 'contact_name',
>  'filters' => array('StringTrim'),
> 'required' => true,
>  'validators' => array(array('Alpha', false, true))
> )
>
> I don't think poedit can parse this. Or?
> So, question is: I have validation messages (Array), labels and view
> scripts, I want to translate and automate parsing new translation strings as
> much as possible, poedit looks like the best way to go. But must keep
> validation messages (and labels) separated in some way.
>
> So, there is a language, and one more global parameter will be a country
> where user is located. This can be some global param stored in session, and
> maybe switch it to new value when changing language, but still allow changin
> country separate from language and having default country for each language
> (subdomain). What do you think?
>
> What are your patterns and best practices, tools...when internationalizing
> zf powered website?
>
> Regards,
> Saša Stamenković
>


Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-26 Thread Саша Стаменковић
That was great answer, thanks Thomas. As I expected, you can't be wrong
using one or another, and using mysqli is not a bad thing (if you are using
PHP 5.3+) :)

Regards,
Saša Stamenković


On Wed, May 26, 2010 at 1:11 PM, Thomas D.  wrote:

> Hi,
>
> Саша Стаменковић wrote:
> > Still, I'm not really informed about differences between mysqli
> > and pdo. When you work with Zend_Db, you can choose between this
> > 2 with just one config param.
> >
> > I would like to know which one is faster?
>
> This question will be asked every month ;-)
>
> You should first understand, what's the difference between these two (well,
> there are 3 "adapters", in PHP 5.3 there you can choose between 4
> "adapters") are. To do that, have a look at the native PHP stack, how these
> adapters are implemented and what they do.
>
> PDO for example is just another layer, which should "abstract" the database
> access (that's why PDO supports different DBEs and mysql* only MySql ;-)).
>
> In general: Everything which is abstracting something will be slower than a
> native implementation of the same thing, because of the "overhead". But you
> should benefit from a great abstraction, so abstraction isn't bad at all ;-)
>
> So when you are using Zend_Db_*, you are already using some kind of
> "abstraction", so you don't really need another abstraction, some PHP
> database API is offering to you.
>
> In theory, PDO should be much slower than ext/mysql or mysqli is. For
> example PDO will prepare everything. But the nature of a PHP script is, that
> it will die after each request, so a prepared statement can only be used
> while the request, which prepared the statement, is active. So preparing a
> simple "SELECT * FROM articles WHERE isPublished = 1 ORDER BY date DESC"
> doesn't really makes sense, because this query will just be executed once in
> the request.
>
> If you would prepare a select statement and execute it more than once with
> different parameters in one request, you would benefit from preparation
> (well, only when preparation is done on server-side, client-side prepared
> statements are another kind of abstraction and therefore aren't as good as
> server-side prepared statements).
>
> So PDO is bad, isn't it? ;)
>
> No! If you don't use any kind of abstraction like Zend_Db* is offering to
> you, the client-side prepared statements are offering you some kind of
> security. Binding parameters to a query makes them secure against known SQL
> injections.
> At least other DBEs just need to implement the PDO interface to support
> PHP. They don't need to re-invent everything.
>
> Ergo:
> When you are using Zend_Db*, I would recommend to use ext/mysql or mysqli,
> because it's faster and you are already using a abstracted DBA.
>
> If you don't use a abstracted DBA, I would recommend to use PDO.
>
> In a normal application, you shouldn't notice any differences.
>
> Only on high traffic applications you would notice differences. But in high
> traffic applications, you won't use Zend_Db*, because Zend_Db* won't support
> the DBE specific (optimized) commands, just "generalized" commands, which
> will work across all supported adapters. ;-)
>
>
> P.s.: Ulf Wendel (from MySQL) wrote about that topic some month ago in this
> list: <
> http://zend-framework-community.634137.n4.nabble.com/PDO-or-Mysqli-td1556941.html
> >
>
>
> --
> Regards,
> Thomas
>
>
>


Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-27 Thread Саша Стаменковић
Still sometimes get

PDOException with message 'SQLSTATE[42000] [1203] User *** already has
more than 'max_user_connections' active connections

:)


Regards,
Saša Stamenković


On Wed, May 26, 2010 at 8:18 PM, Bill Karwin  wrote:

>
> On May 26, 2010, at 4:11 AM, Thomas D. wrote:
>
>  In theory, PDO should be much slower than ext/mysql or mysqli is. For
>> example PDO will prepare everything.
>>
>
>
> I wrote the following on the February thread with Ulf Wendel that you
> linked to, but I think it bears repeating:
>
> MySQLPerformanceBlog.com did some benchmarks in an article about "Prepared
> Statements" (
> http://www.mysqlperformanceblog.com/2006/08/02/mysql-prepared-statements/ ).
>
> Peter Zaitsev wrote:
> > I’ve done a simple benchmark (using SysBench) to see performance of
> > simple query (single row point select) using standard statement,
> > prepared statement and have it served from query cache. Prepared
> > statements give 2290 queries/sec which is significantly better than
> > 2000 with standard statements but it is still well below 4470
> > queries/sec when results are served from query cache.
>
> Peter seems to say that the "overhead" of using prepared statements is that
> they are 14.5% *faster* than using a non-prepared query execution, at least
> in this simple test.   I'd expect the relative difference probably
> diminishes with a more complex query or a larger result set.
>
> In any case, we should be careful about citing round-trips as a significant
> performance factor, because it discourages people from using prepared
> queries when they should.
>
> Regards,
> Bill Karwin


Re: [fw-general] Re: Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-27 Thread Саша Стаменковић
Sure, I'll monitor this, dont happen too often. Thanks.

Regards,
Saša Stamenković


On Thu, May 27, 2010 at 8:27 PM, Thomas D.  wrote:

> Hi,
>
> Bill Karwin wrote:
> > I wrote the following on the February thread with Ulf Wendel that you
> > linked to, but I think it bears repeating:
> >
> > [...]
> >
> > Peter seems to say that the "overhead" of using prepared statements is
> > that they are 14.5% *faster* than using a non-prepared query
> > execution, at least in this simple test.   I'd expect the relative
> > difference probably diminishes with a more complex query or a larger
> > result set.
>
> Peter was testing *real* prepared statements.
> Real prepared statements are prepared on the DBE server-side.
>
> Most people think, that when they are using PDO, which force them to use
> prepared statements in most cases, that they are using *real* prepared
> statements, but they aren't! PDO is just another abstraction PDO just
> emulate prepared statements. That means, preparation is done client-side.
> It's more a validation than preparation.
> This has *nothing* to do with server-side prepared statements. Most of the
> benefits a DBE is offering you when it is supporting prepared statements
> cannot be used by client-side prepared statements.
>
> That's why client-side prepared statements from a high performance
> viewpoint are real show stopper. They do nothing than wasting time ;-)
>
> For more:
> 
>
>
> > In any case, we should be careful about citing round-trips as a
> > significant performance factor, because it discourages people from
> > using prepared queries when they should.
>
> *FULL ACK*
>
> If anyone is not using some kind of abstraction like Zend_Db*, everyone
> should prefer PDO. Not because it is faster (it isn't, but it isn't really
> slower!), but because it is more secure by design, when you work with
> prepared statements (because it is enforcing some kind of security).
>
> But you should understand it. You should know why you are using PDO and why
> you should prefer it. You shouldn't use something, just because someone has
> told you "It's better" ;-)
>
>
> --
> Regards,
> Thomas
>
>


[fw-general] Problem with form translation - strangle logs

2010-05-27 Thread Саша Стаменковић
Hi.

i have in bootstrap

protected function _initTranslate() {
$translate = new Zend_Translate(
 Zend_Translate::AN_ARRAY,
realpath(APPLICATION_PATH . '/../data/languages'),
 null,
array(
'scan' => Zend_Translate::LOCALE_DIRECTORY,
 'log' => $this->getResource('log'),
'logUntranslated' => true
 )
);
Zend_Form::setDefaultTranslator($translate);
 return $translate;
}

under /../data/languages folder I have subfolder for each language (sr, en,
ru...). Under each of them I have Zend_Form.php and Zend_Validate.php

 Zend_Validate.php is from svn, and Zend_Form.php looks like:

// sr
 "Cena:",
"Godište:" => "Godište:",
);

//en
 "Price:",
"Godište:" => "Year:",
);


When I set locale to sr_RS it's ok, but when I switch to en_Gb I get log:

2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Price:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Year:

and labels get correctly translated! Why I get this log then?!?!?!

This is just case for strings defined in Zend_Form.php, Zend_Validate.php
strings are perfect.

Please help.

Regards,
Saša Stamenković


[fw-general] Re: Problem with form translation - strangle logs

2010-05-27 Thread Саша Стаменковић
Also, I noticed the labels that are not translated at all (not found in sr
or en version of Zend_Form.php) are logged twice, ex:

2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Gorivo:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Gorivo:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Lokacija:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Lokacija:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Sortiraj po:
2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
Sortiraj po:

Even if there is only one element with that label. Maybe I'm doing something
wrong with my base form.

I'm extending all forms from this one http://pastie.org/980646

Thanks in advance.

Regards,
Saša Stamenković


2010/5/27 Саша Стаменковић 

> Hi.
>
> i have in bootstrap
>
> protected function _initTranslate() {
> $translate = new Zend_Translate(
>  Zend_Translate::AN_ARRAY,
> realpath(APPLICATION_PATH . '/../data/languages'),
>  null,
> array(
> 'scan' => Zend_Translate::LOCALE_DIRECTORY,
>  'log' => $this->getResource('log'),
> 'logUntranslated' => true
>  )
> );
> Zend_Form::setDefaultTranslator($translate);
>  return $translate;
> }
>
> under /../data/languages folder I have subfolder for each language (sr, en,
> ru...). Under each of them I have Zend_Form.php and Zend_Validate.php
>
>  Zend_Validate.php is from svn, and Zend_Form.php looks like:
>
> // sr
>  return array(
> "Cena:" => "Cena:",
> "Godište:" => "Godište:",
> );
>
> //en
>  return array(
> "Cena:" => "Price:",
> "Godište:" => "Year:",
> );
>
>
> When I set locale to sr_RS it's ok, but when I switch to en_Gb I get log:
>
> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
> Price:
> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
> Year:
>
> and labels get correctly translated! Why I get this log then?!?!?!
>
> This is just case for strings defined in Zend_Form.php, Zend_Validate.php
> strings are perfect.
>
> Please help.
>
> Regards,
> Saša Stamenković
>


Re: [fw-general] Re: Problem with form translation - strangle logs

2010-05-27 Thread Саша Стаменковић
Thanks, when it will be included into release?

Regards,
Saša Stamenković


On Thu, May 27, 2010 at 10:52 PM, James Carr  wrote:

> Саша Стаменковић wrote:
>
>> Also, I noticed the labels that are not translated at all (not found in sr
>> or en version of Zend_Form.php) are logged twice, ex:
>>
>> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
>> Gorivo:
>> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
>> Gorivo:
>> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
>> Lokacija:
>> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
>> Lokacija:
>> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
>> Sortiraj po:
>> 2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within 'en':
>> Sortiraj po:
>>
>> Even if there is only one element with that label. Maybe I'm doing
>> something wrong with my base form.
>>
>> I'm extending all forms from this one http://pastie.org/980646
>>
>> Thanks in advance.
>>
>> Regards,
>> Saša Stamenković
>>
>>
>> 2010/5/27 Саша Стаменковић mailto:umpir...@gmail.com
>> >>
>>
>>
>>Hi.
>>
>>i have in bootstrap
>>
>>protected function _initTranslate() {
>>$translate = new Zend_Translate(
>>Zend_Translate::AN_ARRAY,
>>realpath(APPLICATION_PATH . '/../data/languages'),
>>null,
>>array(
>>'scan' => Zend_Translate::LOCALE_DIRECTORY,
>>'log' => $this->getResource('log'),
>>'logUntranslated' => true
>>)
>>);
>>Zend_Form::setDefaultTranslator($translate);
>>return $translate;
>>}
>>
>>under /../data/languages folder I have subfolder for each language
>>(sr, en, ru...). Under each of them I have Zend_Form.php
>>and Zend_Validate.php
>>
>> Zend_Validate.php is from svn, and Zend_Form.php looks like:
>>
>>// sr
>>>return array(
>>"Cena:" => "Cena:",
>>"Godište:" => "Godište:",
>>);
>>
>>//en
>>>return array(
>>"Cena:" => "Price:",
>>"Godište:" => "Year:",
>>);
>>
>>
>>When I set locale to sr_RS it's ok, but when I switch to en_Gb I get
>>log:
>>
>>2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within
>>'en': Price:
>>2010-05-27T21:30:26+02:00 NOTICE (5): Untranslated message within
>>'en': Year:
>>
>>and labels get correctly translated! Why I get this log then?!?!?!
>>
>>This is just case for strings defined
>>in Zend_Form.php, Zend_Validate.php strings are perfect.
>>
>>Please help.
>>
>>Regards,
>>Saša Stamenković
>>
>>
>>
> It's probably related to one of the following bug reports (they're all
> inter-related):
>
> http://framework.zend.com/issues/browse/ZF-8694
> http://framework.zend.com/issues/browse/ZF-8764
> http://framework.zend.com/issues/browse/ZF-9371
>
> There is a patch attached to the 8764 bug which works for me.
>
> Hope that helps,
> James.
>


[fw-general] Zend_Translate plural forms and poedit

2010-05-30 Thread Саша Стаменковић
In manual there is an example of modern plural translations:

$translate->translate(array('Car','Cars first
plural','Cars second plural',
 $number,'ru'));

i use poedit to update translation strings from sources, by searching for
translate keyword.

Since this param is an array, poedit can't find it, so it always go to
obsolete translations.

Putting keyword translate(array didn't help.

Any ideas?

Regards,
Saša Stamenković


Re: [fw-general] Zend_Translate plural forms and poedit

2010-05-30 Thread Саша Стаменковић
Hm, but we should create interfaces that makes translation easier.

Thanks anyway.

Regards,
Saša Stamenković


On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner wrote:

> poEdit can not handle modern plural translations.
> It is fixed to english notation (one plural form).
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> - Original Message - From: "Саша Стаменковић" 
> To: "Nabble Zend Framework General" 
> Sent: Sunday, May 30, 2010 2:26 PM
> Subject: [fw-general] Zend_Translate plural forms and poedit
>
>
>
> In manual there is an example of modern plural translations:
>
> $translate->translate(array('Car','Cars first
> plural','Cars second plural',
>$number,'ru'));
>
> i use poedit to update translation strings from sources, by searching for
> translate keyword.
>
> Since this param is an array, poedit can't find it, so it always go to
> obsolete translations.
>
> Putting keyword translate(array didn't help.
>
> Any ideas?
>
> Regards,
> Saša Stamenković
>
>


Re: [fw-general] Zend_Translate plural forms and poedit

2010-05-30 Thread Саша Стаменковић
But still, with traditional plural form, poedit works, but is able to parse
onlly strings under ngettext, but not pural forms under translate keyword.

Ex:

$translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto
oglasa', $count); // Not found

ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa',
$count); // found by poedit

I added plural to keywords.

Where did I go wrong?

Do you use parsing from sources at all?

Regards,
Saša Stamenković


On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић wrote:

> Hm, but we should create interfaces that makes translation easier.
>
> Thanks anyway.
>
> Regards,
> Saša Stamenković
>
>
>
> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner wrote:
>
>> poEdit can not handle modern plural translations.
>> It is fixed to english notation (one plural form).
>>
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>>
>> - Original Message - From: "Саша Стаменковић" > >
>> To: "Nabble Zend Framework General" 
>> Sent: Sunday, May 30, 2010 2:26 PM
>> Subject: [fw-general] Zend_Translate plural forms and poedit
>>
>>
>>
>> In manual there is an example of modern plural translations:
>>
>> $translate->translate(array('Car','Cars first
>> plural','Cars second plural',
>>$number,'ru'));
>>
>> i use poedit to update translation strings from sources, by searching for
>> translate keyword.
>>
>> Since this param is an array, poedit can't find it, so it always go to
>> obsolete translations.
>>
>> Putting keyword translate(array didn't help.
>>
>> Any ideas?
>>
>> Regards,
>> Saša Stamenković
>>
>>
>


Re: [fw-general] Zend_Translate plural forms and poedit

2010-05-30 Thread Саша Стаменковић
I know, but poedit parses files very well when you have ordinary keywords
for plural forms. I just don't know how to force it to pick plurals from
'plural' keyword instead from 'ngettext' - that was my question.

Regards,
Saša Stamenković


On Mon, May 31, 2010 at 6:47 AM, Thomas Weidner wrote:

> Wrong,
>
> Zend_Translate_Adapter_Gettext does not parse files at all.
> It reads the binary *.mo file to know what it should translate.
>
> For parsing you need to run gettext's utilities or poEdit (which itself is
> very buggy).
>
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> - Original Message - From: "Aleksey Zapparov"  >
> To: "Саша Стаменковић" 
> Cc: "Thomas Weidner" ; "Nabble Zend Framework
> General" 
> Sent: Monday, May 31, 2010 12:11 AM
> Subject: Re: [fw-general] Zend_Translate plural forms and poedit
>
>
>
> Hello,
>
> Zend_Translate_Adapter_Gettext (used to translate with gettext compatatible
> files as translation sources) do not relay on standard functions like
> gettext(1) or
> ngettext(2) at all. Instead it parses given file line by line.
>
> [1] http://www.php.net/manual/en/function.gettext.php
> [2] http://www.php.net/manual/en/function.ngettext.php
>
>
> 2010/5/30 Саша Стаменковић :
>
>> But still, with traditional plural form, poedit works, but is able to
>> parse
>> onlly strings under ngettext, but not pural forms under translate keyword.
>> Ex:
>> $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto
>> oglasa', $count); // Not found
>> ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa',
>> $count); // found by poedit
>> I added plural to keywords.
>> Where did I go wrong?
>> Do you use parsing from sources at all?
>> Regards,
>> Saša Stamenković
>>
>>
>> On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић 
>> wrote:
>>
>>>
>>> Hm, but we should create interfaces that makes translation easier.
>>> Thanks anyway.
>>>
>>> Regards,
>>> Saša Stamenković
>>>
>>>
>>> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner 
>>> wrote:
>>>
>>>>
>>>> poEdit can not handle modern plural translations.
>>>> It is fixed to english notation (one plural form).
>>>>
>>>> Greetings
>>>> Thomas Weidner, I18N Team Leader, Zend Framework
>>>> http://www.thomasweidner.com
>>>>
>>>> - Original Message - From: "Саша Стаменковић"
>>>> 
>>>> To: "Nabble Zend Framework General" 
>>>> Sent: Sunday, May 30, 2010 2:26 PM
>>>> Subject: [fw-general] Zend_Translate plural forms and poedit
>>>>
>>>>
>>>> In manual there is an example of modern plural translations:
>>>>
>>>> $translate->translate(array('Car', 'Cars first
>>>> plural', 'Cars second plural',
>>>> $number, 'ru'));
>>>>
>>>> i use poedit to update translation strings from sources, by searching
>>>> for
>>>> translate keyword.
>>>>
>>>> Since this param is an array, poedit can't find it, so it always go to
>>>> obsolete translations.
>>>>
>>>> Putting keyword translate(array didn't help.
>>>>
>>>> Any ideas?
>>>>
>>>> Regards,
>>>> Saša Stamenković
>>>>
>>>>
>>>
>>
>>
>
>
> --
> Sincerely yours,
> Aleksey V. Zapparov A.K.A. ixti
> FSF Member #7118
> Mobile Phone: +34 617 179 344
> Homepage: http://www.ixti.ru
> JID: zappa...@jabber.ru
>
> *Origin: Happy Hacking!
>


[fw-general] Zend_Translate missing locale code

2010-05-31 Thread Саша Стаменковић
As I mentioned in some of earlier topics, Serbian language have 2 alphabets,
cyrilic and latin.

There is sr_RS for cyrilic, but sr...@latin is missing (see
http://www.gnu.org/software/hello/manual/gettext/Locale-Names.html).

Regards,
Saša Stamenković


Re: [fw-general] Zend_Translate plural forms and poedit

2010-05-31 Thread Саша Стаменковић
Yes, but if Zend_Translate have alias method named ngettext() which
redelagates to plural(), poedit would be able to parse sources and generate
plural forms. I know it's a bit strnage to add it, maybe I can go with
overriding Zend_Translate in order to achieve this.

Because even if I do this by hand, on next update from sources string goes
to obsolete strings, this is maybe more poedit problem, rather then
Zend_Translate problem.

Regards,
Saša Stamenković


On Mon, May 31, 2010 at 2:00 PM, Aleksey Zapparov wrote:

> Ahh!.. Indeed, sorry.
>
> 2010/5/31 Thomas Weidner :
> > I think you missed the problem itself.
> >
> > He can not run poEdit to create plural form po files.
> > This has nothing to do with Zend_Translate_Adapter_Gettext or with how
> > Zend_Translate parses the translation files.
> >
> > Greetings
> > Thomas Weidner, I18N Team Leader, Zend Framework
> > http://www.thomasweidner.com
> >
> > - Original Message - From: "Aleksey Zapparov" <
> i...@member.fsf.org>
> > To: "Thomas Weidner" 
> > Cc: "Nabble Zend Framework General" 
> > Sent: Monday, May 31, 2010 9:54 AM
> > Subject: Re: [fw-general] Zend_Translate plural forms and poedit
> >
> >
> > Hello,
> >
> > Sorry, seems like I mis-used the word :))
> > I was sure that reading and processing file the way Adapter does:
> >
> > 112 fseek($this->_file, $origtemp[$count * 2 + 2]);
> > 113 $original = @fread($this->_file, $origtemp[$count * 2
> +
> > 1]);
> > 114 $original = explode(chr(00), $original);
> >
> > called parsing. And, to be honest, I don't see big difference between
> > processing .mo file and processing .csv file, except with .mo your parser
> > will be little bit more complicated.
> >
> > But I may be wrong in terms. Correct me if I'm wrong so next time I'll
> > distinguish difference (1) and will use correct term. :))
> >
> > [1] http://xkcd.com/747/
> >
> >
> > 2010/5/31 Thomas Weidner :
> >>
> >> Wrong,
> >>
> >> Zend_Translate_Adapter_Gettext does not parse files at all.
> >> It reads the binary *.mo file to know what it should translate.
> >>
> >> For parsing you need to run gettext's utilities or poEdit (which itself
> is
> >> very buggy).
> >>
> >> Greetings
> >> Thomas Weidner, I18N Team Leader, Zend Framework
> >> http://www.thomasweidner.com
> >>
> >> - Original Message - From: "Aleksey Zapparov"
> >> 
> >> To: "Саша Стаменковић" 
> >> Cc: "Thomas Weidner" ; "Nabble Zend Framework
> >> General" 
> >> Sent: Monday, May 31, 2010 12:11 AM
> >> Subject: Re: [fw-general] Zend_Translate plural forms and poedit
> >>
> >>
> >> Hello,
> >>
> >> Zend_Translate_Adapter_Gettext (used to translate with gettext
> >> compatatible
> >> files as translation sources) do not relay on standard functions like
> >> gettext(1) or
> >> ngettext(2) at all. Instead it parses given file line by line.
> >>
> >> [1] http://www.php.net/manual/en/function.gettext.php
> >> [2] http://www.php.net/manual/en/function.ngettext.php
> >>
> >>
> >> 2010/5/30 Саша Стаменковић :
> >>>
> >>> But still, with traditional plural form, poedit works, but is able to
> >>> parse
> >>> onlly strings under ngettext, but not pural forms under translate
> >>> keyword.
> >>> Ex:
> >>> $translate->plural('Pronađen je %s auto oglas', 'Pronađeno je %s auto
> >>> oglasa', $count); // Not found
> >>> ngettext('Pronađen je %s auto oglas', 'Pronađeno je %s auto oglasa',
> >>> $count); // found by poedit
> >>> I added plural to keywords.
> >>> Where did I go wrong?
> >>> Do you use parsing from sources at all?
> >>> Regards,
> >>> Saša Stamenković
> >>>
> >>>
> >>> On Sun, May 30, 2010 at 3:57 PM, Саша Стаменковић 
> >>> wrote:
> >>>>
> >>>> Hm, but we should create interfaces that makes translation easier.
> >>>> Thanks anyway.
> >>>>
> >>>> Regards,
> >>>> Saša Stamenković
> >>>>
> >>>>
> >>>> On Sun, May 30, 2010 at 3:19 PM, Thomas Weidner <
> thomas

Re: [fw-general] Zend_Translate missing locale code

2010-05-31 Thread Саша Стаменковић
Thanks for the quick response.

Any idea on how to handle this, to have both, cirillic and latin version?

Regards,
Saša Stamenković


On Mon, May 31, 2010 at 2:08 PM, Thomas Weidner wrote:

> Charset informations are actually not supported for translation.
> (also mentioned some topics earlier)
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> - Original Message - From: "Саша Стаменковић" 
> To: "Nabble Zend Framework General" 
> Sent: Monday, May 31, 2010 1:24 PM
> Subject: [fw-general] Zend_Translate missing locale code
>
>
>
> As I mentioned in some of earlier topics, Serbian language have 2
> alphabets,
> cyrilic and latin.
>
> There is sr_RS for cyrilic, but sr...@latin is missing (see
> http://www.gnu.org/software/hello/manual/gettext/Locale-Names.html).
>
> Regards,
> Saša Stamenković
>
>


Re: [fw-general] Zend_Translate missing locale code

2010-05-31 Thread Саша Стаменковић
Lets leave routing as separate problem, maybe I'll not have language route
at all, but save this in session.

So, I can have sr locale, like new Zend_Locale('sr') and create
Zend_Translate for that locale, separated from sr_RS. But aren't my language
translateion files get confused, I keep all related with serbian language
under sr directory.

$locale = new Zend_Locale('sr_RS');
Zend_Registry::set('Zend_Locale', $locale);

$translate = new Zend_Translate(
Zend_Translate::AN_GETTEXT,
 realpath(APPLICATION_PATH . '/../data/languages'),
null,
array(
 'scan' => Zend_Translate::LOCALE_DIRECTORY
)
);

Zend_Registry::set('Zend_Translate', $translate);

So, if I go with only sr instead sr_RS, it will still search for
translations under sr folder, right?

Regards,
Saša Stamenković


On Mon, May 31, 2010 at 3:20 PM, Thomas Weidner wrote:

> Use "sr" for latin and "sr_SR" for cyrillic.
> You need to create a related routing for this to work.
>
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> - Original Message - From: "Саша Стаменковић" 
> To: "Thomas Weidner" 
> Cc: "Nabble Zend Framework General" 
> Sent: Monday, May 31, 2010 2:11 PM
> Subject: Re: [fw-general] Zend_Translate missing locale code
>
>
>
> Thanks for the quick response.
>
> Any idea on how to handle this, to have both, cirillic and latin version?
>
> Regards,
> Saša Stamenković
>
>
> On Mon, May 31, 2010 at 2:08 PM, Thomas Weidner  >wrote:
>
>  Charset informations are actually not supported for translation.
>> (also mentioned some topics earlier)
>>
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>>
>> - Original Message - From: "Саша Стаменковић" > >
>> To: "Nabble Zend Framework General" 
>> Sent: Monday, May 31, 2010 1:24 PM
>> Subject: [fw-general] Zend_Translate missing locale code
>>
>>
>>
>> As I mentioned in some of earlier topics, Serbian language have 2
>> alphabets,
>> cyrilic and latin.
>>
>> There is sr_RS for cyrilic, but sr...@latin is missing (see
>> http://www.gnu.org/software/hello/manual/gettext/Locale-Names.html).
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>


[fw-general] Translating model options

2010-05-31 Thread Саша Стаменковић
I need to access zend translate in my models. The simplest way to do it is
to get it from registry Zend_Registry::get('Zend_Translate').

But I have one class in my models which have static options for select
element, like

protected $options = array(
 self::NOTES =>
Zend_Registry::get('Zend_Translate')->translate('Primedbe, pohvale...'),
 self::MARKETING => 'Marketing',
 self::COOPERATION => 'Saradnja',
 self::HELP => 'Pomoć',
 self::MISSING_BRAND => 'Nedostaje marka automobila',
 self::OTHER => 'Ostalo'
);

This is wrong, because PHP says syntax error, unexpected '(', expecting ')'

I need messages to be under 'translate' keyword, so poedit can pick them,
how can I achieve this with such classes?

Regards,
Saša Stamenković


Re: [fw-general] Fatal error: Call to undefined method Zend_View_Helper_Placeholder_Container::ksort() in /var/local/Zend/View/Helper/HeadLink.php on line 321

2010-06-07 Thread Саша Стаменковић
Looks like you have old version of PHP. Which version are you using?

Regards,
Saša Stamenković


On Mon, Jun 7, 2010 at 12:21 PM, Bart McLeod  wrote:

>  *Fatal error*: Call to undefined method
> Zend_View_Helper_Placeholder_Container::ksort() in *
> /var/local/Zend/View/Helper/HeadLink.php* on line *321
>
> *This reminds me of a similar error I found earlier, I do not remember the
> component. It seems some one is trying to sort a placeholder by it's keys.
> *
> *
> This is the latest from svn standard trunk.*
> *
> I have no backtrace or anything, just this fatal error, do not know what is
> causing it.* *I will have to look in the revision log and see if there is
> something to revert.
>
> Anyone else having this error?
>
> Regards,
>
> Bart McLeod
> *
> *
> --
>   Bart McLeod
> *Space Web*
> Middenlaan 47
> 6865 VN Heveadorp
> The Netherlands
> *t* +31(0)26 3392952
> *m* 06 51 51 89 71
> *...@* i...@spaceweb.nl
> www.spaceweb.nl  [image: zce logo][image: zce PHP 5 logo] [image: zce Zend
> Framework logo]
>
> *Bart McLeod is a Zend Certified Engineer.*
>
> Click to verify! 
>
<><><><>

Re: [fw-general] Fatal error: Call to undefined method Zend_View_Helper_Placeholder_Container::ksort() in /var/local/Zend/View/Helper/HeadLink.php on line 321

2010-06-07 Thread Саша Стаменковић
Check http://framework.zend.com/manual/en/requirements.introduction.html, it
says PHP 5.2.4 or later.

Regards,
Saša Stamenković


On Mon, Jun 7, 2010 at 2:13 PM, Nicolas Grevet  wrote:

>  See: http://www.php.net/manual/en/arrayobject.ksort.php
>
>
>
> On 06/07/2010 02:12 PM, Bart McLeod wrote:
>
> You may be right, this is on a newly installed vps, where they installed a
> smaller version then I had asked for. 5.1.6 I think. I will check against
> 5.3, yes, that seems to work as usual.
>
> I will inform the isp, thank you!
>
> Bart
>
> Op 7-6-2010 12:46, Саша Стаменковић schreef:
>
> Looks like you have old version of PHP. Which version are you using?
>
> Regards,
> Saša Stamenković
>
>
> On Mon, Jun 7, 2010 at 12:21 PM, Bart McLeod  wrote:
>
>> *Fatal error*: Call to undefined method
>> Zend_View_Helper_Placeholder_Container::ksort() in *
>> /var/local/Zend/View/Helper/HeadLink.php* on line *321
>>
>> *This reminds me of a similar error I found earlier, I do not remember
>> the component. It seems some one is trying to sort a placeholder by it's
>> keys.*
>> *
>> This is the latest from svn standard trunk.*
>> *
>> I have no backtrace or anything, just this fatal error, do not know what
>> is causing it.* *I will have to look in the revision log and see if there
>> is something to revert.
>>
>> Anyone else having this error?
>>
>> Regards,
>>
>> Bart McLeod
>> *
>> *
>> --
>>   Bart McLeod
>> *Space Web*
>> Middenlaan 47
>> 6865 VN Heveadorp
>> The Netherlands
>> *t* +31(0)26 3392952
>> *m* 06 51 51 89 71
>> *...@* i...@spaceweb.nl
>> www.spaceweb.nl  [image: zce logo][image: zce PHP 5 logo] [image: zce
>> Zend Framework logo]
>>
>> *Bart McLeod is a Zend Certified Engineer.*
>>
>> Click to verify! <http://www.zend.com/zce.php?c=ZEND004591&r=218204904>
>>
>
>
> --
>   Bart McLeod
> *Space Web*
> Middenlaan 47
> 6865 VN Heveadorp
> The Netherlands
> *t* +31(0)26 3392952
> *m* 06 51 51 89 71
> *...@* i...@spaceweb.nl
> www.spaceweb.nl  [image: zce logo][image: zce PHP 5 logo] [image: zce Zend
> Framework logo]
>
> *Bart McLeod is a Zend Certified Engineer.*
>
> Click to verify! <http://www.zend.com/zce.php?c=ZEND004591&r=218204904>
>
>
<><><><><><><><>

[fw-general] Translating navigation

2010-06-10 Thread Саша Стаменковић
Hi.

I'm trying to translate my navigation, but something is wrong, it simply
won't use the translator, or I am doing something wrong.

In my module bootstrap I'm duilding navigation from XML config

 $navigation = new Zend_Navigation($config);
 
$view->navigation($navigation)->setTranslator(Zend_Registry::get('Zend_Translate_Array'));

Part of my nav config





 Početna
Početna strana
 index
default
 daily
0.9
...

part of my translation

 "Home page",
 "Početna" => "Home",


Everithing works well, except rendered navigation is not translated at all,
also, Zend_Translate have logger attached, and none of labels and titles
from navigaation are not logged as untranslated.

Where can be the problem???

Regards,
Saša Stamenković


Re: [fw-general] Re: Translating navigation

2010-06-10 Thread Саша Стаменковић
Ah, menu partial


container as $page) : ?>
 
 getLabel() ?>
 



I don't know what is the best practice in such case.

I use 2 Zend_Translate objects, one with array and one with gettext adapter.
The one with gettext adapter is for view scritps, and I use poedit to parse
views and auto generate po files. Other array adapter I use for forms and
validation messages, and now I wanted to add navigation.

Should I get it from navigation, so my partial looks like


container as $page) : ?>
 
 navigation()->getTranslator()->translate($page->getLabel()) ?>
 



or you have some better idea?

Regards,
Saša Stamenković


On Thu, Jun 10, 2010 at 10:54 AM, umpirsky  wrote:

>
> In the layout, dumping
>
> navigation()->getUseTranslator());  ?>
> navigation()->getTranslator()); exit; ?>
> navigation()->menu()->setPartial('partials/menu.phtml') ?>
>
> gives correct translator and true for useTranslator.
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Translating-navigation-tp2250120p2250125.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


[fw-general] Translating urls

2010-06-28 Thread Саша Стаменковић
Hi.

I'm adding translated urls to my project. In app config I have some routes,
by adding @ I'm able to translate them, but, what to do with default route?
How to translate this urls? Do I have to define new default route with @
prefix?

Regards,
Saša Stamenković


[fw-general] Zend_Db PDO_PGSQL adapter, quoting problem

2010-06-30 Thread Саша Стаменковић
Hi.

I'm trying to migrate from MySQL to pgsql.

Code:

$this->select()
 ->setIntegrityCheck(false)
  ->from('Feed', array('FeedId', 'FeedName'))
 ->joinLeft(array(
  'LogDate' => new Zend_Db_Expr('(' .
 $this->select()
  ->setIntegrityCheck(false)
 ->from('Log', array('FeedId AS LogDateFeedId', 'MAX("Log"."Dateline") AS
MaxDateline'))
  ->group('FeedId')
  .
  ')')), 'Feed.FeedId = LogDateFeedId')
 ->joinLeft('Log', 'LogDateFeedId = Log.FeedId AND LogDate.MaxDateline =
Log.Dateline', array('Dateline', 'Added', 'Removed'))
  ->join('Category', 'Category.CategoryId = Feed.CategoryId',
'CategoryName')
  ->joinLeft('Content', 'Content.FeedId = Feed.FeedId',
'COUNT("Content"."ContentId") AS ContentCount')
  ->group('Feed.FeedId, Feed.FeedName, LogDate.LogDateFeedId,
LogDate.MaxDateline, Log.Dateline, Log.Added, Log.Removed,
Category.CategoryName');

gives

SELECT "Feed"."FeedId", "Feed"."FeedName", "LogDate".*, "Log"."Dateline",
"Log"."Added", "Log"."Removed", "Category"."CategoryName",
COUNT("Content"."ContentId") AS "ContentCount" FROM "Feed" LEFT JOIN (SELECT
"Log"."FeedId" AS "LogDateFeedId", MAX("Log"."Dateline") AS "MaxDateline"
FROM "Log" GROUP BY "FeedId") AS "LogDate" ON Feed.FeedId = LogDateFeedId
LEFT JOIN "Log" ON LogDateFeedId = Log.FeedId AND LogDate.MaxDateline =
Log.Dateline INNER JOIN "Category" ON Category.CategoryId = Feed.CategoryId
LEFT JOIN "Content" ON Content.FeedId = Feed.FeedId GROUP BY "Feed"."FeedId,
Feed"."FeedName, LogDate"."LogDateFeedId, LogDate"."MaxDateline,
Log"."Dateline, Log"."Added, Log"."Removed, Category"."CategoryName"

identifiers under MAX, COUNT... are not quoted (added manually in example
above), as well as well as join conditions. Which leads to :

exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42P01]:
Undefined table: 7 ERROR:  missing FROM-clause entry for table "feed"
LINE 2: ...Id" FROM "Log" GROUP BY "FeedId") AS "LogDate" ON Feed.FeedI...
 ^' in ...

This use to work with MySQL.

Am I doing something wrong in my code?

Regards,
Saša Stamenković


Re: [fw-general] 301 redirects after changing routes

2010-07-20 Thread Саша Стаменковић
$this->_redirect('/new-url', array('code' => 301));

Regards,
Saša Stamenković


On Tue, Jul 20, 2010 at 7:32 PM, Jean-Michel Philippon-Nadeau <
j...@jmpnadeau.ca> wrote:

> Hi List,
>
> For SEO reasons I've changed the format of my URLs from
> controller/action/param/value to /controller/value. I also have routes
> where I have many implicit parameters, like controller/value/value.
>
> I was wondering if anything in the Zend Framework could help me to
> create 301 redirects from the old routes to the new routes, so my page
> rank is not reset to 0 for my new URLs?
>
> Thank you very much,
>
> --
> Jean-Michel
>


Re: [fw-general] 301 redirects after changing routes

2010-07-21 Thread Саша Стаменковић
Not that I know about that. But I'll need sth like that, so I'm waiting for
the answer, but don't think this is possible.

Regards,
Saša Stamenković


On Thu, Jul 22, 2010 at 4:54 AM, Jean-Michel Philippon-Nadeau <
j...@jmpnadeau.ca> wrote:

> On Tue, Jul 20, 2010 at 5:51 PM, Саша Стаменковић 
> wrote:
> > $this->_redirect('/new-url', array('code' => 301));
>
> Thanks for the reply! Maybe this does not exist, but I am looking for
> something more automated.
>
> I now have many different routes, and adding a routine that checks if
> the request is coming from an old URL and then redirect to the new URL
> might not be the most maintainable solution.
>
> I was hoping there were a config I could add to my routes.ini to catch
> requests made with an old URL scheme and forward them to the new ones.
> Or maybe a simple regex in my bootstrap would do the trick?
>
> Any ideas?
>
> Thanks in advance,
>
> --
> Jean-Michel
>


[fw-general] Is there a plan for Zend_Locale 2.0 ?

2010-08-03 Thread Саша Стаменковић
Hi.

I wonder if there are plans for Zend_Locale in zf 2.0. The thing I miss very
much is support for locale variants. There is a related issue
http://zendframework.com/issues/browse/ZF-7485?page=com.atlassian.jirafisheyeplugin:fisheye-issuepanel
.

It would be nice to add support for this.

Regards,
Saša Stamenković


Re: [fw-general] Is there a plan for Zend_Locale 2.0 ?

2010-08-03 Thread Саша Стаменковић
Hehe, great. Any specific version when we can expect it?

Regards,
Saša Stamenković


On Tue, Aug 3, 2010 at 10:00 AM, Thomas Weidner wrote:

> Yes... otherwise this issue would have been closed as "won't fix". :-)
>
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> ----- Original Message - From: "Саша Стаменковић" 
> To: "Thomas Weidner" 
> Sent: Tuesday, August 03, 2010 9:56 AM
> Subject: Re: [fw-general] Is there a plan for Zend_Locale 2.0 ?
>
>
>
> O.K. Then, are there any plans for adding script support?
>
> Regards,
> Saša Stamenković
>
>
> On Tue, Aug 3, 2010 at 9:55 AM, Thomas Weidner  >wrote:
>
>  Script support as noted in the description of this issue is not equal to
>> locale variants.
>> These are 2 different things.
>>
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>>
>> - Original Message - From: "Саша Стаменковић" > >
>> To: "Nabble Zend Framework General" 
>> Sent: Tuesday, August 03, 2010 9:42 AM
>> Subject: [fw-general] Is there a plan for Zend_Locale 2.0 ?
>>
>>
>>
>> Hi.
>>
>> I wonder if there are plans for Zend_Locale in zf 2.0. The thing I miss
>> very
>> much is support for locale variants. There is a related issue
>>
>>
>> http://zendframework.com/issues/browse/ZF-7485?page=com.atlassian.jirafisheyeplugin:fisheye-issuepanel
>> .
>>
>> It would be nice to add support for this.
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>


Re: [fw-general] RE: Team Development

2010-08-11 Thread Саша Стаменковић
If every developer have its own branch, he can commit to his branch, so you
can diff with trunk, and see cnahges.

Regards,
Saša Stamenković


On Wed, Aug 11, 2010 at 3:20 PM, Paul  wrote:

> One more thing I thought of, was accessing a developers local environment.
>
> Currently, since we have everything on a shared dev server, I can easily
> look at the the teams code (great for the junior developers), and I can
> access their local copy of the site on a domain (site.paul.dev).
>
> Wondering if you do anything similar with your teams.   Having each
> developer with their own local setup, definitely complicates this a bit.
>
>
> On 8/10/2010 3:44 AM, keith Pope wrote:
>
>> On 10 August 2010 01:09, Paul  wrote:
>>
>>
>>> Thanks Keith this is great!  So for local dev, you let the developer
>>> choose
>>> their own environment.  Or do most of your developers have the same setup
>>> (ie. all developer have a mac)?
>>>
>>>
>> Thats right, we allow any environment and allow the staging server to
>> detect the environment specific errors. Developers use Mac, Win and
>> Linux plus most have VM's for testing.
>>
>> I believe the most important part of a teams setup is automation, this
>> solves so many problems!
>>
>>
>>
>>> On 8/8/2010 4:36 PM, keith Pope wrote:
>>>
>>>
 Hi,

 We use the following setup:

 Local dev setup (Development)
 Developers can use any IDE/Editor they like and can have their own
 LAMP etc setup.
 Ant - Used locally to configure, build and test the application
 (checks for dependencies etc)
 Data - Mysql weekly dump, sensitive data scrambled.
 DBDeploy - Used to version the database so everyone has up to date
 schema's
 Services (Solr etc) - Shared machine, available as VM
 Everything in SVN currently

 Dev build server (Staging/Testing)
 Custom application for quickly setting up versions of the software on
 the same server config as the live environment. This lets the
 developers checkout and setup vhosts for user testing/demos,
 integrates with the ant build system.

 PhpUnderControl (QA)
 Does all the continuous integration stuff we need...

 I would say our project is fairly large and I aim to allow the
 developers to setup a fresh install within a couple of minutes (minus
 copying the database)

 Currently to configure our application fully you need to do:

 ant refresh-properties
 ant
 ant apply-db-changes (if there are deltas waiting)

 Takes a couple of minutes, the main thing here is to automate as much
 as possible, this makes dev, testing, integration and deployment much
 easier!

 On 8 August 2010 11:32, Wil Moore IIIwrote:



> Thomas D. wrote:
>
>
>
>> Maybe you are using other services like "Sphinx" for search. Should
>> every
>> developer run and maintain a copy of Sphinx?
>>
>>
>>
>>
> You should be able to get away with running one of these on the dev
> machine.
> Just replicate over from prod periodically and have each developer hit
> this
> instance. It is less likely that every developer needs his/her own
> search
> server.
>
>
> Thomas D. wrote:
>
>
>
>> - Maybe you are working on an intranet application, which requires
>> authorization. You will authorize against a LDAP system. Should every
>> developer run and maintain a local LDAP service?
>>
>>
>>
>>
> I haven't approached this regarding LDAP so I can't comment.
>
>
> Thomas D. wrote:
>
>
>
>> - In real applications, you will have multiple entry points (website,
>> API
>> access...). Do you think every developer can run and maintain these
>> things
>> locally?
>>
>>
>>
>>
> Assuming this is all in your scm and deployed the same way, I see no
> reason
> not to have all of this working on each developer's instance. We run
> the
> main web application, public api, and cli scripts from the same
> Zend_Application instance w/ Zend_Config. You don't need ZF to do this
> but
> ZF makes it easy and organized.
>
>
> Thomas D. wrote:
>
>
>
>> Your dummy data may also run out of date
>>
>>
>>
>>
> I suggest a weekly dump, but depending on your app, dummy data may
> suffice.
> Sorry to say it, but, it depends.
>
>
> Thomas D. wrote:
>
>
>
>> Maybe your application is a shop system, your data contains credit
>> card
>> numbers and other sensible information. Do you want that every
>> developer
>> has access to these data? ;)
>>
>>
>>
>>
> Are you really storing the full credit card number? If so, the dump
> isn't
> the problem. You aren't PCI compliant in this case. Last 4 is OK. Even
> with
> that, I don't se

[fw-general] Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

2010-08-13 Thread Саша Стаменковић
Can you tell us current score? :)

Regards,
Saša Stamenković


On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney
wrote:

> ZF Coding Standards are based on PEAR's CS. That standard was developed
> first by Horde, then expanded by PEAR, during the PHP 4 lifecycle. PHP 4
> had no concept of visibility in its object model; to provide some
> pseudo-visibility, PEAR CS mandated that members considered non-public
> should be prefixed with an underscore.
>
> With the advent of PHP 5, PHP's object model received visibility
> operators in the form of private, protected, and public. Applying PEAR
> CS to PHP 5 code meant that if you marked a member as private or
> protected, you would also prefix with the underscore. Many have felt
> this is redundant, and also that it makes refactoring more difficult
> (changes in visibility often mean renaming the members). Proponents of
> the standard, however, argue that the leading underscore leads to easier
> maintenance of the code -- you know immediately what the visibility of
> the member you're dealing with is just by looking at it.
>
> PEAR2 has decided to eschew the underscore prefix:
>
>
> http://wiki.pear.php.net/index.php/MeetingMinutes20080824#Underscore_prefix_on_private_.28protected.3F.29
>
> Basically, this rule is no longer required (as it was in PEAR1), though
> developers may choose to use them.
>
> What is YOUR opinion? Should the underscore be dropped in ZF2?
> Please vote!
>
>http://is.gd/eeA6f
>
> Please do _not_ reply to this thread -- the arguments for and against
> are well known at this time -- we're simply trying to decide on whether
> or not to amend the coding standards for ZF2.
>
> Thanks!
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>


Re: [fw-general] Re: [zf-contributors] Poll: Should underscore prefixing of non-public elements be dropped?

2010-08-13 Thread Саша Стаменковић
Wow, I expected better score for "Yes"!

What will be the final decision if score remain consistent till the end?

Thanks,
Saša Stamenković


On Fri, Aug 13, 2010 at 2:45 PM, Matthew Weier O'Phinney
wrote:

> -- Саша Стаменковић  wrote
> (on Friday, 13 August 2010, 10:14 AM +0200):
> > Can you tell us current score? :)
>
> There are currently 381 responses:
>
>  * 57% vote "Yes" (to remove the underscores)
>  * 38% vote "No" (to retain underscores)
>  * 4%  vote "No opinion"
>
> What has been interesting is that the percentages have remained
> consistent from the outset -- I expected more deviation. What is also
> interesting is that there is no real clear majority. Typically, I like
> to see a 2/3 vote to feel comfortable that the change is widely
> accepted, but that is not the case at this time.
>
>
> > On Thu, Aug 12, 2010 at 6:05 PM, Matthew Weier O'Phinney <
> matt...@zend.com>
> > wrote:
> >
> > ZF Coding Standards are based on PEAR's CS. That standard was
> developed
> > first by Horde, then expanded by PEAR, during the PHP 4 lifecycle.
> PHP 4
> > had no concept of visibility in its object model; to provide some
> > pseudo-visibility, PEAR CS mandated that members considered
> non-public
> > should be prefixed with an underscore.
> >
> > With the advent of PHP 5, PHP's object model received visibility
> > operators in the form of private, protected, and public. Applying
> PEAR
> > CS to PHP 5 code meant that if you marked a member as private or
> > protected, you would also prefix with the underscore. Many have felt
> > this is redundant, and also that it makes refactoring more difficult
> > (changes in visibility often mean renaming the members). Proponents
> of
> > the standard, however, argue that the leading underscore leads to
> easier
> > maintenance of the code -- you know immediately what the visibility
> of
> > the member you're dealing with is just by looking at it.
> >
> > PEAR2 has decided to eschew the underscore prefix:
> >
> >http://wiki.pear.php.net/index.php/MeetingMinutes20080824#
> > Underscore_prefix_on_private_.28protected.3F.29
> >
> > Basically, this rule is no longer required (as it was in PEAR1),
> though
> > developers may choose to use them.
> >
> > What is YOUR opinion? Should the underscore be dropped in ZF2?
> > Please vote!
> >
> >http://is.gd/eeA6f
> >
> > Please do _not_ reply to this thread -- the arguments for and against
> > are well known at this time -- we're simply trying to decide on
> whether
> > or not to amend the coding standards for ZF2.
> >
> > Thanks!
> >
> > --
> > Matthew Weier O'Phinney
> > Project Lead| matt...@zend.com
> > Zend Framework  | http://framework.zend.com/
> > PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
> >
> >
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>


Re: [fw-general] Modular Application

2010-08-30 Thread Саша Стаменковић
I don't see need for modules in that case, why not making it separate app?

Regards,
Saša Stamenković


On Mon, Aug 30, 2010 at 7:02 PM, Rafael  wrote:

>
>  Thanks for attention,
>
> I have already added the code to my application.ini
>
>
> resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
> resources.modules[] = ""
>
> But I want to use module specific ini file so that each module will get own
> database and other resources, I want to use the module specific ini file
> only when module is called like independent module applications. Is it there
> anything done like it? I have been researching however I found a lot of old
> tutorials...for older zend versions
>
>
> Thank you
>
>
> Em 30/08/2010 13:41, Ralph Schindler escreveu:
>
>  Rafael,
>>
>> I am not sure what you are asking actually.
>>
>> Are you asking how to make an application "modular aware?" If that is the
>> case, this is achieved by adding something like this to your application.ini
>> file:
>>
>>  resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
>>  resources.modules[] = ""
>>
>> If you are asking how to get a module specific ini file, that is not
>> something that is provided by Zend_Application.  This is something you can
>> do on your own since you can do virtually anything you need inside the
>> Module's bootstrapper.
>>
>> Paddy has a good writeup here on module specific configs as part of a
>> larger article:
>>
>>
>> http://blog.astrumfutura.com/archives/415-Self-Contained-Reusable-Zend-Framework-Modules-With-Standardised-Configurators.html
>>
>> You can also have a look at this:
>>
>> http://blog.vandenbos.org/2009/07/07/zend-framework-module-config/
>>
>> Ultimately, the reason it's not explicitly supported is that the use cases
>> for modular configuration are not well defined.  Do you want to incur the
>> cost of loading a config during bootstrap, or do you want to incur the cost
>> only when the module is actually used?  Those questions are only determined
>> by the purpose of the module itself.
>>
>> Hope that helps,
>> Ralph
>>
>> On 8/30/10 11:24 AM, Rafael wrote:
>>
>>>
>>> Hello,
>>>
>>> I have been setting up an modular application however it is not clear in
>>> the manual how it is done.I've monted "skeleton" as in manual says,
>>> configured the module directory but it doesn't load application.ini from
>>> each module. Anyone knows how to load an application.ini from each
>>> module?
>>>
>>> Thanks
>>>
>>>
>>
>>
>


Re: [fw-general] can _getParam() get $_POST['bar']['foo'] ?

2010-08-30 Thread Саша Стаменковић
If there is a PHP function that can get  $_POST['bar']['foo']  using
fnc($this->_getParam(),
'foo') then this is not required. Otherwise, using temporary var and
$tmp['foo'] it makes 2 lines of code :)

Regards,
Saša Stamenković


On Mon, Aug 30, 2010 at 8:35 PM, Matthew Weier O'Phinney
wrote:

> -- Jordan Ryan Moore  wrote
> (on Monday, 30 August 2010, 09:22 AM -0700):
> > Currently, _getParam() can't access $_POST['person']['email']
> > directly. I miss this ability myself. I might be nice to add support
> > by passing an array of keys:
> >
> > $this->_getParam(array('person', 'email'), $default);
>
> Would that get the person and email keys? or would it look for an email
> subkey of person?
>
> (Just hinting that this syntax is ambiguous, which is one reason we
> haven't implemented it before.)
>
> > I believe this would need to be added to the controller and request
> > classes. File a ticket in JIRA, and I'll take a look.
> >
> > On Mon, Aug 30, 2010 at 9:14 AM, David Mintz 
> wrote:
> > > Just wondering if there's a way for a controller to use
> $this->_getParam()
> > > directly to get a POST datum which itself is within an array. Like with
> a
> > > subform for example. So if you have $_POST['person']['email'] can you
> get at
> > > the email in one _getParam() call? Or do you have to
> > >  $person = $this->_getParam('person') ;
> > > and then work with $person['email'] ?
> > >
> > >
> > >
> > >
> > > --
> > > Support real health care reform:
> > > http://phimg.org/
> > >
> > > --
> > > David Mintz
> > > http://davidmintz.org/
> > >
> > >
> > >
> >
> >
> >
> > --
> > Jordan Ryan Moore
> >
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>


Re: [fw-general] Performance and Example of Enterprice Applications

2010-09-04 Thread Саша Стаменковић
I have just finished http://automobi.li/, uses Zend Framework and integrates
jQueryUI with some customizations of ZendX_JQuery.

Regards,
Saša Stamenković


On Sat, Sep 4, 2010 at 8:48 AM,  wrote:

> Thank you very much, friends. I'm sure that i will persuade my boss.
> Antonio
>
>
> > -- i...@antoniocaccese.it  wrote
> > (on Friday, 03 September 2010, 03:05 PM +0200):
> >> i have a problem. I'm an applications developer (zend framework based)
> >> since 2 years. I'm italian.
> >>
> >> Well. Now i'm working since 2 days in a software house that want to
> >> change
> >> its mode to approch at software development. The goal of the factory is
> >> develop software more manageable and faster, so that every developer can
> >> update/upgrade/refactor the code indipendently from who write it.
> >>
> >> Obviously, i suggested Zend Framework, but the boss stop me because its
> >> staff tested Mangento and found it very slow.
> >>
> >> How i can persuade my boss and the other employes to adopt Zend
> >> Framework?
> >
> > Magento _uses_ *SOME* ZF components, but is not built on ZF's MVC at
> > all. As such, it's like comparing a Toyota Matrix to a Pontiac Vibe --
> > they both use some of the same parts and have similar outward
> > appearance, but they're discrete products, with different engines under
> > the hood.
> >
> >> I'm looking for other application examples, open source or not, that
> >> make
> >> massive use of Zend Framework (MVC) but i found only old projects, dead
> >> cms projects, and application written only for educational purposes.
> >>
> >> Can you give me a list (at least 4-5) sample of enterprise applications
> >> like Magento (it can be cms, wiki, crm, e-commerce, e-learning, and so),
> >> if they exists? We want to make a more in-depth analisys of complexity
> >> and
> >> performances of the framework, based on real applications with a lot of
> >> web accesses and large amounts of data.
> >
> > Unfortunately, many companies don't like to publicize what they have
> > built their solutions on. I *can* say that I've heard of sites built
> > using Zend Framework by every major US television media company, the
> > Library of Congress, several other government sites, and more.
> >
> > Hopefully we can get some folks to talk about specific projects on this
> > thread, however.
> >
> > --
> > Matthew Weier O'Phinney
> > Project Lead| matt...@zend.com
> > Zend Framework  | http://framework.zend.com/
> > PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
> >
>
>
>
>


[fw-general] Issue tracker down?

2010-10-01 Thread Саша Стаменковић
http://framework.zend.com/issues/ is down.

Regards,
Saša Stamenković


Re: [fw-general] Accessing config from CLI crons

2010-11-05 Thread Саша Стаменковић
Brilliant, worked like a charm!

Thanks Hector :)

Regards,
Saša Stamenković


On Fri, Nov 5, 2010 at 2:41 PM, Hector Virgen  wrote:

> I believe that param is added when the application is run(). Since you're
> not calling run(), you'll need to add that param manually:
>
> $bootstrap = $application->getBootstrap();
> Zend_Controller_Front::getInstance()->setParam('bootstrap', $bootstrap);
>
> --
> Hector Virgen
> Sent from my Droid X
> On Nov 4, 2010 11:57 PM, "umpirsky"  wrote:
>


Re: [fw-general] Re: ZF 2.0 when and what?

2010-11-10 Thread Саша Стаменковић
Anyone knows when will doctrine 2 be out of beta?

Regards,
Saša Stamenković


On Wed, Nov 10, 2010 at 3:25 PM, monk.e.boy  wrote:

>
> What are the plans for the ORM? How will the class autoloading work in 2.0,
> does it work with Doctrine 2?
>
> (APC http://php.net/manual/en/book.apc.php will help your speed issues)
>
> monk.e.boy
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/ZF-2-0-when-and-what-tp3031964p3036161.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: ZF 2.0 when and what?

2010-11-10 Thread Саша Стаменковић
Wow, refactored MVC, that is great news!

Thanks for the answer and resources.

Regards,
Saša Stamenković


On Wed, Nov 10, 2010 at 5:44 PM, Matthew Weier O'Phinney
wrote:

> -- umpirsky  wrote
> (on Wednesday, 10 November 2010, 07:35 AM -0800):
> > How hard it will be to migrate from zf1 to zf2, and when do you expect
> zf2
> > release?
>
> Short answers: don't know, and don't know.
>
> The last milestone on our list is migration tools. At this time, we're
> still in early development stages, and we won't know how difficult
> migration is until we have a refactored MVC in front of developers. Once
> we have, we'll be analyzing what steps developers need to take to
> migrate existing applications, and determining what, if any, automation
> we can provide.
>
> As for the ZF2 release, I'm optimistically saying this coming April, but
> we'll know better how to schedule once we get close to completing the
> MVC milestone.
>
> If you are interested in ZF2 development status, here are some
> resources:
>
>  * Slides from my (and Ralph's, as he was my voice due to laryngitis)
>   ZF2 talk at ZendCon last week:
>   http://slidesha.re/byESDg
>
>  * ZF 2.0.0dev2 announcement and snapshot:
>   http://bit.ly/zf2dev2
>
>  * ZF2 wiki:
>   http://framework.zend.com/wiki/display/ZFDEV2/Home
>   (In particular, the "Requirements" and "Milestones" pages.)
>
>  * How to contribute to ZF2 using git:
>   http://framework.zend.com/wiki/display/ZFDEV2/Zend+Framework+Git+Guide
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>


Re: [fw-general] Re: ZF models and Zend_Db classes

2010-11-19 Thread Саша Стаменковић
I think we are missing entire layer here - service layer. It lays under
application/services and it is registered as default space in autoloader.
I'm thinking about how it should look like with doctrine models.

http://dev.juokaz.com/programming/service-layer-in-web-applications

Any advices on this topic and good examples are welcome.

Regards,
Saša Stamenković


On Fri, Nov 19, 2010 at 7:00 PM, Fozzyuw  wrote:

>
> Thanks to both Hector and Bill for this discussion.
>
> After Bill's discussion I did go back and read over more of the ZF
> quickstart reference and I got a bit more out of the file structure for
> models and data access classes.
>
> What I've decided to do is break out some folders like this:
>
> /application/models/DbTable/
> /application/models/mapper/
> /application/models/
>
> I put the mapper classes that the quick start guide talks about into their
> own folder as well and then add it as a resource in my bootstrap.php.
>
> $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
>'basePath'  => APPLICATION_PATH,
>'namespace' => '{My}',
> ));
>
> $resourceLoader->addResourceType('form', 'forms/', 'Form'); # where I store
> form classes
> $resourceLoader->addResourceType('models', 'models/', 'Model');
> $resourceLoader->addResourceType('data', 'models/DbTable/',
> 'Model_DbTable');
> $resourceLoader->addResourceType('mappers', 'models/mapper/',
> 'Model_Mapper');
>
> I'll see how that works for organization.
>
> Right now, I'm working with building a product database.  In this case, I
> have a several tables that combine to make a whole product.  There's basic
> product information (part number, UPC, list price, etc), product attributes
> (color, size, etc) and values for product attributes (red, blue, large,
> small, etc.).
>
> But in the sense of an full entity, a product is made up of the product
> information and it's attributes.  So, I would have a "product" model that
> will have an array of attributes models and attributes will have an
> attribute value model.  I'm not really sure if attributes and their values
> are m models, or if the product model could just organize it, but I'm
> trying
> it like this first.
>
> As Bill mentioned, I can then extend this product model to for E-Commerce
> and have it create Invoice models, which handle the saving of data to the
> databases invoice table(s), as well as other possible utility methods that
> might simply notify a sales or fulfillment person by email.
>
> The idea is to try and get a better grasp of what should be a model and
> what
> shouldn't be, and if not, what is it?  It seems like there are utility
> classes such as a logger or, I would think, an email notifier, and data
> access classes such as Zend_Db_Table extensions.
>
> But what would be a good Model would be a Product, an Invoice, a User
> account which might have a User model, and so on.
>
> So, in general, the M in MVC seems to be a bit more expansive than what it
> might appear to be on the surface.
>
> Thanks much!
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/ZF-models-and-Zend-Db-classes-tp3049177p3050747.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: Zend_Date setDay() works strange for sundays

2010-11-29 Thread Саша Стаменковић
Thanks Damir, worked like a charm ;)

Regards,
Saša Stamenković


On Mon, Nov 29, 2010 at 1:48 PM, damir.mitrovic wrote:

>
> Hi,
>
> Zend_Date has method: setWeekday that can be used for this purpose.
>
>/**
> * Sets a new weekday
> * The weekday can be a number or a string. If a localized weekday name
> is given,
> * then it will be parsed as a date in $locale (defaults to the same
> locale as $this).
> * Returned is the new date object.
> * Example: setWeekday(3); will set the wednesday of this week as day.
> *
> * @param  string|integer|array|Zend_Date  $month   Weekday to set
> * @param  string|Zend_Locale  $locale  OPTIONAL Locale for
> parsing input
> * @return Zend_Date Provides fluid interface
> * @throws Zend_Date_Exception
> */
>public function setWeekday($weekday, $locale = null)
>{
>return $this->_weekday('set', $weekday, $locale);
> }
>
>
>
> umpirsky wrote:
> >
> > Hi.
> >
> > I wanted to use Zend_Date to set day of the week and get Zend_Date object
> > which represents that date.
> >
> > I looked in setDay(), but it was working for setting day of a month
> (1-31)
> > or setting a string representation of a day for given locale. Why I cant
> > do sth like Zend_Date->setDayOfWeek(3); // wednesday? Instead I need to
> > mess with strings and do setDay('Montag', 'de_AT')? Is there any easy way
> > to achieve this.
> >
> > In order to achieve this I did a simple fix http://pastie.org/1332064
> >
> > This works great for all days except sunday, If I do
> > $date->setDayOfWeek(Umpirsky_Date::DAY_SUNDAY) which is actually doing
> > $date->setDay('sun', 'en_GB'); I get sunday from last week string(20)
> > "28.11.2010. 12.16.27" and I'm expecting this week.
> >
> > Why this happends and can I set when the week starts (on monday, on
> > sunday) or sth like that to get expected behaviour?
> >
> > Regards,
> > Saša Stamenković.
> >
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Zend-Date-setDay-works-strange-for-sundays-tp3063414p3063517.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


[fw-general] Zend_Config_Xml strange behaviour

2011-03-23 Thread Саша Стаменковић
Hi.

I have a strange problem with Zend_Config_Xml.

Here is an example.

With this xml file https://gist.github.com/883465

this code:

$config = new Zend_Config_Xml('config.xml');
var_dump($config->get('elements')->get('element')->toArray());

gives:

array(2) {
  [0]=>
  array(2) {
["a"]=>
array(1) {
  ["attr"]=>
  string(2) "at"
}
["e"]=>
array(3) {
  [0]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  [1]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  [2]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
}
  }
  [1]=>
  array(2) {
["a"]=>
array(1) {
  ["attr"]=>
  string(2) "at"
}
["e"]=>
array(3) {
  [0]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  [1]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  [2]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
}
  }
}

with this xml file https://gist.github.com/883469

it gives:

array(2) {
  ["a"]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  ["e"]=>
  array(3) {
[0]=>
array(1) {
  ["attr"]=>
  string(2) "at"
}
[1]=>
array(1) {
  ["attr"]=>
  string(2) "at"
}
[2]=>
array(1) {
  ["attr"]=>
  string(2) "at"
}
  }
}

and I expect:

array(1) {
  [0]=>
  array(2) {
["a"]=>
array(1) {
  ["attr"]=>
  string(2) "at"
}
["e"]=>
array(3) {
  [0]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  [1]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
  [2]=>
  array(1) {
["attr"]=>
string(2) "at"
  }
}
  }
}

This is tricky when you want to iterate over elements

$config = new Zend_Config_Xml('config.xml');
foreach($config->get('elements')->get('element') as $element);

which is fine if there are more then one elements, but if you have only one,
you'll end up iterating over element children!

Any idea?


---
Regards,
Saša Stamenković


[fw-general] Zend Framework Composer Pakages

2012-07-31 Thread Саша Стаменковић
I would like to add dependency to zendframework/zend-db package, so I added
it to my composer.json:

"repositories": [
{
"type": "composer",
"url": "http://packages.zendframework.com/";
}
],
"require": {
"php": ">=5.3.2",

"symfony/class-loader":  "dev-master",
"symfony/console":   "dev-master",
"symfony/filesystem":"dev-master",
"symfony/finder":"dev-master",
"symfony/locale":"dev-master",
"symfony/yaml":  "dev-master",
"doctrine/dbal": "dev-master",
"zendframework/zend-db": "dev-master"
}

The problem is that composer instals entire zendframework/zendframework
package.

Any idea why?

BTW, maybe because of the size of entire package, it also goes to timeout:

- Installing zendframework/zendframework (dev-master)
Cloning 310ade9f083fd8444b6c026e0d973054d320620

  [RuntimeException]
  The process timed out.

But that is not the question, just one additional info.
---
Regards,
Saša Stamenković


Re: [fw-general] Zend Framework Composer Pakages

2012-07-31 Thread Саша Стаменковић
Ah, great, didn't know about that particular option.

Still waiting for answer regarding zend-db package.

Thanks a lot!
---
Regards,
Saša Stamenković


On Tue, Jul 31, 2012 at 11:31 PM, Dennis Winter
wrote:

> Hi, sadly I can't help you about your issue with zend-db, but for your
> composer timeout problem, there is an easy fix!
>
> You can set the timeout in your config parameter of composer.json!
>
> {"config":{*"**process-timeout":300}}*
> *
> *
> *Where 300 is the default value!*
> *
> *
> *For more information see here:*
> *
> *
> http://getcomposer.org/doc/04-schema.md#config
>
> Am 31.07.2012 um 22:40 schrieb Саша Стаменковић:
>
> I would like to add dependency to zendframework/zend-db package, so I added
> it to my composer.json:
>
> "repositories": [
>{
>"type": "composer",
>"url": "http://packages.zendframework.com/";
> }
> ],
> "require": {
>"php": ">=5.3.2",
>
>"symfony/class-loader":  "dev-master",
> "symfony/console":   "dev-master",
>"symfony/filesystem":"dev-master",
>"symfony/finder":"dev-master",
> "symfony/locale":"dev-master",
>"symfony/yaml":  "dev-master",
>"doctrine/dbal": "dev-master",
> "zendframework/zend-db": "dev-master"
> }
>
> The problem is that composer instals entire zendframework/zendframework
> package.
>
> Any idea why?
>
> BTW, maybe because of the size of entire package, it also goes to timeout:
>
> - Installing zendframework/zendframework (dev-master)
> Cloning 310ade9f083fd8444b6c026e0d973054d320620
>
>  [RuntimeException]
>  The process timed out.
>
> But that is not the question, just one additional info.
> ---
> Regards,
> Saša Stamenković
>
>


[fw-general] Is CLDR gone?

2012-08-01 Thread Саша Стаменковић
I updated to latest zf2 master and I noticed Locale is moved to I18n. More
important, there is no CLDR!

What is happening? How can I fetch locale data (languages/territories) now?
---
Regards,
Saša Stamenković


Re: [fw-general] Is CLDR gone?

2012-08-01 Thread Саша Стаменковић
Nope, there use to be Zend\Locale\Data\Cldr, but now entire Zend\Locale
namespace is gone.
---
Regards,
Saša Stamenković


On Wed, Aug 1, 2012 at 3:21 PM, Robert Basic wrote:

> This? https://github.com/zendframework/zf2/tree/master/resources/languages
>
> On 1 August 2012 15:19, Саша Стаменковић  wrote:
> > I updated to latest zf2 master and I noticed Locale is moved to I18n.
> More
> > important, there is no CLDR!
> >
> > What is happening? How can I fetch locale data (languages/territories)
> now?
> > ---
> > Regards,
> > Saša Stamenković
>
>
>
> --
> ~Robert Basic;
> http://robertbasic.com/
>


Re: [fw-general] Is CLDR gone?

2012-08-01 Thread Саша Стаменковић
BTW, there is some problem with mailing list, I'm not getting all responses
via email, for example Frank
Brückner<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=265650>response
from
http://zend-framework-community.634137.n4.nabble.com/Is-CLDR-gone-td4656028.htmldidn't
reach my inbox.

He suggested to use \Locale http://de.php.net/manual/de/class.locale.php.

But I need list of all languages and all territories?

On Wed, Aug 1, 2012 at 3:24 PM, Саша Стаменковић  wrote:

> Nope, there use to be Zend\Locale\Data\Cldr, but now entire Zend\Locale
> namespace is gone.
> ---
> Regards,
> Saša Stamenković
>
>
>
> On Wed, Aug 1, 2012 at 3:21 PM, Robert Basic wrote:
>
>> This?
>> https://github.com/zendframework/zf2/tree/master/resources/languages
>>
>> On 1 August 2012 15:19, Саша Стаменковић  wrote:
>> > I updated to latest zf2 master and I noticed Locale is moved to I18n.
>> More
>> > important, there is no CLDR!
>> >
>> > What is happening? How can I fetch locale data (languages/territories)
>> now?
>> > ---
>> > Regards,
>> > Saša Stamenković
>>
>>
>>
>> --
>> ~Robert Basic;
>> http://robertbasic.com/
>>
>
>


Re: [fw-general] Is CLDR gone?

2012-08-01 Thread Саша Стаменковић
My workaround was to downgrade to zf1 which is still capable to do the job
:P
---
Regards,
Saša Stamenković


On Wed, Aug 1, 2012 at 3:46 PM, Саша Стаменковић  wrote:

> BTW, there is some problem with mailing list, I'm not getting all
> responses via email, for example Frank 
> Brückner<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=265650>response
>  from
> http://zend-framework-community.634137.n4.nabble.com/Is-CLDR-gone-td4656028.htmldidn't
>  reach my inbox.
>
> He suggested to use \Locale http://de.php.net/manual/de/class.locale.php.
>
> But I need list of all languages and all territories?
>
>
> On Wed, Aug 1, 2012 at 3:24 PM, Саша Стаменковић wrote:
>
>> Nope, there use to be Zend\Locale\Data\Cldr, but now entire Zend\Locale
>> namespace is gone.
>> ---
>> Regards,
>> Saša Stamenković
>>
>>
>>
>> On Wed, Aug 1, 2012 at 3:21 PM, Robert Basic 
>> wrote:
>>
>>> This?
>>> https://github.com/zendframework/zf2/tree/master/resources/languages
>>>
>>> On 1 August 2012 15:19, Саша Стаменковић  wrote:
>>> > I updated to latest zf2 master and I noticed Locale is moved to I18n.
>>> More
>>> > important, there is no CLDR!
>>> >
>>> > What is happening? How can I fetch locale data (languages/territories)
>>> now?
>>> > ---
>>> > Regards,
>>> > Saša Stamenković
>>>
>>>
>>>
>>> --
>>> ~Robert Basic;
>>> http://robertbasic.com/
>>>
>>
>>
>


Re: [fw-general] Is CLDR gone?

2012-08-01 Thread Саша Стаменковић
Anyone know what is the CLDR version in zf1 trunk? Or how to check it?
---
Regards,
Saša Stamenković


On Wed, Aug 1, 2012 at 5:38 PM, Саша Стаменковић  wrote:

> My workaround was to downgrade to zf1 which is still capable to do the job
> :P
> ---
> Regards,
> Saša Stamenković
>
>
>
> On Wed, Aug 1, 2012 at 3:46 PM, Саша Стаменковић wrote:
>
>> BTW, there is some problem with mailing list, I'm not getting all
>> responses via email, for example Frank 
>> Brückner<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=265650>response
>>  from
>> http://zend-framework-community.634137.n4.nabble.com/Is-CLDR-gone-td4656028.htmldidn't
>>  reach my inbox.
>>
>> He suggested to use \Locale http://de.php.net/manual/de/class.locale.php.
>>
>> But I need list of all languages and all territories?
>>
>>
>> On Wed, Aug 1, 2012 at 3:24 PM, Саша Стаменковић wrote:
>>
>>> Nope, there use to be Zend\Locale\Data\Cldr, but now entire Zend\Locale
>>> namespace is gone.
>>> ---
>>> Regards,
>>> Saša Stamenković
>>>
>>>
>>>
>>> On Wed, Aug 1, 2012 at 3:21 PM, Robert Basic 
>>> wrote:
>>>
>>>> This?
>>>> https://github.com/zendframework/zf2/tree/master/resources/languages
>>>>
>>>> On 1 August 2012 15:19, Саша Стаменковић  wrote:
>>>> > I updated to latest zf2 master and I noticed Locale is moved to I18n.
>>>> More
>>>> > important, there is no CLDR!
>>>> >
>>>> > What is happening? How can I fetch locale data
>>>> (languages/territories) now?
>>>> > ---
>>>> > Regards,
>>>> > Saša Stamenković
>>>>
>>>>
>>>>
>>>> --
>>>> ~Robert Basic;
>>>> http://robertbasic.com/
>>>>
>>>
>>>
>>
>


<    1   2   3   4