2009年11月30日星期一

Re: [fw-db] Select - insert Zend_Db_Row

Hehum.

$row = $this->find($id)->current();
$carHistory = new Automobili_Model_CarHistory();
$carHistory->insert($row->toArray());

is shorter then yours

$row = $this->find($id)->current(); 
$historyTable = new My_Model_CarHistory(); 
$historyRow = $historyTable->createRow($row->toArray()); 
$historyRow->save(); 

and maybe faster, isn't it?

What is the advantage of your approach?

Thanks for the response!

Regards,
Saša Stamenković


On Mon, Nov 30, 2009 at 9:05 PM, Ralph Schindler-2 [via Zend Framework Community] <[hidden email]> wrote:
Hi,

Perhaps something like this-


$row = $this->find($id)->current();
$historyTable = new My_Model_CarHistory();
$historyRow = $historyTable->createRow($row->toArray());
$historyRow->save();

This assumes that you want the primary keys to be the same.  Otherwise
you might have to do this:

$data = $row->toArray();
unset($data['id');

before inserting it into the createRow() method, to ensure that it gets
it's own database provided primary key.

Hope that helps,
Ralph

umpirsky wrote:

> Hi.
>
> I tried (in my class which extends Zend_Db_Table_Abstract):
>
> $row = $this->find($id)->current();
> $row->setTable(new My_Model_History());
> $row->save();
>
> My_Model_History and current class have same mysql structure, identical
> tables, one is active, and other I want to use for data history.
>
> I got:
>
> Zend_Db_Table_Row_Exception: Cannot refresh row as parent is missing
> thrown in Zend\Db\Table\Row\Abstract.php on line 758
>
> It works with:
>
> $row = $this->find($id)->current();
> $history = new My_Model_CarHistory();
> $history->insert($row->toArray());
>
> Is there a way to do it with sth similar to 1st example, or there is maybe
> some other better option?
>
> Regards,
> Sasa Stamenkovic.



View this message in context: Re: [fw-db] Select - insert Zend_Db_Row
Sent from the Zend DB mailing list archive at Nabble.com.

[fw-gdata] ZendGdata stopped working Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 500 Internal Error' in /usr/local/ZendGdata-1.9.2/library/Zend/Gdata/App.php:700

Hi All,
I have an error with some code that has been working for a while, it's
basically just pulling the groups from google.
The code is below:

-- start code ---
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');

$domain = "domain.com";
$emailaddr = "googleadmin@domain.com";
$emailpw = "adm1nzr0x0rz!";
$service = Zend_Gdata_Gapps::AUTH_SERVICE_NAME;


$client = Zend_Gdata_ClientLogin::getHttpClient($emailaddr, $emailpw,
$service);
$gdata = new Zend_Gdata_Gapps($client, $domain);
?>

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="style.css" type="text/css" rel="stylesheet"/>
</script>
</head>

<?php
$feed = $gdata->retrieveAllEmailLists();
$i = 0;
foreach ($feed as $list) {
$i++;
}
?>

<html><body>
<h2>Groups<?php echo " (Total: " . $i . ")"?></h2>
<?php
foreach ($feed as $list) {
echo "$list->emailList->name";
}
?>
--- end code cut ---

When trying to run this now I see the following instead of the group lists:
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message
'Expected response code 200, got 500 Internal Error' in
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata/App.php:700 Stack trace: #0
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata.php(219):
Zend_Gdata_App->performHttpRequest('GET', 'https://apps-ap...', Array, NULL,
NULL, NULL) #1 /usr/local/ZendGdata-1.9.2/library/Zend/Gdata/App.php(861):
Zend_Gdata->performHttpRequest('GET', 'https://apps-ap...', Array) #2
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata/Gapps.php(202):
Zend_Gdata_App->get('https://apps-ap...', NULL) #3
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata/App.php(754):
Zend_Gdata_Gapps->get('https://apps-ap...', NULL) #4
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata/App.php(205):
Zend_Gdata_App->importUrl('https://apps-ap...', 'Zend_Gdata_Gapp...', NULL)
#5 /usr/local/ZendGdata-1.9.2/library/Zend/Gdata.php(162):
Zend_Gdata_App->getFeed('https://apps-ap...', 'Zend_Gdata_Gapp...') #6
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata/Gapps.php(394): in
/usr/local/ZendGdata-1.9.2/library/Zend/Gdata/App.php on line 700

Anyone know how to fix this, and/or why it happened?

--
View this message in context: http://n4.nabble.com/ZendGdata-stopped-working-Uncaught-exception-Zend-Gdata-App-HttpException-with-message-Expected-resp0-tp931738p931738.html
Sent from the Zend gdata mailing list archive at Nabble.com.

Re: [fw-db] Select - insert Zend_Db_Row

Hi,

Perhaps something like this-


$row = $this->find($id)->current();
$historyTable = new My_Model_CarHistory();
$historyRow = $historyTable->createRow($row->toArray());
$historyRow->save();

This assumes that you want the primary keys to be the same. Otherwise
you might have to do this:

$data = $row->toArray();
unset($data['id');

before inserting it into the createRow() method, to ensure that it gets
it's own database provided primary key.

Hope that helps,
Ralph

umpirsky wrote:
> Hi.
>
> I tried (in my class which extends Zend_Db_Table_Abstract):
>
> $row = $this->find($id)->current();
> $row->setTable(new My_Model_History());
> $row->save();
>
> My_Model_History and current class have same mysql structure, identical
> tables, one is active, and other I want to use for data history.
>
> I got:
>
> Zend_Db_Table_Row_Exception: Cannot refresh row as parent is missing
> thrown in Zend\Db\Table\Row\Abstract.php on line 758
>
> It works with:
>
> $row = $this->find($id)->current();
> $history = new My_Model_CarHistory();
> $history->insert($row->toArray());
>
> Is there a way to do it with sth similar to 1st example, or there is maybe
> some other better option?
>
> Regards,
> Sasa Stamenkovic.

[fw-webservices] Node documentation

With help of phpdoc it is possible to create a function description in wsdl,
for instance:

/**
* Here goes the description
* @return string
*/
public function myFunction(){
}

will result in:

<operation name="myFunction">
<documentation>Here goes the description</documentation>
<input message="tns:myFunctionIn" />
<output message="tns:myFunctionOut" />
</operation>

Is it also possible to add a description to a complex return type or to the
properties of a complex return type?
What I would like is something like the following:

<xsd:complexType name="Foo">
- <xsd:all>
<documentation>Here goes the description of the Foo Class</documentation>
<xsd:element name="fooElement" type="tns:fooElement">
<documentation>Here goes the description of the Foo
property</documentation>
</xsd:element>
</xsd:all>
</xsd:complexType>
...
<message name="functionNameOut">
<part name="return" type="tns:Foo" />
</message>
....

I tried various options like adding a text at the start of the return class
and adding comments after the property definition, for instance @var string
This is a help text, but nothing seems to generate a documentation tag.

With these extra documentation tags you will be able to generate complete
human readable documentation with help of an xsl style sheet.

--
View this message in context: http://n4.nabble.com/Node-documentation-tp931498p931498.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

2009年11月29日星期日

Re: [fw-mvc] access url view helper from my custom view helper

Thanks for the tip

I extended Zend_View_Helper_Catmenu to Zend_View_Helper_Abstract.


class Zend_View_Helper_Catmenu extends Zend_View_Helper_Abstract
{
public function Catmenu($cats)
{
$catMenu='';
$link = '';

foreach ($cats as $cat)
{
$link = $this->view->url(array('controller' => 'cats', 'action' =>
'index', 'cat' => $cat['cat_url']));
$catMenu .= "<li> \"$link\" $cat[cat] </li>";
}

return $catMenu;
}

}

The main reason for doing this is to use $this->_request->getQuery('cat')
from the controller and I still can't use it and instead rely on
$this->_request->getParam('cat')

Any ideas on this?

thanks

Jigal Sanders wrote:
>
> Can't you just extend the view class? Like
>
> class Zend_View_Helper_Catmenu extends Zend_View(_Helper) or something
> like
> this? ?
>
> On Fri, Nov 27, 2009 at 6:16 AM, prado <pradosh_k@hotmail.com> wrote:
>
>>
>> Hi I have got a simple view helper which is sitting inside views/helpers
>> directory that generates a list of links
>>
>> class Zend_View_Helper_Catmenu
>> {
>> public function Catmenu($cats)
>> {
>> $catMenu='';
>>
>> foreach ($cats as $cat)
>> {
>> $catMenu .= "<li> \"
>> /cats/index/cat/$cat[cat_url]\">$cat[cat] </li>";
>> }
>>
>> return $catMenu;
>> }
>>
>> }
>>
>>
>> I would like to use the url helper which is in this case "echo
>> $this->url(array('controller'=>'cats', 'action'=>'index',
>> 'cat'=>$cat[cat_url]));" for the highlighted code above. As I am not in
>> the
>> view i won't be able to access the url helper.
>>
>> Any other way to access a helper inside my custom helper, like in this
>> example
>> --
>> View this message in context:
>> http://n4.nabble.com/access-url-view-helper-from-my-custom-view-helper-tp788528p788528.html
>> Sent from the Zend MVC mailing list archive at Nabble.com.
>>
>
>
>
> --
> Met vriendelijke groet,
>
> Jigal Sanders
> A.J. Ernststraat 739
> 1082 LK Amsterdam
> Mobiel: 06-42111489
>
>

--
View this message in context: http://n4.nabble.com/access-url-view-helper-from-my-custom-view-helper-tp788528p930949.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] about Remember Me with zend_auth

You can but I didn't want to clutter up my database with sessions for 2 weeks.  When you got the amount of traffic that site got the database would be huge.  (650K + a day)

--
Zend Certified EngineerJon Whitcraft
Zend Certified Engineer
jwhitcraft@mac.com



Joó Ádám wrote:
Jon, why did you create your own cookie? There’s already PHPSESSID, you can set it’s lifetime for the appropriate interval, set session.gc_maxlifetime, and you’re ok, aren’t you?   Ádám   

2009年11月28日星期六

[fw-db] Select - insert Zend_Db_Row

Hi.

I tried (in my class which extends Zend_Db_Table_Abstract):

$row = $this->find($id)->current();
$row->setTable(new My_Model_History());
$row->save();

My_Model_History and current class have same mysql structure, identical
tables, one is active, and other I want to use for data history.

I got:

Zend_Db_Table_Row_Exception: Cannot refresh row as parent is missing
thrown in Zend\Db\Table\Row\Abstract.php on line 758

It works with:

$row = $this->find($id)->current();
$history = new My_Model_CarHistory();
$history->insert($row->toArray());

Is there a way to do it with sth similar to 1st example, or there is maybe
some other better option?

Regards,
Sasa Stamenkovic.
--
View this message in context: http://n4.nabble.com/Select-insert-Zend-Db-Row-tp930493p930493.html
Sent from the Zend DB mailing list archive at Nabble.com.

2009年11月27日星期五

Re: [fw-mvc] about Remember Me with zend_auth

Jon, why did you create your own cookie? There's already PHPSESSID,
you can set it's lifetime for the appropriate interval, set
session.gc_maxlifetime, and you're ok, aren't you?


Ádám

Re: [fw-mvc] Zend_Navigation & custom routes = several problems

Marcus,

I ran into this problem as well this past week. What I did to fix it was put <route>default</route> on everyone that is using the default.  What I found is that when you are on a page that uses a route it forces the route to be that route for every link that doesn't have a route specified.  I see this as being a flaw with Zend_Navigation.  I have yet to find the actually code that causes the bug but when I do I'll submit a ticket with a patch in the Issue Tracker.

Hope this helps,

--
Zend Certified EngineerJon Whitcraft
Zend Certified Engineer
jwhitcraft@mac.com



Marcus Stöhr wrote:
Hi list,  to create my navigation I use the following bootstrap-code:  $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav'); $nav = new Zend_Application_Resource_Navigation(array('pages' => $config));  Contents of navigation.xml:  <?xml version="1.0" encoding="UTF-8"?> <configdata> 	<nav> 		<index> 			<label>nav_index</label> 			<controller>index</controller> 			<action>index</action> 		</index> 		<release> 			<label>nav_release</label> 			<controller>title</controller> 			<action>list</action> 			<route>titlelist</route> 			<params> 				<char>0-9</char> 				<page>1</page> 			</params> 		</release> 		<names> 			<label>nav_names</label> 			<controller>names</controller> 			<action>list</action> 			<route>nameslist</route> 			<params> 				<char>A</char> 				<page>1</page> 			</params> 		</names> 		<label> 			<label>nav_label</label> 			<controller>sites</controller> 			<action>list</action> 			<route>labellist</route> 			<params> 				<char>0-9</char> 				<page>1</page> 			</params> 		</label> 		<search> 			<label>nav_search</label> 			<controller>search</controller> 		</search> 		<help> 			<label>nav_help</label> 			<controller>help</controller> 		</help> 		<forum> 			<label>nav_forum</label> 			<uri>http://www.soundtrack-board.de</uri> 		</forum> 	</nav> </configdata>  This works and the navigation gets created, BUT when I hover the links which uses no named route, the links isn't just the expected controller/action-couple but the actual route used for the page I'm on, e.g.  /public/names/0-9-p1.html but it should show /public/search  My custom routes are utilizing Zend_Controller_Router_Route_Regex.  The other problem is: There is no active link and so I can't use some of the helper methods to enhance my navigation with a sub-navigation.  What do I wrong?  - Marcus    

Re: [fw-mvc] autoloader problem

You should really use 1.9.6 instead of just the loader with 1.9.1  I'm sure that is your problem.  is there a reason why you are not using the entire 1.9.6 library?

Jon

Ari Awan wrote:
Yes .. I upgrade only the loader module to 1.9.6 ...  but I am using ZF 1.9.1 for the whole library tho .. any hint on why?  On Nov 27, 2009, at 6:41 PM, Yaroslav Vorozhko wrote:    
Hi Ari, Did you upgrade ZF library recently?  Ari Awan wrote:     
Hi Yaroslav,  I have put this in my bootstrap.php  	protected function _initViewHelpers() 	{			 		$autoloader = Zend_Loader_Autoloader::getInstance(); 		$autoloader->registerNamespace('Website_'); 		 		$this->bootstrap('view'); 		$view = $this->getResource('view'); 		$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); 		$view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper'); 		$view->addHelperPath('Website/View/Helper', 'Website_View_Helper');	  	}  is this correct? I never encountered this error before .. and as far as I can remember i didnt change anything .. so I am wondering what happens ...  On Nov 27, 2009, at 5:38 PM, Yaroslav Vorozhko wrote:          
Hi, Your should fix include paths. Look at index.php or bootstrat.php file to setup proper paths.              
Hi ZF community,  today i take a look at apache error_log and I got this error message :  [Fri Nov 27 16:44:33 2009] [error] [client 114.48.30.190] PHP Fatal error:  Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Cdn' was not found in the registry; used paths:\n Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n Stack trace:\n #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Cdn')\n #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'cdn')\n #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('cdn')\n #3 [internal function]: Zend_View_Abstract->__call('cdn', Array)\n #4 /www/website/application/views/scripts/error/error.phtml(22): Zend_View->cdn('images')\n #5 /www/website/library/Zend/View.php(108): include('...')\n #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run(' in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta  Then I try to put Cdn.php under www/website/application/views/helpers/ .. the above error gone .. and i got this error :  [Fri Nov 27 16:47:50 2009] [error] [client 114.48.30.190] PHP Fatal error:  Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:\n Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n Stack trace:\n #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('JQuery')\n #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'jQuery')\n #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery')\n#3 [internal function]: Zend_View_Abstract->__call('jQuery', Array)\n #4 /www/website/application/layouts/layout.phtml(21): Zend_View->jQuery()\n #5 /www/website/library/Zend/View.php(108): include('...')\n #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run('/ in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta  This error does not happen to any client .. but one in particular was [client 114.48.30.190] .. keep receiving this error .. any idea how to fix this?  Thank you very much, Ari                     
         
   

--
Zend Certified EngineerJon Whitcraft
Zend Certified Engineer
jwhitcraft@mac.com

Re: [fw-mvc] about Remember Me with zend_auth

Sina,

You would have to implement some sort of a cookie hash for the user to be checked against when they come back to the site for the remember me.  But not when you do this you also need to make sure that they have to type in their password to change any personal data as someone could just come login to the site when the remember me is checked and take over the users account with out ever knowing the password.

The way i've done this in the past is when the user log-ins and has remember me checked i just create a hash and a has_expires entries in my database and put the hash in a cookie.  When the users comes back to the site in my bootstrap I check for the existance of the cookie and if it exists then I associate their user_id with their session.  But if they go to try and change or view any of their user info they are prompted with a password so I can verify that it's them.

I normally kept the hash for two weeks so they could be logged in for up to two weeks at time.

Jon

Christoph@vonaffenfels.de wrote:
Hi Sina,

have a look at the Zend_Auth method:

Zend_Auth setStorage (Zend_Auth_Storage_Interface $storage)

You can choose between the following storage adapters:

- Interface to implement your very own storage adapter
- NonPersistent to re-populate the authentication for each request
- Session the mainly used storage for authentication

Enjoy ZF :)

Greetings,

Christoph

Am 25.11.2009 19:00, schrieb sina miandashti:
hi zf community  im sina from iran  i completely use zend_auth for login my users in my app but i dont know how to implement the Remember me with zend_auth  plz help    

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel   

--
Zend Certified EngineerJon Whitcraft
Zend Certified Engineer
jwhitcraft@mac.com

Re: [fw-mvc] autoloader problem

Yes .. I upgrade only the loader module to 1.9.6 ...
but I am using ZF 1.9.1 for the whole library tho .. any hint on why?

On Nov 27, 2009, at 6:41 PM, Yaroslav Vorozhko wrote:

> Hi Ari,
> Did you upgrade ZF library recently?
>
> Ari Awan wrote:
>> Hi Yaroslav,
>>
>> I have put this in my bootstrap.php
>>
>> protected function _initViewHelpers()
>> {
>> $autoloader = Zend_Loader_Autoloader::getInstance();
>> $autoloader->registerNamespace('Website_');
>>
>> $this->bootstrap('view');
>> $view = $this->getResource('view');
>> $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
>> $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
>> $view->addHelperPath('Website/View/Helper', 'Website_View_Helper');
>>
>> }
>>
>> is this correct? I never encountered this error before .. and as far as I can remember i didnt change anything .. so I am wondering what happens ...
>>
>> On Nov 27, 2009, at 5:38 PM, Yaroslav Vorozhko wrote:
>>
>>
>>> Hi,
>>> Your should fix include paths.
>>> Look at index.php or bootstrat.php file to setup proper paths.
>>>
>>>
>>>> Hi ZF community,
>>>>
>>>> today i take a look at apache error_log and I got this error message :
>>>>
>>>> [Fri Nov 27 16:44:33 2009] [error] [client 114.48.30.190] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Cdn' was not found in the registry; used paths:\n
>>>> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
>>>> Stack trace:\n
>>>> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Cdn')\n
>>>> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'cdn')\n
>>>> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('cdn')\n
>>>> #3 [internal function]: Zend_View_Abstract->__call('cdn', Array)\n
>>>> #4 /www/website/application/views/scripts/error/error.phtml(22): Zend_View->cdn('images')\n
>>>> #5 /www/website/library/Zend/View.php(108): include('...')\n
>>>> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run(' in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>>>>
>>>> Then I try to put Cdn.php under www/website/application/views/helpers/ .. the above error gone .. and i got this error :
>>>>
>>>> [Fri Nov 27 16:47:50 2009] [error] [client 114.48.30.190] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:\n
>>>> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
>>>> Stack trace:\n
>>>> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('JQuery')\n
>>>> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'jQuery')\n
>>>> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery')\n#3 [internal function]: Zend_View_Abstract->__call('jQuery', Array)\n
>>>> #4 /www/website/application/layouts/layout.phtml(21): Zend_View->jQuery()\n
>>>> #5 /www/website/library/Zend/View.php(108): include('...')\n
>>>> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run('/ in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>>>>
>>>> This error does not happen to any client .. but one in particular was [client 114.48.30.190] .. keep receiving this error .. any idea how to fix this?
>>>>
>>>> Thank you very much,
>>>> Ari
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
>

Re: [fw-mvc] autoloader problem

Hi Ari,
Did you upgrade ZF library recently?

Ari Awan wrote:
> Hi Yaroslav,
>
> I have put this in my bootstrap.php
>
> protected function _initViewHelpers()
> {
> $autoloader = Zend_Loader_Autoloader::getInstance();
> $autoloader->registerNamespace('Website_');
>
> $this->bootstrap('view');
> $view = $this->getResource('view');
> $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
> $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
> $view->addHelperPath('Website/View/Helper', 'Website_View_Helper');
>
> }
>
> is this correct? I never encountered this error before .. and as far as I can remember i didnt change anything .. so I am wondering what happens ...
>
> On Nov 27, 2009, at 5:38 PM, Yaroslav Vorozhko wrote:
>
>
>> Hi,
>> Your should fix include paths.
>> Look at index.php or bootstrat.php file to setup proper paths.
>>
>>
>>> Hi ZF community,
>>>
>>> today i take a look at apache error_log and I got this error message :
>>>
>>> [Fri Nov 27 16:44:33 2009] [error] [client 114.48.30.190] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Cdn' was not found in the registry; used paths:\n
>>> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
>>> Stack trace:\n
>>> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Cdn')\n
>>> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'cdn')\n
>>> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('cdn')\n
>>> #3 [internal function]: Zend_View_Abstract->__call('cdn', Array)\n
>>> #4 /www/website/application/views/scripts/error/error.phtml(22): Zend_View->cdn('images')\n
>>> #5 /www/website/library/Zend/View.php(108): include('...')\n
>>> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run(' in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>>>
>>> Then I try to put Cdn.php under www/website/application/views/helpers/ .. the above error gone .. and i got this error :
>>>
>>> [Fri Nov 27 16:47:50 2009] [error] [client 114.48.30.190] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:\n
>>> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
>>> Stack trace:\n
>>> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('JQuery')\n
>>> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'jQuery')\n
>>> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery')\n#3 [internal function]: Zend_View_Abstract->__call('jQuery', Array)\n
>>> #4 /www/website/application/layouts/layout.phtml(21): Zend_View->jQuery()\n
>>> #5 /www/website/library/Zend/View.php(108): include('...')\n
>>> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run('/ in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>>>
>>> This error does not happen to any client .. but one in particular was [client 114.48.30.190] .. keep receiving this error .. any idea how to fix this?
>>>
>>> Thank you very much,
>>> Ari
>>>
>>>
>>>
>>>
>>>
>
>
>

Re: [fw-mvc] access url view helper from my custom view helper

Why do you want to extend an other helper?
Wie the abstract base class you can access every registered helper in the whole view.
Like $this->view->url() you can also use every other out-of-box helpers like partial or even your own helpers.

Am 27.11.2009 09:55, schrieb Jigal sanders:
Can't you just extend the view class? Like

class Zend_View_Helper_Catmenu extends Zend_View(_Helper) or something like this? ? 

On Fri, Nov 27, 2009 at 6:16 AM, prado <pradosh_k@hotmail.com> wrote:

Hi I have got a simple view helper which is sitting inside views/helpers
directory that generates a list of links

class Zend_View_Helper_Catmenu
{
       public function Catmenu($cats)
       {
               $catMenu='';

               foreach ($cats as $cat)
               {
                       $catMenu .= "<li> \"<b /cats/index/cat/$cat[cat_url]\">$cat[cat] </li>";
               }

               return $catMenu;
       }

}


I would like to use the url helper which is in this case "echo
$this->url(array('controller'=>'cats', 'action'=>'index',
'cat'=>$cat[cat_url]));" for the highlighted code above. As I am not in the
view i won't be able to access the url helper.

Any other way to access a helper inside my custom helper, like in this
example
--
View this message in context: http://n4.nabble.com/access-url-view-helper-from-my-custom-view-helper-tp788528p788528.html
Sent from the Zend MVC mailing list archive at Nabble.com.



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel 

Re: [fw-mvc] access url view helper from my custom view helper

Can't you just extend the view class? Like

class Zend_View_Helper_Catmenu extends Zend_View(_Helper) or something like this? ? 

On Fri, Nov 27, 2009 at 6:16 AM, prado <pradosh_k@hotmail.com> wrote:

Hi I have got a simple view helper which is sitting inside views/helpers
directory that generates a list of links

class Zend_View_Helper_Catmenu
{
       public function Catmenu($cats)
       {
               $catMenu='';

               foreach ($cats as $cat)
               {
                       $catMenu .= "<li> \"<b /cats/index/cat/$cat[cat_url]\">$cat[cat] </li>";
               }

               return $catMenu;
       }

}


I would like to use the url helper which is in this case "echo
$this->url(array('controller'=>'cats', 'action'=>'index',
'cat'=>$cat[cat_url]));" for the highlighted code above. As I am not in the
view i won't be able to access the url helper.

Any other way to access a helper inside my custom helper, like in this
example
--
View this message in context: http://n4.nabble.com/access-url-view-helper-from-my-custom-view-helper-tp788528p788528.html
Sent from the Zend MVC mailing list archive at Nabble.com.



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

Re: [fw-mvc] access url view helper from my custom view helper

Hi!

You should always extend a custom view helper from the base class:
Zend_View_Helper_Abstract
As soon as you do this, the view instance is available via: $this->view
and there you could use $this->view->url() as well.

Regards,

Christoph

Am 27.11.2009 06:16, schrieb prado:
> Hi I have got a simple view helper which is sitting inside views/helpers
> directory that generates a list of links
>
> class Zend_View_Helper_Catmenu
> {
> public function Catmenu($cats)
> {
> $catMenu='';
>
> foreach ($cats as $cat)
> {
> $catMenu .= "<li> \"<b /cats/index/cat/$cat[cat_url]\">$cat[cat]</li>";
> }
>
> return $catMenu;
> }
>
> }
>
>
> I would like to use the url helper which is in this case "echo
> $this->url(array('controller'=>'cats', 'action'=>'index',
> 'cat'=>$cat[cat_url]));" for the highlighted code above. As I am not in the
> view i won't be able to access the url helper.
>
> Any other way to access a helper inside my custom helper, like in this
> example
>

--
------------------------------------------------------------


Christoph Rust
Senior Software Developer

von Affenfels GmbH
Kronenstraße 40
D-70174 Stuttgart

Telefon +49 (0) 711 305 890-36
Telefax +49 (0) 711 305 890-90
http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de

Sitz der Gesellschaft: Stuttgart
Handelsregister Stuttgart HRB 728101

Geschäftsführer: Christian Jehle, Jürgen Knispel

Re: [fw-mvc] autoloader problem

Hi Yaroslav,

I have put this in my bootstrap.php

protected function _initViewHelpers()
{
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Website_');

$this->bootstrap('view');
$view = $this->getResource('view');
$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
$view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
$view->addHelperPath('Website/View/Helper', 'Website_View_Helper');

}

is this correct? I never encountered this error before .. and as far as I can remember i didnt change anything .. so I am wondering what happens ...

On Nov 27, 2009, at 5:38 PM, Yaroslav Vorozhko wrote:

> Hi,
> Your should fix include paths.
> Look at index.php or bootstrat.php file to setup proper paths.
>
>> Hi ZF community,
>>
>> today i take a look at apache error_log and I got this error message :
>>
>> [Fri Nov 27 16:44:33 2009] [error] [client 114.48.30.190] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Cdn' was not found in the registry; used paths:\n
>> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
>> Stack trace:\n
>> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Cdn')\n
>> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'cdn')\n
>> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('cdn')\n
>> #3 [internal function]: Zend_View_Abstract->__call('cdn', Array)\n
>> #4 /www/website/application/views/scripts/error/error.phtml(22): Zend_View->cdn('images')\n
>> #5 /www/website/library/Zend/View.php(108): include('...')\n
>> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run(' in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>>
>> Then I try to put Cdn.php under www/website/application/views/helpers/ .. the above error gone .. and i got this error :
>>
>> [Fri Nov 27 16:47:50 2009] [error] [client 114.48.30.190] PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:\n
>> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
>> Stack trace:\n
>> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('JQuery')\n
>> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'jQuery')\n
>> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery')\n#3 [internal function]: Zend_View_Abstract->__call('jQuery', Array)\n
>> #4 /www/website/application/layouts/layout.phtml(21): Zend_View->jQuery()\n
>> #5 /www/website/library/Zend/View.php(108): include('...')\n
>> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run('/ in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>>
>> This error does not happen to any client .. but one in particular was [client 114.48.30.190] .. keep receiving this error .. any idea how to fix this?
>>
>> Thank you very much,
>> Ari
>>
>>
>>
>>
>

Re: [fw-mvc] autoloader problem

Hi,
Your should fix include paths.
Look at index.php or bootstrat.php file to setup proper paths.

> Hi ZF community,
>
> today i take a look at apache error_log and I got this error message :
>
> [Fri Nov 27 16:44:33 2009] [error] [client 114.48.30.190]
> PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Cdn' was not found in the registry; used paths:\n
> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
> Stack trace:\n
> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Cdn')\n
> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'cdn')\n
> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('cdn')\n
> #3 [internal function]: Zend_View_Abstract->__call('cdn', Array)\n
> #4 /www/website/application/views/scripts/error/error.phtml(22): Zend_View->cdn('images')\n
> #5 /www/website/library/Zend/View.php(108): include('...')\n
> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run(' in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>
> Then I try to put Cdn.php under www/website/application/views/helpers/ .. the above error gone .. and i got this error :
>
> [Fri Nov 27 16:47:50 2009] [error] [client 114.48.30.190]
> PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:\n
> Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
> Stack trace:\n
> #0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('JQuery')\n
> #1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'jQuery')\n
> #2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery')\n#3 [internal function]: Zend_View_Abstract->__call('jQuery', Array)\n
> #4 /www/website/application/layouts/layout.phtml(21): Zend_View->jQuery()\n
> #5 /www/website/library/Zend/View.php(108): include('...')\n
> #6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run('/ in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta
>
> This error does not happen to any client .. but one in particular was [client 114.48.30.190] .. keep receiving this error .. any idea how to fix this?
>
> Thank you very much,
> Ari
>
>
>
>

[fw-mvc] autoloader problem

Hi ZF community,

today i take a look at apache error_log and I got this error message :

[Fri Nov 27 16:44:33 2009] [error] [client 114.48.30.190]
PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Cdn' was not found in the registry; used paths:\n
Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
Stack trace:\n
#0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('Cdn')\n
#1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'cdn')\n
#2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('cdn')\n
#3 [internal function]: Zend_View_Abstract->__call('cdn', Array)\n
#4 /www/website/application/views/scripts/error/error.phtml(22): Zend_View->cdn('images')\n
#5 /www/website/library/Zend/View.php(108): include('...')\n
#6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run(' in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta

Then I try to put Cdn.php under www/website/application/views/helpers/ .. the above error gone .. and i got this error :

[Fri Nov 27 16:47:50 2009] [error] [client 114.48.30.190]
PHP Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'JQuery' was not found in the registry; used paths:\n
Zend_View_Helper_: Zend/View/Helper/:/www/website/application/views/helpers/' in /www/website/library/Zend/Loader/PluginLoader.php:406\n
Stack trace:\n
#0 /www/website/library/Zend/View/Abstract.php(1118): Zend_Loader_PluginLoader->load('JQuery')\n
#1 /www/website/library/Zend/View/Abstract.php(569): Zend_View_Abstract->_getPlugin('helper', 'jQuery')\n
#2 /www/website/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jQuery')\n#3 [internal function]: Zend_View_Abstract->__call('jQuery', Array)\n
#4 /www/website/application/layouts/layout.phtml(21): Zend_View->jQuery()\n
#5 /www/website/library/Zend/View.php(108): include('...')\n
#6 /www/website/library/Zend/View/Abstract.php(833): Zend_View->_run('/ in /www/website/library/Zend/Loader/PluginLoader.php on line 406, referer: http://www.website.com/index/beta

This error does not happen to any client .. but one in particular was [client 114.48.30.190] .. keep receiving this error .. any idea how to fix this?

Thank you very much,
Ari

2009年11月26日星期四

[fw-mvc] access url view helper from my custom view helper

Hi I have got a simple view helper which is sitting inside views/helpers
directory that generates a list of links

class Zend_View_Helper_Catmenu
{
public function Catmenu($cats)
{
$catMenu='';

foreach ($cats as $cat)
{
$catMenu .= "<li> \"<b /cats/index/cat/$cat[cat_url]\">$cat[cat] </li>";
}

return $catMenu;
}

}


I would like to use the url helper which is in this case "echo
$this->url(array('controller'=>'cats', 'action'=>'index',
'cat'=>$cat[cat_url]));" for the highlighted code above. As I am not in the
view i won't be able to access the url helper.

Any other way to access a helper inside my custom helper, like in this
example
--
View this message in context: http://n4.nabble.com/access-url-view-helper-from-my-custom-view-helper-tp788528p788528.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] count query

thanks for help

i think the zend_db_profiler is the right solution

On 11/26/09, Саша Стаменковић <umpirsky@gmail.com> wrote:
> Yaroslav Vorozhko mensioned profiler, if you really want to count queries.
>
> If you want to count rows:
>
> $paginator = new Zend_Paginator(
> new Zend_Paginator_Adapter_DbTableSelect(
> new Zend_Db_Table_Select(...)
> )
> );
> $paginator->setDefaultItemCountPerPage(1);
> return $paginator->count();
>
> Regards,
> Saša Stamenković
>
>
> On Thu, Nov 26, 2009 at 1:50 PM, <Christoph@vonaffenfels.de> wrote:
>
>> Sorry, but you only have limited possibilities:
>>
>> - count the total amount of rows in a table
>> - count the amount of rows in rowset after an executed sql query
>> - count all executed queries which have been executed (profiler)
>>
>> If you want to retrieve the amount of all rows in all executed queries,
>> you
>> need to build your own profiler...
>>
>> What you have to do is to overwrite the Zend_Db_Adapter_Abstract class and
>> implement a counter for the following methods:
>>
>> - fetchAll
>> - fetchAssoc
>> - fetchCol
>> - fetchOne
>> - fetchPairs
>> - fetchRow
>>
>> If you need to count insert-, update- and delete statemens (the amount of
>> it) as well, you should also overwrite the following in
>> Zend_Db_Adapter_Abstract:
>>
>> - delete
>> - insert
>> - update
>>
>> Am 26.11.2009 13:39, schrieb Yaroslav Vorozhko:
>>
>> sina miandashti wrote:
>>>
>>>
>>>> hi
>>>>
>>>> i need a solution for counting total sql queries in a page ...
>>>>
>>>> plz help
>>>>
>>>> thanks
>>>>
>>>>
>>>>
>>>>
>>> Hi,
>>> Look at Zend_Db_Profiler :
>>>
>>> |$profiler = $db->getProfiler();
>>> ||$queryCount = $profiler->getTotalNumQueries();
>>>
>>> --
>>> Thanks Yaroslav Vorozhko
>>> Blog: http://pro100pro.com
>>> LinkedIn: http://www.linkedin.com/in/vorozhko
>>> |
>>>
>>>
>>>
>>>
>>
>> --
>> ------------------------------------------------------------
>>
>>
>> Christoph Rust
>> Senior Software Developer
>>
>> von Affenfels GmbH
>> Kronenstraße 40
>> D-70174 Stuttgart
>>
>> Telefon +49 (0) 711 305 890-36
>> Telefax +49 (0) 711 305 890-90
>> http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de
>>
>> Sitz der Gesellschaft: Stuttgart
>> Handelsregister Stuttgart HRB 728101
>>
>> Geschäftsführer: Christian Jehle, Jürgen Knispel
>>
>>
>


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

Re: [fw-mvc] count query

Yaroslav Vorozhko mensioned profiler, if you really want to count queries.

If you want to count rows:

$paginator = new Zend_Paginator(
     new Zend_Paginator_Adapter_DbTableSelect(
     new Zend_Db_Table_Select(...)
     )
     );
     $paginator->setDefaultItemCountPerPage(1);
     return $paginator->count();

Regards,
Saša Stamenković


On Thu, Nov 26, 2009 at 1:50 PM, <Christoph@vonaffenfels.de> wrote:
Sorry, but you only have limited possibilities:

- count the total amount of rows in a table
- count the amount of rows in rowset after an executed sql query
- count all executed queries which have been executed (profiler)

If you want to retrieve the amount of all rows in all executed queries, you need to build your own profiler...

What you have to do is to overwrite the Zend_Db_Adapter_Abstract class and implement a counter for the following methods:

- fetchAll
- fetchAssoc
- fetchCol
- fetchOne
- fetchPairs
- fetchRow

If you need to count insert-, update- and delete statemens (the amount of it) as well, you should also overwrite the following in Zend_Db_Adapter_Abstract:

- delete
- insert
- update

Am 26.11.2009 13:39, schrieb Yaroslav Vorozhko:

sina miandashti wrote:
 
hi

i need a solution for counting total sql queries in a page ...

plz help

thanks


   
Hi,
Look at Zend_Db_Profiler :

|$profiler = $db->getProfiler();
||$queryCount   = $profiler->getTotalNumQueries();

--
Thanks Yaroslav Vorozhko
Blog: http://pro100pro.com
LinkedIn: http://www.linkedin.com/in/vorozhko
|


 

--
------------------------------------------------------------


Christoph Rust
Senior Software Developer

von Affenfels GmbH
Kronenstraße 40
D-70174 Stuttgart

Telefon +49 (0) 711 305 890-36
Telefax +49 (0) 711 305 890-90
http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de

Sitz der Gesellschaft: Stuttgart
Handelsregister Stuttgart HRB 728101

Geschäftsführer: Christian Jehle, Jürgen Knispel


Re: [fw-mvc] count query

Sorry, but you only have limited possibilities:

- count the total amount of rows in a table
- count the amount of rows in rowset after an executed sql query
- count all executed queries which have been executed (profiler)

If you want to retrieve the amount of all rows in all executed queries,
you need to build your own profiler...

What you have to do is to overwrite the Zend_Db_Adapter_Abstract class
and implement a counter for the following methods:

- fetchAll
- fetchAssoc
- fetchCol
- fetchOne
- fetchPairs
- fetchRow

If you need to count insert-, update- and delete statemens (the amount
of it) as well, you should also overwrite the following in
Zend_Db_Adapter_Abstract:

- delete
- insert
- update

Am 26.11.2009 13:39, schrieb Yaroslav Vorozhko:
> sina miandashti wrote:
>
>> hi
>>
>> i need a solution for counting total sql queries in a page ...
>>
>> plz help
>>
>> thanks
>>
>>
>>
> Hi,
> Look at Zend_Db_Profiler :
>
> |$profiler = $db->getProfiler();
> ||$queryCount = $profiler->getTotalNumQueries();
>
> --
> Thanks Yaroslav Vorozhko
> Blog: http://pro100pro.com
> LinkedIn: http://www.linkedin.com/in/vorozhko
> |
>
>
>

--
------------------------------------------------------------


Christoph Rust
Senior Software Developer

von Affenfels GmbH
Kronenstraße 40
D-70174 Stuttgart

Telefon +49 (0) 711 305 890-36
Telefax +49 (0) 711 305 890-90
http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de

Sitz der Gesellschaft: Stuttgart
Handelsregister Stuttgart HRB 728101

Geschäftsführer: Christian Jehle, Jürgen Knispel

Re: [fw-mvc] count query

sina miandashti wrote:
> hi
>
> i need a solution for counting total sql queries in a page ...
>
> plz help
>
> thanks
>
>
Hi,
Look at Zend_Db_Profiler :

|$profiler = $db->getProfiler();
||$queryCount = $profiler->getTotalNumQueries();

--
Thanks Yaroslav Vorozhko
Blog: http://pro100pro.com
LinkedIn: http://www.linkedin.com/in/vorozhko
|

Re: [fw-mvc] count query

Hi!

What exactly you wanna do?
Do you whant to retrieve the toal amount of rows matching your SQL
query, or the amount of rows in the current rowset?

Am 26.11.2009 13:15, schrieb sina miandashti:
> hi
>
> i need a solution for counting total sql queries in a page ...
>
> plz help
>
> thanks
>
>

--
------------------------------------------------------------


Christoph Rust
Senior Software Developer

von Affenfels GmbH
Kronenstraße 40
D-70174 Stuttgart

Telefon +49 (0) 711 305 890-36
Telefax +49 (0) 711 305 890-90
http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de

Sitz der Gesellschaft: Stuttgart
Handelsregister Stuttgart HRB 728101

Geschäftsführer: Christian Jehle, Jürgen Knispel

[fw-mvc] count query

hi

i need a solution for counting total sql queries in a page ...

plz help

thanks

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

2009年11月25日星期三

Re: [fw-mvc] about Remember Me with zend_auth

Hi Sina,

have a look at the Zend_Auth method:

Zend_Auth setStorage (Zend_Auth_Storage_Interface $storage)

You can choose between the following storage adapters:

- Interface to implement your very own storage adapter
- NonPersistent to re-populate the authentication for each request
- Session the mainly used storage for authentication

Enjoy ZF :)

Greetings,

Christoph

Am 25.11.2009 19:00, schrieb sina miandashti:
hi zf community  im sina from iran  i completely use zend_auth for login my users in my app but i dont know how to implement the Remember me with zend_auth  plz help    

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel 

[fw-mvc] about Remember Me with zend_auth

hi zf community

im sina from iran

i completely use zend_auth for login my users in my app
but i dont know how to implement the Remember me with zend_auth

plz help

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

Re: [fw-auth] problem with zend_auth

That's what I thought ;-)

Am 25.11.2009 17:02, schrieb Jigal sanders:
solved:
it was a typu

OUCH

On Wed, Nov 25, 2009 at 5:01 PM, Jigal sanders <jigalroecha@gmail.com> wrote:
Don't know if it works without adapter.

This is how my recourse file looks like:

phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.db.isDefaultTableAdapter = true

resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = ladosa


I didn't change anything in my project. Created it using zf tool


This is the only method in my bootstrap file
    protected function __initAutoload(){
       
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => '',
            'basePath'  => APPLICATION_PATH,
        ));
        return $autoloader;

    }

On Wed, Nov 25, 2009 at 4:57 PM, <Christoph@vonaffenfels.de> wrote:
Does your database work without the auth adapter?
So have you tried just a simple query?
I think you must use resources.* for every resource in your application, otherwise it won't work.
A possible other issue could be your bootstrap call in the index.php file.
How do you call the bootstrap() method, with or without any parameters?

Am 25.11.2009 16:54, schrieb Jigal sanders:
still the same error

On Wed, Nov 25, 2009 at 4:52 PM, <Christoph@vonaffenfels.de> wrote:
Because it's bogus, use:

resources.db.isDefaultTableAdapter = true

Am 25.11.2009 16:50, schrieb Jigal sanders:
doesn't work.

On Wed, Nov 25, 2009 at 4:49 PM, Andre Fernandes <fernandes.andre@gmail.com> wrote:
Correcting myself,

Try to insert at your INI file the following line:
resourses.db.isDefaultTableAdapter = true

Ignore the other mail answer...

Andre.


2009/11/25 Jigal sanders <jigalroecha@gmail.com>
Hello everyone.


I am following this tutorial. http://www.youtube.com/user/integral30#p/c/90503BB7541343E9/7/4oNo-l6c-H0

But i am getting an error:

Catchable fatal error: Argument 1 passed to Zend_Auth_Adapter_DbTable::__construct() must be an instance of Zend_Db_Adapter_Abstract, null given, called in K:\xampp\htdocs\nrka\application\controllers\AuthenticationController.php on line 44 and defined in K:\xampp\php\PEAR\Zend\Auth\Adapter\DbTable.php on line 128

And this is the method:

private function getAuthAdapter(){
       
        $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
        $authAdapter->setTableName('persons')
                    ->setIdentityColumn('per_email')
                    ->setCredentialColumnt('per_passoword')
                    ->setCredentialTeatment("MD5");
                   
        return $authAdapter;
    }

I have set the resources in my ini file:

resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = zftutorial

That's going wrong?




--
André de Camargo Fernandes





--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel     



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel       



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel 

Re: [fw-auth] problem with zend_auth

solved:
it was a typu

OUCH

On Wed, Nov 25, 2009 at 5:01 PM, Jigal sanders <jigalroecha@gmail.com> wrote:
Don't know if it works without adapter.

This is how my recourse file looks like:

phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.db.isDefaultTableAdapter = true

resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = ladosa


I didn't change anything in my project. Created it using zf tool


This is the only method in my bootstrap file
    protected function __initAutoload(){
       
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => '',
            'basePath'  => APPLICATION_PATH,
        ));
        return $autoloader;

    }

On Wed, Nov 25, 2009 at 4:57 PM, <Christoph@vonaffenfels.de> wrote:
Does your database work without the auth adapter?
So have you tried just a simple query?
I think you must use resources.* for every resource in your application, otherwise it won't work.
A possible other issue could be your bootstrap call in the index.php file.
How do you call the bootstrap() method, with or without any parameters?

Am 25.11.2009 16:54, schrieb Jigal sanders:
still the same error

On Wed, Nov 25, 2009 at 4:52 PM, <Christoph@vonaffenfels.de> wrote:
Because it's bogus, use:

resources.db.isDefaultTableAdapter = true

Am 25.11.2009 16:50, schrieb Jigal sanders:
doesn't work.

On Wed, Nov 25, 2009 at 4:49 PM, Andre Fernandes <fernandes.andre@gmail.com> wrote:
Correcting myself,

Try to insert at your INI file the following line:
resourses.db.isDefaultTableAdapter = true

Ignore the other mail answer...

Andre.


2009/11/25 Jigal sanders <jigalroecha@gmail.com>
Hello everyone.


I am following this tutorial. http://www.youtube.com/user/integral30#p/c/90503BB7541343E9/7/4oNo-l6c-H0

But i am getting an error:

Catchable fatal error: Argument 1 passed to Zend_Auth_Adapter_DbTable::__construct() must be an instance of Zend_Db_Adapter_Abstract, null given, called in K:\xampp\htdocs\nrka\application\controllers\AuthenticationController.php on line 44 and defined in K:\xampp\php\PEAR\Zend\Auth\Adapter\DbTable.php on line 128

And this is the method:

private function getAuthAdapter(){
       
        $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
        $authAdapter->setTableName('persons')
                    ->setIdentityColumn('per_email')
                    ->setCredentialColumnt('per_passoword')
                    ->setCredentialTeatment("MD5");
                   
        return $authAdapter;
    }

