Re: [fw-general] Living with bugs in ZF?

2009-05-18 Thread Eric Coleman
Not sure what the official answer is, but I would think it would be
along the lines of:

1) Write a patch to fix the broken code
2) Write a patch for the relevant test, adding a test case if there
isn't one.. (Or maybe a test case referencing the ticket number?)
3) Attach to the issue

Maybe after that sending the list a message would be good to draw
attention to it.

On Mon, May 18, 2009 at 3:20 PM, till  wrote:
> On Mon, May 18, 2009 at 8:12 PM, keith Pope  wrote:
>> Write a patch, this way you can re-patch the files if there is another
>> release. Plus you can upload the patch to the ticket and hope it will
>> get applied :)
>
> We pretty much do the same that Keith suggested. That's the last
> resort though, if possible we extend classes and avoid patching. You
> could also use runkit to monkey patch PHP code. ;-) But that's
> probably not wise in production.
>
> Till
>



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


Re: [fw-general] problems with zf.sh

2009-05-09 Thread Eric Coleman
Sounds like your link link to 'zf' is pointing to the zf.php script.
Make sure it's pointing to zf.sh and you should be fine.

On Sat, May 9, 2009 at 7:38 PM, Mark Wright  wrote:
> As far as I can tell I followed the docs. I am using zend server on os
> x. I have links to zf.sh and zf.php in /usr/local/zend/bin but I get
> weird output.
>
> $ zf show version
> /usr/local/zend/bin/zf: line 1: ?php: No such file or directory
> /usr/local/zend/bin/zf: line 2: /Applications: is a directory
> Zend Manfist, (c) 2006 Zend Technologies
>
> Usage:
>  -a -i  -d  -o 
>    or
>  -v -i 
>
> Commands:
> a - append a manifest to an executable
> v - verifies and displays the manifest attached to the executable
>
> Options:
> i  - path to the executable to which to add / verify
> o  - path to which the resulting file will be created
> d  - path to a file containing the manifest
> Zend Manfist, (c) 2006 Zend Technologies
>
>
> The Usage, Commands and Options repeats 15 times and at after the last
> one it adds this in place of the zend manfist line:
>
> /usr/local/zend/bin/zf: line 18: syntax error near unexpected token `('
> /usr/local/zend/bin/zf: line 18: ` * @copyright  Copyright (c)
> 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)'
>
>
>
> php -i confirms that zend framework is in the include path. Anybody
> have any ideas?
>
>
> Mark
>
> --
> Have fun or die trying - but try not to actually die.
>



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


Re: [fw-general] size limit raised on javascriptCaptureStart()

2009-04-22 Thread Eric Coleman
http://us.php.net/manual/en/pcre.configuration.php

Could it be those 2 configurable limits causing the problems?  We had
some problems here a while back with hitting the backtrack limit which
was causing weird behaviour, perhaps your running into the same
issues.

On Wed, Apr 22, 2009 at 9:28 AM, Guillaume Oriol  wrote:
>
> Hi Matthew,
>
> I missed something when tracking this bug:
> if you look closely to the regexp, you'll see a question mark following ".*"
> in parenthesis.
> I guess this is an error as I don't understand its meaning.
>
> On my server:
> 
> $a = str_repeat('a', 49997);
> $a = preg_replace('/^\s*(.*?)\s*$/s', '$1', $a);
> 
> would return the string but:
> 
> $a = str_repeat('a', 49998);
> $a = preg_replace('/^\s*(.*?)\s*$/s', '$1', $a);
> would return NULL.
> 
> If I remove the question mark, preg_replace operates properly, whatever size
> the string is.
>
>
> Guillaume Oriol wrote:
>>
>> Thank you Matthew for your answer but, according to PHP manual, the trim()
>> function removes ALL whitespace characters from beginning/end of the
>> string (and not only the first one). Furthermore, the trim() function
>> removes not only space but also:
>>     * "\t" (ASCII 9 (0x09))
>>     * "\n" (ASCII 10 (0x0A))
>>     * "\r" (ASCII 13 (0x0D))
>>     * "\0" (ASCII 0 (0x00))
>>     * "\x0B" (ASCII 11 (0x0B))
>>
>> I will post a message to php-internals regarding the issue on
>> preg_replace.
>>
>>
>> Matthew Weier O'Phinney-3 wrote:
>>>
>>> -- Guillaume Oriol  wrote
>>> (on Monday, 20 April 2009, 09:13 AM -0700):
 Hi, I discovered an issue with the
 javascriptCaptureStart/javascriptCaptureEnd
 function pair. When the captured text exceeds a certain limit (about
 50kB in my
 case), the function returns only a semi-colon. I have the following code
 in a
 view script:

 dojo()->javascriptCaptureStart(); ?>
 var data = data; ?>;
 ...
 dojo()->javascriptCaptureEnd(); ?>

 And, as the number of rows in my database table is growing, $this->data
 is
 getting bigger and bigger. Finally, over ~50KB, the PHP tag returns a
 semi-colon and nothing else (not even the "var data =" preceeding that
 tag).
 I was able to trace this issue back to the function addJavascript($js)
 in
 Zend_Dojo_View_Helper_Dojo_Container and more precisely to the
 preg_replace
 function:

         $js = preg_replace('/^\s*(.*?)\s*$/s', '$1', $js);

 I replaced it by:

         $js = trim($js);

 and everything was fine. Therefore, I have two questions:
 - is there a know limitation on preg_replace()
 - why did you use a preg_replace function to trim the string ?
>>>
>>> I'm not aware of any limitations on preg_replace(), but you might want
>>> to either file a bug with php.net or ask on the php-internals mailing
>>> list about it -- that seems like odd behavior.
>>>
>>> We chose to use preg_replace over trim() as it allows removing more than
>>> one whitespace character from front and back, and will include newlines
>>> when doing so.
>>>
>>> --
>>> Matthew Weier O'Phinney
>>> Project Lead            | matt...@zend.com
>>> Zend Framework          | http://framework.zend.com/
>>>
>>>
>>
>>
>
>
> -
> Guillaume ORIOL
> Sofware architect
> Technema
> --
> View this message in context: 
> http://www.nabble.com/size-limit-raised-on-javascriptCaptureStart%28%29-tp23139812p23175439.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



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


Re: [fw-general] Invalid controller specified (favicon.ico)?

2009-04-01 Thread Eric Coleman
It's because all modern browsers look for /favicon.ico on your site...

To stop the message, put a favicon.ico file into your /public
directory.  You may also need to adjust your rewrite rule depending on
which one your using...

On Wed, Apr 1, 2009 at 4:09 PM, Steven Szymczak
 wrote:
> I'm actually starting to wonder if my messages are making it to the list
> anymore, but here goes.
>
> My site currently has 2 modules: default and photo.  Everything is working
> fine with the default module; however, whenever I try and get to the photo
> module (site.com/photo) the following error shows up:
>
> PHP Fatal error:  Uncaught exception 'Zend_Controller_Dispatcher_Exception'
> with message 'Invalid controller specified (favicon.ico)' in
> /home/bleak/www/farstrider.eu/library/Zend/Controller/Dispatcher/Standard.php:241\nStack
> trace:\n#0
> /home/bleak/www/farstrider.eu/library/Zend/Controller/Front.php(934):
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> Object(Zend_Controller_Response_Http))\n#1
> /home/bleak/www/farstrider.eu/application/bootstrap.php(59):
> Zend_Controller_Front->dispatch()\n#2
> /home/bleak/www/farstrider.eu/public/index.php(3):
> require('/home/bleak/www...')\n#3 {main}\n  thrown in
> /home/bleak/www/farstrider.eu/library/Zend/Controller/Dispatcher/Standard.php
> on line 241
>
> Needless to say, the page fails to load.  No headers, nothing.  Has anybody
> else come across this?
>
> Cheers,
> -- Steven
>



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


Re: [fw-general] Dynamically generated RSS feed question

2009-03-19 Thread Eric Coleman
Deepak,

Scroll up on that link he sent you There is a huge code sample
there listing the structure of the array you need.  Create a
conforming array structure of your own and then follow the examples.

On Wed, Mar 18, 2009 at 11:13 AM, Deepak  wrote:
> On Wed, Mar 18, 2009 at 10:59 PM, till  wrote:
>
>> Yeah, first of all -- why do you wrap everything in short tags?
>>
>> Then, I'd suggest you use Zend_Feed_Builder and follow the example at
>> the bottom:
>> 
>>
>> Till
>>
>
> It is very short. No clue. Could you give me an example on how to wrap
> my data in this feed before saving or sending? Complete example is
> very much appreciated.
>
> Thanks for pointing me to right direction.
>



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


Re: [fw-general] debug horror - a parse error, no error output to be found anywhere

2009-03-09 Thread Eric Coleman

http://pecl.php.net/package/scream

Not sure if ZF is still using the silence operator thingie anymore,  
but scream stops it, very helpful.


- Eric

On Mar 9, 2009, at 5:09 PM, till wrote:

On Mon, Mar 9, 2009 at 8:53 PM, David Mintz   
wrote:

I suppose this is not even ZF-specific, but...

I have been doing some Ajax stuff, intentionally outputting content- 
type
javascript/application followed by javascript code for the client  
to eval.
Working away, all is well until suddenly my javascript is being  
returned as
text/html. After a lot of diagnostic echo() I finally narrowed it  
down to
the fact that I had introduced a syntax error in a class that was  
being

instantiated along the way. (Too bad Zend Studio's usual red syntax
error-flagging is not working today.)  There was nothing in the  
browser
output stream (at last not by the time it got to me) and nothing in  
any
error log by way of error message about this condition. But MY  
content-type
header was apparently being overwritten by the default text/html,  
it seems,

once execution blew up.

The whole thing is really weird, and quite a cruel torture. (I  
know, I
should learn to properly use a proper debugger and I swear I will  
some day
before they put a toe-tag on me --- or cart me away to the  
psychiatric

hospital.)

Has this happened to you? If so, what do you do to safeguard  
against it

happening again?


Yes, of course.

I safe guard with the following measures:

a) error_log (php.ini) is setup and I have a terminal open with tail  
-f on it
b) I usually also have a listener on the log which adds a notice on  
our CI setup

c) I have a task to "php -l" all files in our CI setup -- evaluates a
file for "syntax errors"

Hope that helps,
Till




Re: [fw-general] How to check the SQL string created by Zend_Db_Select?

2009-02-20 Thread Eric Coleman
typecast it to a string..

Zend_Debug::dump((string) $select);
echo $select;
var_dump((string) $select);

It's magic __toString() will compile the sql when the object is used
as a string.

On Sat, Feb 21, 2009 at 12:34 AM, Deepak Shrestha  wrote:
> Hi,
>
> How can we check the SQL string created by select?
>
> for example:
>
> given this
> $select->where ( );
> $select->orwhere ( );
> $select->order ( );
>
>
> I want to check the complete SQL statement it has created
>
> Zend_Debug::Dump($select) doesn't provide what I wanted to know.
>
> Thanks
>
> --
> ===
> Registered Linux User #460714
> Currently Using Fedora 8, 10
> ===
>



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


Re: [fw-general] What do you use to manage your ZF projects?

2009-01-21 Thread Eric Coleman
We use redmine.  Been getting used to it over the last 2 or so weeks
but overall no real complaints.

On Wed, Jan 21, 2009 at 12:32 PM, Robert Castley
 wrote:
