Re: [fw-general] Filter question

2009-01-26 Thread Moritz Mertinkat
Hi Jan,

you don't need two filter classes for compression and decompression, but it
might be easier for others to see what your filter is doing.

If you're going to put compression and decompression into one filter you could
use the constructor to tell it what to do. Or any other method you'd like.

For a start have a look at the existing filters under Zend/Filter/.
There are also some that take additional arguments either through the
constructor or other methods.

Regards,
Maurice.

Jan Pieper schrieb:
 Hi guys,
 
 I am working on a new proposal to compress and uncompress data. I want to use 
 Zend_Filter_Interface as base. Do I have to create two filter classes to 
 compress and uncompress or is there a way I can use only one class? For 
 example using a set-method to say whether I want to compress or uncompress 
 the data? I think I have to create two classes, right?
 
 =
 
 Jan Pieper
 Entwicklung
 
 Tel: +49 22 33 - 612 - 3606
 Fax: +49 22 33 - 612 - 53606
 E-Mail: j.pie...@plusserver.de
 
 PlusServer AG
 Daimlerstraße 9-11
 50354 Hürth
 Germany
 
 HRB 58428 / Amtsgericht Köln, USt-ID DE216 740 823
 Vorstand: Jochen Berger, Frank Gross, Jan Osthues, Thomas Strohe
 Aufsichtsratsvorsitz: Claudius Schmalschläger
 
 =
 
 GPG-Key: 0x025A5521
 GPG-FPR: A15D 24E8 9BDB 3A62 2AE9  FD46 0260 F33A 025A 5521



[fw-general] Any news about Google Maps ?

2009-01-26 Thread Michel Morelli
Hi all. I need to implement Google Maps into one ZF application site. 
But I have read onto manual that Google Maps is not supported via GData.

Have someone some link on how integrate GMaps and ZF without GData ?

Tnx.

--
Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net ICQ: 58351764  
http://www.ziobuddalabs.it  Skype: zio_budda
http://www.ajaxblog.it			MSN: mic...@ziobuddalabs.it   
		JABBER: mic...@gmail.com




[fw-general] Re: How to use Image based Captcha?

2009-01-26 Thread Deepak Shrestha
Hi,

I found out that image is being generated. Also because of
$captchaimg-generate(); command its being generated twice.
So I replaced the 'generate()' with $captchaimg-setWordlen('5');

Now I can see that every time I display the form page, new image is
generated in the 'captcha/images' folder (which are valid images) but
its not displayed inside the form.

What is wrong?

Thanks


-- 
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===


[fw-general] Contributor License Agreement Submissions

2009-01-26 Thread Werner

Hi

I sent a request (containing a signed CLA) to c...@zend.com about 10 days 
ago, but I still haven't received any reply yet. I tried to follow the 
information on 
http://framework.zend.com/wiki/display/ZFPROP/Contributor+License+Agreement 
to the letter... is the information on there outdated, or has the 
submission process maybe been changed in the mean time?


Kind Regards,
Werner


Re: [fw-general] Any news about Google Maps ?

2009-01-26 Thread Mark Wright
I think that google maps is probably outside the scope of ZF. Look at
http://openlayers.org/ It is a js library.


Mark

On Mon, Jan 26, 2009 at 1:51 AM, Michel Morelli mic...@ziobuddalabs.it wrote:
 Hi all. I need to implement Google Maps into one ZF application site. But I
 have read onto manual that Google Maps is not supported via GData.
 Have someone some link on how integrate GMaps and ZF without GData ?

 Tnx.

 --
 Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
 Consulenza sistemistica in ambito OpenSource.
 Sviluppo applicazioni web dinamiche (LAMP+Ajax)
 Telefono: 0200619074
 Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

 http://www.ziobudda.net ICQ: 58351764
  http://www.ziobuddalabs.it  Skype: zio_budda
 http://www.ajaxblog.it  MSN: mic...@ziobuddalabs.it
  JABBER:
 mic...@gmail.com





-- 
Have fun or die trying - but try not to actually die.


