2010年5月31日星期一

Re: [fw-db] Duplicate field names in manytomany relationship


On May 31, 2010, at 5:21 AM, Steve Rayner wrote:
How does Zend Framework deal with the duplicated fieldname for id, created_date and modified_date?

There can be only one column by each name in a Zend_Db_Table_Row object, since the object-field interface must be unambiguous.  

  echo $row->id; // which column will this get?

If you have duplicate column names, one will overwrite the other.  There's no way for you to control which one takes priority.

Can i use some form of alias for these field names so that i can distinguish between them in the resulting recordset?

There ought to be a way to use an object of type Zend_Db_Table_Select as an argument to findManyToManyRowset(), so you could customize the columns retrieved by the query, including aliasing columns.  This is possible with other methods like findDependentRowset() and others.

Unfortunately, findManyToManyRowset(), is hard-coded to fetch all columns from the matching table using the * wildcard.  So you can't customize the columns without creating your own subclass of Zend_Db_Table_Row and rewriting that method, which is very complex.

Your only solution seems to be to bypass the Zend_Db_Table interface and run literal SQL queries, writing the joins and column aliases yourself, and executing the query against the Zend_Db_Adapter interface.

I particularly need the id of the record in the joining table, however the data returned by id seems to be that of the component table.

Right; this would be a good reason to name your primary keys something more descriptive in each table, instead of "ID" everywhere.  Using more descriptive names for columns is good practice anyway.

Regards,
Bill Karwin

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

> But can saving language in session violate google webmaster guidlines
http://www.google.com/support/webmasters/bin/answer.py?answer=66355 ?

No, it can't.

> Can I serve 2 languages on same url?

Yes.
Regards,
Saša Stamenković


On Mon, May 24, 2010 at 10:46 AM, Danny Fröberg <
danny.froberg@foreststar.net> wrote:

