[fw-general] Zend Validations not working properly in FastCGI

2009-08-18 Thread naveed83

Hi,
I am facing a very strange problem in zend input filter validations. I have
a form on my page, some fields are mandatory and some are not. Form works
fine when PHP is configured as ISAPI, but when PHP is configured as FastCGI,
it applies the mandatory validation on all the fields. Please note that it
is only happening in FastCGI mode. 
My server settings are,
Windows 2008
IIS 7
PHP setup as FastCGI
Zend Framework 1.8.0

Can anyone please help me with this.

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Zend-Validations-not-working-properly-in-FastCGI-tp25019010p25019010.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] [fw-mvc] - Zend_Config_Xml with attributes

2009-08-18 Thread Vibhor Singh
Thanks Ben! This will help.

-Original Message-
From: Ben Scholzen 'DASPRiD' [mailto:m...@dasprids.de] 
Sent: Tuesday, August 18, 2009 2:34 AM
To: Zend Framework General
Subject: Re: [fw-general] [fw-mvc] - Zend_Config_Xml with attributes

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Vibhor Singh wrote on 17.08.2009 13:13:
 Now suppose I want to access data under this node(items type=”shoes”),
 then how should I do this using the Zend_Config_Xml object.
 
 Can someone please help me in this? Any help would be greatly appreciated.

$config-items[0]-type === 'clothes';
$config-items[1]-type === 'shoes';
- --
...
:  ___   _   ___ ___ ___ _ ___:
: |   \ /_\ / __| _ \ _ (_)   \   :
: | |) / _ \\__ \  _/   / | |) |  :
: |___/_/:\_\___/_| |_|_\_|___/   :
:::
: Web: http://www.dasprids.de :
: E-mail : m...@dasprids.de   :
: Jabber : jab...@dasprids.de :
: ICQ: 105677955  :
:::
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqJxdAACgkQ0HfT5Ws789A2zACfZPatM4ROgpo77Re5hV5HGicv
wrEAn33wh3cqmIXKdHoMOezWKx4XH8f9
=Scee
-END PGP SIGNATURE-



Re: [fw-general] [fw-mvc] - Zend_Config_Xml with attributes

2009-08-18 Thread Tom Graham
I stand corrected :)

2009/8/17 Ben Scholzen 'DASPRiD' m...@dasprids.de

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Vibhor Singh wrote on 17.08.2009 13:13:
  Now suppose I want to access data under this node(items type=”shoes”),
  then how should I do this using the Zend_Config_Xml object.
 
  Can someone please help me in this? Any help would be greatly
 appreciated.

 $config-items[0]-type === 'clothes';
 $config-items[1]-type === 'shoes';
 - --
 ...
 :  ___   _   ___ ___ ___ _ ___:
 : |   \ /_\ / __| _ \ _ (_)   \   :
 : | |) / _ \\__ \  _/   / | |) |  :
 : |___/_/:\_\___/_| |_|_\_|___/   :
 :::
 : Web: http://www.dasprids.de :
 : E-mail : m...@dasprids.de   :
 : Jabber : jab...@dasprids.de :
 : ICQ: 105677955  :
 :::
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkqJxdAACgkQ0HfT5Ws789A2zACfZPatM4ROgpo77Re5hV5HGicv
 wrEAn33wh3cqmIXKdHoMOezWKx4XH8f9
 =Scee
 -END PGP SIGNATURE-



[fw-general] Zend_PDF utf8 support

2009-08-18 Thread Neriodavid(Wei Dai)
Hi,
   Does the Zend_PDF support utf8 and non-western multi-byte Characters?


Thanks

David.


[fw-general] database transactions, referential integrity MVC

2009-08-18 Thread sinkingfish

I'm doing a 'sign-up' procedure which includes creating a user (if not logged
in), creating an entity, associating the user  the entity, giving
administrative privileges and then setting up a few other supporting records
in a couple of other tables.

So I could just go ahead and do it but I'd like to put it out there and see
what the best approach may be. 

I'd like to use transactions so that if something went wrong half way
through the process I could just roll it back. Due to referential integrity,
the transaction fails because the supporting records don't yet exist as the
transaction hasn't yet been committed, is it an acceptable practice to
switch off referential integrity for a transaction ?

Now, where to put the beginTransaction ? Transaction are directly related to
the db layer, but the process touches on multiple parts of the model. Is it
acceptable to use a try/catch block with transaction in a controller? Or
should I look to make it part of the model ? I see the controller as gluing
the separate model parts together.

