Re: [fw-general] Check if template exists in view script?

2010-01-13 Thread Carlton Gibson
Hi Marko,

On 13 Jan 2010, at 15:36, Marko78 wrote:
 Is there some way to check if some view script (template file) exists?

Yes.

You could use is_readable() in conjunction with Zend_View::getScriptPaths()

http://uk2.php.net/is_readable

http://framework.zend.com/manual/en/zend.view.html#zend.view.introduction.accessors

HTH
Carlton



Re: [fw-general] inArray validator

2009-10-14 Thread Carlton Gibson


On 14 Oct 2009, at 13:59, scs wrote:


Hello,
I have a custom validation class that validates if an e-mail domain is
in the allowed domains list via the native inArray validator of Zend.
Here is the code: http://pastie.org/654380

However, the validator always returns false and gives the form error 
email domain is not allowed  as in the validation class.
If I do the check with the php's in_array function then I get the
desired behaviour.

Something missing?


Yes. The test condition on Line 27 of your example needs a negation if  
you want to do the logic that way round. Either add or exchange the  
branch bodies.


HTH


Re: [fw-general] inArray validator

2009-10-14 Thread Carlton Gibson

On 14 Oct 2009, at 14:44, scs wrote:


In fact, I missed the ! operator on that line during editing the code
on pastie  (now corrected version: http://pastie.org/654380).
Unfortunately, the behaviour does not change when I correct that line.
Still gives email domain is not allowed.



Er... in that case I don't know. :-)

Since you're not using the internal validator in a chain, and you're  
not using the error message, why don't you just use in_array() ? (i.e.  
you don't need any of the extra features that the Zend implementation  
gives you so why bother with the complication?)


Regards,
Carlton







The allowed domains comes from application.ini file (debugged).
the form element is also working fine (debugged).
Yet only this validation...


On Wed, Oct 14, 2009 at 4:23 PM, Carlton Gibson  
li...@noumenal.co.uk wrote:


On 14 Oct 2009, at 13:59, scs wrote:


Hello,
I have a custom validation class that validates if an e-mail  
domain is
in the allowed domains list via the native inArray validator of  
Zend.

Here is the code: http://pastie.org/654380

However, the validator always returns false and gives the form  
error 

email domain is not allowed  as in the validation class.
If I do the check with the php's in_array function then I get the
desired behaviour.

Something missing?


Yes. The test condition on Line 27 of your example needs a negation  
if you
want to do the logic that way round. Either add or exchange the  
branch

bodies.

HTH





Re: [fw-general] Is the book Is Zend Framewo rk: The Official Programmer’s Reference Guide based on ZF v1.9?

2009-10-09 Thread Carlton Gibson


On 9 Oct 2009, at 18:50, Mark Wright wrote:


Does this book have anything more than the Programmer's Reference
Guide (http://framework.zend.com/manual/en/)? I sure hope so or else
what's the point? And way too expensive.


The question is probably, Do you want a hard copy?. If yes, it's  
going to cost you a fair amount of money to print it out yourself, and  
it won't be bound, or have an index, or anything else. 

Re: [fw-general] Is there anybody from Zend team ?

2009-09-23 Thread Carlton Gibson

Aoohralex,

I'm sorry but if you think so little of Zend Framework, why on Earth  
don't you just use all these other frameworks that you think are  
superior instead? This is a question for you to answer to yourself --  
no-one on this list is interested.


If you do want to use Zend Framework then that's great for you, but  
your constant _negativity_ -- based on next to no experience -- will  
achieve nothing but to alienate the most useful resources of Zend  
Framework, the community.


Seriously, calm down, take a step back and consider for the moment  
that just maybe Zend Framework is as good as people think it to be.


Regards,
Carlton


[fw-general] PHP Settings to Build API Documentation

2009-09-17 Thread Carlton Gibson

Hi all,

I'm wondering if anyone is building the API docs locally and can give  
me a rough indication of the amount of memory required? I keep getting  
memory out errors after _some time_ :-)


TIA
Carlton


Re: [fw-general] PHP Settings to Build API Documentation

2009-09-17 Thread Carlton Gibson


On 17 Sep 2009, at 13:57, Diego Potapczuk wrote:


I use 1024mb


Brilliant. Thanks.



::: Diego Potapczuk

»» NEAD - Núcleo de Educação a Distância
»» SENAI-BA
»» Tel: (71) 3287-8343 / (71) 9144-3062
»» http://www.diegoliveira.com.br


On Thu, Sep 17, 2009 at 7:00 AM, Carlton Gibson  
li...@noumenal.co.uk wrote:

Hi all,

I'm wondering if anyone is building the API docs locally and can  
give me a rough indication of the amount of memory required? I keep  
getting memory out errors after _some time_ :-)


TIA
Carlton





Re: [fw-general] PHP Settings to Build API Documentation

2009-09-17 Thread Carlton Gibson


On 17 Sep 2009, at 17:06, Matthew Weier O'Phinney wrote:


-- Carlton Gibson li...@noumenal.co.uk wrote
(on Thursday, 17 September 2009, 11:00 AM +0100):
I'm wondering if anyone is building the API docs locally and can  
give me

a rough indication of the amount of memory required? I keep getting
memory out errors after _some time_ :-)


I usually pass -d memory_limit=-1 to phpdoc. :)


Ah, if that does what I suppose it does then that would be quite  
clever. :-)


Thanks,
Carlton


Re: [fw-general] Is there anybody from Zend team ?

2009-09-16 Thread Carlton Gibson

aoohralex,

On 16 Sep 2009, at 09:16, aoohralex wrote:

[...]


Carlton:
Not everybody needs layout ? :O Then somebody can delete 1 folder +  
1 line
of code - I think this is faster than create folder + write 1 line.  
What is
more - in Symfony Framework or in ASP.NET - we have layout !! In ZF  
we don't

have layout - we must create layout...



[...]


swilhelm:
I wanted only write about some uncomfortable things in ZF - I would  
like to

download ZF and started writing - I hate configure anything.
I know little ZF, I used it little 1 year ago, but then somebody has  
given
me fully configured ZF. Now I would like to do everything by myself  
from

start to the end.




There's a few related points here but they seem to me to come down to  
the trade off between a configuration-free set-up and flexibility.  
Zend Framework is good for so much more than just web pages, and in  
many of those contexts a layout isn't the best option. I have a whole  
host of command line scripts which leverage Zend Framework and not one  
of them uses Zend_Layout, although I guess they could... :-) In  
general, anytime you want to access your model without all the window  
dressing, AJAX requests (?), web services, scheduled tasks etc a  
layout probably won't be appropriate.


Since the actions of adding a deleting a folder and a line of code are  
basically symmetrical, I guess your thought that it's faster have a  
layout included by default is based on the idea that the _default_  
usage of Zend Framework is in building standard web sites. Even if we  
grant that everybody who is building web sites using Zend Framework  
wants to use Zend_Layout, I guess I'd say my point was that the other  
use-cases are common enough to not want the framework to _dictate_  
that the layout be part of the default project structure. (IF a set of  
genuine best practices, rather than just opinions, could be formed for  
web projects I would be happy to see Zend_Tool have a create  
webProject command, but that's a big IF.)


Your response to swilhelm seems to hit the crux of the matter: you  
hate to configure anything yet you want to do everything yourself from  
start to finish -- well, which is it?


One of the big selling points of Zend Framework is that it doesn't  
force you into any particular way of doing things, i.e. that it is  
flexible. Where there are genuine best practices it offers sensible  
defaults but because it targets those who want such flexibility it  
_should not_ go further than that. As lessens are learnt over time,  
the amount of configuration required to perform standard tasks in Zend  
Framework is decreasing; this is a good thing but, given the projects  
goals, there are always going to be other frameworks out there that  
are able to do their one particular thing more easily. That's okay:  
Zend Framework need not be all things to all people -- not everyone  
need pay the cost in terms of configuration that Zend Framework's  
flexibility requires. (i.e. use the tool that is best suited to the  
job you have to do.)


Regards,
Carlton

Re: [fw-general] Is there anybody from Zend team ?

2009-09-16 Thread Carlton Gibson


On 16 Sep 2009, at 12:55, aoohralex wrote:


Based on Yours instructions how to connect to database:
http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.connecting.factory-config

I have:
$config = new Zend_Config(
  array(
  'database' = array(
  'adapter' = 'Mysqli',
  'params'  = array(
  'host' = '127.0.0.1',
  'dbname'   = 'test',
  'username' = 'webuser',
  'password' = 'secret',
  )
  )
  )
);

$db = Zend_Db::factory($config-database);


And what ? What should I do with this ? Where should I place it ?


A standard strategy is to store your DB adapter in the registry  
(Zend_Registry) thus making it available to your application. (Someone  
will tell me that's outdated now, but it will get you started.)



[... stuff about Symfony...]


In ZF I don't know - so maybe somebody should write about that in  
tutorial

and tell me ? Because I don't know.


Sorry your finding it difficult to get going. Zend Framework is  
complicated (and many find it so when beginning -- I know I did -- and  
see the other thread going on right now). The trouble is writing  
software is itself complicated. Famously there's no silver bullet, and  
Zend Framework certainly isn't it. Alas, you just have to take on the  
learning curve and persevere.


Rob Allen has a good tutorial (and book) that's recently been updated:

http://akrabat.com/zend-framework-tutorial/

Padraic Brady has an online book that you can check out:

http://www.survivethedeepend.com

There really are MANY tutorials available. As ever, Google is your  
friend. People on the mailing list are very good at answer specific  
questions.


I hope that helps.

Regards,
Carlton


Re: [fw-general] Is there anybody from Zend team ?

2009-09-16 Thread Carlton Gibson


On 16 Sep 2009, at 15:54, aoohralex wrote:


thx Carlton - this tutorial helped me:
http://akrabat.com/wp-content/uploads/getting-started-with-zend-framework-163.pdf
Now I have at least connection to database (I checked - I can show  
something

from my database)


No problem. Glad to get you started. :-)

If somebody doesn't want to use layout - he needn't, if somebody  
doesn't
want to connect to database - he needn't but it should exists in  
generated

project. :-)



I don' t think we're going to agree here. :-)

Have a good day.

Regards,
Carlton



Re: [fw-general] Is there anybody from Zend team ?

2009-09-16 Thread Carlton Gibson


On 16 Sep 2009, at 16:00, aoohralex wrote:

So you think this is a mistake that these things are in Symfony  
Framework,

ASP.NET Framework and many others frameworks ? :)


No. What they do is up to them. My comments are directly entirely at  
Zend Framework and should not be taken to imply anything about any  
other framework.


What I don't want is for Zend Framework to start dictating which  
components I use and how and when. Again, one of the chief selling  
points of Zend Framework is that isn't opinionated in this sense.


I accept that Zend Framework may be slower off the mark for some tasks  
than other frameworks because it is not opinionated. (Although how  
much slower having done it once I really question.) The trade off is  
massive flexibility. I can use the same components all over the place  
(and do).


All I can suggest is that you use it for a good period and then make  
your own mind up.


Regards,
Carlton

[fw-general] BBEdit Zend Framework Clippings Updated

2009-09-15 Thread Carlton Gibson
I’ve just uploaded the latest version of the Zend Framwork Clipping  
set for BBEdit.


As usual you can grab this from:

http://noumenal.co.uk/resources/downloads

or via GitHub:

http://github.com/tedmasterweb/bbeditclippings/

Changes in this release
Added the class to the clipping name to disambiguate duplicate method  
names. (Picture __construct 1000 times.)


Since BBEdit doesn’t allow whitespace in autocomplete suggestions,  
I’ve used a double-star ** as the divider between method and class  
name. This I hope is clear enough visually, but please let me know  
what you think.


Added parameter and return type hints to the clippings in line with  
the conventions of Ted’s original PHP clippings. (The return value is  
selected upon clipping insertion so a quick delete will get rid of it;  
its purpose is currently just as an aide memoir but I hope to leverage  
it further later.)


Barring any major issues, this will be the final Beta of the BBEdit  
Zend Framework Clippings. They are just missing clippings for the  
Zend_Search_Lucene and Zend_Soap namespaces, which require ad hoc work- 
arounds. After that they will follow the Zend Framework release  
schedule.


Enjoy,
Carlton

Re: [fw-general] Is there anybody from Zend team ?

2009-09-15 Thread Carlton Gibson
Ah okay, you don't need a member of the Zend team to answer these  
questions, many people form the community could do it.


On 15 Sep 2009, at 18:55, aoohralex wrote:


1. Why I must register to download ZF ?


You don't. You just need to register to use the CDN, which is faster.  
Somewhere or other there's a link to download without registering.



2. Why after generate ZF project using console:
zf.bat create project quickstart
and after placed it on the server it DOESN'T WORK !!
I must create .htaccess:
RewriteEngine On
RewriteRule ^(.*)$ /quickstart/public/$1 [QSA,L]
And then it works - BUT YOU SHOULD WRITE ABOUT THAT IN TUTORIAL !!


You need to revisit the quick start. It's quite clear that you need to  
set up a .htaccess file.



3. Why I must modify application.ini file ? I must add:
resources.layout.layoutPath = APPLICATION_PATH /layouts/scripts
and create folder 'layout/scripts/layout.phtml'  ? It should be in  
generated
project !! Everybody needs layout !! So it should be in generated  
project.


Not everybody needs a layout. Indeed, before version 1.5 we all got on  
very well without one. I'm not saying that a layout isn't widely used,  
but I think that's why there's a whole section in the quickstart on  
how to add one.


4. In which file should I write login, password etc. - to have  
access to my
MySQL database ? I want to see empty places to write these data in  
some

file.


The best place is probably application.ini. You can then pass this  
info to Db resource in your bootstrap. I think the Zend_Db manual  
pages have an example of using config data to instantiate a Db adapter.


Hope that helps.

Regards,
Carlton



Re: [fw-general] Unusual error... ZF 1.7.5

2009-08-24 Thread Carlton Gibson


On 24 Aug 2009, at 12:04, Shawn wrote:


Ultimately, re-directing to 400 Bad Request page would be
more ideal instead of the 10 lines of Warning: ... at the top
of my site.


You need to turn display_errors off. This should ALWAYS be done in  
production.


http://uk.php.net/manual/en/errorfunc.configuration.php#ini.display-errors


[fw-general] New Zend Framework Clippings set for Zend Framework

2009-08-20 Thread Carlton Gibson

Hi all,

I've just released the first beta of a Zend Framework Clipping set for  
BBEdit.


You can download a copy at:

http://noumenal.co.uk/resources/downloads

Alternatively, it is also part of the combined clipping set on GitHub:

http://github.com/tedmasterweb/bbeditclippings/

The set currently covers 99%+ of Zend Framework's methods but I'm  
aiming for 100%. After that it'll follow ZF releases.


If you use BBEdit, give them a try. (Now's the time to input  
suggestions.)


Enjoy.

Regards,
Carlton

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

2009-08-20 Thread Carlton Gibson

Hi Alexander,

Thank you for your superb answer! It has broken my impasse.

(I've run into another problem with ... /Document/Docx.php but now I'm  
moving again I'll sort that. :-)


Thanks again.

Regards,
Carlton

On 19 Aug 2009, at 18:50, Alexander Veremyev wrote:


Hi Carlton,

It's a ZF-7256 related issue.

Zend_Search_Lucene is designed to be turned on using one require_once
call:

require_once 'Zend/Search/Lucene.php';
-

It takes less time than common index opening/querying. Moreover in  
some

environments it's faster than conditional files inclusion.
Nevertheless it should be redesigned to complain ZF coding standards.

I could recommend using the following workaround before that, just add
require_once 'Zend/Search/Lucene.php'; in the beginning of your  
code.

It will include all files in the right order.

If it doesn't help, that means autoloader treats already parsed
Zend/Search/Lucene/Analysis/Analyzer/Common.php file and just  
requested
Zend/Search/Lucene/Analysis/Analyzer/Common.php as different files.  
That

may happen if include path was changed since last file access.

With best regards,
  Alexander Veremyev.


-Original Message-
From: Carlton Gibson [mailto:carlton.gib...@noumenal.co.uk]
Sent: Tuesday, August 18, 2009 10:48 PM
To: Zend Framework General
Subject: [fw-general] Autoloader/Require mystery...

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






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

2009-08-19 Thread Carlton Gibson


On 18 Aug 2009, at 19:47, Carlton Gibson wrote:


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.


Following up I have narrowed the problem down to something in the Zend/ 
Search branch. If I exclude this from my iterator the script goes off  
as planned. If I run the script on just the Zend/Search branch the  
error occurs.


It processes Zend/Search/Exception.php but dies on the next file Zend/ 
Search/Lucene/Analysis/Analyzer/Common/Text/CaseInsensitive.php -- I  
suspect that the issue could be restricted to just the Analysis branch  
but I've not had time to track it down further as yet.


Regards,
Carlton



[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



Re: [fw-general] Looping through a class with Zend_Reflection_Class::getMethods()

2009-08-05 Thread Carlton Gibson


On 5 Aug 2009, at 01:52, Abraham Block wrote:

I'm trying to write an action helper which uses docblocks as an  
annotation, but if I loop through the methods and on each one call  
getDocblock, an exception will be thrown. But I'm in a catch-22  
because I can't know which methods have one and which ones don't.  
This leads me to create a really ugly try catch block, with nothing  
in the catch.


Is there a better way to handle this?


Is giving all your methods DocBlocks not a solution? 


Re: [fw-general] Model validation

2009-08-03 Thread Carlton Gibson


On 3 Aug 2009, at 00:24, Chris MacPherson wrote:


Hi,

I've just been following the model section of the quick start (http://framework.zend.com/docs/quickstart/create-a-model-and-database-table 
) and had a few questions. If anyone can help me it would be great.


- Where would I apply validation to the guestbook model data?

- How do I ensure the mapper only saves a valid guestbook entry?

I want to add my validation in one place, so one idea I had was  
adding it to the setter methods in Default_Model_Guestbook. But then  
I would need something else for the mapper to call to make sure the  
whole Default_Model_Guestbook was valid. So maybe an isValid()  
method or similar. Does that sound like the correct direction to be  
going in?


I'm just thinking things through here so any pointers very welcome :)


Hi Chris,

Read this post from Matthew's blog:

http://weierophinney.net/matthew/archives/200-Using-Zend_Form-in-Your-Models.html

Hope that helps.

Regards,
Carlton



Re: [fw-general] Image captcha, remove files

2009-07-28 Thread Carlton Gibson

Hi there,

On 28 Jul 2009, at 13:41, PHPScriptor wrote:
Maybe a simple question, but I never did this before. How can I  
remove the
old image-captcha's from my directory? How can this be done  
efficiently?
Can this be done with Zend Framework? Or do I need to run a cronjob  
every

night? ...


The easiest way to do this is probably just via a shell script run via  
cron.


Assuming all image-captchas live in the same file (with nothing else)  
you can just do something like:


#! /bin/bash
cd /my/image/captcha/directory;
if (( $? == 0 )); then rm * ; fi

(The conditional just checks that the cd command worked -- otherwise  
you could be rm-ing all sorts of things.)


Hope that helps.

Regards,
Carlton




Re: [fw-general] Image captcha, remove files

2009-07-28 Thread Carlton Gibson


On 28 Jul 2009, at 13:55, Tim Fountain wrote:



2009/7/28 PHPScriptor cont...@phpscriptor.com

Maybe a simple question, but I never did this before. How can I  
remove the

old image-captcha's from my directory?

I believe the component does this automatically. You can control how  
frequently it does so by changing the garbage collection frequency  
config options - see  http://framework.zend.com/manual/en/zend.captcha.adapters.html#zend.captcha.adapters.image


The default value is 100, so 1 in 100 of the captcha requests will  
also remove the old images.


You could probably setup a cron job to do this but I don't think it  
would be worth the hassle unless your site gets a very high amount  
of traffic and you're seeing slowdown issues on the captcha  
generation.


Scratch my last response. If the component does it itself, that's  
easier. ;-)


Regards,
Carlton

Re: [fw-general] Changing viewscript

2009-07-21 Thread Carlton Gibson

Hi,


On 21 Jul 2009, at 15:38, Mathieu Suen wrote:


Hi,

A very simple question. How can I share view script (*.phtml) among  
sevral action?

Thanks



The regulation method here is via the ViewRenderer Action Helper.

http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.viewrenderer

Say fooAction _owns_ the view script you want to reuse. In your other  
actions do:


$this-_helper-ViewRenderer-setScriptAction('foo');

Regards,
Carlton


--
-- Mathieu Suen
--




Re: [fw-general] Models as Singletons

2009-07-21 Thread Carlton Gibson


On 21 Jul 2009, at 18:49, till wrote:


Generally, what Matthew stated is super-correct. The singleton makes
testing harder, as does everything static because it's hard to reset
the state. People use singletons because the so-called business logic
demands, or more often because they are not very skilled programmers.
;-) (No offense meant!)


None taken ;-) I'm definitely not a very skilled programmer but I'd  
argue that using singletons can just be a case of getting on with the  
job at hand. Even accepting that it makes testing harder, using  
singletons can be simpler overall.


In particular, in relatively small applications with a known scope/ 
domain (the average professional PHP developer's bread-and-butter)  
knocking up a singleton version of key resources (those that may be  
needed anywhere) is so quick and easy that the trade off against some  
shared fixtures in the test suite is no problem.


Regards,
Carlton


Re: [fw-general] how to force zend form to submit to new action

2009-07-16 Thread Carlton Gibson

Hi there,

On 16 Jul 2009, at 08:31, nulele wrote:



Thank you for your attempt but unfortunately this method doesn't  
work... if

the form is valid I simply see the form again...
Maybe I need something to capture the post request from the form and  
send it

to the pommo's page... but how?



I know you don't want to totally rewrite the existing pommo code, but  
is it possible to extract the functionality AFTER it collects its data  
from $_POST?


The most straight-forward thing to do may be to wrap that bit of the  
pommo code in a class method of your own (an Adapter) and then call it  
from within your action controller.


(The/An alternative would seem to be to form a new HTTP request,  
including POST data, and fire that off to the pommo URL.  
Zend_Http_Client.)


HTH,

Regards,
Carlton






Eugene Morgan wrote:


If I understand correctly what you are trying to do, I think all you
need to do is immediately after you instantiate the $newsletterForm,
set its action to what you want (not after it's posted) ...

i.e.,
$newsletterForm = new Default_Model_NewsletterForm();
$newsletterForm-setAction('/areaprivata/pommo/user/process.php');

Does that help?

On Wed, Jul 15, 2009 at 5:08 AM, nulelenul...@gmail.com wrote:


hello nabble!!
I'm trying to integrate my zend application with pommo.
I don't want to replicate pommo's logic on new user subscription by
creating
zend_db objects for every pommo's table... I just want to:

1) create the subscription form with zend_form,
2) validate the form on zend side
3) submit the form to the pommo's page used to insert new user

I've already completed the first 2 steps... here's the code in my
controller
to validate the form:

   public function newsletterAction()
   {
   $newsletterForm = new Default_Model_NewsletterForm();
   $this-view-newsletterForm = $newsletterForm;

   if ($this-getRequest()-isPost())
   {
   $formData = $this-getRequest()-getPost();

   if ($newsletterForm-isValid($formData))
   {

 $newsletterForm-setAction('/areaprivata/pommo/user/process.php');

    HERE GOES THE MISSING CODE #



   }
   else
   {
   $newsletterForm-populate($formData);
   }
   }
   }

If anyone has an idea, please let me know.
Many Thanks

--
View this message in context:
http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24495073.html
Sent from the Zend Framework mailing list archive at Nabble.com.







--
View this message in context: 
http://www.nabble.com/how-to-force-zend-form-to-submit-to-new-action-tp24495073p24511659.html
Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] XSS Prevention with Zend Framework

2009-07-15 Thread Carlton Gibson


On 15 Jul 2009, at 03:30, Matthew Weier O'Phinney wrote:

80/20 is a nice rule but not for security. I went through this way  
few
years ago and as you mention it was so convenient to don't care in  
80%

of cases but the rest was pain in the ass. The setEscape() method
doesn't help too much when you have to mix css/js/html code in a
single phtml file.


Why are you mixing them into a single file? Why not have separate  
files

for separate types of code? This simplifies the story for escaping,
allows you to run linters specific to the markup and/or language, and
allows you to factor out things like CSS and JS to your presentation
layer (where, arguably, it belongs -- *not* in your view scripts).


Just an idea/suggestion here, could we have an optional second param  
to escape() which if provided would override the default (just for  
that usage)?


I see this as helpful when quickly putting together a page and just  
wanting to inline the css/js for a sketch or a work in progress -- I  
know I'm gonna move it out eventually...


Re: [fw-general] XSS Prevention with Zend Framework

2009-07-15 Thread Carlton Gibson

Hi,
On 15 Jul 2009, at 13:21, Ondrej Ivanič wrote:

On Wed, Jul 15, 2009 at 5:12 PM, Carlton
Just an idea/suggestion here, could we have an optional second  
param to
escape() which if provided would override the default (just for  
that usage)?




You need at least two parameters additional for escaping because you
have to sometimes specify context. For example, value of style
attribute: escape function needs to know context (= html attribute)
and value (= css expression)


Perhaps I'm not fully on board with what you're after but, I imagined  
all of that to be taken care of by the callback (closure?) passed in  
as the second parameter.


Then, say it's html by default, normally I just do this:

$this-title

But if, for the sake of trying something out I've embedded some non- 
html, I do this:


$this-escape($this-script, function($value) { ... });

IMO, this is no worse than the current situation and (if I understand  
you right) it gives you the flexibility you need?


Regards,
Carlton

Re: [fw-general] Zend_DB_Table: delete() won't delete any row in dependent tables

2009-06-30 Thread Carlton Gibson
On Tue, Jun 30, 2009 at 12:18 AM, Thomas D.whist...@googlemail.com  
wrote:

Hi,

I have two tables, drivers and cars.
Each driver in drivers has his cars in cars.

When I delete a driver, his cars should also be deleted in cars.

I defined two classes:

class Drivers extends Zend_Db_Table_Abstract
{
   [...]
   protected $_dependentTables = array(
   'Cars'
   );
}

class Cars extends Zend_Db_Table_Abstract
{
   [...]
   protected $_referenceMap = array(
   'Pages' = array(
   'columns'   = array('driver_id'),
   'refTableClass' = 'Drivers',
   'refColumns'= 'id',
   'onDelete'  = self::CASCADE
   )
   );
}

When I run

$myTable = new Drivers();
$driversRowset = $myTable -find(1278);
$driver = $driversRowset-current();

$driver-delete();

The row with id 1278 in my drivers table will be deleted and also  
all rows

in cars, where driver_id = 1278. Everything is working as expected.

Now I want to add a method to my drivers Zend_Db_Table class, which  
will

delete a driver and do something else:

class Drivers extends Zend_Db_Table_Abstract
{
   [...]
   public function doSth($id)
   {
   $where = $this-_db-quoteInto('id = ?', $id,  
Zend_Db::INT_TYPE);

   $this-delete($where);

   // do my other stuff
   [...]
   }
}

My problem is, that when I call $driverTable-doSth(1278), the row  
in the

driver's table will be deleted, but it won't delete any rows in cars.

Did I miss something?



Yes. The cascading write options ONLY work via the Row object.

In your method doSth you are using the table's delete() method, which  
does not enforce the cascade specified in the $_referenceMap array.


In the example previously you are using the row object's delete().  
This does enforce the cascade.


If you change your doSth() method to use fetchRow() and then call  
delete on that all should work as you intend.


I hope this helps. I have been caught out by this one myself and  
(still) am not sure WHY the table's delete() method doesn't behave as  
you expected.


Regards,
Carlton


Re: [fw-general] Strange Zend_Form cache problem, please URGENT

2009-06-23 Thread Carlton Gibson


On 23 Jun 2009, at 17:23, Jurian Sluiman wrote:

Next, I think a validation for an integer data type isn't necessary  
to facilitate for ZF, because the built in php function is_int()  
would do enough. Therefore, if you need to validate an integer with  
a validator, I think the only requirement is for using it to check  
1.000 vs 1, :)




You might also want a wrapper around is_int() which implements the  
Zend_Validate_Interface, for instance if you wanted to use it in a  
validator chain.

Re: [fw-general] Getting any Zend Framework set up in Eclipse working on Ubuntu

2009-06-18 Thread Carlton Gibson


On 18 Jun 2009, at 03:27, ksgarrett wrote:

  The framework is looking for a controller based on the params
array of the Zend_Controller_Request_Http.  Those params are:

*::_params = Array [3]  
controller = (string:11) ZFMigration
action = (string:6) public  
module = (string:7) default 

This is the path to the default file, but I don't know why it's  
looking for

this...  What is not configured or set up right?


I can't be sure from your description but it looks like the request  
object is failing to detect your Base URL (/ZFMigration/public, yes?)