> Can this help?
>
>
> http://blog.hackix.com/2010/01/bootstrapping-zend_translate-with-a-langselector-plugin/
>
>
>
>
>
> *Från:* sina miandashti [mailto:miandashti@gmail.com]
> *Skickat:* den 19 maj 2010 14:12
> *Till:* dbenjamin
> *Kopia:* fw-mvc@lists.zend.com
> *Ämne:* Re: [fw-mvc] Re: Language in URL: always a particular case !
>
>
>
> any solution for this pl z...
>
> On Wed, May 19, 2010 at 4:34 PM, dbenjamin <bd.webdev@gmail.com> wrote:
>
> Hello,
>
>
>
> Thank you all for your help, but i think it's definitly not possible with
> Zend to have correct routes with language. I'm really stuck with that :(
>
>
>
> The Zend Cast tutorial has exactly the same issue, because it works only
> with default module, try to follow the tutorial, create a module "admin" for
> example, and then go to the : /en/admin/ or /en/admin/index, it will throw :
> "0: Invalid controller specified (admin)".
>
>
>
> I just can't see any solution here.
>
>
>
>
>
> br,
>
> Benjamin.
>
>
>
>
>
> 2010/5/3 Damián Farina [via Zend Framework Community] <[hidden email]<http://user/SendEmail.jtp?type=node&node=2222707&i=0>
> >
>
> dbenjamin (2010-04-27):
>
>
> > Hi,
> >
> > The same subject again and again. Adding the locale into URL to simulate
> a
> > "one folder per language" structure with MVC.
> >
> > Just like the official Zend website does, but how exactly ? :)
> >
> > It's really complicated to add this behaviour with Zend routes and by
> > browsing forums i never found a viable solution.
> >
> > The solution that comes up most often is :
> > - redefine default routes
> > - a plugin to get lang param and initialize Zend_Locale/Zend_Translate
> >
> > But that's not enough !
> >
> > We need to handle the following cases :
> > - the lang param is not valid
> > - the lang param is missing (ex. http://www.my-website.com/contact has
> to
> > be redirected to http://www.my-website.com/defaultlang/contact)
> >
> > Let's assume an user enter the following url :
> > http://www.my-website.com/dsqdsq, we have to return a 404 error page,
> > handled by the ErrorHandler plugin.
> >
> > But that's not possible, in our plugin we will get "dsqdsq" as the lang
> > param value and throwing manually a 404 error from within a plugin is not
>
> > handled by the ErrorHandler.
> >
> > Plus, we will maybe have to redirect automatically the user to :
> > "http://www.my-website.com/en-gb/dsqdsq", but "dsqdsq" is a module ? a
> > controller ? an action ? Who knows and how to redirect to a good url.
> >
> > In other words, if the first param is not a valid lang, we have to add
> the
> > default language to the url and shift all the parts of the url
> > (complicated).
> >
> > I'm wasting a loooot of precious time with that stuff ! :)
> >
> > Is there a solution that works for all cases ? Maybe with apache rewrite
> > rules ?
> >
> >
> > Thanks. (and sorry if my english is sometimes hard :p)
> >
> > Cdt,
> > Benjamin.
>
>
>
> Hi Benjamin, this (1) screen cast helped me a lot when dealing with
> languages.
> Hope it helps the way it did for me.
>
> (1) http://www.zendcasts.com/introducing-zend_translate/2009/11/
>
>
> Slds!
>
>
> --
> Damián Farina
> XoomCode
>
> ------------------------------
>
> View message @
> http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2124425.html
> To unsubscribe from Language in URL: always a particular case !, click
> here.
>
>
>
>
>
>
> ------------------------------
>
> View this message in context: Re: Language in URL: always a particular
> case !<http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2222707.html>
>
>
> Sent from the Zend MVC mailing list archive<http://zend-framework-community.634137.n4.nabble.com/Zend-MVC-f663775.html>at Nabble.com.
>
>
>
>
> --
> ________________
> Sincerely
> Sina Miandashti
> MuSicBasE.ir & InvisionPower.ir Admin
>

[fw-db] Duplicate field names in manytomany relationship

I have a table called components with the following fields;

 

id

part_no

description

created_date

modified_date

 

I have another table called nests with the following fields;

 

id

nest_no

description

created_date

modified_date

 

Finally i have a joining table called nestcomponents with the following fields;

 

id

nest_id

component_id

qty

created_date

modified_date

 

I am using the following code to create and return a manytomany recordset;

 

$components = $nest->findManyToManyRowset('Titanium_Model_Components',

                                          'Titanium_Model_NestComponents');

        $this->view->components = $components;

 

How does Zend Framework deal with the duplicated fieldname for id, created_date and modified_date?

Can i use some form of alias for these field names so that i can distinguish between them in the resulting recordset?

 

I particularly need the id of the record in the joining table, however the data returned by id seems to be that of the component table.

Steve



-
Williams Refrigeration is a trading name of AFE Group Limited.
Registered in England & Wales under Registered Number 3872673. Registered
Office Address - Bryggen Road, North Lynn, Industrial Estate, Kings Lynn, Norfolk, PE30 2HZ

Williams Refrigeration filters email attachments for spam and viruses and malicious content with Sophos Puremessage. While every care has been made to ensure that this message is secure and virus free, we cannot be held responsible for any damage arising from computer viruses and advise that you perform your own checks on this and any other inbound messages.

This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error or are having trouble sending email to us please notify the system administrator - postmaster@williams-refrigeration.co.uk

Any views or opinions expressed in this e-mail are those of the sender and do not necessarily coincide with those of Williams Refrigeration or the AFE Group.

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

But can saving language in session violate google webmaster guidlines http://www.google.com/support/webmasters/bin/answer.py?answer=66355 ?

Can I serve 2 languages on same url?

Regards,
Saša Stamenković


On Mon, May 24, 2010 at 10:46 AM, Danny Fröberg <danny.froberg@foreststar.net> wrote:

Can this help?

http://blog.hackix.com/2010/01/bootstrapping-zend_translate-with-a-langselector-plugin/

 

 

Från: sina miandashti [mailto:miandashti@gmail.com]
Skickat: den 19 maj 2010 14:12
Till: dbenjamin
Kopia: fw-mvc@lists.zend.com
Ämne: Re: [fw-mvc] Re: Language in URL: always a particular case !

 

any solution for this  pl z...

On Wed, May 19, 2010 at 4:34 PM, dbenjamin <bd.webdev@gmail.com> wrote:

Hello,

 

Thank you all for your help, but i think it's definitly not possible with Zend to have correct routes with language. I'm really stuck with that :(

 

The Zend Cast tutorial has exactly the same issue, because it works only with default module, try to follow the tutorial, create a module "admin" for example, and then go to the : /en/admin/ or /en/admin/index, it will throw : "0: Invalid controller specified (admin)".

 

I just can't see any solution here.

 

 

br,

Benjamin.

 

 

2010/5/3 Damián Farina [via Zend Framework Community] <[hidden email]>

dbenjamin (2010-04-27):


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

 

Hi Benjamin, this (1) screen cast helped me a lot when dealing with languages.
Hope it helps the way it did for me.

(1) http://www.zendcasts.com/introducing-zend_translate/2009/11/


Slds!


--
Damián Farina
XoomCode


View message @ http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2124425.html
To unsubscribe from Language in URL: always a particular case !, click here.

 

 

 


View this message in context: Re: Language in URL: always a particular case !


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




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


[fw-server] Re: Zend Server Virtual Host - Error Message Output

Exactly same problem, like i described here :
http://zend-framework-community.634137.n4.nabble.com/Zend-Server-4-5-update-ErrorDocument-issue-tp2228516p2228516.html

No way to fix this, i can't figure out what's wrong with apache2.

If someone had the same problem when upgrading from Zend Server 4 to 5 on
windows, please how did you fix it ?

I'm forced to re-install Zend Server 4 to work properly because even my Ajax
calls can't be handled because when i set an 400 error code to response and
output JSON, apache adds a error too, ex. :

{"errors":{"nickname":{"isEmpty":"Champ requis."},"email":{"isEmpty":"Champ
requis."}}}<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<p>Additionally, a 400 Bad Request
error was encountered while trying to use an ErrorDocument to handle the
request.</p>
</body></html>


No way :)

Any help plz ? Thanks.

br,
Benjamin.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Server-Virtual-Host-Error-Message-Output-tp1574698p2237168.html
Sent from the Zend Server mailing list archive at Nabble.com.

2010年5月29日星期六

[fw-mvc] Re: Form DisplayGroup inside tabs

Here is a solution using ZendX_JQuery_Form, I hope it helps someone. It does
allow putting your submit elements outside the tab container, that is just a
matter of setting the decorators correctly.

http://zendreflections.blogspot.com/2010/05/tabbed-forms-part-3.html

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Form-DisplayGroup-inside-tabs-tp1576290p2235804.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2010年5月28日星期五

RE: [fw-db] Statement containing both parentheses and AS clause

Ok, I issued a bug report… Hope this gets fixed soon J

 

Shehi

 

From: Hector Virgen [mailto:djvirgen@gmail.com]
Sent: Friday, May 28, 2010 7:16 PM
To: Shehi
Cc: fw-db@lists.zend.com
Subject: Re: [fw-db] Statement containing both parentheses and AS clause

 

I believe it's best practice to explicitly wrap all SQL expressions in a Zend_Db_Expr object to help reduce the chance of Zend_Db incorrectly quoting it, including field identifiers.

 

However, you are right about the auto-detection of expressions. I'm looking at ZF 1.8 source (sorry, don't have a more recent ZF on me at the moment) and Zend_Db_Select#_tableCols() is looking for "AS" before checking if it looks like an expression:

 

# Zend/Db/Select.php:895

if (is_string($col)) {

    // Check for a column matching "<column> AS <alias>" and extract the alias name

    if (preg_match('/^(.+)\s+' . self::SQL_AS . '\s+(.+)$/i', $col, $m)) {

        $col = $m[1];

        $alias = $m[2];

    }

    // Check for columns that look like functions and convert to Zend_Db_Expr

    if (preg_match('/\(.*\)/', $col)) {

        $col = new Zend_Db_Expr($col);

    } elseif (preg_match('/(.+)\.(.+)/', $col, $m)) {

        $currentCorrelationName = $m[1];

        $col = $m[2];

    }

}

 

If this problem still exists in the latest version of ZF, please file a bug report:

 

 

--
Hector

On Fri, May 28, 2010 at 7:05 AM, Shehi <shehi@imanov.name> wrote:

Example SELECT statement is like this:

SELECT CAST(column_name AS UNSIGNED)
    FROM table1

Code I used was:

1. $select = $db->select()

2.              ->from(array('table1'),

3.                     array('CAST(column_name AS UNSIGNED)',

4.                    );

which did not work - error returned, was: Could not find "table1.CAST(column_name" field. As we know, if there is a parentheses inside the clause, it is considered to be a Zend_Db_Expr. But on the other hand, the existence of "AS" clause messes things up, making it think we have a field-name-alias here, which we don't. Its just CAST function's syntax. Of course I overcame the problem by explicitly telling it we are having Zend_Db_Expr with this code which worked:

1. $select = $db->select()

2.              ->from(array('table1'),

3.                     array('column_name' => new Zend_Db_Expr('CAST(column_name AS UNSIGNED)'))                 

4.                 );

Question for developers of ZF is: Shouldn't you guys not touch any clauses, including AS clause, inside the statement which contains parentheses - the same way you do with Zend_Db_Expr objects? Statements with parentheses are considered to be Zend_Db_Expr objects, but at the same time they are not...

Shehi

 

RE: [fw-db] Statement containing both parentheses and AS clause

Thank you Bill for your timely response… And for your great work in ZF – I am sure we all here appreciate it J

 

My question is: Your last sentence, saying “it is looking for AS before checking if it looks like an expression” – Can we expect that to be fixed in the next release of ZF? Thanks again…

 

Shehi

 

From: Bill Karwin [mailto:bill@karwin.com]
Sent: Friday, May 28, 2010 7:35 PM
To: fw-db@lists.zend.com
Subject: Re: [fw-db] Statement containing both parentheses and AS clause

 

I wrote this code pre-ZF 1.0, to try to accommodate people who wanted to write "column AS alias" instead of array("alias"=>"column").  

 

My recollection is that it was to preserve backward compatibility with earlier preview releases of ZF.

 

My apologies that I didn't anticipate expressions containing an "AS" keyword other than to introduce an alias.  The mission of ZF as I was told was to make development very simple and easy in the 80% case, while allowing for the other 20% but perhaps not as conveniently.

 

Regards,

Bill Karwin

 

On May 28, 2010, at 9:15 AM, Hector Virgen wrote:

 

However, you are right about the auto-detection of expressions. I'm looking at ZF 1.8 source (sorry, don't have a more recent ZF on me at the moment) and Zend_Db_Select#_tableCols() is looking for "AS" before checking if it looks like an expression:

 

Re: [fw-db] Statement containing both parentheses and AS clause

I wrote this code pre-ZF 1.0, to try to accommodate people who wanted to write "column AS alias" instead of array("alias"=>"column").  

My recollection is that it was to preserve backward compatibility with earlier preview releases of ZF.

My apologies that I didn't anticipate expressions containing an "AS" keyword other than to introduce an alias.  The mission of ZF as I was told was to make development very simple and easy in the 80% case, while allowing for the other 20% but perhaps not as conveniently.

Regards,
Bill Karwin

On May 28, 2010, at 9:15 AM, Hector Virgen wrote:

However, you are right about the auto-detection of expressions. I'm looking at ZF 1.8 source (sorry, don't have a more recent ZF on me at the moment) and Zend_Db_Select#_tableCols() is looking for "AS" before checking if it looks like an expression:

Re: [fw-db] Statement containing both parentheses and AS clause

I believe it's best practice to explicitly wrap all SQL expressions in a Zend_Db_Expr object to help reduce the chance of Zend_Db incorrectly quoting it, including field identifiers.

However, you are right about the auto-detection of expressions. I'm looking at ZF 1.8 source (sorry, don't have a more recent ZF on me at the moment) and Zend_Db_Select#_tableCols() is looking for "AS" before checking if it looks like an expression:

# Zend/Db/Select.php:895
if (is_string($col)) {
    // Check for a column matching "<column> AS <alias>" and extract the alias name
    if (preg_match('/^(.+)\s+' . self::SQL_AS . '\s+(.+)$/i', $col, $m)) {
        $col = $m[1];
        $alias = $m[2];
    }
    // Check for columns that look like functions and convert to Zend_Db_Expr
    if (preg_match('/\(.*\)/', $col)) {
        $col = new Zend_Db_Expr($col);
    } elseif (preg_match('/(.+)\.(.+)/', $col, $m)) {
        $currentCorrelationName = $m[1];
        $col = $m[2];
    }
}

If this problem still exists in the latest version of ZF, please file a bug report:


--
Hector


On Fri, May 28, 2010 at 7:05 AM, Shehi <shehi@imanov.name> wrote:
Example SELECT statement is like this:

SELECT CAST(column_name AS UNSIGNED)
    FROM table1

Code I used was:
  1. $select = $db->select()
  2.              ->from(array('table1'),
  3.                     array('CAST(column_name AS UNSIGNED)',
  4.                    );
which did not work - error returned, was: Could not find "table1.CAST(column_name" field. As we know, if there is a parentheses inside the clause, it is considered to be a Zend_Db_Expr. But on the other hand, the existence of "AS" clause messes things up, making it think we have a field-name-alias here, which we don't. Its just CAST function's syntax. Of course I overcame the problem by explicitly telling it we are having Zend_Db_Expr with this code which worked:

  1. $select = $db->select()
  2.              ->from(array('table1'),
  3.                     array('column_name' => new Zend_Db_Expr('CAST(column_name AS UNSIGNED)'))                 
  4.                 );
Question for developers of ZF is: Shouldn't you guys not touch any clauses, including AS clause, inside the statement which contains parentheses - the same way you do with Zend_Db_Expr objects? Statements with parentheses are considered to be Zend_Db_Expr objects, but at the same time they are not...

Shehi

[fw-db] Statement containing both parentheses and AS clause

Example SELECT statement is like this:

SELECT CAST(column_name AS UNSIGNED)
    FROM table1

Code I used was:
  1. $select = $db->select()
  2.              ->from(array('table1'),
  3.                     array('CAST(column_name AS UNSIGNED)',
  4.                    );
which did not work - error returned, was: Could not find "table1.CAST(column_name" field. As we know, if there is a parentheses inside the clause, it is considered to be a Zend_Db_Expr. But on the other hand, the existence of "AS" clause messes things up, making it think we have a field-name-alias here, which we don't. Its just CAST function's syntax. Of course I overcame the problem by explicitly telling it we are having Zend_Db_Expr with this code which worked:

  1. $select = $db->select()
  2.              ->from(array('table1'),
  3.                     array('column_name' => new Zend_Db_Expr('CAST(column_name AS UNSIGNED)'))                 
  4.                 );
Question for developers of ZF is: Shouldn't you guys not touch any clauses, including AS clause, inside the statement which contains parentheses - the same way you do with Zend_Db_Expr objects? Statements with parentheses are considered to be Zend_Db_Expr objects, but at the same time they are not...

Shehi

[fw-db] Re: zf:accessing db2 table on system i

Ican't believe that there is nobody in the community that can explain this
fatal error, as a consequence of running the folloing code
"$config = array(
'adapter' => 'Db2',
'params' => array(
'username' => 'userid',
'password' => 'mypass',
'dbname' => 'mysystemname',
'adapterNamespace' => 'ZendC_Db_adapter',
'driver_options' => array(
"i5_lib" => "LEVA",
"i5_naming" => "DB2_I5_NAMING_ON")
)
);
$config = new Zend_Config($config);

try {
$db = Zend_Db::factory($config);
$db->getConnection();
} catch (Zend_Db_Adapter_Exception $e) {
echo" perhaps a failed login credential, or perhaps the RDBMS is not
running";
} catch (Zend_Exception $e) {
echo " perhaps factory() failed to load the specified Adapter class";
}"
when istantiating db2 (Zend_Db::factory).
Regards.

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/zf-accessing-db2-table-on-system-i-tp2226165p2234426.html
Sent from the Zend DB mailing list archive at Nabble.com.

2010年5月25日星期二

[fw-mvc] Re: [zf-contributors] ZF-9881: Allow registration of XPath namespaces in Zend_Test_PHPUnit_ControllerTestCase

On Mon, May 24, 2010 at 12:37 PM, David Abdemoulaie <dave@hobodave.com> wrote:
This seems pretty straight-forward to me.

Thanks for the feedback. I've gone ahead and committed the patch. If anyone else has any suggestions for improving this patch, I'd be happy to hear it.


On May 24, 2010, at 11:26 AM, Bradley Holt wrote:

I've submitted an improvement request to allow registration of XPath namespaces in Controller Tests:

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

The issue description includes an explanation as to why this functionality is needed to test certain XML responses. I've also submitted a patch (attached to the issue) that should allow for this functionality. Could someone please review this improvement request and associated patch for any potential problems I have not thought of? I'm in #zftalk and #zftalk.dev as bradley-holt if you'd prefer to discuss this there. If all looks good and there are no complaints, I'll go ahead and commit the patch.




[fw-db] Zend_Db_Table_Exception : "A table must have a primary key, but none was found"

hi all
I'm using Zend_Cachefor Zend_Db_Table_Abstract
Sometimes Htay following occurs:
"A table must have a primary key, but none was found"
While I'm have in the my table primary key.
and Refresh the page to be resolved
What Is Problem؟

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Db-Table-Exception-A-table-must-have-a-primary-key-but-none-was-found-tp2230044p2230044.html
Sent from the Zend DB mailing list archive at Nabble.com.

2010年5月24日星期一

[fw-mvc] Controller preDispatch() and skipping actions

Hello!

I am setting the request's "isDispatched" flag to true from within a controller's preDispatch hook, but the action method is still running (verified by calling die('should not be run');). Is there a way to skip the action method and have it jump straight to postDispatch() or do I need to implement that logic on my own? I am using ZF 1.8. Thanks!

--
Hector

[fw-mvc] ZF-9881: Allow registration of XPath namespaces in Zend_Test_PHPUnit_ControllerTestCase

I've submitted an improvement request to allow registration of XPath namespaces in Controller Tests:

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

The issue description includes an explanation as to why this functionality is needed to test certain XML responses. I've also submitted a patch (attached to the issue) that should allow for this functionality. Could someone please review this improvement request and associated patch for any potential problems I have not thought of? I'm in #zftalk and #zftalk.dev as bradley-holt if you'd prefer to discuss this there. If all looks good and there are no complaints, I'll go ahead and commit the patch.

[fw-server] Re: Zend Server 4 > 5 update - ErrorDocument issue

I think i'm going crazy, all the "ErrorDocument" directives are commented, i
also renamed apache2 "error" folder which is supposed to contain errors HTML
templates but no way, apache always add a html document after mine, it's
really frustrating ! :)

br,
Benjamin.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Server-4-5-update-ErrorDocument-issue-tp2228516p2228666.html
Sent from the Zend Server mailing list archive at Nabble.com.

[fw-server] Zend Server 4 > 5 update - ErrorDocument issue

Hello,

I have upgraded Zend Server 4 to Zend Server 5 on my development machine but
now apache seems to automatically output a document template on "400 bad
request" errors.

I'm not good enough with server configuration and i already spent hours to
find out what's wrong, but no way :)

For example, when i return json to javascript with a 400 http header, in
firebug i have : http://pastie.org/974435

The server is running on a Windows 7 x64 (no problem on production server
with ubuntu).
Every "ErrorDocument" directives are commented into httpd.conf.

My virtualhost : http://pastie.org/974441

I really don't know what to do, does someone knows how to resolve that
please ? :)