Brian


-- 
View this message in context: 
http://www.nabble.com/database-transactions%2C-referential-integrity---MVC-tp25022546p25022546.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Handling MySQL replication with Zend_Db_Adapter and Zend_Db_Table

2009-08-18 Thread till
Did any of you guys ever consider running mysql proxy[0] for this? I
feel like it's the perfect solution because it does not require you to
build replication into the app. Master-slave is probably simple, but
let's say you have a dozen slaves and a master-master in the mix.

Till

[0]: http://forge.mysql.com/wiki/MySQL_Proxy

On Fri, Aug 14, 2009 at 4:12 AM, Cameronthemsel...@gmail.com wrote:
 Also, this sounds like a great idea for ZF 2.0, people are lining up a huge
 list of sweeping, BC-breaking changes for the 2.0 release, why not add this
 to the pile?

 On Fri, Aug 14, 2009 at 9:48 AM, johncongdon j...@johncongdon.com wrote:

 Are you able to make your solution public?  I am looking for this very
 thing
 and would prefer to stand on the shoulders of giants rather than trying to
 eat a ton of calories to become one myself  :)




 william0275 wrote:
 
  We are switching to a replicated database environment and I've been
  studying the class hierarchy in the Zend Framework to find the best way
  to
  handle this. Since it seems ZF makes poor use of interfaces, classes
  like
  Zend_Db_Table checks for an instance of Zend_Db_Adapter instead of a
  similar interface.
 
  I've seen solutions on the web having to do with extending
  Zend_Db_Table.
 
  I think I found a better solution and would like to suggest it here for
  people who might have the same dillema in the future.
 
  I think extending Zend_Db_Table is the wrong idea, because it means
  you're
  limited to Zend_Db_Table to handle your master/slave architecture. If
  you
  extend Zend_Db_Adapter instead, you will have master/slave functionality
  at the core, not only in Zend_Db_Table.
 
  I did extend Zend_Db_Adapter with the concept that the instance of this
  Zend_Db_Adapter is for the master connection, and internally I create a
  second adapter which will be used for the slave. Methods like insert,
  update and delete are not overriden because they always work directly
  with
  the master. I overrode all fetch methods (fetchAll, fetchAssoc, etc) so
  that it uses the slave adapter instead, remapping the calls.
 
  I added a forceAdapter() method to force the use of the master
  connection throughout a series of queries, so that in some circumstances
  you can select data from the master to make sure you get the newly
  updated
  data right away.
 
  Now, my MyCompany_Db_Adapter_Pdo_Mysql will automatically handle reads
  and
  writes to the right server. When I create the instance I pass it a
  series
  of parameters, like before, with a new parameter called 'slave' which
  contains it's own series of connection parameters. If the 'slave' array
  isnt present, the adapter works the traditionnal way.
 
  Anyhow, unless there are other better alternatives, I suggest you do it
  this way, you'll then be able to use this class with most Zend_Db
  classes
  like Zend_Db_Table. It's a shame the Zend Framework team didnt use
  interfaces in an extensive way, I might have chosen other alternatives
  if
  classes like Zend_Db_Table validated the adapter against a
  DbAdapterInterface (for example) instead of Zend_Db_Adapter.
 

 --
 View this message in context:
 http://www.nabble.com/Handling-MySQL-replication-with-Zend_Db_Adapter-and-Zend_Db_Table-tp21812347p24964652.html
 Sent from the Zend Framework mailing list archive at Nabble.com.





[fw-general] iframe in Zend

2009-08-18 Thread Juan Pablo Marroni
Hi, my question is who I create in my view a frameset like this:

FRAMESET ROWS=160,30,*
   FRAMESET COLS=50%,50%
  FRAME SRC=/back/spadmsel name=sel
  FRAME SRC=/back/spadmres name=res
   /FRAMESET
  FRAME SRC=/back/spadmmenu name=menu
  FRAME SRC=/resto/viewdetail/id_gen_resto/2605 name=dis
/FRAMESET


It's posible ?? or another ideal is welcome.
Thanks


Re: [fw-general] Zend Form Grouping Elements

2009-08-18 Thread skorp