> Well ...
>
> Depending on which way you look at it, I have stupidly decided to have a
> stab at developing my own PHP based solution.
>
> Using ZF ... of course!
>
> My starting point is a direct copy of the sqlite database from trac, this
> has already been modified to support projects :-)
>
> I have the Wiki side of things all working thanks to my other attempt at a
> project called ZFWiki.
>
> I will report back when I have more information :-)
>
> I have some screenshots at http://gallery.me.com/robert.castley#100086
>
> - Robert
>
> -Original Message-
> From: Karol Grecki [mailto:kgre...@gmail.com]
> Sent: 21 December 2008 22:42
> To: fw-general@lists.zend.com
> Subject: RE: [fw-general] What do you use to manage your ZF projects?
>
> Everything is raised as tickets, there are different types like bug, task,
> proposal etc.
> You can organise them using milestones, components and versions.
> I used milestones for projects because they have special meaning in Roadmap
> view, but you can chose any of them and create appropriate reports using sql
> syntax.
>
> Anyway I feel your pain, I couldn't find anything meeting my requirements
> either.
> I even considered building it myself, using ZF of course :)
>
> Karol
>
> rcastley wrote:
>>
>> Hi Karol,
>>
>> How do you handle issue/bug tracking?
>>
>> In Bugzilla I can choose the Product and then the component etc.
>>
>> More research tonight has unveiled the following projects:
>>
>> 1) Redmine (seems to be like Trac but written in Ruby).  Not used Ruby
>> or Rails so not comfortable with this from a systems managament POV.
>> See Item 3!
>> 2) I used Gforge on the Mambo project, they now over an Advanced Version:
>> http://gforgegroup.com/es/download.php
>> 3) Retrospectiva - but look at the 'Quick' Install guide:
>> http://retrospectiva.org/wiki/Quick%20install.  Now I know why I love
>> PHP
>> ;-)
>>
>> I think I am now getting myself down to Gforge AS or Trac.
>>
>> Why is nothing ever easy, eh?
>>
>> - Robert
>>
>> -Original Message-
>> From: Karol Grecki [mailto:kgre...@gmail.com]
>> Sent: 21 December 2008 21:46
>> To: fw-general@lists.zend.com
>> Subject: Re: [fw-general] What do you use to manage your ZF projects?
>>
>>
>> Robert
>>
>> I had the same problem over a year ago and settled for Trac. It
>> doesn't support multiple projects but we use milestones for it e.g.
>> "project A sprint 1" It integrates really well with Subversion and
>> there's a lot of plugins extending its functionality. It may still be
>> your best bet if you don't find anything matching all your
>> requirements.
>>
>> Karol
>>
>>
>> rcastley wrote:
>>>
>>> Hi,
>>>
>>> Just curious here.  I/we currently use  Bugzilla & CVS, no formal
>>> wiki but I do have a MediaWiki used for somethings.
>>>
>>> I am looking for a solution that fits all, so the obvious choices are
>>> 'Trac'
>>> like.
>>>
>>> My problem is that I need a solution that will support multiple projects.
>>> (Trac doesn't score well in this area.)
>>>
>>> Bugzilla is used by multiple PHP, Java & C/C++ products.  CVS is used
>>> only by PHP developers the 'others' use VSS.
>>> MediaWiki is used for 'sparse' documentation.
>>>
>>>
>>> My gripes with the current setup:
>>>
>>> Bugzilla - v. slow and ugly but it fitted the bill at the time.
>>> CVS - I like, no love, CVS but I know that there are better solutions
>>> out there but am concerned about migration etc.
>>> MediaWiki - Probably too much of an overkill for what we need and it
>>> is not that easy to configured, extend etc.
>>>
>>> I now that the ZF team uses JIRA, Confluence etc but I have a budget
>>> of £0/$0 :-) and don't qualify for the OS licenses.
>>>
>>> So ... I would be interested on the views of others of a 'one hat
>>> fits all'
>>> solution that can handle multiple projects.
>>> The solution needs to offer Issues/Bug tracking and Wiki at a minimum.
>>> Integration with SCM not important but if it does it great.
>>>
>>> I would prefer a PHP based solution but happy to consider others i.e.
>>> Ruby,
>>> Perl, Java etc.
>>>
>>> - Robert
>>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/What-do-you-use-to-manage-your-ZF-projects--tp21118310p21120113.html
>
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> 
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
>
> 
>
> 
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> __

Re: [fw-general] ZF application optimizations (and speedup)

2008-11-07 Thread Eric Coleman
On Fri, Nov 7, 2008 at 12:15 PM, Matthew Weier O'Phinney
<[EMAIL PROTECTED]> wrote:
> Actually... loadClass() already does that. The issue is in the userland
> code -- if they do a require_once or include_once in userland *after*
> we've already loaded the class in the autoloader using simply include,
> that will trigger the error. That's what I was getting at. That said,
> we may be being to defensive about this.

So, if your worried about includes -after- the autoloaded... what
exactly are you preventing with include_once?  Seems like it'll be an
error regardless, no?

Regards,
Eric


Re: [fw-general] Sysadmin stuff and cookies. . .

2008-07-09 Thread Eric Coleman
Any progress wil? I kinda miss the changeset rss feeds :'( it was nice
to keep an eye on what's going on.

On Mon, Jul 7, 2008 at 4:24 AM, Wil Sinclair <[EMAIL PROTECTED]> wrote:
> Hey all, I've been wearing my sysadmin hat all weekend. I've upgraded
> some of our software, including crowd (for user management and SSO). It
> turns out that there isn't a compatible version of crucible for this new
> version: http://jira.atlassian.com/browse/FE-557. I'm going to contact
> Atlassian support tomorrow, but for the time being
> http://framework.zend.com/code is out of service. Please use
> http://framework.zend.com/svn/framework to browse the code instead. I'll
> keep you updated; if they can't fix it in a few days I will cross my
> fingers and try to downgrade crowd.
> You may also find that you are having problems logging in to the
> applications. Delete any cookies from the framework.zend.com domain and
> try again.
>
> Let me know if you experience any (new) weirdness in the next few days.
>
> Thanks!
> ,Wil
>


Re: [fw-general] Create a new table using Zend_Db_Table

2008-04-23 Thread Eric Coleman

Something along the lines of:

$table = new My_Table; // extends Zend_Db_Table
$db= $table->getAdapter(); // returns Zend_Db_Adapter_Abstract  
object


$db->query('create table...');


On Apr 23, 2008, at 3:51 PM, xing93111 wrote:


Can I use Zend_Db_Table to create a table in a database? If yes,  
how? If not,

which API does ZF provide to do so?

Thanks!
--
View this message in context: 
http://www.nabble.com/Create-a-new-table-using-Zend_Db_Table-tp16834793p16834793.html
Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] Alternate layouts by module

2008-04-23 Thread Eric Coleman
I'm not sure if this is right or wrong, but basically, I create a  
layout instance in my bootstrap and set it to disabled..


Then, each modules has it's own abstract controller, and I use the  
init() method of there to specify the layout for the module.  Is this  
not something I should be doing, and should instead be leaving to a  
plugin like you did below?  I used to use that method but found the  
init() method above better (can't remember why though)...


Best Regards,
Eric

On Apr 23, 2008, at 2:42 PM, Robin Skoglund wrote:
I'd consider writing a postDispatch plugin, so you know what module  
you're

actually dispatching. Something like:

class My_Controller_Plugin_ModuleLayout extends
Zend_Controller_Plugin_Abstract
{
   public function postDispatch(Zend_Controller_Request_Abstract  
$request)

   {
   $layout = Zend_Layout::getMvcInstance();
   $module = $request->getModuleName();
   $layout->setLayout($module);
   }
}

Then in your bootstrap you do $front->registerPlugin(new
My_Controller_Plugin_ModuleLayout()).

Of course, you could also do something more specific, e.g. limiting  
to only
a few layouts and use a switch-case. Endless possibilites. This  
should also

be a quite portable way of doing things.

Robin

On Wed, Apr 23, 2008 at 8:09 PM, rollockg <
[EMAIL PROTECTED]> wrote:



Is there a way to define in my bootstrap a separate layout path for  
each

module?
--
View this message in context:
http://www.nabble.com/Alternate-layouts-by-module-tp16834740p16834740.html
Sent from the Zend Framework mailing list archive at Nabble.com.






Re: [fw-general] Create a new table using Zend_Db_Table

2008-04-23 Thread Eric Coleman
I don't see why not... but you won't be able to create an instance of  
Zend_Db_Table for a table that doesn't exist.


Regards,
Eric

On Apr 23, 2008, at 4:46 PM, Bill wrote:
Thanks, Eric. In this case, I have to define all table's fields in  
the query

statement ($db->query('create table ()'). Can I define the table's
fields in the my My_Table class?

Thank you very much!


On Wed, Apr 23, 2008 at 2:41 PM, Eric Coleman <[EMAIL PROTECTED]>  
wrote:



Something along the lines of:

$table = new My_Table; // extends Zend_Db_Table
$db= $table->getAdapter(); // returns Zend_Db_Adapter_Abstract  
object


$db->query('create table...');


On Apr 23, 2008, at 3:51 PM, xing93111 wrote:



Can I use Zend_Db_Table to create a table in a database? If yes,  
how? If

not,
which API does ZF provide to do so?

Thanks!
--
View this message in context:
http://www.nabble.com/Create-a-new-table-using-Zend_Db_Table-tp16834793p16834793.html
Sent from the Zend Framework mailing list archive at Nabble.com.








Re: [fw-general] Bug: Zend_Http_Client_Adapter_Socket not freeing memory

2008-04-17 Thread Eric Coleman
Couldn't a specific stream registry, and possibly some slight  
refactoring make it easier to implement a way to make multiple  
requests in parallel [1] [2]?  I worked on changing Zend_Http_Client  
to support something like this on several occasions, but each one had  
a set of issues and was ugly.


1: example 1 -> http://us2.php.net/manual/en/function.curl-multi-exec.php
2: http://netevil.org/blog/2005/may/guru-multiplexing

On Apr 17, 2008, at 11:52 PM, Quintin Russ wrote:


Hi Guys,

This is just a quick email for those using the Rest Client / their  
own Http

client and are seeing memory leaks in long running processes.

On line 115 of Zend/Http/Client/Adapter/Socket.php:

// Now, if we are not connected, connect
  if (! is_resource($this->socket) || ! $this- 
>config['keepalive']) {

  $context = stream_context_create();
  if ($secure) {

For each request a stream_context_create call is made. This returns a
resource which is not released until the process finishes as is  
detailed in

this bug report here: http://bugs.php.net/bug.php?id=40257

This means for long running processes  - Every time you make a new  
request a
resource is returned, and not released when the socket is closed.  
Over time

your memory leaks and "Bad Things" start happening.

We came up with a PoC fix by storing this context resource in the
Zend_Registry as follows:

if (Zend_Registry::isRegistered('zf_rest_context'))
{
  $context = Zend_Registry::get('zf_rest_context');
}
else
{
  $context = stream_context_create();
  Zend_Registry::set('zf_rest_context', $context);
}

Not the cleanest / best solution, but we were simply trying to plug  
the

leak. :-)

Use of a common object (Singleton perhaps?) could perhaps fix this  
bug.


Thanks for your time, any comments appreciated.

Best Regards,

Quintin
--
View this message in context: 
http://www.nabble.com/Bug%3A-Zend_Http_Client_Adapter_Socket-not-freeing-memory-tp16760061p16760061.html
Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] RE: CHM Documentation

2008-03-12 Thread Eric Coleman

On Mar 12, 2008, at 3:41 PM, Alan Wagstaff wrote:

On a related note to CHM manuals, are there any plans to add a search
function to the online manual?


+1 for a searchable api / manual online, maybe a nice little tutorial  
on using

Lucene could come from it.

Regards,
Eric



Re: [fw-general] Lucene Highlighting

2008-03-10 Thread Eric Coleman
I also haven't used lucence... so could it be a problem with unicode  
data and non-unicode string manipulation functions?


Regards,
Eric

On Mar 10, 2008, at 5:15 PM, Jordan Moore wrote:


No, it hasn't, and I'm pretty sure that highlighting doesn't use the
index anyway... you just parse a query and give it some HTML to
highlight.

On Mon, Mar 10, 2008 at 2:09 PM, Bradley Holt
<[EMAIL PROTECTED]> wrote:

I have yet to use Lucene so my answer will probably sound completely
ignorant. With that disclaimer, is it possible that your document has
changed since the last time you created your index?



On Mon, Mar 10, 2008 at 4:54 PM, Jordan Moore <[EMAIL PROTECTED] 
>

wrote:

Has anyone ever had the problem of highlighting being off by a few

characters?


--
Jordan Moore





--
Bradley Holt
[EMAIL PROTECTED]






--
Jordan Moore




Re: [fw-general] Amazon SQS Class

2008-03-03 Thread Eric Coleman

I'd definitly have a use for this.

Matthew,

I'm not sure how the "Zend" process works, but you guys seem to have a  
queue api already I found in some marketing materials... any chance of  
getting it cleaned up and into the framework?


Regards,
Eric


On Mar 3, 2008, at 9:17 AM, Matthew Weier O'Phinney wrote:


Definitely; I've written queueing systems a couple of times before.
They're great for ensuring that issues with subsystems don't affect  
the

frontend (e.g., if there's an issue sending a mail, you can keep
queueing it until it sends; or if a service is unavailable, you can  
keep

queueing the request until it's healthy again).

Another backend adapter to consider is the Zend Platform Job Queue.








Re: [fw-general] Make Default Router get 1 param from /some/list/1

2008-02-29 Thread Eric Coleman

On Feb 29, 2008, at 1:33 PM, Nicolae Namolovan wrote:


:controller/:action/:id do not support /key/value/ syntax.

I need support for /key/value/ param, and for some controller actions
/JUSTONEVALUE/, with one default rewrite rule. This actually what mine
patch is doing.



yeah so add the above route... it should work fine.

If your route doesn't match :controller/:action/:id it should  
match :controller/:action/*


I don't understand what the problem here is, or why you need the patch.

On Fri, Feb 29, 2008 at 7:20 PM, Eric Coleman <[EMAIL PROTECTED]>  
wrote:
You don't even need a regex route really... You could define a  
route as:


:controller/:action/:id

and getParam('id') => 1 in your example.

Regards,
Eric



On Feb 29, 2008, at 1:14 PM, Nicolae Namolovan wrote:


Thanks guys, but I think there is no way to change
Zend_Controller_Router_Route_Module behavior (what by default is the
default router) without patching it. What I've done, just copy/paste
it (Zend\Controller\Router\Route\Module.php) in mine library
directory, and then added after this

"for ($i = 0; $i < $numSegs; $i = $i + 2) {
  $key = urldecode($path[$i]);
  $val = isset($path[$i + 1]) ? urldecode($path[$i +
1]) : null;
  $params[$key] = $val;
  }
"

This:

"if ( ($numSegs % 2) == 1) {
 $params[0] = urldecode($path[$numSegs - 1]);
  }
"

And to change the default router I did this

 $compat = new New_Route_Module(); //the new name of the  
patched class

 $rewriteRouter = new Zend_Controller_Router_Rewrite();
 $rewriteRouter->addRoute('default', $compat);
 $front->setRouter($rewriteRouter);

Now if there's a param without key, it will be accessible from a
controller at $this->_getParam(0).. Just what I wanted.. And still
have the key->param feature.. Great.

On Fri, Feb 29, 2008 at 4:39 PM, Vincent <[EMAIL PROTECTED]> wrote:

You might be interested in
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.regex




On 29/02/2008, Nicolae Namolovan <[EMAIL PROTECTED]> wrote:

Yes, but I want to do one rewrite route for all actions.. I mean
change the default router.
For example, very often I need just one paramater, so it doesn't
make
too much sense to pass param name too..
I'd like to get one_param from /controller/action/one_param..
Any way to do that with getParam() ? And how I must rewrite the
route
to leave the /key/value behavior and just add /value behavior..


On Wed, Feb 27, 2008 at 5:07 PM, James Dempster <[EMAIL PROTECTED] 
>

wrote:

You might find that this is more what you are looking for?


http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.basic




On Wed, Feb 27, 2008 at 12:57 PM, Nicolae Namolovan

<[EMAIL PROTECTED]>

wrote:
Is it possible to do a default router with same  
characteristics as

current

one:


Module + controller + action + params:

But also with
Module + controller + action + 1param:
Example:
/some/list/1

And getParam(0) should return 1.. ?

--
Sincerely,
Nicolae Namolovan.





--
/James





--
Sincerely,

Nicolae Namolovan.





--
Vincent




--
Sincerely,
Nicolae Namolovan.







--
Sincerely,
Nicolae Namolovan.




Re: [fw-general] Make Default Router get 1 param from /some/list/1

2008-02-29 Thread Eric Coleman

You don't even need a regex route really... You could define a route as:

:controller/:action/:id

and getParam('id') => 1 in your example.

Regards,
Eric

On Feb 29, 2008, at 1:14 PM, Nicolae Namolovan wrote:


Thanks guys, but I think there is no way to change
Zend_Controller_Router_Route_Module behavior (what by default is the
default router) without patching it. What I've done, just copy/paste
it (Zend\Controller\Router\Route\Module.php) in mine library
directory, and then added after this

"for ($i = 0; $i < $numSegs; $i = $i + 2) {
   $key = urldecode($path[$i]);
   $val = isset($path[$i + 1]) ? urldecode($path[$i +
1]) : null;
   $params[$key] = $val;
   }
"

This:

"if ( ($numSegs % 2) == 1) {
$params[0] = urldecode($path[$numSegs - 1]);
   }
"

And to change the default router I did this

$compat = new New_Route_Module(); //the new name of the patched class
$rewriteRouter = new Zend_Controller_Router_Rewrite();
$rewriteRouter->addRoute('default', $compat);
$front->setRouter($rewriteRouter);

Now if there's a param without key, it will be accessible from a
controller at $this->_getParam(0).. Just what I wanted.. And still
have the key->param feature.. Great.

On Fri, Feb 29, 2008 at 4:39 PM, Vincent <[EMAIL PROTECTED]> wrote:

You might be interested in
http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.regex




On 29/02/2008, Nicolae Namolovan <[EMAIL PROTECTED]> wrote:

Yes, but I want to do one rewrite route for all actions.. I mean
change the default router.
For example, very often I need just one paramater, so it doesn't  
make

too much sense to pass param name too..
I'd like to get one_param from /controller/action/one_param..
Any way to do that with getParam() ? And how I must rewrite the  
route

to leave the /key/value behavior and just add /value behavior..


On Wed, Feb 27, 2008 at 5:07 PM, James Dempster <[EMAIL PROTECTED]>

wrote:

You might find that this is more what you are looking for?


http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.basic




On Wed, Feb 27, 2008 at 12:57 PM, Nicolae Namolovan

<[EMAIL PROTECTED]>

wrote:

Is it possible to do a default router with same characteristics as

current

one:


Module + controller + action + params:

But also with
Module + controller + action + 1param:
Example:
/some/list/1

And getParam(0) should return 1.. ?

--
Sincerely,
Nicolae Namolovan.





--
/James





--
Sincerely,

Nicolae Namolovan.





--
Vincent




--
Sincerely,
Nicolae Namolovan.




Re: [fw-general] Sanity check releases OK?

2008-02-25 Thread Eric Coleman

Same here, I keep building off of trunk, and it's been fine.

Regards,
Eric


On Feb 25, 2008, at 3:30 PM, Jurriën Stutterheim wrote:


Hi Wil,

I update the trunk from the svn almost daily for my testing/devving  
environment.
So far I haven't run into any problems using Form, Controller, View  
and Db. (including all helpers etc.)

As far as I can see, 1.5 is ready for RC1.


On Feb 25, 2008, at 7:51 PM, Wil Sinclair wrote:


Hi all, doesn't look like there has been much discussion on this list
about the sanity check releases. So, I'm assuming either they're OK  
or

nobody is actually testing them. ;)
I was wondering in particular if anyone had tried the 1.0.4 release,
since it is a production release and the last of the 1.0 series. If  
we

go live with this package and there are major defects we'll lose some
time on a 1.0.5 release, so please let me know if you've tried it,  
which

components you tested, and what your experiences have been.

Thanks much.
,Wil







Re: [fw-general] CakePHP vs. ZendFramework

2008-02-21 Thread Eric Coleman

Pretty cool to link to an unavailable product ;)

On Feb 21, 2008, at 4:11 PM, Andi Gutmans wrote:


That's an obvious answer.

We have much cooler merchandise:

http://www.zend.com/en/store/php-extras/framework-shirt#Additional-Information


Re: [fw-general] Caching of MVC and other ZF components

2008-02-20 Thread Eric Coleman
I'll second the clarification.  There seems to be a lot of  
misinformation around about this exact subject, and up until now I was  
under the same impressions that Bill was.


On Feb 20, 2008, at 5:50 PM, Bill Karwin wrote:




Stanislav Malyshev wrote:



Yes and no.  Rasmus Lerdorf has explained
(http://pooteeweet.org/blog/538)
that opcode caching is a compile-time optimization.  Runtime  
inclusion of
code happens after compile-time is past, and therefore cannot use  
the

opcode
cache.


This is not correct. Each file is compiled by the engine  
separately, so

include can and are benefiting from opcode caching.



Thanks for the correction, Stas.  Is the explanation attributed to  
Rasmus in
that blog out of date, talking about an older version of PHP & APC?   
Or is
he talking about something else entirely?  Rasmus' statements  
appeared to be
pretty clear on the matter.  Though I note that blog posting is now  
over a

year old.


Stanislav Malyshev wrote:


BTW, we plan to solve these problems in 5.3 - so that all opcode  
caches

(that would bother to use the new stuff of course ;) will be able to
cache all files in 5.3+, regardless of how and when and in which way
they were included.



Great to hear!  If only Achilles had been able to upgrade his heel  
in a

similar way.  :-)

Will that be for Zend Platform's opcode cache only, or will it also  
help APC

and Xcache?

Regards,
Bill Karwin
--
View this message in context: 
http://www.nabble.com/Caching-of-MVC-and-other-ZF-components-tp15576554s16154p15600867.html
Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] Zend_Config_Xml is not producinf the proper Zend_Config object

2008-02-05 Thread Eric Coleman

Zend_Db::factory() can take a native Config Object.

The config object below, would be used like so:

$config = Zend_Config_Xml('my-config.xml', 'application');
$db = Zend_Db::factory($config->database);

Note, the profiler line should also work ;)



  
1


PDO_MYSQL
set names 'utf8';


localhost
eric
mypass
devel
1



  


Regards,
Eric

On Feb 6, 2008, at 1:20 AM, Garri Santos wrote:

On Feb 6, 2008 11:33 AM, Garri Santos  
<[EMAIL PROTECTED]> wrote:


On Feb 6, 2008 11:22 AM, Matthew Weier O'Phinney <[EMAIL PROTECTED]>  
wrote:



-- Garri Santos <[EMAIL PROTECTED]> wrote
(on Wednesday, 06 February 2008, 10:43 AM +0800):

Good Day,

Im not sure anymore whether it's my xml file or is it  
Zend_Config_Xml

has the

problem. Here's my xml file.

config.xml



/ubraa/public

pdo_mysql
localhost
root
password
ubraa




After doing this:

$this->config = new Zend_Config_Xml($this->ubraaRoot .

DIRECTORY_SEPARATOR .

'configuration' . DIRECTORY_SEPARATOR .
'config.xml', 'default');

The Zend_Db::factory($config->type, $config); is throwing me an  
error


Um... shouldn't that be

  Zend_Db::factory($config->database->type, $config->database);

?

Based on the structure of your XML, you're not pulling from the  
correct

location in the config...



Adapter parameters must be in an array or a Zend_Config object

I have var_dump($this->config->database) and these is the result:

object(Zend_Config_Xml)#2 (6) {
["_allowModifications:protected"]=>
bool(false)
["_index:protected"]=>
int(0)
["_count:protected"]=>
int(2)
["_data:protected"]=>
array(2) {
  ["baseurl"]=>
  string(13) "/ubraa/public"
  ["database"]=>
  object(Zend_Config)#4 (6) {
["_allowModifications:protected"]=>
bool(false)
["_index:protected"]=>
int(0)
["_count:protected"]=>
int(5)
["_data:protected"]=>
array(5) {
  ["type"]=>
  string(9) "pdo_mysql"
  ["host"]=>
  string(9) "localhost"
  ["username"]=>
  string(4) "root"
  ["password"]=>
  string(8) "password"
  ["dbname"]=>
  string(5) "ubraa"
}
["_loadedSection:protected"]=>
NULL
["_extends:protected"]=>
array(0) {
}
  }
}
["_loadedSection:protected"]=>
string(7) "default"
["_extends:protected"]=>
array(0) {
}
}

Notice that the Zend_Config produce by the Zend_Config_Xml is  
missing

"params"

w/c should contain a correct Zend_Config Object like this:
$configuration = new Zend_Config(
  array(
  'database' => array(
  'adapter' => 'Mysqli',
  'params' => array(
  'dbname' => 'test',
  'username' => 'webuser',
  'password' => 'secret',
  )
  )
  )
);

object(Zend_Config)#32 (6) {
["_allowModifications:protected"]=>
bool(false)
["_index:protected"]=>
int(0)
["_count:protected"]=>
int(1)
["_data:protected"]=>
array(1) {
  ["database"]=>
  object(Zend_Config)#40 (6) {
["_allowModifications:protected"]=>
bool(false)
["_index:protected"]=>
int(0)
["_count:protected"]=>
int(2)
["_data:protected"]=>
array(2) {
  ["adapter"]=>
  string(6) "Mysqli"
  ["params"]=>
  object(Zend_Config)#43 (6) {
["_allowModifications:protected"]=>
bool(false)
["_index:protected"]=>
int(0)
["_count:protected"]=>
int(3)
["_data:protected"]=>
array(3) {
  ["dbname"]=>
  string(4) "test"
  ["username"]=>
  string(7) "webuser"
  ["password"]=>
  string(6) "secret"
}
["_loadedSection:protected"]=>
NULL
["_extends:protected"]=>
array(0) {
}
  }
}
["_loadedSection:protected"]=>
NULL
["_extends:protected"]=>
array(0) {
}
  }
}
["_loadedSection:protected"]=>
NULL
["_extends:protected"]=>
array(0) {
}
}


Thanks,
Garri


--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/



Hi Matthew,

I have tried your suggestion but still no luck. Here's the part  
that uses

$this->config.

   public function getDb()
   {
   if (null === $this->_services['db']) {
   $config = $this->config->database;
   //$this->_services['db'] = Zend_Db::factory($config->type,
$config);
   $this->_services['db'] =
Zend_Db::factory($config->database->type, $config->database);
   }

   return $this->_services['db'];
   }

As you can see I have already assigned $this->config->database to  
$config.
Though I have tried what you have suggest again it's throwing me  
the same

error.



Good Day,

It's finally working now thanks to all you guys here and SpotSec at  
#zftalk.


Can we remove "or a Zend_Config object" in the Zend/Db.php line no.  
217 it

Re: [fw-general] Re: Documentation on framework site

2008-02-05 Thread Eric Coleman

Why not use a version number in the url?

Or, what about putting some kind of "version" number information into  
the docbook data?  that way a component can specify what version it  
was introduced, etc... would be nice :-d


Regards,
Eric

On Feb 5, 2008, at 10:03 PM, Simon Mundy wrote:

Heh, yeah I _would_ ... but I know nothing about how the manual gets  
from the repository to the website :)


I'll wait to see if any of the existing maintainers put their hand  
up and if not then we'll put a prop up on the wiki post-1.5


Cheerio


To be honest, IMO the documentation situation is far from ideal right
now, and I can definitely see your point. On the other hand, 1.5. ;)
Have you considered putting together a proposal and reviewing what
changes would be required to our release process and build scripts?  
As

I'm sure you've noticed, Simon, the best way to get something done in
framework is to do as much as you can yourself without blocking on  
any

Zend involvement. :D Let me know what I can do to help you here, and
keep in mind that you might get more traction after 1.5 drops.

Thanks.
,Wil


-Original Message-
From: Simon Mundy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 05, 2008 6:39 PM
To: Wil Sinclair
Cc: Zend Mailing List
Subject: Documentation on framework site

Hi Wil

I'm not sure if this has been requested before, but would it be
possible to make it slightly clearer on the documentation pages that
the manual refers to the current trunk release of the framework?

If not that then perhaps hold back updates on the website until a
minor/major version has been released. I've seen a few cases where
people are confused as the new documentation refers to functionality
or changes that haven't yet been released to a stable version.

Or perhaps a-la MySQL's site there could be a browseable-by-version
page on the site? I'm not sure how automated the current process  
is so

hope I'm not asking for a biggy here :)

--

Simon Mundy | Director | PEPTOLAB

""" " "" "" "" "" """ " "" " " " "  "" "" "

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124
http://www.peptolab.com




--

Simon Mundy | Director | PEPTOLAB

""" " "" "" "" "" """ " "" " " " "  "" "" "

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654  
4124

http://www.peptolab.com





[fw-general] Re: Zend_Db Changes in 1.5PR

2008-01-24 Thread Eric Coleman
Yeah, so my sub-classes are to blame...  I really apologize for not  
investigating further before bitching.


Is there a detailed list of changes available yet for Zend_Db and  
related classes, or do I need to hold tight a little while longer...


/me hides

On Jan 24, 2008, at 7:03 AM, Eric Coleman wrote:


Seems all kinds of mistakes :/

Catchable fatal error: Argument 1 passed to  
Zend_Db_Table_Abstract::_order() must be an instance of  
Zend_Db_Table_Select, instance of Zend_Db_Select given


PHP Catchable fatal error:  Argument 1 passed to  
Zend_Db_Table_Abstract::_fetch() must be an instance of  
Zend_Db_Table_Select, instance of Zend_Db_Select given


Also, it seems to be generating messed up queries... Example:


$table = new Zend_Db_Table();
$table->fetchAll(null, array('lastName', 'firstName'));

results in:

SELECT

ORDER BY
`lastName` ASC,
`firstName` ASC

Regards,
Eric




[fw-general] Zend_Db Changes in 1.5PR

2008-01-24 Thread Eric Coleman

Seems all kinds of mistakes :/

Catchable fatal error: Argument 1 passed to  
Zend_Db_Table_Abstract::_order() must be an instance of  
Zend_Db_Table_Select, instance of Zend_Db_Select given


PHP Catchable fatal error:  Argument 1 passed to  
Zend_Db_Table_Abstract::_fetch() must be an instance of  
Zend_Db_Table_Select, instance of Zend_Db_Select given


Also, it seems to be generating messed up queries... Example:


$table = new Zend_Db_Table();
$table->fetchAll(null, array('lastName', 'firstName'));

results in:

SELECT

ORDER BY
`lastName` ASC,
`firstName` ASC

Regards,
Eric


Re: [fw-general] ZF Packaging

2008-01-23 Thread Eric Coleman

I got a question that I didn't see asked :p

Are the 2 packages going to be seperated in subversion, or will it  
remain the same SVN wise?


I only ask because of my current use of svn:externals to include trunk  
into my project (it's still in development)


Regards,
Eric

On Jan 23, 2008, at 2:42 PM, Wil Sinclair wrote:

So, not being one to leave important issues hanging, I’ll let all of  
you in on our thinking WRT PEAR here at Zend. While PEAR is a great  
packaging and distribution tool, many of our users really appreciate  
the simple tarball installation we currently offer; this is  
something we get a lot of positive feedback on. Suffice it to say,  
whatever we do vis a vis PEAR is unlikely to entirely replace the  
current method of distribution.


At this point, we don’t see enough value in establishing a PEAR  
channel and packaging ZF for PEAR to commit Zend resources to do  
this for every release (remember we’re trying to release  
functionality early and often, so release overhead must be kept to a  
minimum). That said, there are no terms in the licensing of ZF that  
prevent another party from packaging ZF for PEAR as they see fit and  
creating a PEAR channel. We could even consider hosting this if  
someone makes the significant commitment to keep it current and we  
can agree on the packaging. That would be a discussion for *after*  
someone has shown that they are dedicated to this project (probably  
by establishing an existing PEAR package(s) for a few releases) and  
has put together a proposal for us to consider.


In any case, there are- and almost surely will always be- those  
users who won’t want to use PEAR, and we will continue to make the  
installation process simple for them. At this point it seems that  
the best option is a tarball with possibly some CLI support for  
downloading some optional code/data. We do appreciate the  
distribution/versioning/dependency management issues in general  
packaging systems, and we certainly wouldn’t take on something this  
ambitious at this point. We’ll only add support for minimal  
distribution capabilities to the CLI if we can simplify requirements  
for a ZF-specific setup in a way that doesn’t have nasty side  
effects or gets us in to dependency hell.




Hope that sheds some light on the issue from our side.



,Wil



From: Kevin McArthur [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 23, 2008 9:11 AM
To: Pádraic Brady
Cc: fw-general@lists.zend.com
Subject: Re: [fw-general] ZF Packaging



No time for a big rant today,

1. No versioned/split sub-packages. (decided long ago)
2. Versioned paths in pear breaks pear standard operating method.  
May be confusing for that reason. Pear Upgrade ZendFramework _must_  
be avoided if it will change files to newer functional versions.

3. How would you deploy security fixes to existing version releases.
4. There has been talk/work on a CLI tool for bootstrapping anyway,  
just seems installation would be a natural extension as one command  
could download/install and bootstrap to prevent any pathing problems.


K

Pádraic Brady wrote:

To remark on some of the PEAR FUD.

PEAR doesn't remove the ability to download, decompress, copy and  
otherwise
manually manage the source code - essentially it just takes a  
default action
of downloading, decompressing, and copying into the /php/pear  
directory
which should already be present on the PHP include_path in php.ini  
which
alleviates one more include_path search for those getting a bit  
worried
about having >2. The proposed download archives for Core/Extras/etc.  
can

merrily continue their existence. They wouldn't even share the same
subdomain...

Does it preclude path versioning? I can script an entire PEAR system  
into
existence using Phing based on any array of preferred version  
numbers -
especially since PEAR does allow you to force installation of one  
specific
version irrespective of it's status or age. Last I checked the basic  
PEAR
installed in under 5 minutes. There is also version compatibility  
control
built into PEAR since you can set a preferred-version on all  
dependencies
package by package. This means control over specific preferred  
versions for

any remote system is a doddle. The only manual intervention would be
changing the include_path for the application...

Finally, the ZF is a componentised framework - not a fragile stack  
of cards
that will fall apart in PEAR - everyone did quite a good job of  
ensuring
classes/components are decoupled. I would agree that at a minimum  
there
would have to be a Core package of say the MVC components to form  
the basic

installation base for immediate use - everything else could be made a
self-contained package available across PEAR, with aggregated  
commands to
install specific "bundles" of packages (perhaps reflecting the  
proposed

download split). Then one could:

pear channel-discover pear.framework.zend.com
pear install zend/Zend_Core
pear install zend/

Re: [fw-general] Zend_Form from config file

2008-01-22 Thread Eric Coleman

Vincent,

No, unless you tell PoEdit to look for setLabel().  I tried to get  
this point acrost to Matthew and Thomas already, but it didn't seem to  
get through (maybe because I was using xgettext as the example).


Regards,
Eric

On Jan 22, 2008, at 2:04 PM, Vincent wrote:


On 22/01/2008, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:




If so how we gonna handle multilanguage (site been in multiple
languages) case ? With multiple sections of same config file,
"inherited" ([general], [en], [de], aso) ?


Right now, I've got the following setup for i18n:

 * With labels, if a Zend_Translate_Adapter has been registered with
   the form, the label provided to the element will be passed to
   translate(). So, you can specify a translation messageid for the
   label, and as long as you have a translation in the current  
locale,

   it will provide the translation.



Sorry to chime in, but this made me wonder: will this method still  
allow e.g.

PoEdit to generate translation files containing those strings?



--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/




Thanks,
--
Vincent




Re: [fw-general] Zend Locale - getCountryTranslation()

2008-01-22 Thread Eric Coleman

Thomas,

Not to be mean or anything, but I really think that "holografix" is on  
to something.  There's a -ton- of useful information available within  
Zend_Locale_Data, it's just that it appears not clear enough or  
something in the documentation.  I used the class a few times before I  
realized how much data really is contained within the beast.


Regards,
Eric


On Jan 22, 2008, at 6:56 AM, Thomas Weidner wrote:

Of course you will not have all parameters documented within the  
documentation.


But you could look into the API doc, where you will have ALL  
parameters and methods documented.
This is the default way for looking about detailed informations for  
methods.


/**
* Returns the localized country name
*
* @param   string  $whatName to get detailed information about
* @param   string  $locale  OPTIONAL locale for country translation
* @return   array
*/

It's all there. :-)

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com


- Original Message - From: "holografix ." <[EMAIL PROTECTED] 
>

To: 
Sent: Tuesday, January 22, 2008 12:46 PM
Subject: Re: [fw-general] Zend Locale - getCountryTranslation()



Hi
Thank you very much the help.
I agree with you Thomas. There is no need of an explicit example  
for a

simple function that returns a string but in the current docs we read
getCountryTranslation($what, $locale = null); (what is $what?) and
believe that I wouldn't ask for help if I read
getCountryTranslation($country_iso_code, $locale = null);. Just a
simple change in the docs.
Thank you again.

Best regards
holo

2008/1/21, Thomas Weidner <[EMAIL PROTECTED]>:
If you wait some days for the release you will get the new  
additional

documentation to this and related functions.

Generally as can be seen by the method name you will get a country
translation which means give a Country in ISO and get the  
translated string

for this country returned.

$loc = new Zend_Locale();
print $loc->getCountryTranslation('DE', 'en_US');

Generally I don't think that an explicit example is needed for a  
simple

string returning function...

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com

- Original Message -
From: "holografix ." <[EMAIL PROTECTED]>
To: 
Sent: Monday, January 21, 2008 6:41 PM
Subject: [fw-general] Zend Locale - getCountryTranslation()


> Hi
>
> Can someone help with this function?
> getCountryTranslation($what, $locale = null);
>
> It's missing a small example about this function in the docs.
>
> Best regards
> holo







Re: [fw-general] 1.0.4?!?!

2008-01-16 Thread Eric Coleman

+1

On Jan 16, 2008, at 1:04 PM, Michał Minicki wrote:


And +1 from me. Better to be sure earlier than sorry later :)

Andries Seutens wrote:

Hi Will,
I'd like to encourage to do another mini-release like you suggest.
+1
Best,
Andriesss
Wil Sinclair schreef:
Hi all, as 1.5 begins to take shape, I'd like to get people's  
opinions
about squeezing one last mini release out of the 1.0 branch. While  
there

is no concrete reason I'm aware of to hold off on upgrading to Zend
Framework 1.5 the day it is released in GA, the reality is that many
developers and admins will wait to make sure that it's stable  
enough to
rely on in production. I think we should embrace this reality and  
make
life a little easier for them by releasing all the current bug  
fixes in
a 1.0.4 release before moving on to 1.5 for good. We've already  
ensured

that we have the bandwidth to do this; there shouldn't be too many
backports required, and Darby will be good to go for the release  
process
after the 1.5 preview release. Also, please note that we do *not*  
intend

to create 2 active branches. The 1.5 PR would be cut, then the 1.0.4
release would be cut, then a few RC's and finally a 1.5 GA release.
After the 1.5 release there would be no looking back (without a  
*very*

good reason).
Any objections?

Thanks.
,Wil





--
Michał Minicki aka Martel Valgoerad | [EMAIL PROTECTED] | http://aie.pl/martel.as 
c
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
=-=-=-=-=-=
"Idleness is not doing nothing. Idleness is being free to do  
anything." --

Floyd Dell




Re: [fw-general] Zend_Filter_Input, no toArray()

2007-12-28 Thread Eric Coleman


$row->setFromArray($input->getUnescaped())->save();

Or, you can also call $input->getEscaped() to get an array of escaped  
values...


You'll probably want to save the unescaped versions though ;)

Regards,
Eric

On Dec 28, 2007, at 2:04 PM, David Mintz wrote:

Any way to get all the filtered/validated data out of your  
Zend_Filter_Input

object in one shot?

It would be nice to say

$input = new Zend_Filter_Input($filters, $validators,$data);


if ($input->isValid()) {

   $row->setFromArray($input->toArray())->save();

}

and be done with it. It seems that all we need in Zend_Input_Filter is

function toArray() { return this->_data; }



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

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




Re: [fw-general] When Zend_Session_SaveHandler_DbTable will be ready for core?

2007-12-23 Thread Eric Coleman
I've been meaning to post to the issue tracker, but there's a flaw I  
believe in the class.


It should be slightly refactored to allow customization of the select  
object.


Use case for this would be:

I want to only check against users with "isActive = 1" in the  
database.  I would subclass this, override a method (perferrably a new  
one like getPreparedSelect() or something) to allow for this.


Currently, you'd have to over ride authenticate(), call it from it's  
parent class, check the response, then check the result objects  
"isActive" value.


On Dec 23, 2007, at 9:44 AM, Alexey Simonenko wrote:

Recent changes in this component were long enough, now lacks only  
the tests and documentation. Are there any plans for the moving  
component in the core?



--
Best wishes, Alexey Simonenko
Chief developer, «Serenity Ltd»
Office phone: (812) 448-55-12
Mobile phone: (812) 923-95-74
ICQ: 424662283
http://serenity.su





[fw-general] Using ZVE Helpers with partial & action helper...

2007-12-20 Thread Eric Coleman
Sorry about sending this to general... either gmail ate my message to  
fw-db or it was denied :/


...

Any Placeholder data appears to get lost when using a combination of  
the action helper & partial...


I have something along the lines of:

edit.phtml:

action('action', 'controller') ?>

action.phtml:

partial('_bar.phtml', $data) ?>

If I use any of the head() helpers inside of _bar.phtml, they won't  
get appended into the layout.  I'm not sure if this is a bug per-say;  
I could just be doing this in a retarded fashion.


Regards,
Eric


[fw-general] Zend_Yaml & Zend_Service_Yadis

2007-12-19 Thread Eric Coleman
What exactly is going on with these components?  They have been  
sitting in the review queue for a while it appears...


Regards,
Eric


Re: [fw-general] creating webservices/mobile framework with current site

2007-12-18 Thread Eric Coleman
What you could do, is just use rewriting to route all of them to the  
same module / controller / action.


Then, in the action itself, just show the appropriate view.  You could  
name your scripts like:


users/books.phtml
users/books.api.phtml
users/books.mobile.phtml

and use a plugin to determine the appropriate postfix to use for the  
templates based on the request.


On Dec 18, 2007, at 7:03 PM, sgrobins wrote:



Hello,

I am using Zend Framework to create my website.  I have a typical  
directory
setup (without modules).  Here is an example of a url (user books is  
just

something i came up with for this example):
http://mysite.com/user/books?userId=1

This goes to the UserController::booksAction function.  The page  
that gets

returned is the user's information along with all the books they have
entered.

Now I plan to have a REST webservice with somewhat the same  
information.  My

url I would like is: http://api.mysite.com/user/books?userId=1

I would like something similar for mobile:
http://mobile.mysite.com/user/books?userId=1

How would you recommend I setup the directory structure and
controller/actions to accomplish this?  Obviously, with the current  
setup I
have, all above urls will go to UserController::booksAction, but I  
probably
want 3 different ones, since each will be returning different data  
(at the
very least different formats, but probably slightly different data  
too).  I
obviously want all three sites to use the same models I have written  
for a

User and for a Book.

Here are some options I came up with, but I am wondering if there is
something better:

1) I was thinking I could have three different bootstrap files, one  
for each

site.  And then place all my models (which currently live in
.../application/default/models) to some general location that for  
all three

sites to use.

2) I could change my urls to now use modules instead, so they would  
look

like:
http://mysite.com/default/user/books?userId=1
http://mysite.com/api/user/books?userId=1
http://mysite.com/mobile/user/books?userId=1

Then create the directory structure as:
.../application/default/controllers
.../application/api/controllers
.../application/mobile/controllers
and place my models somewhere for all to see: .../models/User.php

3) Inside the UserController::booksAction function determine which  
site I am
on (website, api, or mobile) and then send to the appropriate page  
to view.


4) other?  how are other people doing this?

Thanks,
Shawn
--
View this message in context: 
http://www.nabble.com/creating-webservices-mobile-framework-with-current-site-tp14408497s16154p14408497.html
Sent from the Zend Framework mailing list archive at Nabble.com.





[fw-general] Re: [fw-core] RE: [fw-general] Reducing the number of loaded exception files

2007-12-15 Thread Eric Coleman

When and where will these results be published?

Regards,
Eric

On Dec 15, 2007, at 9:58 PM, Wil Sinclair wrote:

Hey guys, sorry I didn't get a chance to reply to this thread until  
now.

While I might not be an expert on performance tuning in PHP, I believe
there are a few best practices that apply to all languages and
frameworks out there. Foremost among these is never increase code
complexity before having reasonable benchmarks to give you a decent
'before' and 'after' picture of the optimization. I realize that PHP  
is
somewhat unique in the benefit it can realize from an opcode cache,  
so I

would expect these figures for both opcode-cached and -uncached
installations. I also realize the extent of the complexity that  
might be

introduced- in fact, we might be able to simplify the lazy-loading of
exception classes further by introducing a factory method- possibly in
the Zend_Loader class- which doesn't make for a whole hell of a lot of
complexity. That said, it does add SOME complexity to the framework,
since we either have to include the exception class in more places  
than
we had to previously or we would have to prescribe a different  
method of

exception class loading than the most basic suggested usage at the
language level, and is therefore subject to the rule of thumb I  
mention

above.
Fortunately, we plan to do a performance audit of framework in the 1.5
timeframe that will create exactly these benchmarks to test against
going forward. ;D While I imagine that these will support a strong
argument for lazy loading of exceptions, I suggest we wait until we've
had a chance to run these benchmarks to decide which optimizations of
the many possibilities that we agree are worth the extra complexity.
Ultimately, this is another argument against 'premature optimization',
but I'm being slightly more specific about the definition of  
'premature'

here- anything before our 1.5 performance tests are executed and the
results compiled. :)

Thanks.
,Wil


-Original Message-
From: Philip G [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 15, 2007 2:17 PM
To: fw-general; fw-core
Subject: Re: [fw-general] Reducing the number of loaded exception

files


On Dec 15, 2007 3:43 PM, Shahar Evron <[EMAIL PROTECTED]> wrote:

Hi Nico,

On Sat, 2007-12-15 at 16:54 +0100, Nico Edtinger wrote:

Shahar Evron wrote:

10 redundant include files have quite an impact on performance,
especially in places where you have no opcode cache installed.


If you don't have an opcode cache you simply don't care about
performance. So why should we optimize for these people?


That's not true - some people (actually much more than "some") run

in

shared hosting environments where they have no control on what PHP
extensions are installed.

Also, IMHO we build a framework, and it should be used by *users*

who

*do not need to care* about much. The whole essence of frameworks is
like saying "I'll take care of this issue for you, so you don't have

to

care about that".



As a user and developer, I'm going to have to agree with Shahar here.
Majority of your users are going to be on shared servers where they  
do

not have control of what caching, if any, is installed. A framework
that is meant to be used by users (think RoR) needs to be as  
optimized
as possible by the original coders. Simply saying "use opcode  
caching"

is a poor excuse for poorly developed code.

This is just my opinion as a developer...btw, this message might not
make it to the fw-core list as I don't believe I'm on it.

--
Philip
[EMAIL PROTECTED]
http://www.gpcentre.net/




Re: [fw-general] Layout in svn broken

2007-12-13 Thread Eric Coleman

On Dec 13, 2007, at 7:59 AM, Matthew Weier O'Phinney wrote:


-- Eric Coleman <[EMAIL PROTECTED]> wrote
(on Thursday, 13 December 2007, 03:14 AM -0500):
Shouldn't broken code be restricted to the incubator?  It doesn't  
seem

"right" to have busted code sitting in trunk...


True, but it was an honest mistake. I was working on the placeholders,
and forgot to run the test suite for layouts (which depend on
placeholders); simply forgot about the dependency. I take full  
ownership

of the situation.

It's fixed in svn now.


It's cool ;)  I don't really update from trunk until I look @ the  
commits; I was more curious of what the "actual" policy was on trunk...


Thanks Matt & Ralph
Eric


Re: [fw-general] Layout in svn broken

2007-12-13 Thread Eric Coleman
Shouldn't broken code be restricted to the incubator?  It doesn't seem  
"right" to have busted code sitting in trunk...


Regards,
Eric


On Dec 12, 2007, at 11:42 PM, Ralph Schindler wrote:


Hey Richard,

We are actually working on the Placeholder implementations at this  
exact moment!  There were some changes needed to the made to the  
Placeholder and Registry to facilitate the new Head*() helpers.


That said, I think until tomorrow (if you need Zend_Layout) you  
might want to roll back to a new revision.


We'll keep you updated on the progress,

Thanks,
Ralph

Richard Shank wrote:

Hey Matthew,
Just wanted to give you a heads up on this one.  The 7096 revision  
on the Placeholder & Registry causes the Zend/View/Layout to  
break.  It looks for the 'REGISTRY_KEY' constant, which is no  
longer there.

Richard






Re: [fw-general] Appending extra config in zend config xml

2007-12-11 Thread Eric Coleman

Hi Sancar,

You'd wanna do something like this:

$config->merge($configExtras);

http://framework.zend.com/apidoc/core/Zend_Config/Zend_Config.html#merge

Regards,
Eric


On Dec 11, 2007, at 4:08 AM, Sancar Saran wrote:


Hello,

I just wonder is there any possibility to add extra config values from
different soruce in run time

Regards




Re: [fw-general] Zend_Http_Client_Adapter_Socket

2007-12-10 Thread Eric Coleman
I gave it a shot once... however, my results weren't so hot.  It was  
very hackish as I tried to implement it by extending classes.


I'm not really sure what the best approach is to accomplishing it,  
however I'd really be interested in having this ability.


Regards,
Eric

On Dec 10, 2007, at 6:50 PM, Alexander Johannesen wrote:


Hi,

Is there any thoughts on making the Zend_Http_Client_Adapter_Socket
multitasking? Currently one can only do sequences of requests, but
given response times and size of requests it would be very good to
multi-task these requests. I currently handle a number of web services
that in sequence spans several seconds, but (in a prototype with
sockets) multi-tasked is cut in 1/4.

I could give it a stab myself, but wanted to know if there were any
plans or further thoughts about this?


Regards,

Alex
--
---
Project Wrangler, SOA, Information Alchemist, UX, RESTafarian, Topic  
Maps
-- http://shelter.nu/blog/  





Re: [fw-general] db migrations

2007-11-28 Thread Eric Coleman

Wil,

You might want to take a look at the DbDeploy stuff in phing.

http://phing.info/docs/guide/current/chapters/appendixes/AppendixC-OptionalTasks.html#DbDeployTask

Regards,
Eric


On Nov 28, 2007, at 9:34 PM, Wil Sinclair wrote:

In principal yes, although the code actually doing the migrations  
looks
much more 'procedural' than in RoR. That's mainly because RoR uses  
Ruby
syntax tricks heavily in migrations to make them look more like  
'config'

files. I'd assume Rails migrations were a big inspiration for that
proposal because of the similarities and the 2 references to RoR
migrations in the reference section. ;)

This is a decent reproduction of Rails migrations AFAIC see, but I  
think

we could aim higher (or at least more flexible?) in ZF.



,Wil



From: Simon Mundy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 28, 2007 6:24 PM
To: Wil Sinclair
Cc: Sander van de Graaf; Zend Framework - General
Subject: Re: [fw-general] db migrations



I don't know RoR at all but is this similar to the proposal on the  
wiki

for Zend_Db_Schema_Manager? -
http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Schema_Manager+-+R
ob+Allen





Hi Sander, I've put some thought in to db migrations because it was a
part of RoR that I both really liked and found somewhat over- 
simplified.
On the one hand, I thought the RoR implementation was an elegant way  
to
version application schemas and it lent a helpful tool to a pretty  
vital
best practice. On the other, I felt that the ruby-based DDL  
abstraction

was rather toy-like and one would quickly revert to 'execute' and
standard SQL DDL/DML in real environments. Admittedly, I haven't  
tested

the limits of db:migrations, but the differences in ddl among- and in
the objects that can be created in- different DB's combined with the
relatively minor savings in complexity and database 'independence'  
left

me less impressed than with other parts of RoR. As always, I'd love to
hear about other opinions and  experiences with different frameworks.
For ZF, my current preference would be for raw sql-script-based
migrations with the possibility of supporting or providing  
extensibility

for future support of files and possibly other non-code application
artifacts. Basically it would aim to be a simple versioning/ 
environment
setup tool that is much easier to use- but no less powerful than-  
shell
scripts. Questions that I haven't fully thought through include:  
Should

we support only one usage pattern over others- like sequential
versioning over schema management simplification/separation? Would  
it be

feasible to generate raw sql-scripts if we decide we'd like to do that
in the future, or would we rather be generating a sort of  
'intermediate

language' much like RoR migrations? Are there any useful integration
points with CVS/SVN? And the list goes on and on. . .
Right now I'm putting together a proposal for a CLI tool that
(hopefully) reflects some of the best ideas out there but doesn't  
skimp

on flexibility. I would love to see someone working off the draft
proposal to provide migrations. ;)

,Wil

-Original Message-
From: Sander van de Graaf [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 28, 2007 2:38 PM
To: Zend Framework - General
Subject: [fw-general] db migrations

Hi!

I was wondering if someone has any thoughts on db migrations in
combination with ZF. I have some great deployment scripts ready for
pushing out my application code, but I was wondering how to get db
migrations up and running in an easy way.

I have looked at the Cake db migrations, but it's too much mixed with
the Cake console. I also looked at liquibase (liquibase.org), but it
has a pretty bloated xml config, and I prefer some sort of yaml or
perhaps sql migrations.

Anyone any ideas or suggestions?

--
cheers!
Sander van de Graaf



--



Simon Mundy | Director | PEPTOLAB



""" " "" "" "" "" """ " "" " " " "  "" "" "



Please support Movember today!  Visit http://www.movember.com/au/ 
donate


Registration number for Simon 160725



202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000

Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124

http://www.peptolab.com







Re: [fw-general] Zend_Log with SMTP

2007-11-14 Thread Eric Coleman
Do you want all log items sent to you?  Seems like you should be able  
to utilize a Filter to email you particular statues...


Shouldn't be to difficult to implement:

http://framework.zend.com/manual/en/zend.log.filters.html

Regards,
Eric

On Nov 13, 2007, at 8:11 PM, Dan Rossi wrote:

Hi I generally use PEAR Log for these things but is there an smtp  
logger driver built yet for Zend_Log or do a i have to implement one  
myself ?




Re: [fw-general] Zend_Form

2007-11-11 Thread Eric Coleman

See my post in this very thread (refer to nabble). heh...

And Matthew... Thanks for the clarification.

Regards,
Eric

On Nov 11, 2007, at 1:05 PM, dinok wrote:



I had a look at Jurriën's Proposal in the current versions.
As I could see, it looks very nice!
Why don't we merge these two existing proposal instead of  
refactoring a

third one?
I think this is the better way, because this proposal already  
includes a lot

of options and helpers which are realy useful. For example a database
adapter and so on.
Have a look at it :)
--
View this message in context: 
http://www.nabble.com/Zend_Form-tf4719410s16154.html#a13694081
Sent from the Zend Framework mailing list archive at Nabble.com.





Re: [fw-general] Zend_Form

2007-11-09 Thread Eric Coleman
Matthew, I'm curious as to what's wrong with the current Zend_Form  
implementations currently around. There are 2 'New' proposals listed  
in the wiki, as well as 1 under 'Ready for Review'.  That's 3  
proposals, and 2 working implementations already.


Mitchell Hashimoto - http://mitchellhashimoto.com/zend-form

There is also Jurriën's Proposal and working implementation (which not  
only has feedback already from the community on the wiki, but he was  
also given plenty of feedback on #zftalk).


http://framework.zend.com/wiki/pages/viewpage.action?pageId=36061
http://tools.assembla.com/svn/IntermentisFW/trunk/Mentis/

On Nov 9, 2007, at 2:03 PM, Matthew Weier O'Phinney wrote:


-- dinok <[EMAIL PROTECTED]> wrote
(on Friday, 09 November 2007, 10:56 AM -0800):

Looks nice! Thank you for the link.


Thanks!


I've got one question. Is there already something like API freeze
planed?  Because I want to use Zend_Form in a new project.


Not yet -- this is a prototype, and I'm still ironing it out. After
that, it will go back to the community for feedback, and only after  
I've
incorporated that and done testing will we have API freeze. It'll  
likely

be stable in around 4-5 weeks.

--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/




Re: [fw-general] ZF performance advice

2007-10-12 Thread Eric Coleman
Does your app rely on autoload or even do you use  
Zend_Loader::loadClass() a lot?


Just a bit curious


On Oct 12, 2007, at 9:03 PM, Dennis Fogg wrote:



I did some more investigation:

I'm not getting much of a performance boost from either  
eAccelerator or Zend

Optimizer
over no op code cache for my ZF infrastructure, which is a bit of a
surprise.

I decided to try optimization on code that everyone can try.
I loaded Rob Allen's current ZF tutorial (zf_tutorial-1.4.1.zip) at
http://akrabat.com/zend-framework-tutorial/
and added some timing functions in a file called util.php and  
placed it in

the library dir.
I also modified his index.php.  Both these files are included in  
this post.

http://www.nabble.com/file/p13185506/util.php util.php
http://www.nabble.com/file/p13185506/index.php index.php

The results:

It's much faster: zend framework page generation takes about 0.4 sec.

I used MySQL this time and the db connection times are quick!   
About 0.02 -

0.03 sec on my computer compared to 0.57 sec with Postgres.

The op code cache solutions are not providing much of a performance  
boost.

The optimizers might improve performance a bit but it's hard to tell.
I did not load the data in excel so this is more of an eyeball  
result, but

you can try it yourself.

If others try the code (esp on linux), please report some numbers so
comparisons can be made.
If you find op code caches are giving a big performance  
improvement, that

would be interesting to know.
Also, if you find that postgres on linux performances much faster,  
that

would be great to know!

--
View this message in context: http://www.nabble.com/ZF-performance- 
advice-tf4610974s16154.html#a13185506

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





[fw-general] Re: [fw-webservices] ZF-2019 - Http_Client->setHeaders() in non-strict mode

2007-10-11 Thread Eric Coleman
When me and Kevin talked about it on #zftalk, we both came to a  
similar solution.  We thought it should be up to us to do the  
validation on the headers ourselves.. (Or, provide a method that can  
do it...).


In the end, I think it's a better solution to just make the following  
changes:


 - remove header validation regex
 - add a validateHeaders function


On Oct 11, 2007, at 1:10 PM, Shahar Evron wrote:


Currently we throw exceptions when non-RFC-compliant HTTP headers are
passed to the setHeaders() method. Following ZF-2019 I did some
thinking, and it seems there is a good reason to allow a non-strict  
mode

in which users could add their own headers.

What I propose doing is one of the following:

1. Add a configuration option ("strict") to the HTTP Client object
(passed in the constructor or using setConfig()). This option will be
set to true by default - but if set to false, will allow setting
non-strict headers and possibly override some other RFC-compliance
tests.

2. Add an optional $strict parameter to the setHeaders() method.

3. Ignore non-compliance requests and tell people to subclass
Zend_Http_Client ;)

I tend to favor #1 because it allows a general non-strict mode for the
entire client (and not just for setHeaders()).

Opinions or thoughts are welcome.




--
Best Regards,

Shahar Evron  <[EMAIL PROTECTED]>

Professional Services EngineerDepartment of Global Services
Zend Technologies





Re: [fw-general] Core paging functionality for Zend_Db

2007-08-07 Thread Eric Coleman
Why not use array_chunk on an array of your results?  Can be done in one line.

On 8/7/07, Dan Rossi <[EMAIL PROTECTED]> wrote:
> Hi i was wondering if there was any functionality yet for paging with
> Zend_Db. I was also wondering if there was a way to have these paged
> results able to be split into columns of 2 to 3 columns per row when
> fetchAll is called ? Currently I have to do this which seem a bit clunky
> to me
>
> $cols = 2;
> $loop = ceil(count($results) / $cols);
> $arr = array();
> for ($j=0;$j <= $loop;$j++) {
> $arr[$j] = array_slice($results,$i,$cols);
> $i = $i + $cols;
> }
>


Re: [fw-general] Error handling with mysqli adapter

2007-07-18 Thread Eric Coleman

On Jul 18, 2007, at 11:15 PM, Ryan Graciano wrote:

Fatal error: Exception thrown without a stack frame in Unknown on  
line 0


If you search php.internals you'll find a thread about this.  I can't  
remember what the exact error message actually means (Positive it was  
discussed though).


Re: [fw-general] FlashMessenger Patch - Completion of the API

2007-07-16 Thread Eric Coleman

way to rain on my parade

On 7/16/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:

-- townxelliot <[EMAIL PROTECTED]> wrote
(on Monday, 16 July 2007, 09:03 AM -0700):
>
> I'm not sure how FlashMessenger is supposed to work, as there are several
> places where a $namespace option is supposed to be accepted by a function,
> but it's not part of the parameters. Also, adding namespaces adds complexity
> when using hasMessages(), count() etc., which currently only return values
> for the current namespace, not all namespaces. I wondered whether anyone can
> point me at the definitive design document or similar for this, so I can get
> an idea of how it's intended to work. I would like to be able to use
> namespaces, so it would be useful to know whether the API is going to cope
> with those or not.

A number of developers -- including Eric, whom you quote below, and
myself -- have voiced frustration over how the FlashMessenger currently
works in regards to namespaces. I've created a JIRA issue requesting
that each of the various *Messages() methods take an optional $namespace
parameter; this would simplify using the FlashMessenger in most cases
as there would be no setup required to use alternate namespaces (other
than the default namespace).

The issue can be found at:

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

This will only deal with namespace usage, not with clearing a namespace
after retrieval; that will be addressed separately.

> Eric Coleman-3 wrote:
> >
> > I believe the API is incomplete as I mentioned in a previous email.
> > I spent a tiny bit of time testing this and I think the small changes
> > are enough..
> >
> > What I did
> >
> >   - added getNamespace() - returns current namespace
> >   - implemented direct method as direct($message, $namespace =
> > 'default')
> > this was mentioned in the manual but seems to have been missing
> >   - changed getCurrentMessages() to getCurrentMessages($clear = false)
> > if you want to clear out the namespace after retrieval, change it
> > to true

--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/



Re: [fw-general] Allowing global variables with Zend Framework

2007-07-07 Thread Eric Coleman
If your migrating TO the zend framework, wouldn't it make more sense  
to just fix the spots that rely on globals, esp since php 6 removed  
them afaik



On Jul 7, 2007, at 8:34 PM, kevin7654 wrote:



Hello,

I'm trying to slowly migrate an app I've written over to the zend  
framework.
The app currently relies on global variables, ie global $my_name,  
and it

also relies on get and post values.  Can I enable this with the zend
framework?


Thanks,

Kevin
--
View this message in context: http://www.nabble.com/Allowing-global- 
variables-with-Zend-Framework-tf4042358s16154.html#a11483587

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





[fw-general] No way to get invalid data from Zend_Filter_Input

2007-06-19 Thread Eric Coleman
While playing with a method to keep form data in sync when a  
validation/filtering error occurs, I realized that there is no method  
to get the invalid data back...


So, basically, if you submit something that fails validation, it gets  
nuked unless you store your own copy of $_POST.  This hardly seems  
like the correct way to do things.


Bill, or someone, can we get a method added to Zend_Filter_Input to  
solve this?


Regards,
Eric


[fw-general] FlashMessenger Patch - Completion of the API

2007-06-10 Thread Eric Coleman
I believe the API is incomplete as I mentioned in a previous email.   
I spent a tiny bit of time testing this and I think the small changes  
are enough..


What I did

 - added getNamespace() - returns current namespace
 - implemented direct method as direct($message, $namespace =  
'default')

   this was mentioned in the manual but seems to have been missing
 - changed getCurrentMessages() to getCurrentMessages($clear = false)
   if you want to clear out the namespace after retrieval, change it  
to true


Regards,
Eric



zf-flashmessenger.diff
Description: Binary data


Re: [fw-general] Deployment tool?

2007-06-09 Thread Eric Coleman
I want to re-propose Zend_Db_Schema and develop it, so if we get  
enough idea's and someone wants to give me a hand, that would be awsome.


Maybe the discussion should be on the db list

On Jun 8, 2007, at 7:14 PM, Markus Fischer wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

isn't the pure sql-file being used as an upgrade script too limiting?

How are you handling downgrades (e.g. knowing how to remove the  
changes
done through an upgrade)? And what if you, besides changing the  
database

layout, need to perform additional tasks (hint: manually executed
specific PHP code for this upgrade/downgrade) ?

Should we move on to a list more specific to the deployment topic? Are
there any such lists? Should we create one? It seems at least and
handful of people are very interested.

- - Markus

Tony Brady wrote:
I'd like to add my support to this idea - I'm sure many of us  
deploy our

code to staging/production servers and would appreciate some utility
tools to help streamline this process. A utility to upgrade/downgrade
database schemas would be particularly useful. I'm not so sure about
scripts to help with subversion deployment - this area might be too
specific to each individual setup? I have a php script that traverses
the current directory plus matching subdirectories applying raw SQL
upgrade scripts to the chosen database. The syntax is:

dbupgrade.php [options] database_name [server_type]

[options] are things like -u user_name and -p password for the  
database
connection. The server_type allows extra scripts to be run on  
particular

types of server (e.g. 'production', 'staging').

It takes a snapshot of the database first (using mysqldump - so it is
MySQL specific currently) allowing the user to run a 'rollback'  
script

if something goes horribly wrong. It uses Zend_Db to connect to the
database server and applies the SQL commands using the exec()  
method of

the PDO object. The only requirement is that the database must have a
_version table with only one field (version) that contains the  
current
version number of the database. Upgrade scripts are named  
upgradeXXX.sql

where XXX is the version number. Only upgrade scripts with a value of
XXX greater than the current version are applied. It would be easy to
implement downgrade scripts as well. Upgrade scripts are stored in  
a sql