Thanks,

br,
Benjamin.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Server-4-5-update-ErrorDocument-issue-tp2228516p2228516.html
Sent from the Zend Server mailing list archive at Nabble.com.

Re: [fw-mvc] send file to browser?

Hi Sina,

You will need to look at the response object in Zend_Controller.  Depending on what you are trying to do, this can be accomplished by manipulating the code in your controller or writing a plugin.

Take a look at http://framework.zend.com/manual/en/zend.controller.response.html for more information.

On Sun, May 23, 2010 at 4:48 PM, sina miandashti <miandashti@gmail.com> wrote:
hi

is zf have any method in classes for sending file to browser for downloading ?

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



--
Andrew Sledge

RE: AW: [fw-db] zf:accessing db2 table on system i

To be more accurate, I'm getting this new message "Fatal error: Class ZendC_Db_Adapter_Db2
contains 2 abstract methods and must therefore be declared abstract or implement
the remaining methods (Zend_Db_Adapter_Abstract::isConnected, Zend_Db_Adapter_Abstract::getServerVersion)
in /usr/local/zend/ZendFramework/library/ZendC/Db/Adapter/Db2.php on line
767"
Thanks again
Regards
Sante

>-- Original Message --
>Date: Fri, 21 May 2010 08:04:08 -0700 (PDT)
>From: "Jan Burkl [via Zend Framework Community]" <[hidden email]>
>To: sante <[hidden email]>
>Subject: AW: [fw-db] zf:accessing db2 table on system i
>
>
>
>
>
>Hi Sante,
>
>you should not use the Db2 Adapter from Zend Framework, but the one which
>was especially created for System i. You can find it in the ZendC folder
>next to the ZF library. More information can be found here in Appendix H:
>http://static.zend.com/topics/Zend-Core-User-Guide-i5OS-V261.pdf
>
>Regards,
>Jan
>
>-----Ursprüngliche Nachricht-----
>Von: sante [mailto:[hidden email]]
>Gesendet: Freitag, 21. Mai 2010 15:44
>An: [hidden email]
>Betreff: [fw-db] zf:accessing db2 table on system i
>
>
>Hi all!
>I'm trying to work with ZF, so I've downloaded the quickstart tutorial from
>the web. My installation is on system ibm i os/v5r4 and my database is
>(obviously) db2. I've changed the tutorial in order that it can deal with
>this database. Actually connection to the database works and I can get
>metadata from any table. But there is a big problem. When the script attemps
>to access a db2 table (namely the "save" function of GuestbookMapper.php
>for
>signAction of the controller) I get the following error message:
>An error occurred
>Application error
>#0 /usr/local/Zend/ZendFramework/library/Zend/Db/Statement.php(115):
>Zend_Db_Statement_Db2->_prepare('INSERT INTO "gu...')
>#1 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Db2.php(230):
>Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Db2), 'INSERT INTO
>"gu...')
>#2 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(467):
>Zend_Db_Adapter_Db2->prepare('INSERT INTO "gu...')
>#3 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(546):
>Zend_Db_Adapter_Abstract->query('INSERT INTO "gu...', Array)
>#4 /usr/local/Zend/ZendFramework/library/Zend/Db/Table/Abstract.php(1056):
>Zend_Db_Adapter_Abstract->insert('guestbook', Array)
>#5
>/www/zendcore/htdocs/quickstart/application/models/GuestbookMapper.php(69):
>Zend_Db_Table_Abstract->insert(Array)
>#6 /www/zendcore/htdocs/quickstart/application/models/Guestbook.php(224):
>Default_Model_GuestbookMapper->save(Object(Default_Model_Guestbook))
>#7
>/www/zendcore/htdocs/quickstart/application/controllers/GuestbookController.php(59):
>Default_Model_Guestbook->save()
>#8 /usr/local/Zend/ZendFramework/library/Zend/Controller/Action.php(513):
>GuestbookController->signAction()
>#9
>/usr/local/Zend/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(289):
>Zend_Controller_Action->dispatch('signAction')
>#10 /usr/local/Zend/ZendFramework/library/Zend/Controller/Front.php(946):
>Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
>Object(Zend_Controller_Response_Http))
>#11
>/usr/local/Zend/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(77):
>Zend_Controller_Front->dispatch()
>#12 /usr/local/Zend/ZendFramework/library/Zend/Application.php(358):
>Zend_Application_Bootstrap_Bootstrap->run()
>#13 /www/zendcore/htdocs/quickstart/public/index.php(28):
>Zend_Application->run()
>#14 {main}
>Any guggestion?
>Thanks a lot
>
>
>
>--
>View this message in context: http://zend-framework-community.634137.n4.nabble.com/zf-accessing-db2-table-on-system-i-tp2226165p2226165.html
>Sent from the Zend DB mailing list archive at Nabble.com.
>
>
>
>______________________________________
>View message @ http://zend-framework-community.634137.n4.nabble.com/zf-accessing-db2-table-on-system-i-tp2226165p2226287.html
>
>To unsubscribe from zf:accessing db2 table on system i, click <Link Removed>