I have set the resources in my ini file:

resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = zftutorial

That's going wrong?




--
André de Camargo Fernandes





--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel     



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel 



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

Re: [fw-auth] problem with zend_auth

Don't know if it works without adapter.

This is how my recourse file looks like:

phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.db.isDefaultTableAdapter = true
resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = ladosa


I didn't change anything in my project. Created it using zf tool


This is the only method in my bootstrap file
    protected function __initAutoload(){
       
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => '',
            'basePath'  => APPLICATION_PATH,
        ));
        return $autoloader;
    }

On Wed, Nov 25, 2009 at 4:57 PM, <Christoph@vonaffenfels.de> wrote:
Does your database work without the auth adapter?
So have you tried just a simple query?
I think you must use resources.* for every resource in your application, otherwise it won't work.
A possible other issue could be your bootstrap call in the index.php file.
How do you call the bootstrap() method, with or without any parameters?

Am 25.11.2009 16:54, schrieb Jigal sanders:
still the same error

On Wed, Nov 25, 2009 at 4:52 PM, <Christoph@vonaffenfels.de> wrote:
Because it's bogus, use:

resources.db.isDefaultTableAdapter = true

Am 25.11.2009 16:50, schrieb Jigal sanders:
doesn't work.

On Wed, Nov 25, 2009 at 4:49 PM, Andre Fernandes <fernandes.andre@gmail.com> wrote:
Correcting myself,