Try calling setBaseUrl() -- perhaps easiest via the front controller  
-- prior to dispatching.


http://framework.zend.com/manual/en/zend.controller.request.html#zend.controller.request.http.baseurl 



HTH,

[fw-general] SVN tags for ZendX

2009-03-11 Thread Carlton Gibson

Hi all,

I'm looking to checkout the ZendX library as a svn:external. I was  
hoping to just target a release tag but there aren't any defined in / 
extras/tags.


In the meantime I'll target the revision shipped with the latest  
distribution but would it be possible to get tags set up for each  
release as they happen going forward?


Regards,
Carlton





Re: [fw-general] SVN tags for ZendX

2009-03-11 Thread Carlton Gibson


On 11 Mar 2009, at 13:11, Jan Wagner-Rosenkranz wrote:

Carlton Gibson schrieb:
I'm looking to checkout the ZendX library as a svn:external. I was  
hoping to just target a release tag but there aren't any defined  
in /extras/tags.



I use:
http://framework.zend.com/svn/framework/extras/branches/release-1.7/library/ZendX


Jan,
Thanks for your suggestion. My only concern is that this is still  
subject to changes. That's why I'm after a tag.


Regards,
Carlton


Re: [fw-general] SVN tags for ZendX

2009-03-11 Thread Carlton Gibson


Thanks for both your answers Matthew.

On 11 Mar 2009, at 15:09, Matthew Weier O'Phinney wrote:


-- Carlton Gibson carlton.gib...@noumenal.co.uk wrote
(on Wednesday, 11 March 2009, 01:29 PM +):


On 11 Mar 2009, at 13:11, Jan Wagner-Rosenkranz wrote:

Carlton Gibson schrieb:

I'm looking to checkout the ZendX library as a svn:external. I was
hoping to just target a release tag but there aren't any defined in
/extras/tags.



I use:
http://framework.zend.com/svn/framework/extras/branches/release-1.7/library/ZendX


Jan,
Thanks for your suggestion. My only concern is that this is still
subject to changes. That's why I'm after a tag.


Two things with regard to this. First, changes merged to a release
branch are primarily bugfixes, and should always be backwards
compatible.


Okay, since this is the case I'll probably go with Jan's approach.


Second, if you want to ensure that the revision does not change... pin
to a specific revision. svn:externals supports that natively. As an
example, you can use something like the following:

   externals/extras r14722  
http://framework.zend.com/svn/framework/extras/branches/release-1.7/library/ZendX

I gave a made-up revision number there, but that's the basic idea --  
you

can specify a revision between the local path and the externals path.



This was what I had in mind (but the syntax is helpful).

Thanks again.


--
Matthew Weier O'Phinney
Software Architect   | matt...@zend.com
Zend Framework   | http://framework.zend.com/




Re: [fw-general] New To PHP Zend

2008-11-24 Thread Carlton Gibson


On 24 Nov 2008, at 16:55, Django Woolf wrote:



Hi All

Am new to php/mysql and am looking to use Zend Framework as the  
backbone of
my introduction into such application design, for the purposes of  
building

dynamic web sites.

I have made myself sufficiently familair with HTML as the first part  
of my
learning and now wish to step up to building data driven web  
applications.


Have fore-armed myself with several books for reference, but feel  
that at my
advanced years and lack of technical nous...the best method for  
accelerated
learning is to use the above, in a by rote manner.almost like  
building a

jigsaw, which I can examine by seeing completed and working code.

Could someone kindly offer a start point?

thanks
Mike


Hi Mike,

Welcome on board!

I'd recommend Rob Allen's site/blog. He has a good tutorial at:

http://akrabat.com/zend-framework-tutorial/

Rob also has a book that's due out any minute, which assumes you know  
PHP but goes through the Zend Framework very well.


Rob's Book's site: Zend Framework in Action

Padraic 'will get cross because I'm not using Unicode ;-)' Brady has a  
whole blog application series starting at:


http://tinyurl.com/6o4xkq

Beyond that there's the programmers reference, experimenting and this  
list.


Hope this helps. All the best,
Carlton

Re: [fw-general] zend registry problem

2008-08-08 Thread Carlton Gibson


On 8 Aug 2008, at 10:34, Ahmed Abdel-Aliem wrote:

here is the scenario, when a user log in i set his last login from  
the database in a variable :



Zend_Registry::getInstance();
Zend_Registry::set('user_last_login', $user_row 
[user_last_login]);



and in the page he is redirected to i try to retrieve this variable  
like this :



Zend_Registry::getInstance();
echo Zend_Registry::get('user_last_login');



Hi,

If you are using a **redirect** then you are starting a new request.  
You would need to store the last login data in a session (rather than  
the registry) in order to access it.


Try:

$session = new Zend_Session_Namespace('login');
$session-user_last_login = $user_row[user_last_login];


And

$session = new Zend_Session_Namespace('login');
echo session-user_last_login;

Regards,
Carlton


Re: [fw-general] paginator

2008-07-28 Thread Carlton Gibson


On 28 Jul 2008, at 01:36, samuel verdier wrote:


Hi,

i am french... so my language is not good...

I would like to receive an object and not a array with : myItems =  
$paginator-getCurrentItems();


it would be possible to have a object like Zend_Db::FETCH_OBJ when  
i use DbSelect adaptater of paginator ?


thanks



You could type cast the array...

$myItems = (object) $paginator-getCurrentItems();


Re: [fw-general] Building statistics with ZF. click trail etc

2008-07-28 Thread Carlton Gibson
Why? (I'm guessing Google have significantly more resources to spend  
on their FREE solution than you do on developing yours...)


On 28 Jul 2008, at 12:52, Julian Davchev wrote:


No thanks.
Looking for private solution with ZF.

Joó Ádám wrote:

Check out Google Analytics: http://www.google.com/analytics/


Regards,
Ádám





Re: [fw-general] zf-contributor list has been created!

2008-07-18 Thread Carlton Gibson
Just checking, should we be expecting the usual confirmation emails  
for those sent to the address below?


(I've sent two with no reply...)

Thanks
Carlton


On 17 Jul 2008, at 21:03, Wil Sinclair wrote:

Howdy all, the zf-contributor list has been created. Please send a  
mail

to [EMAIL PROTECTED] to subscribe.
Please keep in mind that this provides a forum for contributors to the
ZF project to discuss development of the framework itself and the
scheduling thereof. Everyone is welcome to subscribe, but please do  
not

post to this list with user-oriented messages such as usage questions.
Such messages should continue to be posted on the 'fw-*' mailing  
lists.

Thanks, and looking forward to seeing all of you on the contributor
list!

,Wil




Re: [fw-general] Recent Component Promotions

2008-07-17 Thread Carlton Gibson


On 16 Jul 2008, at 20:26, Matthew Weier O'Phinney wrote:

No proposal documentation? Not that I don't mind digging elbow  
deep into new
code, just thought there would be a little hand holding in the  
work leading up

to the move to an officially sanctioned Zend Component.


There's documentation in the repository, and it's human-readable:

http://framework.zend.com/svn/framework/standard/documentation/ 
manual/en/module_specs/


look for Zend_Dom*.xml (or Zend_Dojo*.xml, or Zend_Test*.xml, etc.).


You can build to HTML documentation yourself.

Navigate to the language subfolder you're after, e.g. documentation/ 
manual/en and run

$ autoconf
$ ./configure
$ make

(This is in the README)

Come back in a while and the html folder will contain your docs.

When you want to update the documentation simply run
$ make clean  make html

Regards
Carlton


Re: [fw-general] Setting up controllers for common vars etc

2008-07-03 Thread Carlton Gibson


On 3 Jul 2008, at 12:51, AJ McKee wrote:

I have several Controllers that all do various things. However there
are common things I wish them all to do. Mostly just set up vars for
ease of use. Eample

protected $_myRegistry = null;
protected $_myDebug = false;

public function init()
{
$this-_myRegistry = $this-_registry =  
Zend_Registry::getInstance();

%this-_myDebug = $this-_myRegistry-get('debug');
}

I am trying to apply the principle of DRY here, because as the
application grows, I am repeating myself more and more.



Does anyone have any pointers to me about how I would accomplish this,
if its possible.


Hi AJ,

One thing you **could do** is extend Zend_Controller_Action in order  
to override the constructor.


(You then have your application controllers extend from that).

?php
class My_Controller_Action extend Zend_Controller_Action
{
// shared class properties here

public function __construct(Zend_Controller_Request_Abstract $request,
 
Zend_Controller_Response_Abstract $response,
 array $invokeArgs = 
array()
)
{
// stuff to happen before init()

parent::parent::__construct($request, $response, $invokeArgs);

//stuff to happen after init()
}


// Class Continues...
}

The key thing is to call parent::_construct() which runs init() as  
its last action. Also you can't access things like $this-getRequest 
() until after you've done so (however they are already in scope so  
you may not want to...)


I use this approach myself for loading module include paths. In  
general though I'd want to avoid loading too much into the controller  
this way as plugins and action helpers are more flexible in the main.


(Note to self: move module include path stuff to a plugin! :-)

I hope this helps.

regards,
Carlton


Re: [fw-general] Why haven't you reviewed the Zend_Tool proposals?

2008-07-03 Thread Carlton Gibson


On 3 Jul 2008, at 20:17, Bill Karwin wrote:


Then you might want to recruit some folks in the ZF community who have
developed their own ZF apps, and ask them to do a similar  
exercise.  Work
with them closely, and give advice on the usage of Zend_Tool.   
Together

produce a script that can reproduce their web app from scratch.



I'd happily be involved in this.

Regards,
Carlton


Re: [fw-general] Creating a multiple language website to use the same php scripts

2008-06-20 Thread Carlton Gibson

Hi Rishi,

The set up you describe is perfectly possible with ZF...

Have you checked out Magento? You may not want to use it per se but  
it is built on ZF and they use a sites/stores breakdown that is the  
sort of thing you're aiming at --- you could use it for inspiration  
at least...


http://www.magentocommerce.com/wiki/ 
welcome_to_the_magento_user_s_guide/ 
chapter_1#elements_and_terminologies_of_magento_sites


(Sorry I think that link might break...)

Regards,
Carlton


On 20 Jun 2008, at 06:17, Rishi Daryanani wrote:


Hi all,

Sorry but since I didn't receive any replies to the below I wanted  
to try once more..


My biggest concern is how to share code between multiple sub- 
sites.. ZF actions seem really useful for this but then again,   
maybe I did my own PHP function to replicate what .htaccess  
mod_rewrite does...and go through the URL part by part to do  
redirects...


Does anyone have any recommendations on how to tackle this, or does  
my solution above sound like the right thing to do? (i.e. custom  
php code to mimic .htaccess mod_rewrite, without making use of ZF  
actions)


Please see my email below to get a better idea of what I'm trying  
to do. Thanks so much to everyone for your time.


Thanks,
Rishi


--- On Wed, 6/11/08, Rishi Daryanani [EMAIL PROTECTED] wrote:


From: Rishi Daryanani [EMAIL PROTECTED]
Subject: [fw-general] Creating a multiple language website to use  
the same php scripts

To: fw-general@lists.zend.com
Date: Wednesday, June 11, 2008, 8:46 PM
Hi,

I am setting up a site which will be divided into
subsites, one per country (for a set number of
countries). The sites will be the same (the coding
must be shared), but the content will vary depending
on the site ID or code, for example, the following
URLs should work for my site..and the key difference
would be the SITE ID as you can see below (which will
show different content from a database, based on that
site id):

http://www.mydomain.com/  {english site}
http://www.mydomain.com/nl/ (netherlands site)
http://www.mydomain.com/de/ (german site)