View this message in context: RE: AW: [fw-db] zf:accessing db2 table on system i
Sent from the Zend DB mailing list archive at Nabble.com.

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

Can this help?

http://blog.hackix.com/2010/01/bootstrapping-zend_translate-with-a-langselector-plugin/

 

 

Från: sina miandashti [mailto:miandashti@gmail.com]
Skickat: den 19 maj 2010 14:12
Till: dbenjamin
Kopia: fw-mvc@lists.zend.com
Ämne: Re: [fw-mvc] Re: Language in URL: always a particular case !

 

any solution for this  pl z...

On Wed, May 19, 2010 at 4:34 PM, dbenjamin <bd.webdev@gmail.com> wrote:

Hello,

 

Thank you all for your help, but i think it's definitly not possible with Zend to have correct routes with language. I'm really stuck with that :(

 

The Zend Cast tutorial has exactly the same issue, because it works only with default module, try to follow the tutorial, create a module "admin" for example, and then go to the : /en/admin/ or /en/admin/index, it will throw : "0: Invalid controller specified (admin)".

 

I just can't see any solution here.

 

 

br,

Benjamin.

 

 

2010/5/3 Damián Farina [via Zend Framework Community] <[hidden email]>

dbenjamin (2010-04-27):


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

 

Hi Benjamin, this (1) screen cast helped me a lot when dealing with languages.
Hope it helps the way it did for me.

(1) http://www.zendcasts.com/introducing-zend_translate/2009/11/


Slds!


--
Damián Farina
XoomCode


View message @ http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2124425.html
To unsubscribe from Language in URL: always a particular case !, click here.

 

 

 


View this message in context: Re: Language in URL: always a particular case !


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




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

2010年5月23日星期日

[fw-mvc] send file to browser?

hi

is zf have any method in classes for sending file to browser for downloading ?

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

2010年5月21日星期五

Re: [fw-mvc] Bootstrapping action helpers

Thanks, Abraham. Sometimes the simplest solution is the bestest. :)

--
Hector


On Fri, May 21, 2010 at 10:49 AM, Abraham Block <atblock@gmail.com> wrote:
Can't guarantee that this is "recommended", but I usually opt for something like #3


On Fri, May 21, 2010 at 1:47 PM, Hector Virgen <djvirgen@gmail.com> wrote:
Is there a recommended approach for bootstrapping action helpers? I like that I can bootstrap plugins using the front controller resource, but it doesn't seem to support action helpers.

Some of the ideas in mind are:
  1. Bootstrapping a plugin that loads the action helpers.
  2. Extending the front controller resource to support helper names in application.ini.
  3. Adding an _initActionHelpers method to my bootstrap.
Any other ideas that I might be overlooking? Thanks!

--
Hector


Re: [fw-mvc] Bootstrapping action helpers

Can't guarantee that this is "recommended", but I usually opt for something like #3

On Fri, May 21, 2010 at 1:47 PM, Hector Virgen <djvirgen@gmail.com> wrote:
Is there a recommended approach for bootstrapping action helpers? I like that I can bootstrap plugins using the front controller resource, but it doesn't seem to support action helpers.

Some of the ideas in mind are:
  1. Bootstrapping a plugin that loads the action helpers.
  2. Extending the front controller resource to support helper names in application.ini.
  3. Adding an _initActionHelpers method to my bootstrap.
Any other ideas that I might be overlooking? Thanks!

--
Hector

[fw-mvc] Bootstrapping action helpers

Is there a recommended approach for bootstrapping action helpers? I like that I can bootstrap plugins using the front controller resource, but it doesn't seem to support action helpers.

Some of the ideas in mind are:
  1. Bootstrapping a plugin that loads the action helpers.
  2. Extending the front controller resource to support helper names in application.ini.
  3. Adding an _initActionHelpers method to my bootstrap.
Any other ideas that I might be overlooking? Thanks!

--
Hector

AW: [fw-db] zf:accessing db2 table on system i

Hi Sante,

you should not use the Db2 Adapter from Zend Framework, but the one which was especially created for System i. You can find it in the ZendC folder next to the ZF library. More information can be found here in Appendix H:
http://static.zend.com/topics/Zend-Core-User-Guide-i5OS-V261.pdf

Regards,
Jan

-----Ursprüngliche Nachricht-----
Von: sante [mailto:sante_malatesta@codexroma.it]
Gesendet: Freitag, 21. Mai 2010 15:44
An: fw-db@lists.zend.com
Betreff: [fw-db] zf:accessing db2 table on system i


Hi all!
I'm trying to work with ZF, so I've downloaded the quickstart tutorial from
the web. My installation is on system ibm i os/v5r4 and my database is
(obviously) db2. I've changed the tutorial in order that it can deal with
this database. Actually connection to the database works and I can get
metadata from any table. But there is a big problem. When the script attemps
to access a db2 table (namely the "save" function of GuestbookMapper.php for
signAction of the controller) I get the following error message:
An error occurred
Application error
#0 /usr/local/Zend/ZendFramework/library/Zend/Db/Statement.php(115):
Zend_Db_Statement_Db2->_prepare('INSERT INTO "gu...')
#1 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Db2.php(230):
Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Db2), 'INSERT INTO
"gu...')
#2 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(467):
Zend_Db_Adapter_Db2->prepare('INSERT INTO "gu...')
#3 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(546):
Zend_Db_Adapter_Abstract->query('INSERT INTO "gu...', Array)
#4 /usr/local/Zend/ZendFramework/library/Zend/Db/Table/Abstract.php(1056):
Zend_Db_Adapter_Abstract->insert('guestbook', Array)
#5
/www/zendcore/htdocs/quickstart/application/models/GuestbookMapper.php(69):
Zend_Db_Table_Abstract->insert(Array)
#6 /www/zendcore/htdocs/quickstart/application/models/Guestbook.php(224):
Default_Model_GuestbookMapper->save(Object(Default_Model_Guestbook))
#7
/www/zendcore/htdocs/quickstart/application/controllers/GuestbookController.php(59):
Default_Model_Guestbook->save()
#8 /usr/local/Zend/ZendFramework/library/Zend/Controller/Action.php(513):
GuestbookController->signAction()
#9
/usr/local/Zend/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(289):
Zend_Controller_Action->dispatch('signAction')
#10 /usr/local/Zend/ZendFramework/library/Zend/Controller/Front.php(946):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http))
#11
/usr/local/Zend/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(77):
Zend_Controller_Front->dispatch()
#12 /usr/local/Zend/ZendFramework/library/Zend/Application.php(358):
Zend_Application_Bootstrap_Bootstrap->run()
#13 /www/zendcore/htdocs/quickstart/public/index.php(28):
Zend_Application->run()
#14 {main}
Any guggestion?
Thanks a lot

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/zf-accessing-db2-table-on-system-i-tp2226165p2226165.html
Sent from the Zend DB mailing list archive at Nabble.com.