have the same error message 
Message: Plugin by name 'DivWrapper' was not found in the registry; used
paths: ZendX_JQuery_Form_Decorator_: ZendX/JQuery/Form/Decorator/
Zend_Form_Decorator_: Zend/Form/Decorator/ 

it's not searching in the direcotory which i add with addelementprefixpath.

has anyone a solution for this?


vladimirn wrote:
 
 Hello Mathew,
 I tried this, but wont work for me.
 $form-addDisplayGroupPrefixPath('forms_Decorator', 'forms/Decorator');
 .
  $form-addDisplayGroup(array('username', 'password'), 'login', array(
 'legend' = 'Please Login:',
 'decorators' = array(
 'FormElements',
 array('DivWrapper', array(
 'labelFor'   = 'login',
 'labelClass' = 'required left optional',
 ))
 ), 
 ..
 and i have application/forms/Decorator/ with DivWrapper.php in it.
 in bootstrap:
 $base  = realpath(dirname(__FILE__) . '/../');
 $paths = array(
 '.', 
 $base . '/library',
 $base . '/application',
 $base . '/application/forms',
 $base . '/application/models',
 );
 ini_set('include_path', implode(PATH_SEPARATOR, $paths));
 
 Error i am getting:
 exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by
 name DivWrapper was not found in the registry.' in
 
 Any suggestion?
 Thanks
 Vladimir
 
 Matthew Weier O'Phinney-3 wrote:
 
 What did you try? :)
 
 Here's what I'd try: you'll need to create a custom decorator for the
 display group, which I'll detail below, and then the following
 element/group definitions.
 
 $form-addDisplayGroupPrefixPath('My_Form_Decorator',
 'My/Form/Decorator');
 $form-addElement('text', 'txtZipcode', array(
 'size'   = 10,
 'maxlength'  = 10,
 'class'  = 'true',
 'required'   = 'true',
 'decorators' = array('ViewHelper'),
 ));
 $form-addElement('text', 'txtCity', array(
 'size'   = 30,
 'maxlength'  = 20,
 'class'  = 'true',
 'required'   = 'true',
 'decorators' = array('ViewHelper'),
 ));
 $form-addDisplayGroup(array('txtZipcode', 'txtCity'), 'zipCity',
 array(
 'legend' = 'Zipcode/City',
 'decorators' = array(
 'FormElements',
 array('DivWrapper', array(
 'labelFor'   = 'txtZipcode', 
 'labelClass' = 'required left optional',
 ))
 ),
 ));
 
 The DivWrapper decorator would look like this:
 
 My_Form_Decorator_DivWrapper extends Zend_Form_Decorator_Abstract()
 {
 public function render($content)
 {
 $group = $this-getElement();
 if (null === $group) {
 return $content;
 }
 
 $labelFor   = $this-getOption('labelFor');
 $labelClass = $this-getOption('labelClass');
 $label  = $group-getLegend();
 
 $html =EOH
 div class=row
 label for=$labelFor class=$labelClass$label/label
 div class=element
 $content
 /div
 /div
 EOH;
 return $html;
 }
 }
 
 Put the above in My/Form/Decorator/DivWrapper.php on your include path,
 and you should be set.
 
 I think this is a common problem. So hopefully some can give me a hint
 how my decorator needs to look like...
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | matt...@zend.com
 Zend Framework   | http://framework.zend.com/
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Zend-Form-Grouping-Elements-tp18890779p25028079.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Fwd: Autoloader/Require mystery...

2009-08-18 Thread Carlton Gibson
Sorry if this arrives twice - I realised I sent it from a non- 
subscribed address and am expecting it to bounce first time.




Hi all, I'm wondering if anyone can help.

I'm using a RecursiveDirectoryIterator to go through the Zend  
Framework files and generate clippings for my favourite text editor. I  
am passing this an absolute path to the Zend Framework library.


The library is also on my include path and I have the new Autoloader  
enabled. (The copy of the library I am iterating through is the same  
as that on my include_path)


My script seems to be working fine. Starting at the top, all goes well  
until I reach Zend/Search/Lucene/Analysis/Analyzer/Common/Text/ 
CaseInsensitive.php


At this point I get a Fatal Error:

Fatal error: Cannot redeclare class  
Zend_Search_Lucene_Analysis_Analyzer_Common in [my set up]/library/ 
Zend/Search/Lucene/Analysis/Analyzer/Common.php on line 41


The _Common file is being required in Zend/Search/Lucene/Analysis/ 
Analyzer/Common/Text.php but it must have been included sometime  
before that.


My first thought was to comment out the offending require_once  
statement -- I have the Autoloader so it shouldn't be necessary.


If I do comment out the offening require I get another fatal error:

Fatal error: Class 'Zend_Search_Lucene_Analysis_Analyzer_Common' not  
found in [my set up]/Zend/Search/Lucene/Analysis/Analyzer/Common/ 
Utf8.php


And this one doesn't make much sense because there's still an  
uncommented require_once for the missing class (file) just a few lines  
above.


__What's more__ the stack trace shows that immediately after the  
Zend_Loader::loadClass() call (which presumably is stepping in where  
the commented require_once left off) the is a require_once being  
issued FROM the ../Common.php file in which the supposedly missing  
class is defined.


i.e. I can't really see how it's actually missing !? It's a bit of a  
mystery.


I guess that this is something PHP related but I can't think what. Any  
ideas (especially good ones :-) would really be appreciated.


TIA
Carlton




[fw-general] Autoloader/Require mystery...

2009-08-18 Thread Carlton Gibson

Hi all, I'm wondering if anyone can help.

I'm using a RecursiveDirectoryIterator to go through the Zend  
Framework files and generate clippings for my favourite text editor. I  
am passing this an absolute path to the Zend Framework library.


The library is also on my include path and I have the new Autoloader  
enabled. (The copy of the library I am iterating through is the same  
as that on my include_path)


My script seems to be working fine. Starting at the top, all goes well  
until I reach Zend/Search/Lucene/Analysis/Analyzer/Common/Text/ 
CaseInsensitive.php


At this point I get a Fatal Error:

Fatal error: Cannot redeclare class  
Zend_Search_Lucene_Analysis_Analyzer_Common in [my set up]/library/ 
Zend/Search/Lucene/Analysis/Analyzer/Common.php on line 41


The _Common file is being required in Zend/Search/Lucene/Analysis/ 
Analyzer/Common/Text.php but it must have been included sometime  
before that.


My first thought was to comment out the offending require_once  
statement -- I have the Autoloader so it shouldn't be necessary.


If I do comment out the offening require I get another fatal error:

Fatal error: Class 'Zend_Search_Lucene_Analysis_Analyzer_Common' not  
found in [my set up]/Zend/Search/Lucene/Analysis/Analyzer/Common/ 
Utf8.php


And this one doesn't make much sense because there's still an  
uncommented require_once for the missing class (file) just a few lines  
above.


__What's more__ the stack trace shows that immediately after the  
Zend_Loader::loadClass() call (which presumably is stepping in where  
the commented require_once left off) the is a require_once being  
issued FROM the ../Common.php file in which the supposedly missing  
class is defined.


i.e. I can't really see how it's actually missing !? It's a bit of a  
mystery.


I guess that this is something PHP related but I can't think what. Any  
ideas (especially good ones :-) would really be appreciated.


TIA
Carlton



[fw-general] routing based on hostname

2009-08-18 Thread András Csányi
Hi!

I need some help. In last 6 hours I tried to setup my application based on this:

subdomains:
games.sayusi.hu
library.sayusi.hu
blog.sayusi.hu

Every subdomains point the public/ directory.

directory structure:

app/
app/modules/
app/modules/games/
app/modules/games/controllers
app/modules/games/models
app/modules/games/views
app/modules/library/controllers
app/modules/library/models
app/modules/library/views
app/modules/blog/controllers
app/modules/blog/models
app/modules/blog/views
lib/
lib/Zend
lib/MyLibs
public/
public/index.php

I read these - [1] [2] [3] [4] - howtos and documentation pages but I'm failed.

[1] - http://www.noginn.com/2008/09/03/using-subdomains-as-account-keys/
[2] - 
http://www.noginn.com/2009/02/04/revisiting-hostname-routing-with-the-zend-framework/
[3] - http://www.mail-archive.com/fw-general@lists.zend.com/msg18229.html
[4] - 
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.hostname

Now, I don't decide my whishes are to high or I'm to stupid for this.
I did make one route but if I want to more than one the nightmare is
started. I'm not sure I have or haven't to add the modules controller
directorys to $controller. If I added I got this exception
$moduleName_IndexController is invalid controller name. If I didn't
add the directory the application using the default controllers.

Can somebody show me a live example?

I would appreciate your kind help!

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell