2009年10月31日星期六

Re: [fw-mvc] Routing trees and its decendants

I would use a regex route like myblog/:categories/:articleid then i would
extract the individual categories myself from the single categories route
segment in the controller or in a front controller plugin. I think that
would be the simplest way.

If you need more control directly in the router i think you could put
something together with the route chain but i havent dived into that yet so
i cant offer advice there.


David G. wrote:
>
> I've been wondering, how would I route a hierarchical tree? like
>
> http://localhost/Services/WebDevelopment/ or (better)
>
> http://myblog/parentCategory/subcategory1/subsubcategory2/article-id
>
> been trying but it seems I need a little push to make a breakthrough =/
>
> Thanks in advance,
> David
>

--
View this message in context: http://old.nabble.com/Routing-trees-and-its-decendants-tp26139966p26148609.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-db] weird Zend_Db_Table_Abstract behaviour

The result is successful. Update returns the number of affected rows. IF
there is nothing to update it will retun 0 which is going to eval to false.
IF something goes wrong in the query its going to throw an exception, not
return false.

if you want to check that the qurey went through then wrap your update in a
try catch and return false in the catch.

If on the other hand you are expecting to at least have one row modified
then you can test agianst > 0.


nulele wrote:
>
> Hello,
> I don't know why, but when I call the method below and there's nothing to
> update (datas are not changed) it returns false... I mean is this normal?
> Even if datas are not changed I would expect a successful result of the
> update operation... it simply would update nothing!!
>
> class Model_DbTable_Users extends Zend_Db_Table_Abstract
> {
> protected $_name = 'users';
> protected $_primary = 'id_user';
>
> ....
>
> public function updateData($data, $id)
> {
> $id = (int)$id;
> if($this->update($data, "id_user = " . $id))
> {
> return true;
> }
> return false;
> }
>
> ...
>
> }
>
> Maybe the problem could be NOT NULL fileds in the db?
> I know, would be better to include the update code in a try/catch
> statement, but I want to hear your opinion on this weird behaviour.
>
> Thanks
>

--
View this message in context: http://old.nabble.com/weird-Zend_Db_Table_Abstract-behaviour-tp26136108p26148578.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-db] weird Zend_Db_Table_Abstract behaviour

I'm sure all input parameters are valid... the problem only occurs if datas
don't need to be updated.

I can extend my question: how do you check db operation
(insert/update/delete) if something goes wrong?

bye


tfk wrote:
>
> On Fri, Oct 30, 2009 at 9:00 PM, nulele <nulele@gmail.com> wrote:
>>
>> Hello,
>> I don't know why, but when I call the method below and there's nothing to
>> update (datas are not changed) it returns false... I mean is this normal?
>> Even if datas are not changed I would expect a successful result of the
>> update operation... it simply would update nothing!!
>>
>> class Model_DbTable_Users extends Zend_Db_Table_Abstract
>> {
>>        protected $_name = 'users';
>>        protected $_primary = 'id_user';
>>
>> ....
>>
>>        public function updateData($data, $id)
>>        {
>>                $id = (int)$id;
>
> Maybe $id is casted to 0 here, and nothing matches?
>
> Till
>
>>        if($this->update($data, "id_user = " . $id))
>>        {
>>                return true;
>>        }
>>        return false;
>>        }
>>
>> ...
>>
>> }
>>
>> Maybe the problem could be NOT NULL fileds in the db?
>> I know, would be better to include the update code in a try/catch
>> statement,
>> but I want to hear your opinion on this weird behaviour.
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/weird-Zend_Db_Table_Abstract-behaviour-tp26136108p26136108.html
>> Sent from the Zend DB mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context: http://old.nabble.com/weird-Zend_Db_Table_Abstract-behaviour-tp26136108p26144290.html
Sent from the Zend DB mailing list archive at Nabble.com.

2009年10月30日星期五

[fw-mvc] Routing trees and its decendants

I've been wondering, how would I route a hierarchical tree? like

http://localhost/Services/WebDevelopment/ or (better)

http://myblog/parentCategory/subcategory1/subsubcategory2/article-id

been trying but it seems I need a little push to make a breakthrough =/

Thanks in advance,
David
--
View this message in context: http://old.nabble.com/Routing-trees-and-its-decendants-tp26139966p26139966.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-db] How can I to print Json formated response?

That may not necessarily be the problem, but did you try specifying the
response type (adding "json" as the 4th parameter in the $.post() call)?


BEREGU wrote:
>
> Hello,
>
> I wanted to print json formatted response, which is passed from
> controller passing to a view script.
> The response, which is catched with firebug is:
>
> |{"ai80":"1050","ai92":"1100","diesel":"1300"}|
>
>
> But I can't see any of those values on my browser. Please advice me what
> I made wrong.
>
>
>
> In the controller:
> =============
> $fuels = new BEREGU_FuelsDbTable();
> $result = $fuels->fetchAll();
>
> foreach ($result as $fuel){
> switch ($fuel->id) {
> case '2':
> $ai80 = $fuel->price;
> break;
>
> case '3':
> $ai92 = $fuel->price;
> break;
>
> case '6':
> $diesel = $fuel->price;
> break;
> }
> }
>
> $item = array();
> $item['ai80'] = $ai80;
> $item['ai92'] = $ai92;
> $item['diesel'] = $diesel;
>
> echo Zend_Json_Encoder::encode($item);
> ///////////////////////////////
>
> In the view script
> =============
> function getPriceJson(volume)
> {
> $.post(
> "/async/getprice",
> {
> "volume" : volume
> },
>
> function(response)
> {
> $("#ai92").append(" # "+response.diesel+" ");
> $("#ai80").append(response.ai80);
> $("#diesel").append(response.diesel);
> });
> }
> //////////////////////////////////////
>
>
>
>
> Sincerely,
> Enkhbilguun Erdenetsogt
>
> begin:vcard
> fn:Enkhbilguun Erdenetsogt
> n:Erdenetsogt;Enkhbilguun
> email;internet:enkhbilguun@beregu.com
> tel;cell:99113638
> x-mozilla-html:TRUE
> version:2.1
> end:vcard
>
>
>

--
View this message in context: http://old.nabble.com/How-can-I-to-print-Json-formated-response--tp26111958p26139117.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-db] weird Zend_Db_Table_Abstract behaviour

On Fri, Oct 30, 2009 at 9:00 PM, nulele <nulele@gmail.com> wrote:
>
> Hello,
> I don't know why, but when I call the method below and there's nothing to
> update (datas are not changed) it returns false... I mean is this normal?
> Even if datas are not changed I would expect a successful result of the
> update operation... it simply would update nothing!!
>
> class Model_DbTable_Users extends Zend_Db_Table_Abstract
> {
>        protected $_name = 'users';
>        protected $_primary = 'id_user';
>
> ....
>
>        public function updateData($data, $id)
>        {
>                $id = (int)$id;

Maybe $id is casted to 0 here, and nothing matches?

Till

>        if($this->update($data, "id_user = " . $id))
>        {
>                return true;
>        }
>        return false;
>        }
>
> ...
>
> }
>
> Maybe the problem could be NOT NULL fileds in the db?
> I know, would be better to include the update code in a try/catch statement,
> but I want to hear your opinion on this weird behaviour.
>
> Thanks
> --
> View this message in context: http://old.nabble.com/weird-Zend_Db_Table_Abstract-behaviour-tp26136108p26136108.html
> Sent from the Zend DB mailing list archive at Nabble.com.
>
>

Re: [fw-mvc] Zend_Search_Lucene and PDF files

Not yet, got prioritized to something else. A few more days maybe...
hopefully monday

sebdev wrote:
> Hi there,
>
> we are also looking for a PHP only solution.
>
> Did you put the classes yet for download?
>
> Thanks,
> Seb.
>
>
> Bill Chmura-2 wrote:
>
>> Hey, I spoke with the guy who wrote it and he is cool with putting it
>> out - he wanted a day or two to include some brief docs
>>
>> I'll post it then
>>
>> Following that we are going to read keywords and titles also, which it
>> don't do now and wrap it as a lucence_PDF class and give that one out also
>>
>>
>> Bill Chmura wrote:
>>
>>> I don't see why we wouldn't. Let me clean it up a bit, and I will
>>> post it.
>>>
>>> Nothing terribly complicated, but it could save some time for other
>>> people.
>>>
>>>
>>> Shaun Farrell wrote:
>>>
>>>> Bill,
>>>>
>>>> Are you going to open source that code?
>>>>
>>>>
>>>> On Fri, Sep 11, 2009 at 1:58 PM, Bill Chmura <Bill@explosivo.com
>>>> <mailto:Bill@explosivo.com>> wrote:
>>>>
>>>>
>>>> Just to bring closure to this... basically what we ended up doing
>>>> was writing the PDF code ourselves to grab only the text out of
>>>> the PDF. The spec's are available from Adobe for the PDF
>>>> format, so it was not that bad in the end. At least it is still
>>>> all PHP.
>>>>
>>>> Thanks to everyone for the suggestions on this
>>>>
>>>>
>>>>
>>>>
>>>> Bill Chmura wrote:
>>>>
>>>>> Thanks Shaun and Matthias,
>>>>>
>>>>> Shaun: I actually already found your post, and so far it is the
>>>>> most likely scenario if I cannot get a pure PHP solution working
>>>>> - The server is OpenBSD, but development is done on OSX, Linux,
>>>>> and Windows so it presents a problem with the XPDF. But if push
>>>>> comes to shove it's where I will be heading.
>>>>>
>>>>> Matthias: It needs to be able to update on the fly, and running
>>>>> Java up there may be a bit dicey... There is also a db
>>>>> component, so some of the meta data comes from my model, and
>>>>> well - its seeming to look painful as I move ahead either way -
>>>>> thanks for the suggestion though!
>>>>>
>>>>> I was really hoping someone with Zend_PDF knowledge would see
>>>>> this and yell, hey - just grab this array from the PDF object,
>>>>> its got your strings :)
>>>>>
>>>>> Thanks guys!
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Shaun Farrell wrote:
>>>>>
>>>>>> About a 1 1/2 yrs ago I wrote a 2 part post on how to index
>>>>>> pdf's with Zend.
>>>>>>
>>>>>> (http://www.kapustabrothers.com/2008/01/20/indexing-pdf-documents-with-zend_search_lucene/)
>>>>>> the Framework has come along way since then so it's probably
>>>>>> out of date. I have been thinking about updating the topic.
>>>>>> The current implementation uses XPDF which at the time was the
>>>>>> best to convert PDF's to Text. I have been looking for some
>>>>>> other libraries but have no luck. I'm also looking so ill let
>>>>>> you know if i find anything.
>>>>>>
>>>>>> On Wed, Sep 9, 2009 at 8:00 AM, Matthias W.
>>>>>> <Matthias.Wangler@e-projecta.com
>>>>>> <mailto:Matthias.Wangler@e-projecta.com>> wrote:
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>> some time ago I had the same problem. But I needed the
>>>>>> support for other
>>>>>> documents, too (Excel, Powerpoint, ...).
>>>>>> Because of this I created my index with java Apache
>>>>>> projects: Lucene, PDFBox
>>>>>> (PDF parser/writer) and POI (Office document parser/writer).
>>>>>>
>>>>>> I think it wouldn't be much work to parse your PDF docs
>>>>>> Java-side...
>>>>>>
>>>>>>
>>>>>> Bill Chmura-2 wrote:
>>>>>> >
>>>>>> > Hello,
>>>>>> >
>>>>>> > I am implementing Lucene and need to index my PDF files.
>>>>>> >
>>>>>> > I have found several solutions, but they all require some
>>>>>> non PHP
>>>>>> > component such as XPDF, etc... I need this to be cross
>>>>>> platform, so
>>>>>> > those are generally out.
>>>>>> >
>>>>>> > I also started looking for ways to get inside Zend_PDF to
>>>>>> get at the
>>>>>> > elements of each page with no success yet. I was hoping
>>>>>> that I could
>>>>>> > iterate the pages in a PDF (done), get a list of the
>>>>>> elements on that
>>>>>> > page (?) and then grab the text from perhaps the
>>>>>> Zend_Pdf_Element_String
>>>>>> > I was able to find in there. Since I am not going to be
>>>>>> displaying the
>>>>>> > context in my search, the location of the text does not
>>>>>> matter to me so
>>>>>> > much.
>>>>>> >
>>>>>> > I am getting totally bogged down in the source code for
>>>>>> the pages and
>>>>>> > the parsers, partially at least because I am not familiar
>>>>>> with the
>>>>>> > nomenclature of PDF internals :(
>>>>>> >
>>>>>> > Does anyone have any pointers on how to approach this?
>>>>>> Ideally I'd like
>>>>>> > to keep it Zend, but I can use other PDF libraries if I
>>>>>> need to.
>>>>>> >
>>>>>> > Thanks
>>>>>> >
>>>>>> > Bill
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>> http://www.nabble.com/Zend_Search_Lucene-and-PDF-files-tp25352084p25363483.html
>>>>>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Shaun J. Farrell
>>>>>> Washington, DC
>>>>>> (202) 713-5241
>>>>>> www.farrelley.com <http://www.farrelley.com>
>>>>>>
>>>>
>>>>
>>>> --
>>>> Shaun J. Farrell
>>>> Washington, DC
>>>> (202) 713-5241
>>>> www.farrelley.com <http://www.farrelley.com>
>>>>
>>
>>
>
>

[fw-db] weird Zend_Db_Table_Abstract behaviour

Hello,
I don't know why, but when I call the method below and there's nothing to
update (datas are not changed) it returns false... I mean is this normal?
Even if datas are not changed I would expect a successful result of the
update operation... it simply would update nothing!!

class Model_DbTable_Users extends Zend_Db_Table_Abstract
{
protected $_name = 'users';
protected $_primary = 'id_user';

....

public function updateData($data, $id)
{
$id = (int)$id;
if($this->update($data, "id_user = " . $id))
{
return true;
}
return false;
}

...

}

Maybe the problem could be NOT NULL fileds in the db?
I know, would be better to include the update code in a try/catch statement,
but I want to hear your opinion on this weird behaviour.

Thanks
--
View this message in context: http://old.nabble.com/weird-Zend_Db_Table_Abstract-behaviour-tp26136108p26136108.html
Sent from the Zend DB mailing list archive at Nabble.com.

Re: [fw-mvc] how to use APPLICATION_ENV

Hi,

Unfortunately, in IIS I never find how to define an environment variable
as in apache (if someone know how to do that, I am very interested). So,
for the moment I instead use the name of the computer (variable
COMPUTERNAME), so the modification to rely on a ini variable in the
default error.phtml instead of an environment variable is great.
Thanks.

Ithier


Ralph Schindler a écrit :
> This is being changed in 1.10.
>
> See:
>
> http://framework.zend.com/svn/framework/standard/incubator/library/Zend/Tool/Project/Context/Zf/ControllerFile.php
>
>
> Currently this work is in the incubator, although I am rolling out
> alpha packages at major milestones in the pear package format.
>
> Hector Virgen wrote:
>> The default error.phtml created by zf.sh tests the APPLICATION_ENV
>> constant to determine if exception information should be displayed.
>> If it's set to "development", then exception information is
>> displayed. Is there a better way for it to determine this without
>> using the constant?
>>
>> --
>> Hector
>>
>>
>> On Wed, Oct 28, 2009 at 2:26 PM, Brenton Alker <brenton@tekerson.com
>> <mailto:brenton@tekerson.com>> wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> huajun qi wrote:
>> > I know zend defines a APPLICATION_ENV variable in the index.php
>> file,
>> > but we don't see it is used explicitly. Is it used in zend source
>> code?
>>
>> It's not used internally, no. So, you could rename it (or not set
>> it)
>> without problem. The only way it is used is when you instantiate
>> Zend_Application you tell it which section of the config
>> (application.ini by default) you want to load.
>>
>> > Does it have some usage to help develop?
>>
>> You often have different sections of the config file
>> (application.ini)
>> for each environment. By default, one for
>> testing/staging/production.
>> Usually, the majority of the configuration is in production and the
>> others inherit from that.
>>
>> You can then override values in the other sections. This can be
>> used to
>> do things like override the database configuration, to use SQLite
>> for
>> testing, or a separate MySQL instance for staging.
>>
>> Hope that helps.
>>
>> - --
>>
>> Brenton Alker
>> PHP Developer - Brisbane, Australia
>>
>> http://blog.tekerson.com/
>> http://twitter.com/tekerson
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iEYEARECAAYFAkrotwAACgkQ7bkAtAithuv4UwCfYTPeVj+McP94lz4OEm0NN48x
>> ojcAn3IE3ofwyL2s8Q4quvR+3XBe+UEC
>> =AGUq
>> -----END PGP SIGNATURE-----
>>
>>
>

Re: [fw-auth] Zend_Acl , Ownership - request scope or injection in domain objects

A lot of people (me included), like to have their domain entities implement the ACL Role interface, and then have the ACL check directly against the domain entities in question. You can do this in a service layer, or perhaps with some kind of event system.

On Fri, Oct 30, 2009 at 12:37 PM, tomascejka <dis.cejkatomas@gmail.com> wrote:

Hi,

I stand before implementing authorization/ownership in ZF based application.
I am developer but now I ask you as developer and architect in one person. I
would like to know how to design authorization process. After I read some
sources - there are two articles which interest me.

A.
http://devzone.zend.com/article/3510-Zend_Acl-and-MVC-Integration-Part-II-Advanced-Use
B.
http://www.weierophinney.net/matthew/archives/201-Applying-ACLs-to-Models.html

Where is good location to check rights and ownership?




-----
Enviroment
==========

OS:
SUSE Linux Enterprice 10 (i586) - version 2.6.16.60-0.27-smp
Windows XP SP 3

Tomcat v6.0.16, 6.0.18
Java(TM) SE Runtime Enviroment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
Maven v2.0.9
Apache 2.2.11
MySQL 5.1.30
PHP 5.2.10
qooxdoo-0.8.2
Python 2.5
Zend framework 1.9.3
Dojo 1.3.2

Hudson:
=======
version 1.329
plugins: Maven 1.304, SSH Slaves
running: deployed in Tomcat

front-end developer web-based application
A.S.E.I. [http://www.asei.cz]
--
View this message in context: http://old.nabble.com/Zend_Acl-%2C-Ownership---request-scope-or-injection-in-domain-objects-tp26133244p26133244.html
Sent from the Zend Auth mailing list archive at Nabble.com.


[fw-auth] Zend_Acl , Ownership - request scope or injection in domain objects

Hi,

I stand before implementing authorization/ownership in ZF based application.
I am developer but now I ask you as developer and architect in one person. I
would like to know how to design authorization process. After I read some
sources - there are two articles which interest me.

A.
http://devzone.zend.com/article/3510-Zend_Acl-and-MVC-Integration-Part-II-Advanced-Use
B.
http://www.weierophinney.net/matthew/archives/201-Applying-ACLs-to-Models.html

Where is good location to check rights and ownership?


-----
Enviroment
==========

OS:
SUSE Linux Enterprice 10 (i586) - version 2.6.16.60-0.27-smp
Windows XP SP 3

Tomcat v6.0.16, 6.0.18
Java(TM) SE Runtime Enviroment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
Maven v2.0.9
Apache 2.2.11
MySQL 5.1.30
PHP 5.2.10
qooxdoo-0.8.2
Python 2.5
Zend framework 1.9.3
Dojo 1.3.2

Hudson:
=======
version 1.329
plugins: Maven 1.304, SSH Slaves
running: deployed in Tomcat

front-end developer web-based application
A.S.E.I. [http://www.asei.cz]
--
View this message in context: http://old.nabble.com/Zend_Acl-%2C-Ownership---request-scope-or-injection-in-domain-objects-tp26133244p26133244.html
Sent from the Zend Auth mailing list archive at Nabble.com.

Re: [fw-mvc] how to use APPLICATION_ENV

On of the main reasons that this constant is used is b/c it map nicely
to an actual environment variable.

In my projects, I typically SetEnv this variable inside the vhost. The
constant will have different values on different systems, but from that
point, the index.php will either use what its seen, or assume production
mode.

By setting this value in the actual environment itself (like a vhost
that is generally not transfered with the project), the project itself
can be as portable between dev, testing, qa, prod. as possible).

Hope that sheds some light on its usage.

-ralph


huajun qi wrote:
> I know zend defines a APPLICATION_ENV variable in the index.php file,
> but we don't see it is used explicitly. Is it used in zend source code?
>
> Does it have some usage to help develop?
>
> --
> Location:

Re: [fw-mvc] how to use APPLICATION_ENV

This is being changed in 1.10.

See:

http://framework.zend.com/svn/framework/standard/incubator/library/Zend/Tool/Project/Context/Zf/ControllerFile.php

Currently this work is in the incubator, although I am rolling out alpha
packages at major milestones in the pear package format.

Hector Virgen wrote:
> The default error.phtml created by zf.sh tests the APPLICATION_ENV
> constant to determine if exception information should be displayed. If
> it's set to "development", then exception information is displayed. Is
> there a better way for it to determine this without using the constant?
>
> --
> Hector
>
>
> On Wed, Oct 28, 2009 at 2:26 PM, Brenton Alker <brenton@tekerson.com
> <mailto:brenton@tekerson.com>> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> huajun qi wrote:
> > I know zend defines a APPLICATION_ENV variable in the index.php
> file,
> > but we don't see it is used explicitly. Is it used in zend source
> code?
>
> It's not used internally, no. So, you could rename it (or not set it)
> without problem. The only way it is used is when you instantiate
> Zend_Application you tell it which section of the config
> (application.ini by default) you want to load.
>
> > Does it have some usage to help develop?
>
> You often have different sections of the config file (application.ini)
> for each environment. By default, one for testing/staging/production.
> Usually, the majority of the configuration is in production and the
> others inherit from that.
>
> You can then override values in the other sections. This can be used to
> do things like override the database configuration, to use SQLite for
> testing, or a separate MySQL instance for staging.
>
> Hope that helps.
>
> - --
>
> Brenton Alker
> PHP Developer - Brisbane, Australia
>
> http://blog.tekerson.com/
> http://twitter.com/tekerson
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkrotwAACgkQ7bkAtAithuv4UwCfYTPeVj+McP94lz4OEm0NN48x
> ojcAn3IE3ofwyL2s8Q4quvR+3XBe+UEC
> =AGUq
> -----END PGP SIGNATURE-----
>
>

Re: [fw-mvc] how to use APPLICATION_ENV

On 29 Oct 2009, at 01:41, Pádraic Brady wrote:

> Someone could throw an issue at JIRA about it. It really shouldn't
> be tied to a specific constant name. That said, the whole point of
> the Zend tool component is to work with a predictable generated
> project so it could be a deliberate simplication by design.
>

I noticed in April :) It's been fixed for 1.10.

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

Regards,

Rob...

Re: [fw-mvc] zend log helper

huajun qi wrote:
>
> I needto do some log in every controller, So i want to add a log helper to
> controller helpers.
>
> How can I make it?
>

Have a look at http://devzone.zend.com/article/3350 for info on creating
action helpers.

Regards,

Goran Juric
http://gogs.info/
--
View this message in context: http://old.nabble.com/zend-log-helper-tp26124741p26126759.html
Sent from the Zend MVC mailing list archive at Nabble.com.

2009年10月29日星期四

[fw-mvc] zend log helper

I needto do some log in every controller, So i want to add a log helper to controller helpers. 

How can I make it?

--
Location:

Re: [fw-mvc] Registering Helpers with Views

Created issue #ZF-8177

Putting together a patch and unit test now.

--
Hector


On Thu, Oct 29, 2009 at 4:55 AM, Matthew Weier O'Phinney <matthew@zend.com> wrote:
-- Hector Virgen <djvirgen@gmail.com> wrote
(on Wednesday, 28 October 2009, 01:20 PM -0700):
> Here's how I imagine this would look like:
>
> // Adding a custom helper
> $view = new Zend_View();
> $helper = new MyCustomHelper();
> $view->addHelper($helper, 'foo');
> $view->foo(); // calls MyCustomHelper#foo()
>
> // Overwriting a built-in helper
> $myUrlHelper = new MyUrlHelper();
> $view->addHelper($myUrlHelper, 'url');
> $view->url(); // calls MyUrlHelper#url();
>
> There's always a potential for a BC break when adding new methods to
> Zend_View_Abstract, but the chances are slim that someone created their own
> view helper named "AddHelper". Just something to keep in mind when picking the
> name for the method.

Please create a feature request in the tracker for this. Bonus points if
you attach a patch (including unit tests!), as I'll be more likely to
include it sooner. :)


> On Wed, Oct 28, 2009 at 6:04 AM, Matthew Weier O'Phinney <matthew@zend.com>
> wrote:
>
>     -- Abraham Block <atblock@gmail.com> wrote
>     (on Wednesday, 28 October 2009, 08:38 AM -0400):
>     > Why is there no way of registering a helper that you've instantiate
>     yourself
>     > with an instance of Zend_View? Why is the only way to instantiate one
>     through
>     > the plugin loader? What if I wanted to control the instantiation of a
>     view
>     > helper (for DI purposes, let's say). Or what if I wanted to add a view
>     helper
>     > which didn't conform to the Zend\Pear naming standards (let's say it used
>     php
>     > 5.3 namespaces). Is there a reason the design is this way?
>
>     There is not a way to do this currently; it was not a part of the
>     original design specification.
>
>     If you would like to see this in a future version, please put in a
>     request on the issue tracker, or create a proposal indicating how you
>     would envision this working.
>
>     Thanks!
>
>     --
>     Matthew Weier O'Phinney
>     Project Lead            | matthew@zend.com
>     Zend Framework          | http://framework.zend.com/
>
>
>

--
Matthew Weier O'Phinney
Project Lead            | matthew@zend.com
Zend Framework          | http://framework.zend.com/


Re: [fw-mvc] Catching Exception thrown in _forward

Thanks, it helped me find a workaround. Here is what I did:

public function initAction()
{

$this->getFrontController()->getPlugin('Zend_Controller_Plugin_ErrorHandler')
->setErrorHandlerModule('somemodule')
->setErrorHandlerController('somecontroller')
->setErrorHandlerAction('someaction');

$this->_forward('somewhere');

}

In the Controller somecontroller of Module somemodule:

public function someactionAction()
{
$error = $this->_getParam('error_handler');

// Then work using $error->exception as my exception
}


Hector Virgen wrote:
>
> From what I understand, _forward only modifies the request and resets its
> dispatched flag. In other words, you can't catch any exception thrown in
> the
> action because the action isn't actually dispatched at that point.
>
> Generally, exceptions thrown by actions are caught in the ErrorHandler
> plugin and forwarded to the ErrorController. Can you handle your error in
> the ErrorController?
>
> --
> Hector
>
>
> On Wed, Oct 28, 2009 at 10:26 AM, Cadrach <masterachid@yahoo.com> wrote:
>
>>
>> Hi everyone,
>>
>> I have the following issue, inside an action I would like to catch the
>> Exception thrown inside a $this->_forward I am making.
>>
>> Example code of my controller:
>> public function initAction()
>> {
>> $this->getFrontController()->setParam('noErrorHandler', true);
>> $this->getFrontController()->throwExceptions(true);
>> try
>> {
>> $this->_forward('test');
>> }
>> catch(Exception $e)
>> {
>> echo "CAUGHT";
>> exit;
>> }
>> }
>>
>> public function testAction()
>> {
>> throw new Exception('TEST');
>> }
>>
>> This code displays the exception using standard PHP display, but the
>> "catch"
>> is never run.
>>
>> Any idea what I am doing wrong? Or is this the excepted behavior of
>> _forward()?
>>
>> Thanks for reading,
>> Cadrach
>> --
>> View this message in context:
>> http://www.nabble.com/Catching-Exception-thrown-in-_forward-tp26098718p26098718.html
>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Catching-Exception-thrown-in-_forward-tp26098718p26115965.html
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-db] How can I to print Json formated response?

begin:vcard
fn:Enkhbilguun Erdenetsogt
n:Erdenetsogt;Enkhbilguun
email;internet:enkhbilguun@beregu.com
tel;cell:99113638
x-mozilla-html:TRUE
version:2.1
end:vcard

Hello,

I wanted to print json formatted response, which is passed from
controller passing to a view script.
The response, which is catched with firebug is:

|{"ai80":"1050","ai92":"1100","diesel":"1300"}|


But I can't see any of those values on my browser. Please advice me what
I made wrong.

In the controller:
=============
$fuels = new BEREGU_FuelsDbTable();
$result = $fuels->fetchAll();

foreach ($result as $fuel){
switch ($fuel->id) {
case '2':
$ai80 = $fuel->price;
break;

case '3':
$ai92 = $fuel->price;
break;

case '6':
$diesel = $fuel->price;
break;
}
}

$item = array();
$item['ai80'] = $ai80;
$item['ai92'] = $ai92;
$item['diesel'] = $diesel;

echo Zend_Json_Encoder::encode($item);
///////////////////////////////

In the view script
=============
function getPriceJson(volume)
{
$.post(
"/async/getprice",
{
"volume" : volume
},

function(response)
{
$("#ai92").append("<a href='#'>"+response.diesel+"</a>");
$("#ai80").append(response.ai80);
$("#diesel").append(response.diesel);
});
}
//////////////////////////////////////


Sincerely,
Enkhbilguun Erdenetsogt

Re: [fw-mvc] Registering Helpers with Views

-- Hector Virgen <djvirgen@gmail.com> wrote
(on Wednesday, 28 October 2009, 01:20 PM -0700):
> Here's how I imagine this would look like:
>
> // Adding a custom helper
> $view = new Zend_View();
> $helper = new MyCustomHelper();
> $view->addHelper($helper, 'foo');
> $view->foo(); // calls MyCustomHelper#foo()
>
> // Overwriting a built-in helper
> $myUrlHelper = new MyUrlHelper();
> $view->addHelper($myUrlHelper, 'url');
> $view->url(); // calls MyUrlHelper#url();
>
> There's always a potential for a BC break when adding new methods to
> Zend_View_Abstract, but the chances are slim that someone created their own
> view helper named "AddHelper". Just something to keep in mind when picking the
> name for the method.

Please create a feature request in the tracker for this. Bonus points if
you attach a patch (including unit tests!), as I'll be more likely to
include it sooner. :)


> On Wed, Oct 28, 2009 at 6:04 AM, Matthew Weier O'Phinney <matthew@zend.com>
> wrote:
>
> -- Abraham Block <atblock@gmail.com> wrote
> (on Wednesday, 28 October 2009, 08:38 AM -0400):
> > Why is there no way of registering a helper that you've instantiate
> yourself
> > with an instance of Zend_View? Why is the only way to instantiate one
> through
> > the plugin loader? What if I wanted to control the instantiation of a
> view
> > helper (for DI purposes, let's say). Or what if I wanted to add a view
> helper
> > which didn't conform to the Zend\Pear naming standards (let's say it used
> php
> > 5.3 namespaces). Is there a reason the design is this way?
>
> There is not a way to do this currently; it was not a part of the
> original design specification.
>
> If you would like to see this in a future version, please put in a
> request on the issue tracker, or create a proposal indicating how you
> would envision this working.
>
> Thanks!
>
> --
> Matthew Weier O'Phinney
> Project Lead | matthew@zend.com
> Zend Framework | http://framework.zend.com/
>
>
>

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/

Re: [fw-db] How to assign typical Zend Db Query Object into Array

You can just do Zend_Json::encode($array); to encode and to decode just do Zend_Json::decode($json)

On Thu, Oct 29, 2009 at 6:08 AM, Nick Pack <nick@nickpack.com> wrote:
Enkhbilguun Erdenetsogt wrote:
Hello,

I'm learning Ajax with Zend Framework, and I just want to make my typical Zend Db Query Object (fetchAll()ed) to Json encoding ready array.

Can someone help me?

Thank you very much in advance.


Sincerely,

Enkhbilguun Erdenetsogt

You can do (in your controller):

$results = $table->fetchAll()->toArray();

$this->_helper->json($results);

Hope that helps




--
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com

Re: [fw-db] How to assign typical Zend Db Query Object into Array

Enkhbilguun Erdenetsogt wrote:
> Hello,
>
> I'm learning Ajax with Zend Framework, and I just want to make my
> typical Zend Db Query Object (fetchAll()ed) to Json encoding ready array.
>
> Can someone help me?
>
> Thank you very much in advance.
>
>
> Sincerely,
>
> Enkhbilguun Erdenetsogt

You can do (in your controller):

$results = $table->fetchAll()->toArray();

$this->_helper->json($results);

Hope that helps

[fw-db] How to assign typical Zend Db Query Object into Array

begin:vcard
fn:Enkhbilguun Erdenetsogt
n:Erdenetsogt;Enkhbilguun
email;internet:enkhbilguun@beregu.com
tel;cell:99113638
x-mozilla-html:TRUE
version:2.1
end:vcard

Hello,

I'm learning Ajax with Zend Framework, and I just want to make my
typical Zend Db Query Object (fetchAll()ed) to Json encoding ready array.

Can someone help me?

Thank you very much in advance.


Sincerely,

Enkhbilguun Erdenetsogt

2009年10月28日星期三

Re: [fw-db] Zend_Db_Table and mysql COUNT() function

Why fetching all rows if you need just count? It's far faster to select count (*).

Regards,
Saša Stamenković


On Wed, Oct 28, 2009 at 11:15 PM, Ralph Schindler <ralph.schindler@zend.com> wrote:
What rows do you want to count?

If you get a rowset back, you can always call count:

$rowset = $table->fetchAll('foo = "bar"');

echo count($rowset);
// OR
echo $rowset->count();

Does that help? I feel you might have a more specific question, but that basically is counting an existing rowset.

-ralph



greg606 wrote:
Hi
I have a table (Zend_Db_table object) and I want to count rows.
What is the simplest way to do it? ;)

Regards
Greg

Re: [fw-mvc] how to use APPLICATION_ENV

thanks brenton alker ....

nice reply

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

Re: [fw-mvc] how to use APPLICATION_ENV

Someone could throw an issue at JIRA about it. It really shouldn't be tied to a specific constant name. That said, the whole point of the Zend tool component is to work with a predictable generated project so it could be a deliberate simplication by design.

Paddy
 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative



From: Hector Virgen <djvirgen@gmail.com>
To: Brenton Alker <brenton@tekerson.com>
Cc: huajun qi <qihjun@gmail.com>; fw-mvc@lists.zend.com
Sent: Wed, October 28, 2009 10:49:11 PM
Subject: Re: [fw-mvc] how to use APPLICATION_ENV

The default error.phtml created by zf.sh tests the APPLICATION_ENV constant to determine if exception information should be displayed. If it's set to "development", then exception information is displayed. Is there a better way for it to determine this without using the constant?

--
Hector


On Wed, Oct 28, 2009 at 2:26 PM, Brenton Alker <brenton@tekerson.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

huajun qi wrote:
> I  know zend defines a APPLICATION_ENV variable in the index.php file,
> but we don't see it is used explicitly. Is it used in zend source code?

It's not used internally, no. So, you could rename it (or not set it)
without problem. The only way it is used is when you instantiate
Zend_Application you tell it which section of the config
(application.ini by default) you want to load.

> Does it have some usage to help develop?

You often have different sections of the config file (application.ini)
for each environment. By default, one for testing/staging/production.
Usually, the majority of the configuration is in production and the
others inherit from that.

You can then override values in the other sections. This can be used to
do things like override the database configuration, to use SQLite for
testing, or a separate MySQL instance for staging.

Hope that helps.

- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

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

iEYEARECAAYFAkrotwAACgkQ7bkAtAithuv4UwCfYTPeVj+McP94lz4OEm0NN48x
ojcAn3IE3ofwyL2s8Q4quvR+3XBe+UEC
=AGUq
-----END PGP SIGNATURE-----


Re: [fw-mvc] how to use APPLICATION_ENV

I, like Brenton, don't prefer to have to deal with the APPLICATION_ENV.

I usually have three different environments (dev/staging/production) where I will create a server.xml and place it in my global include_path.

In the bootstrap I grab the value for the environment and pass it to the frontcontroller:

$server       = new Zend_Config_Xml(SERVER_PROPERTIES, 'properties');

Just pass: $server->environment to boostrap

On Wed, Oct 28, 2009 at 7:19 PM, Brenton Alker <brenton@tekerson.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hector Virgen wrote:
> The default error.phtml created by zf.sh tests the APPLICATION_ENV
> constant to determine if exception information should be displayed. If
> it's set to "development", then exception information is displayed. Is
> there a better way for it to determine this without using the constant?

Ah, true.
Personally, I don't like checking for a specific environment, but would
rather check for a configuration directive.

eg. I would add a "debug" configuration option to the development
environment config and check for that.

That way, you could add it to other environments, or remove it from that
environment without editing the code. Basically, I try not to depend on
the constant for anything.

Having said that, this is just my opinion, and since it's used in the
error page, somebody apparently disagrees :)


- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

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

iEYEARECAAYFAkro33EACgkQ7bkAtAithuvPrwCgzk2F+EDSyZho0zlvriIh968f
hLQAn0LDjzbFBW0dS/Hwf20SrdZtDZlq
=ZY8h
-----END PGP SIGNATURE-----




--
Cory Wiles
kwylez@gmail.com
www.corywiles.com | www.feedfootball.com

Re: [fw-mvc] how to use APPLICATION_ENV

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hector Virgen wrote:
> The default error.phtml created by zf.sh tests the APPLICATION_ENV
> constant to determine if exception information should be displayed. If
> it's set to "development", then exception information is displayed. Is
> there a better way for it to determine this without using the constant?

Ah, true.
Personally, I don't like checking for a specific environment, but would
rather check for a configuration directive.

eg. I would add a "debug" configuration option to the development
environment config and check for that.

That way, you could add it to other environments, or remove it from that
environment without editing the code. Basically, I try not to depend on
the constant for anything.

Having said that, this is just my opinion, and since it's used in the
error page, somebody apparently disagrees :)


- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

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

iEYEARECAAYFAkro33EACgkQ7bkAtAithuvPrwCgzk2F+EDSyZho0zlvriIh968f
hLQAn0LDjzbFBW0dS/Hwf20SrdZtDZlq
=ZY8h
-----END PGP SIGNATURE-----

Re: [fw-mvc] how to use APPLICATION_ENV

The default error.phtml created by zf.sh tests the APPLICATION_ENV constant to determine if exception information should be displayed. If it's set to "development", then exception information is displayed. Is there a better way for it to determine this without using the constant?

--
Hector


On Wed, Oct 28, 2009 at 2:26 PM, Brenton Alker <brenton@tekerson.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

huajun qi wrote:
> I  know zend defines a APPLICATION_ENV variable in the index.php file,
> but we don't see it is used explicitly. Is it used in zend source code?

It's not used internally, no. So, you could rename it (or not set it)
without problem. The only way it is used is when you instantiate
Zend_Application you tell it which section of the config
(application.ini by default) you want to load.

> Does it have some usage to help develop?

You often have different sections of the config file (application.ini)
for each environment. By default, one for testing/staging/production.
Usually, the majority of the configuration is in production and the
others inherit from that.

You can then override values in the other sections. This can be used to
do things like override the database configuration, to use SQLite for
testing, or a separate MySQL instance for staging.

Hope that helps.

- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

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

iEYEARECAAYFAkrotwAACgkQ7bkAtAithuv4UwCfYTPeVj+McP94lz4OEm0NN48x
ojcAn3IE3ofwyL2s8Q4quvR+3XBe+UEC
=AGUq
-----END PGP SIGNATURE-----


Re: [fw-db] Zend_Db_Table and mysql COUNT() function

What rows do you want to count?

If you get a rowset back, you can always call count:

$rowset = $table->fetchAll('foo = "bar"');

echo count($rowset);
// OR
echo $rowset->count();

Does that help? I feel you might have a more specific question, but that
basically is counting an existing rowset.

-ralph


greg606 wrote:
> Hi
> I have a table (Zend_Db_table object) and I want to count rows.
> What is the simplest way to do it? ;)
>
> Regards
> Greg

Re: [fw-mvc] Registering Helpers with Views

As far as implementation goes, it doesn't look so hard either. Now, Zend_View::getHelper() delegates to Zend_View:_getPlugin() which instantiates the class, and adds it to the $_helper array. So addHelper, or whatever you'd call it, can just add your already instantiated class to that array. 

On Wed, Oct 28, 2009 at 4:20 PM, Hector Virgen <djvirgen@gmail.com> wrote:
Here's how I imagine this would look like:

// Adding a custom helper
$view = new Zend_View();
$helper = new MyCustomHelper();
$view->addHelper($helper, 'foo');
$view->foo(); // calls MyCustomHelper#foo()

// Overwriting a built-in helper
$myUrlHelper = new MyUrlHelper();
$view->addHelper($myUrlHelper, 'url');
$view->url(); // calls MyUrlHelper#url();

There's always a potential for a BC break when adding new methods to Zend_View_Abstract, but the chances are slim that someone created their own view helper named "AddHelper". Just something to keep in mind when picking the name for the method.

--
Hector



On Wed, Oct 28, 2009 at 6:04 AM, Matthew Weier O'Phinney <matthew@zend.com> wrote:
-- Abraham Block <atblock@gmail.com> wrote
(on Wednesday, 28 October 2009, 08:38 AM -0400):
> Why is there no way of registering a helper that you've instantiate yourself
> with an instance of Zend_View? Why is the only way to instantiate one through
> the plugin loader? What if I wanted to control the instantiation of a view
> helper (for DI purposes, let's say). Or what if I wanted to add a view helper
> which didn't conform to the Zend\Pear naming standards (let's say it used php
> 5.3 namespaces). Is there a reason the design is this way?

There is not a way to do this currently; it was not a part of the
original design specification.

If you would like to see this in a future version, please put in a
request on the issue tracker, or create a proposal indicating how you
would envision this working.

Thanks!

--
Matthew Weier O'Phinney
Project Lead            | matthew@zend.com
Zend Framework          | http://framework.zend.com/



Re: [fw-mvc] how to use APPLICATION_ENV

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

huajun qi wrote:
> I know zend defines a APPLICATION_ENV variable in the index.php file,
> but we don't see it is used explicitly. Is it used in zend source code?

It's not used internally, no. So, you could rename it (or not set it)
without problem. The only way it is used is when you instantiate
Zend_Application you tell it which section of the config
(application.ini by default) you want to load.

> Does it have some usage to help develop?

You often have different sections of the config file (application.ini)
for each environment. By default, one for testing/staging/production.
Usually, the majority of the configuration is in production and the
others inherit from that.

You can then override values in the other sections. This can be used to
do things like override the database configuration, to use SQLite for
testing, or a separate MySQL instance for staging.

Hope that helps.

- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

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

iEYEARECAAYFAkrotwAACgkQ7bkAtAithuv4UwCfYTPeVj+McP94lz4OEm0NN48x
ojcAn3IE3ofwyL2s8Q4quvR+3XBe+UEC
=AGUq
-----END PGP SIGNATURE-----

Re: [fw-mvc] Registering Helpers with Views

Here's how I imagine this would look like:

// Adding a custom helper
$view = new Zend_View();
$helper = new MyCustomHelper();
$view->addHelper($helper, 'foo');
$view->foo(); // calls MyCustomHelper#foo()

// Overwriting a built-in helper
$myUrlHelper = new MyUrlHelper();
$view->addHelper($myUrlHelper, 'url');
$view->url(); // calls MyUrlHelper#url();

There's always a potential for a BC break when adding new methods to Zend_View_Abstract, but the chances are slim that someone created their own view helper named "AddHelper". Just something to keep in mind when picking the name for the method.

--
Hector


On Wed, Oct 28, 2009 at 6:04 AM, Matthew Weier O'Phinney <matthew@zend.com> wrote:
-- Abraham Block <atblock@gmail.com> wrote
(on Wednesday, 28 October 2009, 08:38 AM -0400):
> Why is there no way of registering a helper that you've instantiate yourself
> with an instance of Zend_View? Why is the only way to instantiate one through
> the plugin loader? What if I wanted to control the instantiation of a view
> helper (for DI purposes, let's say). Or what if I wanted to add a view helper
> which didn't conform to the Zend\Pear naming standards (let's say it used php
> 5.3 namespaces). Is there a reason the design is this way?

There is not a way to do this currently; it was not a part of the
original design specification.

If you would like to see this in a future version, please put in a
request on the issue tracker, or create a proposal indicating how you
would envision this working.

Thanks!

--
Matthew Weier O'Phinney
Project Lead            | matthew@zend.com
Zend Framework          | http://framework.zend.com/


[fw-db] Re: confirm unsubscribe from fw-db@lists.zend.com

On 28/10/2009 20:13, fw-db-help@lists.zend.com wrote:
> Hi! This is the ezmlm program. I'm managing the
> fw-db@lists.zend.com mailing list.
>
> I'm working for my owner, who can be reached
> at fw-db-owner@lists.zend.com.
>
> To confirm that you would like
>
> skinner@destiny-denied.co.uk
>
> removed from the fw-db mailing list, please send an empty reply
> to this address:
>
> fw-db-uc.1256760802.nfekenbifhnnbggmecii-skinner=destiny-denied.co.uk@lists.zend.com
>
> Usually, this happens when you just hit the "reply" button.
> If this does not work, simply copy the address and paste it into
> the "To:" field of a new message.
>
> I haven't checked whether your address is currently on the mailing list.
> To see what address you used to subscribe, look at the messages you are
> receiving from the mailing list. Each message has your address hidden
> inside its return path; for example, mary@example.com receives
> messages with return path:
> <fw-db-return-<number>-mary=example.com@lists.zend.com.
>
>
> --- Administrative commands for the fw-db list ---
>
> I can handle administrative requests automatically. Please
> do not send them to the list address! Instead, send
> your message to the correct command address:
>
> For help and a description of available commands, send a message to:
> <fw-db-help@lists.zend.com>
>
> To subscribe to the list, send a message to:
> <fw-db-subscribe@lists.zend.com>
>
> To remove your address from the list, just send a message to
> the address in the ``List-Unsubscribe'' header of any list
> message. If you haven't changed addresses since subscribing,
> you can also send a message to:
> <fw-db-unsubscribe@lists.zend.com>
>
> or for the digest to:
> <fw-db-digest-unsubscribe@lists.zend.com>
>
> For addition or removal of addresses, I'll send a confirmation
> message to that address. When you receive it, simply reply to it
> to complete the transaction.
>
> If you need to get in touch with the human owner of this list,
> please send a message to:
>
> <fw-db-owner@lists.zend.com>
>
> Please include a FORWARDED list message with ALL HEADERS intact
> to make it easier to help you.
>
> --- Enclosed is a copy of the request I received.
>
> Return-Path:<skinner@destiny-denied.co.uk>
> Received: (qmail 26011 invoked from network); 28 Oct 2009 20:13:21 -0000
> Received: from exprod7mx234.postini.com (HELO psmtp.com) (64.18.2.187)
> by lists.zend.com with SMTP; 28 Oct 2009 20:13:21 -0000
> Received: from source ([209.20.77.253]) (using TLSv1) by exprod7mx234.postini.com ([64.18.6.14]) with SMTP;
> Wed, 28 Oct 2009 13:13:21 PDT
> Received: from [78.148.178.141] (helo=[172.16.0.12])
> by pion.xeaura.co.uk with esmtpsa (TLSv1:AES256-SHA:256)
> (Exim 4.69)
> (envelope-from<skinner@destiny-denied.co.uk>)
> id 1N3EtU-0003qd-5b
> for fw-db-unsubscribe@lists.zend.com; Wed, 28 Oct 2009 20:13:20 +0000
> Message-ID:<4AE8A5E0.8050505@destiny-denied.co.uk>
> Date: Wed, 28 Oct 2009 20:13:20 +0000
> From: Daniel Skinner<skinner@destiny-denied.co.uk>
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4
> MIME-Version: 1.0
> To: fw-db-unsubscribe@lists.zend.com
> References:<772053.91755.qm@web55207.mail.re4.yahoo.com> <COL108-W38990CBB7EC48232AA331DB2B80@phx.gbl> <c4cabf100910281222y3ff78ec5i36b47aa31d85b7e7@mail.gmail.com>
> In-Reply-To:<c4cabf100910281222y3ff78ec5i36b47aa31d85b7e7@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
> X-AntiAbuse: Primary Hostname - pion.xeaura.co.uk
> X-AntiAbuse: Original Domain - lists.zend.com
> X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
> X-AntiAbuse: Sender Address Domain - destiny-denied.co.uk
> X-pstn-2strike: clear
> X-pstn-neptune: 0/0/0.00/0
> X-pstn-levels: (S: 1.01124/99.88923 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
>
>

[fw-mvc] Re: confirm unsubscribe from fw-mvc@lists.zend.com

On 28/10/2009 20:13, fw-mvc-help@lists.zend.com wrote:
> Hi! This is the ezmlm program. I'm managing the
> fw-mvc@lists.zend.com mailing list.
>
> I'm working for my owner, who can be reached
> at fw-mvc-owner@lists.zend.com.
>
> To confirm that you would like
>
> skinner@destiny-denied.co.uk
>
> removed from the fw-mvc mailing list, please send an empty reply
> to this address:
>
> fw-mvc-uc.1256760837.ndmipdhiahmbaojaeikk-skinner=destiny-denied.co.uk@lists.zend.com
>
> Usually, this happens when you just hit the "reply" button.
> If this does not work, simply copy the address and paste it into
> the "To:" field of a new message.
>
> I haven't checked whether your address is currently on the mailing list.
> To see what address you used to subscribe, look at the messages you are
> receiving from the mailing list. Each message has your address hidden
> inside its return path; for example, mary@example.com receives
> messages with return path:
> <fw-mvc-return-<number>-mary=example.com@lists.zend.com.
>
>
> --- Administrative commands for the fw-mvc list ---
>
> I can handle administrative requests automatically. Please
> do not send them to the list address! Instead, send
> your message to the correct command address:
>
> For help and a description of available commands, send a message to:
> <fw-mvc-help@lists.zend.com>
>
> To subscribe to the list, send a message to:
> <fw-mvc-subscribe@lists.zend.com>
>
> To remove your address from the list, just send a message to
> the address in the ``List-Unsubscribe'' header of any list
> message. If you haven't changed addresses since subscribing,
> you can also send a message to:
> <fw-mvc-unsubscribe@lists.zend.com>
>
> or for the digest to:
> <fw-mvc-digest-unsubscribe@lists.zend.com>
>
> For addition or removal of addresses, I'll send a confirmation
> message to that address. When you receive it, simply reply to it
> to complete the transaction.
>
> If you need to get in touch with the human owner of this list,
> please send a message to:
>
> <fw-mvc-owner@lists.zend.com>
>
> Please include a FORWARDED list message with ALL HEADERS intact
> to make it easier to help you.
>
> --- Enclosed is a copy of the request I received.
>
> Return-Path:<skinner@destiny-denied.co.uk>
> Received: (qmail 26089 invoked from network); 28 Oct 2009 20:13:57 -0000
> Received: from exprod7mx164.postini.com (HELO psmtp.com) (64.18.2.69)
> by lists.zend.com with SMTP; 28 Oct 2009 20:13:57 -0000
> Received: from source ([209.20.77.253]) (using TLSv1) by exprod7mx164.postini.com ([64.18.6.14]) with SMTP;
> Wed, 28 Oct 2009 16:13:57 EDT
> Received: from [78.148.178.141] (helo=[172.16.0.12])
> by pion.xeaura.co.uk with esmtpsa (TLSv1:AES256-SHA:256)
> (Exim 4.69)
> (envelope-from<skinner@destiny-denied.co.uk>)
> id 1N3Eu3-0003rE-Pp
> for fw-mvc-unsubscribe@lists.zend.com; Wed, 28 Oct 2009 20:13:55 +0000
> Message-ID:<4AE8A604.1030403@destiny-denied.co.uk>
> Date: Wed, 28 Oct 2009 20:13:56 +0000
> From: Daniel Skinner<skinner@destiny-denied.co.uk>
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4
> MIME-Version: 1.0
> To: fw-mvc-unsubscribe@lists.zend.com
> References:<26098718.post@talk.nabble.com> <4b9a3c080910281146p6a85413bvbeabe63dfc9450c2@mail.gmail.com>
> In-Reply-To:<4b9a3c080910281146p6a85413bvbeabe63dfc9450c2@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
> X-AntiAbuse: Primary Hostname - pion.xeaura.co.uk
> X-AntiAbuse: Original Domain - lists.zend.com
> X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
> X-AntiAbuse: Sender Address Domain - destiny-denied.co.uk
> X-pstn-neptune: 0/0/0.00/0
> X-pstn-levels: (S: 1.01124/99.88923 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
>
>

[fw-db] META=SER EL CORREO MAS ENVIADO EN MEXICO (Si te Interesa Reenvíalo)




Felicidades Querétaro!!! Por ser el primer Estado en lograr que la tenencia vehicular fuera derogada, -al menos hubo un gobernador a quien sí le importa su gente- debemos hacer una fuerza común para lograr que esto se haga efectivo en todos los estados de nuestro País, no es posible que aún en momentos de extrema crisis económica se sigan robando el dinero que tanto nos cuesta ganar, hagamos valer el poder del Pueblo. (Reenvíalo a todos tus conocidos, no importa que ya lo hayas hecho antes)
 
 
A él ya se le olvido.
PERO A NOSOTROS NO.
cid:image005.jpg@01C998FB.BBAB0390

 

ESTA FOTO ES FIEL TESTIGO DE LO QUE SE PROMETE Y NO SE CUMPLE.

 

QUE SEA EL CORREO MAS ENVIADO DE MÉXICO Y A VER SI ASÍ HACEMOS PRESIÓN PARA QUE SE CUMPLA.  
El presidente
Felipe Calderón en su campaña prometió eliminar este impuesto.
E
mpecemos por primera vez a exigir y a unirnos como mexicanos, para poder lograrlo.
SI NO LO RE-ENVIAS NO TE QUEJES  DEL GOBIERNO Y PAÍS EN EL QUE VIVES.

 

Re: [fw-mvc] Catching Exception thrown in _forward

>From what I understand, _forward only modifies the request and resets its dispatched flag. In other words, you can't catch any exception thrown in the action because the action isn't actually dispatched at that point.

Generally, exceptions thrown by actions are caught in the ErrorHandler plugin and forwarded to the ErrorController. Can you handle your error in the ErrorController?

--
Hector


On Wed, Oct 28, 2009 at 10:26 AM, Cadrach <masterachid@yahoo.com> wrote:

Hi everyone,

I have the following issue, inside an action I would like to catch the
Exception thrown inside a $this->_forward I am making.

Example code of my controller:
   public function initAction()
   {
       $this->getFrontController()->setParam('noErrorHandler', true);
       $this->getFrontController()->throwExceptions(true);
       try
       {
           $this->_forward('test');
       }
       catch(Exception $e)
       {
           echo "CAUGHT";
           exit;
       }
   }

   public function testAction()
   {
       throw new Exception('TEST');
   }

This code displays the exception using standard PHP display, but the "catch"
is never run.

Any idea what I am doing wrong? Or is this the excepted behavior of
_forward()?

Thanks for reading,
Cadrach
--
View this message in context: http://www.nabble.com/Catching-Exception-thrown-in-_forward-tp26098718p26098718.html
Sent from the Zend MVC mailing list archive at Nabble.com.


[fw-mvc] Catching Exception thrown in _forward

Hi everyone,

I have the following issue, inside an action I would like to catch the
Exception thrown inside a $this->_forward I am making.

Example code of my controller:
public function initAction()
{
$this->getFrontController()->setParam('noErrorHandler', true);
$this->getFrontController()->throwExceptions(true);
try
{
$this->_forward('test');
}
catch(Exception $e)
{
echo "CAUGHT";
exit;
}
}

public function testAction()
{
throw new Exception('TEST');
}

This code displays the exception using standard PHP display, but the "catch"
is never run.

Any idea what I am doing wrong? Or is this the excepted behavior of
_forward()?

Thanks for reading,
Cadrach
--
View this message in context: http://www.nabble.com/Catching-Exception-thrown-in-_forward-tp26098718p26098718.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] how to use APPLICATION_ENV

APPLICATION_ENV is used to specify what environment your application
is running in -- for example, development, production, staging,
testing.

It can be set in your virtual host configuration file or your .htaccess file.

On Wed, Oct 28, 2009 at 8:50 AM, Abraham Block <atblock@gmail.com> wrote:
> It could be set in your .htaccess file, i believe.
>
> On Wed, Oct 28, 2009 at 9:49 AM, huajun qi <qihjun@gmail.com> wrote:
>>
>> I  know zend defines a APPLICATION_ENV variable in the index.php file, but
>> we don't see it is used explicitly. Is it used in zend source code?
>> Does it have some usage to help develop?
>>
>> --
>> Location:
>
>

Re: [fw-mvc] how to use APPLICATION_ENV

It could be set in your .htaccess file, i believe.

On Wed, Oct 28, 2009 at 9:49 AM, huajun qi <qihjun@gmail.com> wrote:
I  know zend defines a APPLICATION_ENV variable in the index.php file, but we don't see it is used explicitly. Is it used in zend source code?

Does it have some usage to help develop?

--
Location:

[fw-mvc] how to use APPLICATION_ENV

I  know zend defines a APPLICATION_ENV variable in the index.php file, but we don't see it is used explicitly. Is it used in zend source code?

Does it have some usage to help develop?

--
Location:

Re: [fw-mvc] Registering Helpers with Views

-- Abraham Block <atblock@gmail.com> wrote
(on Wednesday, 28 October 2009, 08:38 AM -0400):
> Why is there no way of registering a helper that you've instantiate yourself
> with an instance of Zend_View? Why is the only way to instantiate one through
> the plugin loader? What if I wanted to control the instantiation of a view
> helper (for DI purposes, let's say). Or what if I wanted to add a view helper
> which didn't conform to the Zend\Pear naming standards (let's say it used php
> 5.3 namespaces). Is there a reason the design is this way?

There is not a way to do this currently; it was not a part of the
original design specification.

If you would like to see this in a future version, please put in a
request on the issue tracker, or create a proposal indicating how you
would envision this working.

Thanks!

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/

[fw-db] Zend_Db_Table and mysql COUNT() function

Hi
I have a table (Zend_Db_table object) and I want to count rows.
What is the simplest way to do it? ;)

Regards
Greg
--
View this message in context: http://www.nabble.com/Zend_Db_Table-and-mysql-COUNT%28%29-function-tp26093954p26093954.html
Sent from the Zend DB mailing list archive at Nabble.com.

[fw-mvc] Registering Helpers with Views

Why is there no way of registering a helper that you've instantiate yourself with an instance of Zend_View? Why is the only way to instantiate one through the plugin loader? What if I wanted to control the instantiation of a view helper (for DI purposes, let's say). Or what if I wanted to add a view helper which didn't conform to the Zend\Pear naming standards (let's say it used php 5.3 namespaces). Is there a reason the design is this way?

2009年10月27日星期二

[fw-mvc] Using Zend_Navigation for hierarchically menus

Hi,

I have one problem with implementation of menus using Zend_Navigation
and Menu view helper.

I have a hierarchically (2+ levels) menu. Most of the menu items are
based based, and couple are url based. For grouping the items from level
2 i am using some "empty" nodes on level 1, which are basically some url
menu items, with # as href. This is a very often case for drop down
menus or so, so could be rendered fine both with Javascript or without
(with just CSS).

Let's see a menu sample:

About Us (with # as url)
- About Us (mvc)
- Contact (mvc)
- Jobs (mvc)
- Blog (url)
Support (with # as url)
- List tickets (mvc)
- New ticket (mvc)


Each mvc item has associated resource and privilege, and at view helper
i am setting the acl and current role.

Now, here is my problem. Let's suppose the use doesn't have access to
both "List tickets" and "New ticket". The view helper is rendering the
"Support" (with # as url) and of course there are no subitems to be
rendered...
This looks odd by many reasons... So the problem is: how should i make
the view helper to NOT render also "Support" if the child pages are not
rendered.

There are couple of possible solutions:
- use custom partial script to render menu
- add an assert for the "empty" menu items to check if subitems would be
rendered or not and decide by this
- maybe even other solutions...

But i wannt to see what approach are you using for such problems...

--
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

Re: [fw-mvc] Custom Zend_Helper_Navigation_* helper

Ah thank you, that's done it.

I actually tried something very similar, creating a custom Navigation class
and changing the its NS constant. However, because the findHelper() method
is the same as the parent class I hadn't copied it across to my new class.
Of course thinking about that means that the parent findHelper() method was
being called, and it was using the parent::NS constant, completely bypassing
the change I'd made.

Thanks,

Pete


Jurian Sluiman wrote:
>
> The big problem is Zend adds the helper path. Because all ZF helpers are
> inside Zend_Helper_Navigation_* and not Zend_Helper_*, the framework adds
> the
> namespace for these elements itself.
>
> This is in most cases done *after* you added the namespaces youself (e.g.
> in
> application.ini). Therefore, Zend will always find its own helpers first
> (because it searches inside the most recent added namespaces first). If
> you
> create your own Navigation view helper and add your own My_View_Helper_*
> namespace, it all works fine.
>
> As an example, I added my Navigation view helper here:
> http://pastie.org/671879. This works fine for all our
> Soflomo_View_Navigation_* helpers.
>
> Regards, Jurian
> --
> Jurian Sluiman
> Soflomo.com
>

--
View this message in context: http://www.nabble.com/Custom-Zend_Helper_Navigation_*-helper-tp26081193p26081667.html
Sent from the Zend MVC mailing list archive at Nabble.com.