[fw-db] zf:accessing db2 table on system i

Hi all!
I'm trying to work with ZF, so I've downloaded the quickstart tutorial from
the web. My installation is on system ibm i os/v5r4 and my database is
(obviously) db2. I've changed the tutorial in order that it can deal with
this database. Actually connection to the database works and I can get
metadata from any table. But there is a big problem. When the script attemps
to access a db2 table (namely the "save" function of GuestbookMapper.php for
signAction of the controller) I get the following error message:
An error occurred
Application error
#0 /usr/local/Zend/ZendFramework/library/Zend/Db/Statement.php(115):
Zend_Db_Statement_Db2->_prepare('INSERT INTO "gu...')
#1 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Db2.php(230):
Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Db2), 'INSERT INTO
"gu...')
#2 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(467):
Zend_Db_Adapter_Db2->prepare('INSERT INTO "gu...')
#3 /usr/local/Zend/ZendFramework/library/Zend/Db/Adapter/Abstract.php(546):
Zend_Db_Adapter_Abstract->query('INSERT INTO "gu...', Array)
#4 /usr/local/Zend/ZendFramework/library/Zend/Db/Table/Abstract.php(1056):
Zend_Db_Adapter_Abstract->insert('guestbook', Array)
#5
/www/zendcore/htdocs/quickstart/application/models/GuestbookMapper.php(69):
Zend_Db_Table_Abstract->insert(Array)
#6 /www/zendcore/htdocs/quickstart/application/models/Guestbook.php(224):
Default_Model_GuestbookMapper->save(Object(Default_Model_Guestbook))
#7
/www/zendcore/htdocs/quickstart/application/controllers/GuestbookController.php(59):
Default_Model_Guestbook->save()
#8 /usr/local/Zend/ZendFramework/library/Zend/Controller/Action.php(513):
GuestbookController->signAction()
#9
/usr/local/Zend/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(289):
Zend_Controller_Action->dispatch('signAction')
#10 /usr/local/Zend/ZendFramework/library/Zend/Controller/Front.php(946):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http))
#11
/usr/local/Zend/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(77):
Zend_Controller_Front->dispatch()
#12 /usr/local/Zend/ZendFramework/library/Zend/Application.php(358):
Zend_Application_Bootstrap_Bootstrap->run()
#13 /www/zendcore/htdocs/quickstart/public/index.php(28):
Zend_Application->run()
#14 {main}
Any guggestion?
Thanks a lot

--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/zf-accessing-db2-table-on-system-i-tp2226165p2226165.html
Sent from the Zend DB mailing list archive at Nabble.com.

2010年5月19日星期三

Re: [fw-mvc] regular expression ? where to start

This is a good slideshow on Regex's called a "Regex Clinic" by Andrei Zmievski. Apparently he has been developing this clinic for years.

Its 236 slides and it has good number of views and comments.
 

http://www.slideshare.net/andreizm/andreis-regex-clinic



On Wed, May 19, 2010 at 10:04 AM, David Mintz <david@davidmintz.org> wrote:


On Tue, May 18, 2010 at 11:30 PM, Bill Chmura <Bill@explosivo.com> wrote:

If you like books, there is one called "Mastering Regular Expressions" from O'Rielly...  You could find the same info online, but if you like a dead tree format to take with you - that would be my vote.


And if you like to experiment and want instant gratification, though it isn't exactly the same as PCRE, you can run Javascript snippets in the Firebug console

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

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