directory like this:

sql/
   database1/
  upgrade1.sql
  upgrade2.sql
  production/
  upgrade3.sql
  staging/
  database2/
upgrade1.sql

The dbupgrade script looks for subdirectories of sql that match the
database_name. It applies all upgrade scripts named >  
_version.version.

It will also apply any upgrade scripts found in a subdirectory that
matches server_type. I've found this arrangement gives me enough
flexibility for my server setup. I also make use of Zend_Config to  
look

for default database connection settings. However, this requires some
kind of naming convention to be generally useful.

It would be nice maybe if the _version table stored the version  
history

(by introducing a timestamp field).

Tony

On 8 Jun 2007, at 07:03, oetting wrote:



This is something which RubyOnRails nicely manages with  
"migrations".
Each change to the database is versioned in a separate file  
which is
basically some ruby code to be executed. It knows about hooks  
like "up"
and "down" and within this hooks it e.g. creates the new columns  
with

default values or removes the column.

Year i know, it is rather cool. ZF is missing a database schema
abstraction
layer for this to be possible in the same way. There is a  
proposal for

this.
An alternative implementation could be done by automating the
execution of
raw SQL commands. The developer would specify files like this:

# UP
ALTER TABLE foo ADD COLUMN bar int(11);

# DOWN
ALTER TABLE foo DROP COLUMN bar;

A script would then automate execution series of these migration
files. This
would not require any schema abstraction. I have made a proof of  
concept

implementation of this, and would like to contribute in this area as
well,
if anyone finds it interesting.


The "idea" for a flexible deployment tool is "good", but actually I
think it has nothing to do with the Zend Framework in any way.  
Whenever
you would create such a tool you wouldn't want it specific for  
ZF, do

you?


Perhaps it could utillize ZF components but it should not be  
specific

to any
apecific project layout.

Jacob
--
View this message in context:
http://www.nabble.com/Deployment-tool-- 
tf3886709s16154.html#a11020982

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




-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFGaeLu1nS0RcInK9ARAipSAJUcFb/NofsKYoB2XR4Yi0l+bfuQAJ9r7YB2
diuUA6PfcVS+298k4JZsxA==
=2A9b
-END PGP SIGNATURE-




Re: [fw-general] Deployment tool?

2007-06-07 Thread Eric Coleman


On Jun 8, 2007, at 2:03 AM, oetting wrote:

Year i know, it is rather cool. ZF is missing a database schema  
abstraction
layer for this to be possible in the same way. There is a proposal  
for this.
An alternative implementation could be done by automating the  
execution of

raw SQL commands. The developer would specify files like this:

# UP
ALTER TABLE foo ADD COLUMN bar int(11);

# DOWN
ALTER TABLE foo DROP COLUMN bar;

A script would then automate execution series of these migration  
files. This
would not require any schema abstraction. I have made a proof of  
concept
implementation of this, and would like to contribute in this area  
as well,

if anyone finds it interesting.


I want to complete this component, and asked Rob if he minded, of  
course he said he didn't, so I'll be looking at and hopefully  
submitting something to get this closer to being a reality :-D


Re: [fw-general] Deployment tool?

2007-06-07 Thread Eric Coleman

I am really curious as to why no one has mentioned Capistrano...

http://manuals.rubyonrails.com/read/book/17
http://devthatweb.com/view/automate-the-deployment-of-any-php-project- 
using-capistrano


Regards,
Eric

On Jun 7, 2007, at 8:24 PM, Markus Fischer wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

oetting wrote:

Other features:
Deployment of database schema.


This is something which RubyOnRails nicely manages with "migrations".
Each change to the database is versioned in a separate file which is
basically some ruby code to be executed. It knows about hooks like  
"up"

and "down" and within this hooks it e.g. creates the new columns with
default values or removes the column.


What do you think. Is this a good idea?


The "idea" for a flexible deployment tool is "good", but actually I
think it has nothing to do with the Zend Framework in any way.  
Whenever
you would create such a tool you wouldn't want it specific for ZF,  
do you?


I'm currently also evaluation possibilities, yet nothing useful found.
Deploying changesets which includes dir/file and database changes on
multiple servers including dedicated testing and live servers can be
quite complex.

- - Markus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGaKHU1nS0RcInK9ARAguYAJ95ynZayPU48FuheNnABA1+imMtugCfQwqi
oXDH6WbB4nm67WZ2hF/JL+M=
=IR1y
-END PGP SIGNATURE-




[fw-general] zend_date accepting iso dates

2007-05-31 Thread Eric Coleman

The following doesn't seem to work, though i've seen it mentioned that
it -should- be

$date = new Zend_Date('2007-05-31 04:02:00');
echo $date;

// should be -> May 31, 2007 4:02:00 AM
// actual output -> May 31, 2007 12:00:00 AM


Re: [fw-general] FirePHP integration

2007-04-10 Thread Eric Coleman

In addition to this request, it would be nice if Zend_Debug::dump()
detected and used xdebug if available.

Regards,
Eric

On 4/10/07, Matthew Ratzloff <[EMAIL PROTECTED]> wrote:

On Tue, April 10, 2007 7:12 am, Ivan Shumkov wrote:
>
> I'm think about integration FirePHP (http://firephp.org) in to Zend
> Framework:
> 1. Use Our_FirePHP for implementation protocol (I didn't like default PEAR
> class)
> 2. Use Zend_Log_Writer_FirePhp for writing log
> 3. Use Zend_Controller_Plugin_FirePhp for response "Capabilities
> Definition"
> and FirePhp data
>
> What do you think about it? It's intresting for you?

I like the idea.  Is there some way to create the proposal using
Zend_Debug?  I've never used Zend Platform, but if there's similar
functionality (according to the FirePHP site, there is), it'd be nice to
have it all in one place.

The FirePHP PEAR class isn't complicated and could be built on Zend
Framework components that will already be loaded anyway.  Also, I just
threw up a quick, one-class Zend_Stopwatch proposal that I had laying
around that it could use, as well.

-Matt




Re: [fw-general] Great work with 0.9

2007-03-19 Thread Eric Coleman

Just FYI, The 0.9.0 svn tag is missing:

http://framework.zend.com/svn/framework/tag/

On 3/19/07, Simon R Jones <[EMAIL PROTECTED]> wrote:

I third that!

We looked around hard and wide for a decent framework to use for our company
and settled on Zend Framework 6 months ago. The progress since then has been
fabulous and has certainly validating my decision to go with ZF.

Excellent work everyone :-)

Si




Re: [fw-general] Module name not available in bootstrap file

2007-03-17 Thread Eric Coleman

Matt,

Didn't look at the code / docs, but is there a way to change the path  
a bit?


On Mar 17, 2007, at 10:58 AM, Matthew Weier O'Phinney wrote:


-- david pr <[EMAIL PROTECTED]> wrote
(on Thursday, 15 March 2007, 09:20 PM -0700):
I am trying to use modules. It is "half" successful - my  
controllers are
being found in the appropriate directory - my problem is I want to  
set the
view script path to the appropriate module but the module name is  
only

available after the front controller is "dispatched". I can see in
/Zend/Controller/Front.php that the module is set when the  
following code is

executed in function dispatch():-

$router->route($request);

But I can't see how I can set up the router before dispatching. I  
don't want
to set up my view's script path in every controller. I would like  
to do it
in the bootstrap file. I can't see how I can easily do this. Find  
below a

snippet of my bootstrap file. Can someone help please?

version 0.8.0


Grab the current SVN (or 0.9.0 when it's released) and use initView()
and/or render() in the action controllers. The default  
implementation of

initView() assumes the following directory structure

(application|module)/
controllers/
views/
scripts/
/
.phtml
(helpers)/
(filters)/

This means you can then assume that views are in ../views/scripts, in
relation to your controller.

You can simply call this in your action, then:

$view = $this->initView();

Or, if you don't need to assign any variables, call something like  
this:


$this->render();

and it will render /.phtml.

--
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/




Re: [fw-general] ActiveRecord patch

2007-03-07 Thread Eric Coleman
Why are you not being open to Daveys suggestions?  For one, would  
prefer the AR classes to have the ability to be mapped using meta  
data, or to automatically map themselves.


On Mar 7, 2007, at 2:31 PM, Bill Karwin wrote:


Hi Davey,

Thanks so much for your enthusiasm.  I think you misunderstood the
intent of my email.  The code in the DbTable-09 branch is the
implementation that will be used in the ZF 1.0 release.  If you  
want to

develop your ActiveRecord prototype for Zend, please write a formal
proposal in our wiki format and it will go through the usual review
process.  Some of your work may be approved for inclusion in a future
release of Zend Framework.  The formal proposal template can be  
found at

the following URL:
http://framework.zend.com/wiki/display/ZFPROP/Home

Bill Karwin


-Original Message-
From: Davey Shafik [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 3:15 AM
To: Bill Karwin
Cc: Zend Framework
Subject: Re: [fw-general] ActiveRecord patch

Bill,

First off, thank you for such a detailed comparison, this is great!!

I'll go through your list and say what I would like to bring to
Zend_Db_ActiveRecord,
and maybe we can move some of your work over and therefore have the
name people expect
and provide a good implementation :)


The implementation in the branch:
- The find() method always returns a Rowset object (see ZF-21).

Good

because it's easy to call exists() after find().


I agree on the Row Vs Rowset, I never *really* liked it :)


- Supports multi-column primary keys.


Honestly, I've never used this, so I missed this from AR, would love
to see it moved in


- No usage of inflectors.


We could allow both?


- No object vars for searching.


I could easily add a cleanup method, or perhaps you could pass a Row
with the
vars to find() ? I think both would be good :)


- Supports any number of custom Row and Rowset classes per Table
class.


Great, I'd like to see this, but automated use of ARClass_Row(Set)
would be
great too


- Supports queries against related tables, e.g. parent table,
dependent
table, many-to-many table.  All queries support multi-column keys.


Obvously needs adding


- Table class supports custom _insert(), _update(), _delete()
filtering.


I'm not sure what this would be used for, but lets bring it over :)


- Table relationship query methods can be either magic or non-magic
(non-magic is useful for tool support).


This would be good too



Your patch has a lot of good ideas, but there are some places where
you
and I disagree:
- I don't think the find() method should return two different class
types depending on the arguments.


Agreed


- I don't care for inflectors, or any manipulation of SQL

identifiers.


The use is minimal, lets remove it :)


- I prefer declaration of metadata, instead of imposing schema
conventions on developers.  There are plenty of frameworks that

impose

conventions, which is great for new projects where the developer
has the
freedom to design the database schema.  But Zend_Db could gain a

very

valuable differentiator if it works with an existing database

schema.


I already have plans for this, and I agree, it should be possible to
*easily*
wrap AR around an existing table that doesn't conform to our "norm",

and

as I mentioned elsewhere, the way I would like to do this, is
aliasing, that
allows your tables to have a consistent AR API regardless of the

actual

schema beneath.

This is very important to me, actually, that the AR whilst it has a
lot of
voodoo, should be easily overridden internally, and still provide
the same API when used.

- Davey


On Mar 7, 2007, at 4:13 AM, Bill Karwin wrote:


Hi Davey,

I took a good look at your patch for a prototype ActiveRecord
implementation.

You might want to take a look at the implementation currently in
branch
"DbTable-09".  I just committed a doc section for it today:
http://framework.zend.com/fisheye/browse/~raw,r=3781/Zend_Framework/
bran
ch/DbTable-09/documentation/manual/en/module_specs/Zend_Db_Table-
Relatio
nships.xml

The implementation currently in the branch actually shares a lot of
features with your implementation.  Here are some differences (not
necessarily a complete list):

Your implementation:
- find() method returns a Row or Rowset object, depending on
whether you
give 1 arg or > 1 arg.
- findAll() and findFirst() methods support Boolean operators for
combining the array of where conditions.
- Supports a single custom Row and Rowset class per ActiveRecord
class,
custom Row and Rowset classnames must be based on ActiveRecord
classname.
- Primary keys limited to a single column.
- Supports object vars for searching (how does one reset the object
vars
back to an initial state?)
- "Roll back" (i.e. reset) Row members to clean data.
- Supports custom methods in Row per column, for filtering values
during
__set().
- Uses inflectors to pluralize/singularize during the table
relationships query methods.

The implementation in the branch:
- T

Re: [fw-general] Zend Logging General Question(s)...

2007-03-06 Thread Eric Coleman


On Mar 6, 2007, at 10:22 PM, Adam Balgach wrote:


I find myself often wanting to output entire arrays to the log via
Zend_Log::log()  however, I think the only quick way in php to dump an
entire array to a string is with print_r()  but this outputs it to the
screen, and not a string variable which i can write to the log.

1.  is there something similar to java's toString() function so i  
could in

theory do something like

$var = .  //some array, maybe a db->fetchAll()

Zend_Log::log("Result Set: " . $var->toString() );



var_export($array, true)



Re: [fw-general] Request for feedback: moving Zend.php to Zend/Zend.php

2007-02-26 Thread Eric Coleman

-1 on all accounts, leave it where it is.

Is it really that difficult to have your 'libs' folder seperated out  
by what it is?  Mine looks as follows:


libs/lib-pear
libs/lib-zend
libs/lib-vlx
libs/lib-am

with lib-zend being svn:externals to a specific revision, and lib- 
vlx, and lib-am being pear/zf code standard framework style  
components of my own.  It works fine, and honestly it's not really  
that difficult to deal with.


On Feb 26, 2007, at 9:20 AM, Shekar C Reddy wrote:


Shuffling the files one level down - sounds good to me.




On 2/26/07, Tautvydas Andrikys <[EMAIL PROTECTED]> wrote:


Hi,

I think the best solution would be to change naming conventions,  
so that
the main class of a package would be in package directory, like in  
Java.

And as Ralf suggested class Zend could be removed.
So:
Zend/Db.php => Zend/Db/Db.php,
Zend/Db/Table.php => Zend/Db/Table/Table.php
...

This way use of one separate framework package would be much  
easier: it
would be enough to copy directory[now we need to copy directory  
and one

.php class file] and there would be much cleaner package separation.

Ralf Eggert wrote:
> Hi,
>
> I personally think that the proposed renaming of the Zend class to
> Zend_Framework is very misleading. I would expect that a  
Zend_Framework

> class will set up the whole framework and not be just a funny
> conglomeration of methods who did not find their way to a proper
component.
>
> Here are my suggestions:
>
> - move Zend::register(), Zend::registry(), Zend::isRegistered(),
>   Zend::initRegistry() and Zend::__unsetRegistry() to Zend_Registry
>
> - drop Zend::exception() and Zend::loadInterface()
>
> - move Zend::loadClass(), Zend::loadFile() and Zend::isReadable 
() to

>   a new Zend_Loader class
>
> - as suggested by others, move Zend::dump() to Zend_Debug
>
> - the only method I am not sure about yet is Zend::compareVersion 
() but

>   I bet we will find a solution for this as well
>
> Like others I would also suggest to implement these changes  
before the

> 0.9.0 beta release gets launched.
>
> Best Regards,
>
> Ralf
>
>


Tautvydas Andrikys aka esminis






smime.p7s
Description: S/MIME cryptographic signature


[fw-general] Gdata Post doesn't return

2007-02-15 Thread Eric Coleman
Anyone notice issues posting items to Google Base?  The post() method  
always returns an exception saying no / empty response, yet the items  
I submitted were indeed added to google.


- Eric

smime.p7s
Description: S/MIME cryptographic signature


Re: [fw-general] how to add auth?

2007-01-02 Thread Eric Coleman

Andris,

That wouldn't work however, because, that has the plugin itself  
containing the list of auth-required actions, whilst my goal is to  
contain that within each controller individually.


Regards,
Eric

On Jan 2, 2007, at 5:01 PM, Andris Paikens wrote:


well, in Tony example You simply have to add after
if ($resource == 'index/timedout') {
  // Timed out - always allow
  return;
  }
$requiresAuth = array('action1', 'action2', 'action3');

//static $requiresAuth = array('*');

if ( !in_array($resource, $requiresAuth )) {
  // doesn't need authentification
  return;
  }

I think it should work.

Andris

On 02/01/07, Eric Coleman <[EMAIL PROTECTED]> wrote:

Something I've wanted to do, and I spent a few hours trying to, (and
was unsuccessful btw) is to control access via a static variable in
the controller itself.

having

static $requiresAuth = array('action1', 'action2', 'action3');

or if you want all:

static $requiresAuth = array('*');

Then, when the plugin checks, it would check the action, compare it
to the controllers requiresAuth variable, and decide if we need to
require login.  Maybe I missed this in the plugin code some how, but
if this is possible, it would be brilliant.

Regards,
Eric

On Jan 2, 2007, at 7:31 AM, Andris Paikens wrote:

> Hi Tony,
>
> One thing I can add - seems that this way user can see any page  
only

> if he is logged in.
> What if there would be any informative pages or registration,  
that not

> registered and logged in users would like to see? These screens
> probably can be easily added next to if($resource == 'index/ 
timedout')

>
> To solve this, I'm using Acl and "guest" Acl object is created, if
> there is no logged in user. If this user tries to see something  
that

> is not allowed to guest, he gets login screen.
>
> Ps. thanks for the good idea about keeping parameters, while  
logging

> in and then redirecting where needed.
>
> Bes wishes,
> Andris
>
> On 02/01/07, Tony Brady <[EMAIL PROTECTED]> wrote:
>> Hi Philip
>> be happy to - and appreciate any feedback because this may not
>> necessarily be the optimal way to do this. One obvious  
improvement is
>> to use Zend_Auth as you mentioned earlier. My plugin is pretty  
basic:

>>
>> class MyApp_Controller_AuthPlugin extends
>> Zend_Controller_Plugin_Abstract
>> {
>>
>>  public function preDispatch($request)
>>  {
>>  // Page user is trying to access
>>  $resource = $request->getControllerName() . '/' .  
$request-

>>  >getActionName();
>>  if ($resource == 'index/timedout') {
>>  // Timed out - always allow
>>  return;
>>  }
>>
>>  // check to see if logged in
>>  if (! isset($_SESSION['User'])) {
>>  // not logged in - divert to login page
>>  $request->setParam('target_params', $request- 
>getParams

>> ()); // save original params for later
>>  $request->setControllerName('index');
>>  $request->setActionName('login');
>>  }
>>  else {
>>  // Logged-in: check access
>>  if (! $_SESSION['User']->allowedAccess($resource)) {
>>  // Access denied
>>  $request->setControllerName('index');
>>  $request->setActionName('noaccess');
>>  }
>>  }
>>  }
>>
>> }
>>
>> What's nice about this is that you can change the request  
before it
>> has been dispatched. I also save the original request parameter  
array
>> as a parameter in the diverted request ('target_params'). This  
allows
>> me to store these in my login form so that the original user  
request

>> can be carried out after authentication. So the user requests some
>> page - has to login - but is then shown the page they wanted and
>> happy because they didn't get shunted to some home page hell  
with a

>> million links ;-) In my index/login action I have:
>>
>>  public function loginAction()
>>  {
>>  if (isset($_POST['email'])) {
>>  // Login attempt
>>  $filterPost = new Zend_Filter_Input($_POST, false);
>>  $this->_view->target_params = $filterPost->testRegex
>> ('target_params', '#^[a-z0-9\{\}:;"]*$#i

Re: [fw-general] how to add auth?

2007-01-02 Thread Eric Coleman
Something I've wanted to do, and I spent a few hours trying to, (and  
was unsuccessful btw) is to control access via a static variable in  
the controller itself.


having

static $requiresAuth = array('action1', 'action2', 'action3');

or if you want all:

static $requiresAuth = array('*');

Then, when the plugin checks, it would check the action, compare it  
to the controllers requiresAuth variable, and decide if we need to  
require login.  Maybe I missed this in the plugin code some how, but  
if this is possible, it would be brilliant.


Regards,
Eric

On Jan 2, 2007, at 7:31 AM, Andris Paikens wrote:


Hi Tony,

One thing I can add - seems that this way user can see any page only
if he is logged in.
What if there would be any informative pages or registration, that not
registered and logged in users would like to see? These screens
probably can be easily added next to if($resource == 'index/timedout')

To solve this, I'm using Acl and "guest" Acl object is created, if
there is no logged in user. If this user tries to see something that
is not allowed to guest, he gets login screen.

Ps. thanks for the good idea about keeping parameters, while logging
in and then redirecting where needed.

Bes wishes,
Andris

On 02/01/07, Tony Brady <[EMAIL PROTECTED]> wrote:

Hi Philip
be happy to - and appreciate any feedback because this may not
necessarily be the optimal way to do this. One obvious improvement is
to use Zend_Auth as you mentioned earlier. My plugin is pretty basic:

class MyApp_Controller_AuthPlugin extends
Zend_Controller_Plugin_Abstract
{

 public function preDispatch($request)
 {
 // Page user is trying to access
 $resource = $request->getControllerName() . '/' . $request-
 >getActionName();
 if ($resource == 'index/timedout') {
 // Timed out - always allow
 return;
 }

 // check to see if logged in
 if (! isset($_SESSION['User'])) {
 // not logged in - divert to login page
 $request->setParam('target_params', $request->getParams
()); // save original params for later
 $request->setControllerName('index');
 $request->setActionName('login');
 }
 else {
 // Logged-in: check access
 if (! $_SESSION['User']->allowedAccess($resource)) {
 // Access denied
 $request->setControllerName('index');
 $request->setActionName('noaccess');
 }
 }
 }

}

What's nice about this is that you can change the request before it
has been dispatched. I also save the original request parameter array
as a parameter in the diverted request ('target_params'). This allows
me to store these in my login form so that the original user request
can be carried out after authentication. So the user requests some
page - has to login - but is then shown the page they wanted and
happy because they didn't get shunted to some home page hell with a
million links ;-) In my index/login action I have:

 public function loginAction()
 {
 if (isset($_POST['email'])) {
 // Login attempt
 $filterPost = new Zend_Filter_Input($_POST, false);
 $this->_view->target_params = $filterPost->testRegex
('target_params', '#^[a-z0-9\{\}:;"]*$#i');
 if (** your test for successful login here **) {
 // Successful login
 $params = unserialize($this->_view->target_params);
 $controller = $params['controller'];
 $action = $params['action'];
 if ($action == 'login') {
 // Default action to avoid endless loop
 $action = 'index';
 }
 unset($params['controller']);
 unset($params['action']);
 $this->_forward($controller, $action, $params);
 return;
 }
 }
 else {
 // Sent here by AuthPlugin
 $this->_view->target_params = serialize($this->_getParam
('target_params'));
 }
 // Template for action specific view
 $this->getResponse()
  ->setBody($this->_view->render('login.php'));
 }

and my login page view has a form like this:

Log in here
action='login'>

 formHidden('target_params', $this-
 >target_params); ?>
 
 
 Email address:
 formText('email', '', array('size'
=> 30)); ?>
 
 Password:
 formPassword('password', '', array
('size' => 20)); ?>
 
 
 
 
 
 


So when the form has been submitted I can get hold of the user's
original request by unserializing $_POST['target_params']. I'd be
interested in knowing if anyone can see any security problems with
this. Could an evil array be sent to login action that would cause
some unexpected behaviour?

The pl

[fw-general] multiple subscriptions to a list...

2006-12-21 Thread Eric Coleman

Ok,

So, I have a few small issues, there's a few lists that I appear to  
be subscribed to multiple times, specifically fw-auth (I think fw-mvc  
as well, there's a few other ones though I can't seem to figure out  
which ones atm)


How do I get that to friggin stop, it's starting to annoy me to death.

Regards,
Eric


[fw-general] Re: [fw-auth] Zend_Session - Ready for Testing!

2006-12-21 Thread Eric Coleman
Is anyone working on a Zend_Db session handler?  If not, is it  
alright to go ahead and make this?


Regards,
Eric


On Dec 21, 2006, at 12:38 PM, Gavin Vess wrote:


Greetings, and Merry Christmas!

Ralph and I have been working hard to bring you Zend_Session.

To test drive this cool component, please see the instructions for  
using the ZF incubator:

http://framework.zend.com/wiki/display/ZFDEV/Subversion+Standards

Briefly:
1) Always run "svn update" first, to use the best version of  
incubator components.

2) set_include_path( '/path/to/incubator/library' . PATH_SEPARATOR
. '/path/to/library' . PATH_SEPARATOR . get_include_path 
());


Please use the *newest* documentation, found below:
http://framework.zend.com/wiki/display/ZFDOC/Zend_Session

Everyone is most welcomed to register a wiki/issue tracker account,
and post comments on the wiki documentation above.  If you have
a new account, you may need to request posting privileges by
sending an email to [EMAIL PROTECTED] with the name of your account.

Cheers,
Gavin





Re: [fw-general] Build Zend Framework, parse errors.

2006-12-12 Thread Eric Coleman
Why are you encoding Zend Framework at all?  It's an open source  
project, not like you need to conceal any intellectual property...


Regards,
Eric


On Dec 12, 2006, at 11:02 AM, Joe Kramer wrote:


Nico,

My point is incompatibility between Zend products.

If you build serious, enterprise-level project, you probably will use
Zend Guard. I am not being elitist, but it seems like Zend framework
is not used for projects that are encoded with Zend Guard? Because
nobody raised the issue before.

Regards.

On 12/12/06, Nico Edtinger <[EMAIL PROTECTED]> wrote:

[12.12.2006 16:26] Joe Kramer wrote:
> There is no "compile php", you can only do "php -f" to parse single
> file.

There is a syntax checker (lint) built into php with "php -l". -f
does also execute the file.

> Probably can be automated using some script to parse every file in
> whole project tree.

find . -name "*.php" -exec php -l {} \; | grep -v "^No syntax errors
detected"

> ZF has 10 or so parse errors.

With the above line in trunk/ I only got:
   Strict standards: Assigning the return value of new by reference
is deprecated in ./incubator/library/Zend/Db/Adapter/Mysqli.php on
line 273

What other errors do you get?


nico

PS: I used 5.2.0 for the syntax check.