[fw-general] SQL_CALC_FOUND_ROWS with Zend_Db_Select

2009-01-26 Thread Colin Guthrie

Hi,

Is there a way to inject this into SELECT statements?

This is typically very useful when paging and getting the correct number 
of results without having to re-run the query twice once with and once 
without the LIMIT/OFFSET components.


e.g. SELECT SQL_CALC_FOUND_ROWS * from blah LIMIT 10 OFFSET 10;

then SELECT FOUND_ROWS();



If this is something that would be accepted into ZF upstream, then I'll 
happily code it. It's more or less the same as $select-distinct($flag) 
function call. The select found rows things could be left to the user.


So, I'm just asking if this would be accepted? If not I'll try and work 
out another way of achieving the same result without hacking ZF.


Col



--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



Re: [fw-general] SQL_CALC_FOUND_ROWS with Zend_Db_Select

2009-01-26 Thread Dennis Becker
This is slower in comparison with a 2nd SELCT COUNT(PRIMARY_KEY_COLUMN)
FROM blah - look at
http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/

Regards,
Dennis

On Mon, Jan 26, 2009 at 11:12 AM, Colin Guthrie gm...@colin.guthr.iewrote:

 Hi,

 Is there a way to inject this into SELECT statements?

 This is typically very useful when paging and getting the correct number of
 results without having to re-run the query twice once with and once without
 the LIMIT/OFFSET components.

 e.g. SELECT SQL_CALC_FOUND_ROWS * from blah LIMIT 10 OFFSET 10;

 then SELECT FOUND_ROWS();



 If this is something that would be accepted into ZF upstream, then I'll
 happily code it. It's more or less the same as $select-distinct($flag)
 function call. The select found rows things could be left to the user.

 So, I'm just asking if this would be accepted? If not I'll try and work out
 another way of achieving the same result without hacking ZF.

 Col



 --

 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/

 Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
 Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




-- 
Dennis Becker   bec...@sipgate.de
Telefon:+49 (0) 211-63 55 55-97
Telefax:+49 (0) 211-63 55 55-22

sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf
HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois
Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391

www.sipgate.de - www.sipgate.at - www.sipgate.co.uk


[fw-general] Re: SQL_CALC_FOUND_ROWS with Zend_Db_Select

2009-01-26 Thread Colin Guthrie

'Twas brillig, and Dennis Becker at 26/01/09 10:54 did gyre and gimble:
This is slower in comparison with a 2nd SELCT COUNT(PRIMARY_KEY_COLUMN) 
FROM blah - look 
at http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/


An interesting, if not always accurate (according to the comments) analysis.

In some cases tho', due to the kind of select statement your running 
you'd have to do:



$select-reset(Zend_Db_Select::COLUMNS);
$select-reset(Zend_Db_Select::GROUP);
$select-reset(Zend_Db_Select::ORDER);
$select-columns(new Zend_Db_Expr('COUNT(DISTINCT 
table.pri_key_col)'));


Depending on the use case, it could be faster/slower than the 
calc_found_rows technique. I always heard that with innodb that select 
count(*)'s were pretty inefficient anyway, but perhaps that no longer 
holds true.


Either way, it's actually very simple to support this in Zend_Db_Select 
(I've already coded it up in an extended class), so I'll submit the 
patch upstream for inclusion in a future ZF release anyway.


Cheers

Col


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



Re: [fw-general] Amf ZF-5094 and ZF-5388

2009-01-26 Thread Dirk Thomas

Hi Tobias,

i reposted this message since the last one was not relayed - probably
because of the attachment.

I looked into the file branches/release-1.7/tests/Zend/Amf/ServerTest.php.

First of all the method testDown should be renamed in tearDown.

I have appended a file with some additions to the Amf-ServerTest.
Copy  paste the methods
Zend_Amf_ServerTest::testDispatchingMethodShouldPassInvocationArgumentsToMethodFromNetConnection
and Zend_Amf_testclass::checkStringArgv to the existing classes.

Without my described fix the special assertion will fail with the message
All arguments are wrongly wrapped inside an array.

Since this is my first test for ZF please be forgiving...

Best regards,
Dirk

-- 

class Zend_Amf_ServerTest extends PHPUnit_Framework_TestCase
{

public function tearDown()
{
unset($this-_server);
}

public function
testDispatchingMethodShouldPassInvocationArgumentsToMethodFromNetConnection()
{
// serialize the data to an AMF output stream
$data[] = baz;
$this-_server-setClass('Zend_Amf_testclass', '', 'foo', 'bar');

$source= 'Zend_Amf_testclass';
$operation = 'checkStringArgv';

// create a mock message body to place th remoting message inside
$newBody = new Zend_Amf_Value_MessageBody($source.'.'.$operation,
/1 ,$data);
$request = new Zend_Amf_Request();

// at the requested service to a request
$request-addAmfBody($newBody);
$request-setObjectEncoding(0x03);

// let the server handle mock request
$result = $this-_server-handle($request);
$bodies = $result-getAmfBodies();
$found  = false;
foreach ($bodies as $body) {
$data  = $body-getData();
if ('baz:foo:bar' == $data) {
$found = true;
break;
}
else if ('Array:foo:bar' == $data) {
$this-assertTrue(false, 'All arguments are wrongly wrapped
inside an array');
}
}
$this-assertTrue($found, 'Valid response not found');
}

}

class Zend_Amf_testclass
{

public function checkStringArgv($message)
{
$argv = func_get_args();
$args = array();
foreach ($argv as $arg) {
  $args[] = (string)$arg;
}
return implode(':', $args);
}

}

-- 
View this message in context: 
http://www.nabble.com/Amf-ZF-5094-and-ZF-5388-tp21624321p21665189.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Dojo - javascript error in generated layout elements

2009-01-26 Thread LesTR

hello!

I have a problem with Zend_Dojo.

Trying example from
http://framework.zend.com/manual/en/zend.dojo.view.html#zend.dojo.view.dijit.layout.borderexample
but browser ends with an error:
[Exception... 'Error: Tried to register widget with id==masterLayout but
that id is already registered' when calling method:
[nsIDOMEventListener::handleEvent] nsresult: 0x8057001c
(NS_ERROR_XPC_JS_THREW_JS_OBJECT) location: unknown data: no]

Element with id masterLayout is unique.

Layout helpers generate imho corectly dojo code, like this:
dojo.addOnLoad(function() {
dojo.forEach(zendDijits, function(info) {
var n = dojo.byId(info.id);
if (null != n) {
dojo.attr(n, dojo.mixin({ id: info.id }, info.params));
}
});
dojo.parser.parse();
});
var zendDijits =
[{id:topPane,params:{region:top,dojoType:dijit.layout.ContentPane}},{id:mainPane,params:{region:center,dojoType:dijit.layout.ContentPane}},{id:masterLayout,params:{design:headline,dojoType:dijit.layout.BorderContainer}}
 
etc for all elements ...


Value of Zend_Dojo_View_Helper_Dojo::$_useProgrammatic is default from ZF
distribution.
Problem disappears whe i call
Zend_Dojo_View_Helper_Dojo::setUseDeclarative(); in init method of
controller. I'd like to use but
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic(1); - page isn't valid in
declaration mode etc

I do something wrong?
Code in view script is the same as an example.

This is my inicialize dojo:
class DefaultController extends Zend_Controller_Action
{
public function init()
{
Zend_Dojo::enableView($this-view);
$this-view-dojo()
-enable()
-setLocalPath('/shared/scripts/dojo/dojo.js')
-setDjConfig(
array(
'parseOnLoad' = 'true',
'locale' = 'cs',
'usePlainJson' = 'true'
)
);
//[...]
}
}

In layout script have it:
head
[...]
if($this-dojo()-isEnabled()){
$this-dojo()-addStyleSheetModule('dijit.themes.tundra');
echo $this-dojo();
}
/head

Version of Zend Framework: 1.7.3
Version of Dojo: 1.2.3 (But it's the same with 1.2.X)

Thank you for any advice.
-- 
View this message in context: 
http://www.nabble.com/Zend_Dojo---javascript-error-in-generated-layout-elements-tp21665233p21665233.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] making global view variables visible to view helpers

2009-01-26 Thread David Mintz
On Fri, Jan 23, 2009 at 5:51 PM, Matthew Weier O'Phinney
matt...@zend.comwrote:

 -- David Mintz vtbludg...@gmail.com wrote
 (on Friday, 23 January 2009, 05:06 PM -0500):
 
 
  On Fri, Jan 23, 2009 at 4:36 PM, Matthew Weier O'Phinney 
 matt...@zend.com
  wrote:
 
  -- David Mintz da...@davidmintz.org wrote
  (on Friday, 23 January 2009, 04:14 PM -0500):
   I have view variables that I want to be set in every view instance
 --
  things
   like paths to public resources. So I have been doing something
 stolen
  from an
   example somewhere a long while ago:
  
   $view = new Zend_View;
   $view-web_root =
 Zend_Registry::get('siteConfig')-paths-web_root;
   if (Zend_Auth::getInstance()-hasIdentity()) {
   $view-user = Zend_Auth::getInstance()-getIdentity();
   }
   // etc
   $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
   $viewRenderer-setView($view);
   Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 
  Try changing the above three lines to this, and see if it makes any
  difference:
 
 $viewRenderer =
 Zend_Controller_Action_HelperBroker::getStaticHelper
  ('viewRenderer')
 $viewRenderer-setView($view);
 
 
 
  Same story. e.g., I stick this stdClass $user object in the view in my
  bootstrap, and can dump it in the view, but the helper doesn't see it.
 How do
  people deal with this? It's got to be a common scenario. I suppose I
 could pass
  whatever to the helper as args to the helper call.
 
  Would it make a difference if I set these view vars in a plugin? Hmm I
 think
  I'll try and see for myself...

 Shouldn't make a difference. The other possibility is that it's an issue
 in your helper. Are you extending Zend_View_Helper_Abstract? That class
 provides a setView() implementation, which will ensure that $this-view
 is available in your helper.


This is the whole thing, except I deleted the body of the one function for
brevity.

$this-view is in fact set and available to the helper, but, as I say,
$this-view does not see the vars I set in the bootstrap. Makes me think
it's either not a ref to the same object, or else this stuff with
$this-view is executing before the assignment stuff in the bootstrap -- not
likely.

class  Zend_View_Helper_RequestStatus extends Zend_View_Helper_Abstract {

public function RequestStatus($event_id) {
// echo empty($this-view-user) ?  ... no user ...  :  ... yes
user ...;
   // do things, and return an informative string instead of a digit
}

}
}
}


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

The subtle source is clear and bright
The tributary streams flow through the darkness


[fw-general] AjaxContext and Array

2009-01-26 Thread Michel Morelli

Hi all.

I'm reading Zend Framework in action and for the Ajax context there is 
write to insert this lines in the init() controller's function:


   $ajaxContent = $this-_helper-getHelper('AjaxContext');
   $ajaxContent-addActionContext('myAction','json');
   $ajaxContent-initContext();

Now It works when I need to send (via ajax response) an HTML code, but 
If I need to send an Array  like :


$arr = array('code' = 0,
'msg' = 'Attivazione effettuata'
);

How this ?

In the book (page 106) there is example (feedback.json.pthml):

?php
   echo get_object_vars($this);
?

But I don't understand why it does not work for me. When I call a simil 
function I receive the entire layout. Where is my error ?.


M.

--
Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net ICQ: 58351764  
http://www.ziobuddalabs.it  Skype: zio_budda
http://www.ajaxblog.it			MSN: mic...@ziobuddalabs.it   
		JABBER: mic...@gmail.com




[fw-general] zend_db : where ( X OR Y) and not where (X) OR (Y)

2009-01-26 Thread Michel Morelli

Hi all. I have this code:

   $select-from(array('a' = 'ads'),array( 'a.id_ad', 'a.title', 
'a.insert_date', 'a.id_status', 'i.image'))

   -join(array('i' = 'images'), 'a.id_ad = i.id_ad')
   -where('a.id_company = ?',$user-id_company)
   -where('a.id_status = 1')
   -orWhere('a.id_status = 2')
   -where('i.mainImage = 1')
   -order('a.id_ad desc')
   ;

The resultant select query is :

SELECT `a`.`id_ad`, `a`.`title`, `a`.`insert_date`, `a`.`id_status`, 
`i`.`image`, `i`.* FROM `ads` AS `a`
INNER JOIN `images` AS `i` ON a.id_ad = i.id_ad WHERE (a.id_company = '1') AND 
(a.id_status = 1) OR (a.id_status = 2) AND (i.mainImage = 1) ORDER BY 
`a`.`id_ad` desc


But the where that I want (for a.id_status elements) is :  
(a.id_status = 1 OR a.id_status = 2)  [now is   (a.id_status = 1) OR 
(a.id_status = 2)  ]


How can I do it ?

M.

--
Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net ICQ: 58351764  
http://www.ziobuddalabs.it  Skype: zio_budda
http://www.ajaxblog.it			MSN: mic...@ziobuddalabs.it   
		JABBER: mic...@gmail.com




RE: [fw-general] Re: How to use Image based Captcha?

2009-01-26 Thread Terre Porter

How are you displaying the form and captcha image in your view?

-Original Message-
From: Deepak Shrestha [mailto:d88...@gmail.com] 
Sent: Monday, January 26, 2009 4:07 AM
To: fw-general@lists.zend.com
Subject: [fw-general] Re: How to use Image based Captcha?

Hi,

I found out that image is being generated. Also because of
$captchaimg-generate(); command its being generated twice.
So I replaced the 'generate()' with $captchaimg-setWordlen('5');

Now I can see that every time I display the form page, new image is
generated in the 'captcha/images' folder (which are valid images) but its
not displayed inside the form.

What is wrong?

Thanks


--
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===



[fw-general] Problem with fetchAll of Table with Primary Keys as pair

2009-01-26 Thread atay

I have Table 
Categories_Products
{
   cat_id int
   prod_id int
   primary key (cat_id, prod_id)
}

and the class:

class Prodcat extends Zend_Db_Table  {

protected $_name = 'Categories_Products';
protected $_primary = array(prod_id, cat_id);
.

or without protected $_primary, no diffrence.

And now when I'm going to 
$pc = new Prodcat();
$where = $pc-getAdapter()-quoteInto(cat_id IN (?), explode(|,
$list));
$temp = $pc-fetchAll($where);


if THERE'S RECORDS FOUND IT'S GOOD, no problem, everything is working
excelent, but if there is NOT matching record in my database (there is no
records with cat_id from list) I got very bad error. 

I will write AGAIN, the error is ONLY when no records found.

Very bad error:
Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message
'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near '))' at line 1' in
D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Statement\Pdo.php:238 Stack
trace: #0
D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Statement.php(283):
Zend_Db_Statement_Pdo-_execute(Array) #1
D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Adapter\Abstract.php(430):
Zend_Db_Statement-execute(Array) #2
D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Adapter\Pdo\Abstract.php(220):
Zend_Db_Adapter_Abstract-query(Object(Zend_Db_Table_Select), Array) #3
D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Table\Abstract.php(1330):
Zend_Db_Adapter_Pdo_Abstract-query(Object(Zend_Db_Table_Select)) #4
D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Table\Abstract.php(1158):
Zend_Db_Table_Abstract-_fetch(Object(Zend_Db_Table_Select)) #5 D:\progs\Ver
in D:\progs\VertrigoServ\www\cudny\library\Zend\Db\Statement\Pdo.php on line
238


What can I do ? Can anyone help ? Can anyone know why it happen ?
-- 
View this message in context: 
http://www.nabble.com/Problem-with-fetchAll-of-Table-with-Primary-Keys-as-pair-tp21670110p21670110.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Best practice for sorting a rowset

2009-01-26 Thread Vince42
Hi,

I need to sort a rowset that is fetched by findDependentRowset() ... i
read that this feature will never be implemented according to ZF-1182
(?) and that there are suggestions to work around it via
array_multisort() or usort() ... so what is the best practice for doing so?

-- 
Cheers,\\|//
Vince  (o o)
ooO-(_)-Ooo-
 '''   (o)_(o)[ ][0][ ]
 ô¿ô   (=°o°=)   World Domination by Copy and Paste   [ ][ ][0]
  -()_()[0][0][0]

 ()  ascii ribbon campaign - against html e-mail
 /\  www.asciiribbon.org   - against proprietary attachments
   Ooo.
---.ooO(  )-
   (  )(_/
\_)



signature.asc
Description: OpenPGP digital signature


[fw-general] Favorite CLI for a framework?

2009-01-26 Thread Wil Sinclair
As everyone should know by now :), we're focusing heavily on RAD tools
in the 1.8 release. So that we can design the best CLI interface
possible, we'd like to know if anyone has had experience with the CLI's
for other frameworks. Frameworks such as Ruby on Rails, Django, CakePHP,
Symfony, etc. If so, what did you like/dislike about them?

Thanks for any feedback!
,Wil


Re: [fw-general] Best practice for sorting a rowset

2009-01-26 Thread keith Pope
The third parameter takes a Zend_Db_Select object, it does not seem to
be reflected in the docs though but is in the source.

2009/1/26 Vince42 z...@vineal.de:
 Hi,

 I need to sort a rowset that is fetched by findDependentRowset() ... i
 read that this feature will never be implemented according to ZF-1182
 (?) and that there are suggestions to work around it via
 array_multisort() or usort() ... so what is the best practice for doing so?

 --
 Cheers,\\|//
 Vince  (o o)
 ooO-(_)-Ooo-
  '''   (o)_(o)[ ][0][ ]
  ô¿ô   (=°o°=)   World Domination by Copy and Paste   [ ][ ][0]
  -()_()[0][0][0]

  ()  ascii ribbon campaign - against html e-mail
  /\  www.asciiribbon.org   - against proprietary attachments
   Ooo.
 ---.ooO(  )-
   (  )(_/
\_)





-- 
--
[MuTe]
--


Re: [fw-general] zend_db : where ( X OR Y) and not where (X) OR (Y)

2009-01-26 Thread Michel Morelli

Terre Porter ha scritto:

Easiest way I found, when I needed something similar.

-where('a.id_status = 1 OR a.id_status = 2')
  

This is my solution, too. But I ask myself if there is some better
solution, because where() second parameter's type is string so I can
not do this:

-where('a.id_stauts = ? OR a.id_status = ?, array(1,2));

However, tnx for the help.

M.

--
Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net ICQ: 58351764
http://www.ziobuddalabs.it  Skype: zio_budda
http://www.ajaxblog.it			MSN: mic...@ziobuddalabs.it 


JABBER: mic...@gmail.com



Re: [fw-general] Problem with fetchAll of Table with Primary Keys as pair

2009-01-26 Thread atay

ok, I resolve my problem.

The problem was that $list hasn't no value so SQL was cat_id IN () so
wasn't values in ().

I got it finally :)
-- 
View this message in context: 
http://www.nabble.com/Problem-with-fetchAll-of-Table-with-Primary-Keys-as-pair-tp21670110p21674250.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] zend_db : where ( X OR Y) and not where (X) OR (Y)

2009-01-26 Thread Mark Wright
Zend_Db_Adapter_Abstract::quoteInto() takes a mixed value for the
second argument. I've not tried it but it looks like you could do
this:
-where($db-quoteInto('a.id_status = ? OR a.id_status = ?',array(1,2)));

Otherwise, it may be sloppy, but you could do
-where($db-quoteInto('a.id_status = ?',1) . ' OR ' .
$db-quoteInto('a.id_status = ?',2));

On Mon, Jan 26, 2009 at 3:46 PM, Michel Morelli mic...@ziobuddalabs.it wrote:
 Terre Porter ha scritto:

 Easiest way I found, when I needed something similar.

 -where('a.id_status = 1 OR a.id_status = 2')


 This is my solution, too. But I ask myself if there is some better
 solution, because where() second parameter's type is string so I can
 not do this:

 -where('a.id_stauts = ? OR a.id_status = ?, array(1,2));

 However, tnx for the help.

 M.

 --
 Michel 'ZioBudda' Morelli   mic...@ziobuddalabs.it
 Consulenza sistemistica in ambito OpenSource.
 Sviluppo applicazioni web dinamiche (LAMP+Ajax)
 Telefono: 0200619074
 Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

 http://www.ziobudda.net ICQ: 58351764
 http://www.ziobuddalabs.it  Skype: zio_budda
 http://www.ajaxblog.it  MSN: mic...@ziobuddalabs.it
JABBER: mic...@gmail.com





-- 
Have fun or die trying - but try not to actually die.


[fw-general] mod_rewrite and SSL

2009-01-26 Thread spaceage

I'm somewhat new to mod_rewrite and am hoping somebody here has already
solved this problem.

I use an .htaccess in my root dir as follows:

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|swf|xml|avi|flv|mov|mp3|wav|pdf)$
index.php

I want to add another condition which requires/forwards to https for any
request which has a URI of /checkout.

I have full access to the apache server, so I can insert any directives
necessary...

Is it possible to chain the two conditions (the one I am running for the
front controller above + the new /checkout forward to https) in the
.htaccess file, or does one (or both) of the conditions need to be in a
Directory or VirtualHost block?  Or maybe a Location block for
/checkout?

TIA!
-- 
View this message in context: 
http://www.nabble.com/mod_rewrite-and-SSL-tp21677891p21677891.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Form or Captcha bug?

2009-01-26 Thread Deepak Shrestha
Hi,

Didn't get any help from my last post so I went through documentation
and tried to understand as much I can but can't find a way to display
captcha image in Zend_Form using default behavior of Zend Framework's
MVC. AFAIK (with my current knowledge), my code is correct.

This is the code snippet in  my [application/forms/myform.php]
===

//first create an image type captcha
$captchaimg = New Zend_Captcha_Image('captchaimg');
$captchaimg-setFont(../application/captcha/fonts/tahoma.ttf);
$captchaimg-setImgDir(../application/captcha/images);
$captchaimg-setImgUrl(../application/captcha/images);
$captchaimg-setWordlen('6');

//create user input for captcha and include the captchaimg in form
$adcaptcha = New Zend_Form_Element_Captcha('adcaptcha', array(
'captcha' = $captchaimg));
$adcaptcha-setLabel('Please enter the 5 letters displayed below:');
$adcaptcha-setRequired(true);
$adcaptcha-addErrorMessage('Entered value did not match with
displayed image.');

$this-addElements( array($adcaptcha));
=

My view script:

?= $this-form ?



dirctory structure for captcha image is:
=
application
- captcha
- fonts
- images (for genreated images)
=


My Observation
===
1. There is no captcha image when form renders. However, I can see
image being generated in 'application/captcha/images' folder.

2. Trying to post the empty form (expecting that my custom error
message will be displayed) gives me empty error message string with
just a round bullet list in the captcha section but other text input
fields show the correct error messages.

3. Using view source in the browser, i got this about captcha

*
dd
img alt= 
src=../application/captcha/images/641aa987b887cbefb441f33e194a45b9.png/br/
input type=hidden name=adcaptcha[id]
value=641aa987b887cbefb441f33e194a45b9 helper=formText
id=adcaptcha-id /
input type=text name=adcaptcha[input] id=adcaptcha-input
value= helper=formText //dd

**
===


My Questions:

1. The image url was passed to the brower but why it didn't get
rendered in the form?
2. Is this the bug or feature? If it is the feature, how do I make the
image appear in my form using the code I have posted above? what are
the additional things I need to consider?



Partial answer (best guess) to my own question:

1. Probably form is forgetting to call some default rendering function
of Zend_Captcha to render it (or ???).  However custom approach (with
custom form) as shown in zend documentation
[http://framework.zend.com/manual/en/zend.captcha.operation.html] and
the one I found in recent blog [http://www.tfountain.co.uk/] works
because it explicitly calls echo $captcha-render($view); method.



But I want to stick with ZF's default MVC behaviors and want to
understand how these pieces fit together before I can understand and
do customized stuffs. So I need to show the captcha image suing zend
form.

Can somebody guide me about whether it is bug/feature? and any workaround?

Thanks a lot


-- 
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===


[fw-general] Re: Zend_Form or Captcha bug?

2009-01-26 Thread Deepak Shrestha
On Tue, Jan 27, 2009 at 3:24 PM, Deepak Shrestha d88...@gmail.com wrote:
 Hi,

 Didn't get any help from my last post so I went through documentation
 and tried to understand as much I can but can't find a way to display
 captcha image in Zend_Form using default behavior of Zend Framework's
 MVC. AFAIK (with my current knowledge), my code is correct.

 This is the code snippet in  my [application/forms/myform.php]
 ===

//first create an image type captcha
$captchaimg = New Zend_Captcha_Image('captchaimg');
$captchaimg-setFont(../application/captcha/fonts/tahoma.ttf);
$captchaimg-setImgDir(../application/captcha/images);
$captchaimg-setImgUrl(../application/captcha/images);
$captchaimg-setWordlen('6');

//create user input for captcha and include the captchaimg in form
$adcaptcha = New Zend_Form_Element_Captcha('adcaptcha', array(
'captcha' = $captchaimg));
$adcaptcha-setLabel('Please enter the 5 letters displayed below:');
$adcaptcha-setRequired(true);
$adcaptcha-addErrorMessage('Entered value did not match with
 displayed image.');

 $this-addElements( array($adcaptcha));
 =

 My view script:
 
 ?= $this-form ?
 


 dirctory structure for captcha image is:
 =
 application
- captcha
- fonts
- images (for genreated images)
 =


 My Observation
 ===
 1. There is no captcha image when form renders. However, I can see
 image being generated in 'application/captcha/images' folder.

 2. Trying to post the empty form (expecting that my custom error
 message will be displayed) gives me empty error message string with
 just a round bullet list in the captcha section but other text input
 fields show the correct error messages.

 3. Using view source in the browser, i got this about captcha

 *
 dd
 img alt= 
 src=../application/captcha/images/641aa987b887cbefb441f33e194a45b9.png/br/
 input type=hidden name=adcaptcha[id]
 value=641aa987b887cbefb441f33e194a45b9 helper=formText
 id=adcaptcha-id /
 input type=text name=adcaptcha[input] id=adcaptcha-input
 value= helper=formText //dd

 **
 ===


 My Questions:
 
 1. The image url was passed to the brower but why it didn't get
 rendered in the form?
 2. Is this the bug or feature? If it is the feature, how do I make the
 image appear in my form using the code I have posted above? what are
 the additional things I need to consider?
 


 Partial answer (best guess) to my own question:
 
 1. Probably form is forgetting to call some default rendering function
 of Zend_Captcha to render it (or ???).  However custom approach (with
 custom form) as shown in zend documentation
 [http://framework.zend.com/manual/en/zend.captcha.operation.html] and
 the one I found in recent blog [http://www.tfountain.co.uk/] works
 because it explicitly calls echo $captcha-render($view); method.
 


 But I want to stick with ZF's default MVC behaviors and want to
 understand how these pieces fit together before I can understand and
 do customized stuffs. So I need to show the captcha image suing zend
 form.

 Can somebody guide me about whether it is bug/feature? and any workaround?

 Thanks a lot



Sorry I forgot to mention that I am using current version of ZF 1.7

Thanks


-- 
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===