Try to insert at your INI file the following line:
resourses.db.isDefaultTableAdapter = true

Ignore the other mail answer...

Andre.


2009/11/25 Jigal sanders <jigalroecha@gmail.com>
Hello everyone.


I am following this tutorial. http://www.youtube.com/user/integral30#p/c/90503BB7541343E9/7/4oNo-l6c-H0

But i am getting an error:

Catchable fatal error: Argument 1 passed to Zend_Auth_Adapter_DbTable::__construct() must be an instance of Zend_Db_Adapter_Abstract, null given, called in K:\xampp\htdocs\nrka\application\controllers\AuthenticationController.php on line 44 and defined in K:\xampp\php\PEAR\Zend\Auth\Adapter\DbTable.php on line 128

And this is the method:

private function getAuthAdapter(){
       
        $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
        $authAdapter->setTableName('persons')
                    ->setIdentityColumn('per_email')
                    ->setCredentialColumnt('per_passoword')
                    ->setCredentialTeatment("MD5");
                   
        return $authAdapter;
    }

I have set the resources in my ini file:

resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = zftutorial

That's going wrong?




--
André de Camargo Fernandes





--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel     



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel 



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

Re: [fw-auth] problem with zend_auth

Does your database work without the auth adapter?
So have you tried just a simple query?
I think you must use resources.* for every resource in your application, otherwise it won't work.
A possible other issue could be your bootstrap call in the index.php file.
How do you call the bootstrap() method, with or without any parameters?

Am 25.11.2009 16:54, schrieb Jigal sanders:
still the same error

On Wed, Nov 25, 2009 at 4:52 PM, <Christoph@vonaffenfels.de> wrote:
Because it's bogus, use:

resources.db.isDefaultTableAdapter = true

Am 25.11.2009 16:50, schrieb Jigal sanders:
doesn't work.

On Wed, Nov 25, 2009 at 4:49 PM, Andre Fernandes <fernandes.andre@gmail.com> wrote:
Correcting myself,

Try to insert at your INI file the following line:
resourses.db.isDefaultTableAdapter = true

Ignore the other mail answer...

Andre.


2009/11/25 Jigal sanders <jigalroecha@gmail.com>
Hello everyone.


I am following this tutorial. http://www.youtube.com/user/integral30#p/c/90503BB7541343E9/7/4oNo-l6c-H0

But i am getting an error:

Catchable fatal error: Argument 1 passed to Zend_Auth_Adapter_DbTable::__construct() must be an instance of Zend_Db_Adapter_Abstract, null given, called in K:\xampp\htdocs\nrka\application\controllers\AuthenticationController.php on line 44 and defined in K:\xampp\php\PEAR\Zend\Auth\Adapter\DbTable.php on line 128

And this is the method:

private function getAuthAdapter(){
       
        $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
        $authAdapter->setTableName('persons')
                    ->setIdentityColumn('per_email')
                    ->setCredentialColumnt('per_passoword')
                    ->setCredentialTeatment("MD5");
                   
        return $authAdapter;
    }

I have set the resources in my ini file:

resourses.db.adapter =  mysqli
resourses.db.params.host    = localhost
resourses.db.params.username = root
resourses.db.params.password =
resourses.db.params.dbname = zftutorial

That's going wrong?




--
André de Camargo Fernandes





--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel     



--
Met vriendelijke groet,

Jigal Sanders
A.J. Ernststraat 739
1082 LK Amsterdam
Mobiel: 06-42111489

--  ------------------------------------------------------------    Christoph Rust Senior Software Developer   von Affenfels GmbH Kronenstraße 40 D-70174 Stuttgart  Telefon +49 (0) 711 305 890-36 Telefax +49 (0) 711 305 890-90 http://www.vonaffenfels.de | christoph.rust@vonaffenfels.de  Sitz der Gesellschaft: Stuttgart Handelsregister Stuttgart HRB 728101  Geschäftsführer: Christian Jehle, Jürgen Knispel