http://www.mydomain.com/ads/cars/36/
http://www.mydomain.com/nl/ads/cars/36/
http://www.mydomain.com/de/ads/cars/37/

Basically we are planning to set up the English site
under the main domain and language sites under a
directory structure like the above, so the following
would be valid:

http://www.mydomain.com/ads/cars/36/
{shows content in English and uses a certain
controller and view to do this}

http://www.mydomain.com/sg/ads/cars/36/
(must use the same controller and view, but the site
id will be different (stored in a session) and
therefore display everything in the other
language/country


My question - how can I do this in ZF? In the
IndexController, I know I can define functions for the
above like this:

public function adsAction() {
}

But then how do I make sure the same function is
called if I go to a URL like this:
http://www.mydomain.com/sg/ads/cars/36/

public function sgAction() {
 //set session site id as sg
 //redirect to adsAction() if /ads/ is the next item
in the URL, or redirect to productsAction if the next
item in the URL is products, or redirect to
indexAction if there is no next item in the URL
}

Can someone please let me know how to code this? I'm
still a newbie... the complication comes in because
the redirect depends on the URL. You may also have a
URL like this:

http://www.mydomain.com/?myparameter=1
http://www.mydomain.com/nl/?myparameter=1

Basically in both cases, I would want the indexAction
to be called with the appropriate session siteid set,
and the parameter would also need to be passed without
change.

Any advice on the best way to do this?

Many thanks!








[fw-general] How do I get my patch applied?

2008-06-17 Thread Carlton Gibson

Hi all,

I've written a patch for an issue with Zend_Filter_Input.
( http://framework.zend.com/issues/browse/ZF-3100 ).

Not sure what else to do, I've uploaded it to the issue tracker. And  
I'm wondering now, what next?


I'm a beginner at the whole open source community-reviewed project  
thing and despite promises that Contributing is easier than you  
think am finding the ZF workflow quite hard to understand --  
specifically, in this case, I understood from the wiki that I'd need  
to put my patch forward for review, but I can't see a link anywhere  
for THAT. Perhaps I've already done the right thing, but if so that's  
more luck than anything else -- and it's anything but clear to a newbie.


Can I just ask for some advice from more seasoned pros?

I'd like to go on and document the patch etc but I'm just sure of the  
workflow -- I continually seem to spend the time I could be spending  
on the ZF trying to work out what to do next/first by browsing big  
circles in the issue tracker/wiki. Perhaps this is just me :) but if  
someone who does this regularly could outline the steps *they would  
take* when patching a simple issue, that would be a great help.


Thanks,
Carlton 


Re: [fw-general] How do I get my patch applied?

2008-06-17 Thread Carlton Gibson


On 17 Jun 2008, at 14:18, Matthew Weier O'Phinney wrote:


-- Carlton Gibson [EMAIL PROTECTED] wrote
(on Tuesday, 17 June 2008, 09:31 AM +0100):
I'm a beginner at the whole open source community-reviewed project  
thing

and despite promises that Contributing is easier than you think am
finding the ZF workflow quite hard to understand -- specifically,  
in this
case, I understood from the wiki that I'd need to put my patch  
forward

for review, but I can't see a link anywhere for THAT. Perhaps I've
already done the right thing, but if so that's more luck than  
anything

else -- and it's anything but clear to a newbie.

Can I just ask for some advice from more seasoned pros?



Carlton -- this is one area that we're still working on improving, and
my apologies at how frustrating this is.


Matthew -- thanks for getting back to me; I appreciate that there's  
masses going on with the framework and that it is a question of  
available resources...


There might be a kind of *long tail* argument for (Zend itself even)  
prioritising the improvements here: despite limited lead developer  
time, the sum of the contributions from the tail may very quickly pay  
back the cost of improvements if only they could be encouraged/ 
captured. This would also have permanent benefits for the speed of  
the framework's development -- we would all benefit if lead  
developers were free to rush ahead knowing a whole wave of users  
could easily pick up any dropped fragments behind them.


(Just thoughts :-)


We will be reviewing issues for inclusion with 1.6 (and potentially
another bugfix release of 1.5) in the coming weeks. Those that have
patches are usually given higher priority as, well, quite simply, the
work has been done. :-) Somebody with SVN karma will then apply the
patch, and write any necessary tests to exercise it (hint, if you
haven't written a test case, do so and attach it!).


Test case it is then! (Thanks)

Regards,
Carlton



Re: [fw-general] moving site

2008-06-16 Thread Carlton Gibson

Hi Darren,

On 16 Jun 2008, at 15:10, darren wrote:
I have a ZF site up and running.  It's just my first little  
practice site.  And, I'd like to move it underneath an existing  
site that is not based on ZF.


My first question, Is that possible?  I tried it and I got  
controller errors.



Yes, it's possible.

The basic idea would be to have a .htaccess file in the sub-folder  
you want to host the zf-site in which redirects all requests to that  
folder to a bootstrap, say index.php.


It sounds like you're on the right track... when you say 'controller  
errors' do you mean ones like this:
Zend_Controller_Dispatcher_Exception: 'Invalid controller class  
(IndexController)'


?

If so, and on the assumption that the trial site is working then, it  
is very likely that you've just got the path to your controllers  
directory wrong. Check that and see how you get on.


Regards,
Carlton


Re: [fw-general] Zend_Log - data does not make into the table

2008-06-15 Thread Carlton Gibson


On 15 Jun 2008, at 06:49, Shekar C Reddy wrote:

I'm logging messages into an InnoDb table and I can see the return  
code of 1 from the insert method and a valid lastInsertId of the  
autoincrement PK column, too. But the data for some reason is  
missing in the table - even if I abort the script right after the  
insert and go query the table, its empty! I can insert data into  
the table manually using a GUI tool. What could be the reason for  
the data inserted through Zend_Log but missing in the MySQL table?  
Has anyone had similar problems before? Using ZF v1.5.1.


You're not automatically starting a transaction and then failing to  
commit it are you?