[fw-general] Re: Stuck in loop with Zend_Controller_Action::_forward() and Zend_Controller_Plugin_Abstract::preDispatch()

2007-03-29 Thread Simon Mundy

What happens if you add:-

$this-add(new Zend_Acl_Resource('default'));

$this-allow(null, 'login');




Hey, no worries. I'm here and I'm finding any excuse to get  
distracted at the moment :)


I had read your code too quickly - yes indeed, you're using a plugin.

It looks to me that you're requesting a controller name that the  
ACL is returning as a DENY. And then you're _forward'ing to  
another controller that is _also_ being returned by ACL as a DENY.


Does your ACL rule allow the 'login' resource to any anonymous  
user? Could you provide a quick extract of your ACL rules?


Yeah I know what you mean about distraction!

The ACL is not really setup for much at the moment and hasn't  
really changed much from your example (except perhaps that my  
resource became the module rather than the  
controller ...experimenting with that still):


class Example_Acl extends Zend_Acl
{
public function __construct()
{
//parent::__construct();

$this-add(new Zend_Acl_Resource('default'));
$this-add(new Zend_Acl_Resource('gallery'));
$this-add(new Zend_Acl_Resource('articles'));
$this-add(new Zend_Acl_Resource('directory'));
$this-add(new Zend_Acl_Resource('shop'));
$this-add(new Zend_Acl_Resource('forum'));
$this-add(new Zend_Acl_Resource('support'));
$this-add(new Zend_Acl_Resource('admin'));

$this-addRole(new Zend_Acl_Role('guest'));
$this-addRole(new Zend_Acl_Role('member'), 'guest');
$this-addRole(new Zend_Acl_Role('admin'), 'member');

// Guest may only view content
$this-allow('guest', 'default');
$this-allow('guest', 'gallery');
$this-allow('guest', 'directory');
$this-allow('guest', 'articles');
$this-allow('guest', 'shop');
$this-allow('guest', 'forum');
$this-deny('member', 'forum', 'update'); // Remove  
specific privilege

$this-allow('member', 'support');
$this-allow('admin'); // unrestricted access

}
}

Thanks,

Nick



Hi Simon,

Thanks for the super quick reply, I didn't mean to summons you to  
an answer by the way, I just cc'd past you since I was using your  
code and thought you might be interested.


I don't quite follow but, suspecting I may be being dense here,  
I'll go ahead anyway...


No mystery there - having the auth logic embedded within the  
Controller means preDispatch will be called each time the  
controller is called... sending it onto the same controller...  
with the same preDispatch... etc...


I'm not entirely clear on your use of Controller there. Do you  
mean embedded in Zend_Controller_Front or a  
Zend_Controller_Action? To clarify (mostly for myself) I have the  
auth logic in a subclass of Zend_Controller_Plugin_Abstract which  
is registered as a plugin with Zend_Controller_Front, which is  
what I think you mean with (b) below?


Nick


--

Simon Mundy | Director | PEPTOLAB


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

http://www.peptolab.com






--

Simon Mundy | Director | PEPTOLAB


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

http://www.peptolab.com




[fw-general] Re: Stuck in loop with Zend_Controller_Action::_forward() and Zend_Controller_Plugin_Abstract::preDispatch()

2007-03-29 Thread Nick Lo

What happens if you add:-

$this-add(new Zend_Acl_Resource('default'));

$this-allow(null, 'login');


Well the default resource is already there so just adding the  
latter bit results in:


Fatal error: Uncaught exception 'Zend_Acl_Exception' with message  
'Resource 'login' not found' in...


So guessing you may have meant/also meant $this-add(new  
Zend_Acl_Resource('login')); that results in the old infinite loop  
and my MacBook fan whizzing again.


Thanks,

Nick



Re: [fw-general] Zend Controller: get controller instance from within a plugin

2007-03-29 Thread Ivan Shumkov


gMail-27 wrote:
 
 Can I get an action controller instance from within a controller
 plugin (class MyPlugin extends Zend_Controller_Plugin_Abstract).
 
You may use response object:



class MyController ...
{
  protected $_layout = 'default';
   ...
  function getLayout()
  {
return $_layout;
  }
  function postDispatch()
  {
 $this-getResponse()-setController($this);
  }
   ...
}

class My_Controller_Response_Http ...
{
  protected $_controller;
  ...
  function setController(Zend_Controller_Action $controller)
  {
$this-_controller = $controller;
  }
  function getController()
  {
return $this-_controller;
  }
  ...
}

class My_Controller_Plugin_Layout ...
{
  function ...
  {
  $layout = $this-getResponse()-getController()-getLayout();
  }
}


http://www.nabble.com/Layout-templates-tf3432215s16154.html#a9567943
-- 
View this message in context: 
http://www.nabble.com/Zend-Controller%3A-get-controller-instance-from-within-a-plugin-tf3483629s16154.html#a9728342
Sent from the Zend Framework mailing list archive at Nabble.com.


[fw-general] Re: Stuck in loop with Zend_Controller_Action::_forward() and Zend_Controller_Plugin_Abstract::preDispatch()

2007-03-29 Thread Nick Lo
Forgot to finish that by asking if you are able to get  _forward()  
doing its stuff succesfully, presuming of course, a similar  
Controller plugin, Auth, Acl, etc setup as you originally specified  
(and I pinched)? If not then I'll know it's not just me.


Thanks,

Nick



What happens if you add:-

$this-add(new Zend_Acl_Resource('default'));

$this-allow(null, 'login');


Well the default resource is already there so just adding the  
latter bit results in:


Fatal error: Uncaught exception 'Zend_Acl_Exception' with message  
'Resource 'login' not found' in...


So guessing you may have meant/also meant $this-add(new  
Zend_Acl_Resource('login')); that results in the old infinite loop  
and my MacBook fan whizzing again.


Thanks,

Nick





Re: [fw-general] No error output on page with ZF 0.9.1, just blank page

2007-03-29 Thread Jeunejean Pierre

Thank you so much Philippe

$controller-throwExceptions(true) did resolve the problem.

So basically, when $controller-throwExceptions() is not set to true, 
only parse errors are showned,
but  all  throwned exceptions are not displayed on page or logged, but 
trapped in a Response object,
as mentioned in 
http://framework.zend.com/manual/en/zend.controller.html#zend.controller.overview.response 
--- ok I missed that one :-)


So the first question is: Would be good to add this information in 
instalation or/and migration manual,
so people starting or migrating to ZF have at least some errors 
available to them, that seems essential to me ?!


My second question is $controller-throwExceptions(null so false) by 
default, is this a good default value !?


Regards, Pierre

Philippe Le Van wrote:


But errors such as Native SQLite errors or non existing class error 
(such as Zend_Filter_Input) are not outputed on the screen,

sometimes in apache logs files, but not all.
In most of the times, I get a blank page

Hi,
try to add the line :
$controller-throwExceptions(true);
in your index.php

Regards,
Philippe




--
Pierre Jeunejean
gérant

[EMAIL PROTECTED]
www.adnexus.be

Wirtzfeld 3a, B-4760 Büllingen
Tel: 0478556586

A D N E X U S
Solutions informatiques Internet en sous-traitance pour les agences 
publicitaires.
Solutions informatiques de gestion sur mesure pour les entreprises.





Re: [fw-general] Zend_view or Smarty?

2007-03-29 Thread frederic wolf

Shekar C Reddy a écrit :
For the most performance, the one with the least overhead. Although 
Smarty offers several features and does a nice caching, the overhead 
of its huge libraries cannot simply be overlooked.
 

Try Template lite, it offers almost the same features and does a nice 
caching too. And the libraries are smaller. I am using it and by now, I 
find in it a good alternative.


regards fred


 
On 3/26/07, *Binzy Wu* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:


No best, just find one which is suitable to your requirement. From
dev perspective, normally zend_view  might be  more  convenience,
but from another perspective other solutions would be better.


Binzy


2007/3/26, José de Menezes Soares Neto [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]:

Which is the best? Which do you choose? Why?
 
I am afraid to start using SMARTY and then ZEND_VIEW goes

better...
 
Could someone recommend one and say why?
 
Best regards,
 
José








[fw-general] Zend Framework is licensed ???

2007-03-29 Thread Nahalingam N. Kanakavel

Hi,

Please any one help me to understand one thing very clearly,
I am trying to adopt with this zend framework for my PHP development.
so I just want to know whether it was licensed and if yes, what license it
is.

Thanks in advance.

--
with regds,
Nahalingam N. Kanakavel.
(http://www.nahalingam.bravehost.com/PlanetN/)


Re: [fw-general] Zend Framework is licensed ???

2007-03-29 Thread Andries Seutens


Nahalingam N. Kanakavel schreef:

Hi,

Please any one help me to understand one thing very clearly,
I am trying to adopt with this zend framework for my PHP development.
so I just want to know whether it was licensed and if yes, what 
license it is.


Thanks in advance.

--
with regds,
Nahalingam N. Kanakavel.
(http://www.nahalingam.bravehost.com/PlanetN/)


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.20/737 - Release Date: 28/03/2007 
16:23
  


Please see:
http://framework.zend.com/faq/license


Best,

--
Andries Seutens
http://andries.systray.be

Gecontroleerd op virussen door de JOJO Secure Gateway.


[fw-general] Conventional Modular Layout and application wide view scripts

2007-03-29 Thread Martin Carpentier

Hi everyone,

I'm currently in the process of upgrading our application to ZF 0.9.1 from
0.8 . So far it's going smoothly and I took the oportunity to convert to a
Conventional Modular for convenience and because since the application is an
intranet, it will eventually includes a lot of different modules.

So I based the directory structure on what's described here Conventional
Modular 
Layouthttp://framework.zend.com/wiki/display/ZFDEV/Choosing+Your+Application%2527s+Directory+Layout#ChoosingYourApplication%2527sDirectoryLayout-ConventionalModularto
have something that looks like this:

/application
   /config
   config.ini
   /default
   /controllers
   IndexController.php
   /models
   /views
   /scripts
   /index
   index.phtml
   _menu.phtml
   /(module x)
   /controllers
   IndexController.php
   /models
   /views
/library
   /Zend
/www
   /images
   /scripts
   /styles
   index.php


In the bootstrap I correctly set the controller directories with:

$controller = Zend_Controller_Front::getInstance();
$controller-throwExceptions(true)
  -setControllerDirectory(array(
  'default' = '../application/default/controllers',
  '(module x)' = '../application/(module x)/controllers'))
  -setParam('config', $config);


With that setup I can simply use this in the default controller:

   function init()
   {
   $this-initView();
   $this-view-config = $this-getInvokeArg('config');
   $this-view-baseUrl = $this-_request-getBaseUrl();
   }

   function indexAction()
   {
   $this-view-title = 'title';

   $this-view-actionTemplate = '_menu.phtml';
   $this-render();
   }

Which will render the view script in
/application/default/views/scripts/index.phtml in wich the file _menu.phtml
is called with ?php echo $this-render($this-actionTemplate); ? .

What I'm wondering is where would be a good place to put the site wide view
scripts such as _menu.phtml (also think header/footer scripts) and what
would be the best way to use them inside the modules controller ?

Thanks in advance,

--
Martin Carpentier


Re: [fw-general] Zend_Service_RememberTheMilk

2007-03-29 Thread Pádraic Brady
From what I understand the review process is temporarily in a holding pattern 
until the release of 1.0. I would guess a full review will take at least until 
then, and likely some weeks after. Admittedly I'm a little impatient about 
such delays too, but I guess you have to live with it and let folk focus their 
limited resources on reaching 1.0 ;). I don't mind waiting until the review 
process is engaged again, in the meantime I can continue writing some source 
code and refining my proposals a bit more.
 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com


- Original Message 
From: Matthew Turland [EMAIL PROTECTED]
To: Zend Framework fw-general@lists.zend.com
Sent: Thursday, March 29, 2007 4:14:41 AM
Subject: [fw-general] Zend_Service_RememberTheMilk

Just a note to those that review proposals, I've posted a new one: 
Zend_Service_RememberTheMilk. /shameless_plug

BTW, what's the average wait on getting a proposal approved these days?

Thanks!


Matthew Turland







 

Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

Re: [fw-general] Zend_Acl, lazy loading, addParentRole

2007-03-29 Thread Darby Felton
Hi Phillipe,

I think this is a good feature request. Would you please create a JIRA
issue for this?

Thank you!

Best regards,
Darby

Philippe Le Van wrote:
 Hi,
 
 I'm using Zend_Acl for a community site. I would like to
 use a lazy loading for access right because number of acl
 is too big. acl already loaded are saved in session.
 
 When the user arrives on a new page, I load some new roles
 and I want to add the current user as a child of some of these
 new roles to my Zend_Acl instance saved in session.
 
 But I didn't find a method to add a parent to an existing role
 (same problem with resources).
 
 Is there a way to add a parent to an existing role ? is my approch
 stupid ?  Does anybody experiment the same problem ?
 
 Regards,
 Philippe Le Van
 


Re: [fw-general] No error output on page with ZF 0.9.1, just blank page

2007-03-29 Thread Matthew Weier O'Phinney
-- Jeunejean Pierre [EMAIL PROTECTED] wrote
(on Thursday, 29 March 2007, 10:24 AM +0200):
 Thank you so much Philippe
 
 $controller-throwExceptions(true) did resolve the problem.
 
 So basically, when $controller-throwExceptions() is not set to true, 
 only parse errors are showned,
 but  all  throwned exceptions are not displayed on page or logged, but 
 trapped in a Response object,
 as mentioned in 
 http://framework.zend.com/manual/en/zend.controller.html#zend.controller.overview.response
  
 --- ok I missed that one :-)
 
 So the first question is: Would be good to add this information in 
 instalation or/and migration manual,
 so people starting or migrating to ZF have at least some errors 
 available to them, that seems essential to me ?!

It's in the manual already:

http://framework.zend.com/manual/en/zend.controller.exceptions.html

and it's been there since 0.6.0. :-)

 My second question is $controller-throwExceptions(null so false) by 
 default, is this a good default value !?

Yes. The idea is to force developers to *think* about what errors they
display on the site. Most exceptions provide a lot of sensitive system
information -- things like the names of classes (which would identify
what framework or components you use, which could reveal potential
security vectors), file locations, database queries, etc. By turning
this *off* by default, the developer needs to explicitly turn it *on*
when developing in order to expose those errors.

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


[fw-general] camelCaps in Zend_Db_Table_Row

2007-03-29 Thread Andrew Yager

Hi,

I'm a bit slower than the rest of you. I'm doing my ZF0.8/0.9 upgrade  
tonight. The current version of the documentation seems to suggest  
that the auto camelCapsing of table field names in Zend_Db_Table_Row  
should still work (I take it that you now must explicitly specify the  
table name as it no longer auto resolves - I think this is a really  
good move), however it doesn't for me.


Is there an option or something like that now hidden from my view I  
need to play with?


Thanks,
Andrew

_
Andrew Yager, Managing Director
Real World Technology Solutions Pty Ltd
ph: 1300 798 718 or (02) 9563 4840
fax: (02) 9563 4848 mob: 0405 152 568
http://www.rwts.com.au/
_




[fw-general] Zend_Config question

2007-03-29 Thread Chris Hartjes

I was wondering if it is possible with Zend_Config to do Apache-style
loading of configuration files.  By this, I mean is it possible to
have a directive in a Zend_Config_Ini file that says load any .ini
files that are in directory X, much like how you can ask Apache2 to
load any configuration files in a specific directory.

Right now I have a layout like this:

project/application/config/config.ini

what I'd like is to be able to do the following

project/application/config/global_config.ini (used by multiple
projects, doesn't change)
project/application/config/project/config.ini (project-specific
config, will be very different)

The goal is to make configuration follow a DRY principle.  By some
judicious use of svn externals, I will only ever have to edit the
project-specific config.ini file while the global_config.ini file only
has to be maintained in one spot.

Hopefully I've explained this properly.

--
Chris Hartjes

My motto for 2007:  Just build it, damnit!

rallyhat.com - digital photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard


Re: [fw-general] Conventional Modular Layout and application wide view scripts

2007-03-29 Thread Martin Carpentier

Mathew,

That's exactly the kind of elegant solution I was looking for.
Thanks for your fast reply.

I still have a little problem though.
Unless I misundersood something, when I put

   // rendering /application/default/views/scripts/_menu.phtml
   $this-render('_menu', null, true);

in /application/default/views/scripts/index/index.phtml

I get a fatal error:

*Fatal error*: Uncaught exception 'Zend_View_Exception' with message 'script
'_menu' not found in path' in
C:\Eclipse\e-workspaces\mcarpentier\SIMON\library\Zend\View\Abstract.php:595
Stack trace: #0

(After looking the documentation, I found out $noController need to be set
to true in order to get the behavior you described)

Can you see what's wrong in what I try to do ?


Also, on a side note regarding my other inquiry, where would be good place
to put the siteView scripts (as best practice) ?

I can see some options:

1) placing them in the default module views/scripts folder. This feels a bit
awkward since the script are not specific to the module

2) placing them in /application/views. Seems like a good idea to me but I
find annoying to mix module folders with other folder like config, views,
etc.

What would you suggest ?


On 3/29/07, Matthew Weier O'Phinney [EMAIL PROTECTED] wrote:


-- Martin Carpentier [EMAIL PROTECTED] wrote
(on Thursday, 29 March 2007, 02:48 PM +0200):
 I'm currently in the process of upgrading our application to ZF 0.9.1from
0.8
 . So far it's going smoothly and I took the oportunity to convert to a
 Conventional Modular for convenience and because since the application
is an
 intranet, it will eventually includes a lot of different modules.

 So I based the directory structure on what's described here Conventional
 Modular Layout to have something that looks like this:


snip -- directory layout

 In the bootstrap I correctly set the controller directories with:

 $controller = Zend_Controller_Front::getInstance();
 $controller-throwExceptions(true)
-setControllerDirectory(array(
'default' = '../application/default/controllers',
'(module x)' = '../application/(module
x)/controllers'))
-setParam('config', $config);


 With that setup I can simply use this in the default controller:

 function init()
 {
 $this-initView();
 $this-view-config = $this-getInvokeArg('config');
 $this-view-baseUrl = $this-_request-getBaseUrl();
 }

 function indexAction()
 {
 $this-view-title = 'title';

 $this-view-actionTemplate = '_menu.phtml';
 $this-render();
 }

 Which will render the view script in /application/default/views/scripts/
 index.phtml in wich the file _menu.phtml is called with ?php echo
$this-
 render($this-actionTemplate); ? .

 What I'm wondering is where would be a good place to put the site wide
view
 scripts such as _menu.phtml (also think header/footer scripts) and what
would
 be the best way to use them inside the modules controller ?

initView() uses setScriptPath() to set the view script path. I'd suggest
that in your init() method, you also add one or more additional script
paths -- one for templates common to your entire site:

function init()
{
$this-initView();
$this-view-config = $this-getInvokeArg('config');
$this-view-baseUrl = $this-_request-getBaseUrl();
$this-view-addScriptPath($this-getInvokeArg('siteViewPath'));
}

Additionally, assuming you have this structure in your modules:

moduleName/
views/
scripts/
controller/
controller/

Then you could also put module-wide templates directly under the
scripts/ subdirectory; these can be called using render and passing
false to the third argument ($noController):

// render _menu.phtml in moduleName/views/scripts/
$this-render('_menu', null, false);

Two notes:

* Passing in false for $noController would also allow specifying
  subdirectories: $this-render('shared/_menu', null, false)
* If you register additional script paths with the view object, it
  will search through them until it finds (or doesn't find) the
  requested view script. So, the above examples could also look in
  the siteViewPath as registered in the init() example above

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





--
Martin Carpentier


[fw-general] Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database'

2007-03-29 Thread Jeunejean Pierre

Hi everyone,

I try to connect to an SQLite 2 DB with Zend_Db, without success, same 
error with the 2 following syntaxes (the first precise 'sqlite2' as 
dsnprefix value).

Connecting to the same DB with Propel 2 does not cause any problem.

Someone would be kind to help me on this ?

$params = array ('dbname' = D:\websites\ola_lu\ola_lu.db,

  'dsnprefix' = 'sqlite2');
$db = Zend_Db::factory('PDO_SQLITE', $params);

OR

$params = array ('dbname' = D:\websites\ola_lu\ola_lu.db);
$db = Zend_Db::factory('PDO_SQLITE', $params);

same error:

*Fatal error*: Uncaught exception 'Zend_Db_Adapter_Exception' with 
message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not 
a database' in 
D:\websites\himalaya\library\Zend\Db\Adapter\Pdo\Abstract.php:156 Stack 
trace: #0 
D:\websites\himalaya\application\models\be\adnexus\himalaya\HyaForm.php(225): 
Zend_Db_Adapter_Pdo_Abstract-query('SELECT * FROM h...') #1 
D:\websites\himalaya\application\controllers\HyaobjectController.php(93): 
HyaForm-import('a:17:{i:0;a:2:{...') #2 
D:\websites\himalaya\library\Zend\Controller\Action.php(488): 
HyaobjectController-importAction() #3 
D:\websites\himalaya\library\Zend\Controller\Dispatcher\Standard.php(214): 
Zend_Controller_Action-dispatch('importAction') #4 
D:\websites\himalaya\library\Zend\Controller\Front.php(753): 
Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), 
Object(Zend_Controller_Response_Http)) #5 
D:\websites\himalaya\library\Zend\Controller\Front.php(202): 
Zend_Controller_Front-dispatch() #6 
D:\websites\ola_lu\www\himalaya\inde in 
*D:\websites\himalaya\library\Zend\Db\Adapter\Pdo\Abstract.php* on line 
*156*




--
Pierre Jeunejean
gérant

[EMAIL PROTECTED]
www.adnexus.be

Wirtzfeld 3a, B-4760 Büllingen
Tel: 0478556586

A D N E X U S
Solutions informatiques Internet en sous-traitance pour les agences 
publicitaires.
Solutions informatiques de gestion sur mesure pour les entreprises.





RE: [fw-general] Uncaught exception 'Zend_Db_Adapter_Exception' with message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database'

2007-03-29 Thread Bill Karwin
SQLite databases created with SQLite version 2 cannot be used with SQLite 3, 
and vice versa.  The file formats between these two versions are incompatible.

Zend_Db uses the PDO_SQLITE extension.  This supports the SQLite 3 format, and 
cannot open a SQLite 2 database.

Does this help?

Regards,
Bill Karwin

 -Original Message-
 From: Jeunejean Pierre [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 29, 2007 9:39 AM
 To: fw-general@lists.zend.com
 Subject: [fw-general] Uncaught exception 'Zend_Db_Adapter_Exception' with
 message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not a
 database'
 
 Hi everyone,
 
 I try to connect to an SQLite 2 DB with Zend_Db, without success, same
 error with the 2 following syntaxes (the first precise 'sqlite2' as
 dsnprefix value).
 Connecting to the same DB with Propel 2 does not cause any problem.
 
 Someone would be kind to help me on this ?
 
 $params = array ('dbname' = D:\websites\ola_lu\ola_lu.db,
'dsnprefix' = 'sqlite2');
 $db = Zend_Db::factory('PDO_SQLITE', $params);
 
 OR
 
 $params = array ('dbname' = D:\websites\ola_lu\ola_lu.db);
 $db = Zend_Db::factory('PDO_SQLITE', $params);
 
 same error:
 
 *Fatal error*: Uncaught exception 'Zend_Db_Adapter_Exception' with
 message 'SQLSTATE[HY000]: General error: 26 file is encrypted or is not
 a database' in
 D:\websites\himalaya\library\Zend\Db\Adapter\Pdo\Abstract.php:156 Stack
 trace: #0
 D:\websites\himalaya\application\models\be\adnexus\himalaya\HyaForm.php(22
 5):
 Zend_Db_Adapter_Pdo_Abstract-query('SELECT * FROM h...') #1
 D:\websites\himalaya\application\controllers\HyaobjectController.php(93):
 HyaForm-import('a:17:{i:0;a:2:{...') #2
 D:\websites\himalaya\library\Zend\Controller\Action.php(488):
 HyaobjectController-importAction() #3
 D:\websites\himalaya\library\Zend\Controller\Dispatcher\Standard.php(214):
 Zend_Controller_Action-dispatch('importAction') #4
 D:\websites\himalaya\library\Zend\Controller\Front.php(753):
 Zend_Controller_Dispatcher_Standard-
 dispatch(Object(Zend_Controller_Request_Http),
 Object(Zend_Controller_Response_Http)) #5
 D:\websites\himalaya\library\Zend\Controller\Front.php(202):
 Zend_Controller_Front-dispatch() #6
 D:\websites\ola_lu\www\himalaya\inde in
 *D:\websites\himalaya\library\Zend\Db\Adapter\Pdo\Abstract.php* on line
 *156*
 
 
 
 --
 Pierre Jeunejean
 gérant
 
 [EMAIL PROTECTED]
 www.adnexus.be
 
 Wirtzfeld 3a, B-4760 Büllingen
 Tel: 0478556586
 
 A D N E X U S
 Solutions informatiques Internet en sous-traitance pour les agences
 publicitaires.
 Solutions informatiques de gestion sur mesure pour les entreprises.
 
 



[fw-general] Re: Zend_Config question

2007-03-29 Thread Chris Hartjes

Well, the two cases are different.  This proposal talks about merging
two config files together where you already know the names of the
configuration files.

I'm looking for the ability to load a number of smaller configuration
files without having to actually worry what they are actually called.

If the person who is maintaining Zend_Config wants to contact me, I
might be able to get some support from my boss to fund this change...
:)


On 3/29/07, Darby Felton [EMAIL PROTECTED] wrote:

Hi Chris,

Maybe you would like to comment on ZF-988?

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

Though your use case may not be quite the same, I believe there is some
overlap where we consider merging configurations.

Thanks for the feedback!

Best regards,
Darby

Chris Hartjes wrote:
 I was wondering if it is possible with Zend_Config to do Apache-style
 loading of configuration files.  By this, I mean is it possible to
 have a directive in a Zend_Config_Ini file that says load any .ini
 files that are in directory X, much like how you can ask Apache2 to
 load any configuration files in a specific directory.

 Right now I have a layout like this:

 project/application/config/config.ini

 what I'd like is to be able to do the following

 project/application/config/global_config.ini (used by multiple
 projects, doesn't change)
 project/application/config/project/config.ini (project-specific
 config, will be very different)

 The goal is to make configuration follow a DRY principle.  By some
 judicious use of svn externals, I will only ever have to edit the
 project-specific config.ini file while the global_config.ini file only
 has to be maintained in one spot.

 Hopefully I've explained this properly.





--
Chris Hartjes

My motto for 2007:  Just build it, damnit!

rallyhat.com - digital photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard


Re: [fw-general] Re: Zend_Config question

2007-03-29 Thread Rob Allen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris Hartjes wrote:
 Well, the two cases are different.  This proposal talks about merging
 two config files together where you already know the names of the
 configuration files.
 

Yes. I agree.


 I'm looking for the ability to load a number of smaller configuration
 files without having to actually worry what they are actually called.

My initial instinct that this would add too much complexity to and
exceed the responsibily of Zend_Config_Ini which has a one-to-one
relationship with an ini file.

The obvious solutions are to use some userland code to load each one
separately and then merge. Alternatively, if there there is a lot of
requirement for this sort of loading of configuration files, then maybe
a Zend_Config_Loader class would make sense?


Regards,

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

iD8DBQFGDAwC421+qn4cITwRAvd4AJ9LDA3SUwdKd/G1Hs5UCRsix0L+YgCfRTT7
pmLbWo4epL0UPTgTLgiCerM=
=MDu+
-END PGP SIGNATURE-


Re: [fw-general] Re: Zend_Config question

2007-03-29 Thread Matthew Ratzloff
On Thu, March 29, 2007 11:57 am, Rob Allen wrote:
 My initial instinct that this would add too much complexity to and
 exceed the responsibily of Zend_Config_Ini which has a one-to-one
 relationship with an ini file.

 The obvious solutions are to use some userland code to load each one
 separately and then merge. Alternatively, if there there is a lot of
 requirement for this sort of loading of configuration files, then maybe
 a Zend_Config_Loader class would make sense?

A better solution would be to rename Zend_Config to Zend_Config_Array,
which is a better description of what it does.  Then make Zend_Config a
top-level configuration loading class that auto-detects the appropriate
adapter for any given file based on extension, loads all files in a given
set of directories, and merges them as necessary.

-Matt



Re: [fw-general] camelCaps in Zend_Db_Table_Row

2007-03-29 Thread Matt Schmidt

Will there be any further disregard for backwards compatibility? If
so, when can I expect the API to stabilize?


On 3/29/07, Bill Karwin [EMAIL PROTECTED] wrote:

Hi Andrew,

I havn't updated the Row and Rowset documentation pages yet (I do intend
to).  The camelCaps treatment of column names has been eliminated from
the Zend_Db_Table_Row class.  You should use the spelling of your
columns as they appear in the database.

Regards,
Bill Karwin

 -Original Message-
 From: Andrew Yager [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 29, 2007 6:45 AM
 To: fw-general@lists.zend.com
 Subject: [fw-general] camelCaps in Zend_Db_Table_Row

 Hi,

 I'm a bit slower than the rest of you. I'm doing my ZF0.8/0.9 upgrade
 tonight. The current version of the documentation seems to suggest
 that the auto camelCapsing of table field names in Zend_Db_Table_Row
 should still work (I take it that you now must explicitly specify the
 table name as it no longer auto resolves - I think this is a really
 good move), however it doesn't for me.

 Is there an option or something like that now hidden from my view I
 need to play with?

 Thanks,
 Andrew

 _
 Andrew Yager, Managing Director
 Real World Technology Solutions Pty Ltd
 ph: 1300 798 718 or (02) 9563 4840
 fax: (02) 9563 4848 mob: 0405 152 568
 http://www.rwts.com.au/
 _






--
Matt
http://sloat.liek.us/


RE: [fw-general] camelCaps in Zend_Db_Table_Row

2007-03-29 Thread Bill Karwin
Hi Matt,

I believe interface changes in Zend_Db have finished.  I have no further
enhancements planned at this time that will result in changing existing
interfaces.  There are some more enhancements planned, but they should
not alter existing usage of the interface.

The only possible exception to this is that the Oracle adapter (not the
PDO_OCI adapter) returns result sets in a format that is different from
the other adapters.  I plan to fix the Oracle adapter to match the data
structure used by the other adapters.  See ZF-812.

I will post to the fw-db list shortly with a list of changes planned for
Zend_Db in ZF 1.0.

Regards,
Bill Karwin

 -Original Message-
 From: Matt Schmidt [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 29, 2007 1:07 PM
 To: Bill Karwin; fw-general@lists.zend.com
 Subject: Re: [fw-general] camelCaps in Zend_Db_Table_Row
 
 Will there be any further disregard for backwards compatibility? If
 so, when can I expect the API to stabilize?
 
 
 On 3/29/07, Bill Karwin [EMAIL PROTECTED] wrote:
  Hi Andrew,
 
  I havn't updated the Row and Rowset documentation pages yet (I do
intend
  to).  The camelCaps treatment of column names has been eliminated
from
  the Zend_Db_Table_Row class.  You should use the spelling of your
  columns as they appear in the database.
 
  Regards,
  Bill Karwin
 
   -Original Message-
   From: Andrew Yager [mailto:[EMAIL PROTECTED]
   Sent: Thursday, March 29, 2007 6:45 AM
   To: fw-general@lists.zend.com
   Subject: [fw-general] camelCaps in Zend_Db_Table_Row
  
   Hi,
  
   I'm a bit slower than the rest of you. I'm doing my ZF0.8/0.9
upgrade
   tonight. The current version of the documentation seems to suggest
   that the auto camelCapsing of table field names in
Zend_Db_Table_Row
   should still work (I take it that you now must explicitly specify
the
   table name as it no longer auto resolves - I think this is a
really
   good move), however it doesn't for me.
  
   Is there an option or something like that now hidden from my view
I
   need to play with?
  
   Thanks,
   Andrew
  
   _
   Andrew Yager, Managing Director
   Real World Technology Solutions Pty Ltd
   ph: 1300 798 718 or (02) 9563 4840
   fax: (02) 9563 4848 mob: 0405 152 568
   http://www.rwts.com.au/
   _
  
 
 
 
 
 --
 Matt
 http://sloat.liek.us/


[fw-general] Re: Stuck in loop with Zend_Controller_Action::_forward() and Zend_Controller_Plugin_Abstract::preDispatch()

2007-03-29 Thread Nick Lo

A further follow up:

The secret recipe seems to be to use dispatchLoopStartup() rather  
than preDispatch as in:


class Menu_Controller_Plugin_Auth extends  
Zend_Controller_Plugin_Abstract

{
private $_auth;
private $_acl;

private $_noauth = array('module' = 'default',
 'controller' = 'auth',
 'action' = 'login');

private $_noacl = array('module' = 'default',
'controller' = 'index',
'action' = 'index');

public function __construct( $acl )
{
$this-_auth = Zend_Auth::getInstance();
$this-_acl = $acl;
}

public function dispatchLoopStartup()
{

if( $this-_auth-hasIdentity() ) {
$identity = $this-_auth-getIdentity();
$role = $identity-role;
} else {
$role = 'guest';
}

$controller = $this-_request-controller;
$action = $this-_request-action;
$module = $this-_request-module;
//echo $module;
//$resource = $controller;
$resource = $module;

if (!$this-_acl-has($resource)) {
$resource = null;
}

if (!$this-_acl-isAllowed($role, $resource, $action)) {
if (!$this-_auth-hasIdentity()) {
$module = $this-_noauth['module'];
$controller = $this-_noauth['controller'];
$action = $this-_noauth['action'];
} else {
$module = $this-_noacl['module'];
$controller = $this-_noacl['controller'];
$action = $this-_noacl['action'];
}
}
Zend_Debug::dump( $module );
Zend_Debug::dump( $controller );
Zend_Debug::dump( $action );
Zend_Debug::dump( $this-getRequest() );
$this-_request-setModuleName($module)
-setControllerName($controller)
-setActionName($action)
-setDispatched( TRUE );
}
}

On 30/03/2007, at 12:53 PM, Nick Lo wrote:


Hi Simon,

I've sussed out where the issue is and have commented it in the  
following:


The example url; site.com/auth/ goes to default/controllers/ 
AuthController.php...


AuthController extends Zend_Controller_Action
{
public function indexAction()
{
$this-_forward( 'login', 'auth', 'default' );
}

 public function loginAction()
{
...setup form stuff...
}
}

...and will then be sent back through...

class My_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
private $_auth;
private $_acl;

private $_noauth = array('module' = 'default',
 'controller' = 'auth',
 'action' = 'login');

private $_noacl = array('module' = 'default',
'controller' = 'error',
'action' = 'privileges');

public function __construct($auth, $acl)
{
$this-_auth = $auth;
$this-_acl = $acl;
}

public function preDispatch($request)
{
if ($this-_auth-hasIdentity()) {
$role = $this-_auth-getIdentity()-getUser()-role;
} else {
$role = 'guest';
}

$controller = $request-controller;
$action = $request-action;
$module = $request-module;
$resource = $controller;

/*** At this point we have...
* $module = 'default'
* $controller =  'auth'
* $action = 'index'
* ...which is the original action that _forwards()
*/

if (!$this-_acl-has($resource)) {
$resource = null;
}

if (!$this-_acl-isAllowed($role, $resource, $action)) {

/*** Now if we ARE allowed the next if/else will be skipped  
***/


if (!$this-_auth-hasIdentity()) {
$module = $this-_noauth['module'];
$controller = $this-_noauth['controller'];
$action = $this-_noauth['action'];
} else {
$module = $this-_noacl['module'];
$controller = $this-_noacl['controller'];
$action = $this-_noacl['action'];
}
}

/***
* So we end up still with...
* $module = 'default'
* $controller =  'auth'
* $action = 'index'
* ...which is still the original action that _forwards()
* and we are just resetting the following to what it already is.
*  There lies the loop.
*/

$request-setModuleName($module);
$request-setControllerName($controller);
$request-setActionName($action);
}
}

Hope that is useful. Now to go sort it in my 

[fw-general] Re: Stuck in loop with Zend_Controller_Action::_forward() and Zend_Controller_Plugin_Abstract::preDispatch()

2007-03-29 Thread Simon Mundy

Hi Nick

So you're saying that if you set the request's action via  
setActionName(), it will trigger another forward? Even if it's the  
same value as it was before the plugin performed its check? Must have  
been one of those subtle changes from 0.7 - 0.9 that I missed.


Thanks for spotting that one!

Cheers


Hi Simon,

I've sussed out where the issue is and have commented it in the  
following:


The example url; site.com/auth/ goes to default/controllers/ 
AuthController.php...


AuthController extends Zend_Controller_Action
{
public function indexAction()
{
$this-_forward( 'login', 'auth', 'default' );
}

 public function loginAction()
{
...setup form stuff...
}
}

...and will then be sent back through...

class My_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
private $_auth;
private $_acl;

private $_noauth = array('module' = 'default',
 'controller' = 'auth',
 'action' = 'login');

private $_noacl = array('module' = 'default',
'controller' = 'error',
'action' = 'privileges');

public function __construct($auth, $acl)
{
$this-_auth = $auth;
$this-_acl = $acl;
}

public function preDispatch($request)
{
if ($this-_auth-hasIdentity()) {
$role = $this-_auth-getIdentity()-getUser()-role;
} else {
$role = 'guest';
}

$controller = $request-controller;
$action = $request-action;
$module = $request-module;
$resource = $controller;

/*** At this point we have...
* $module = 'default'
* $controller =  'auth'
* $action = 'index'
* ...which is the original action that _forwards()
*/

if (!$this-_acl-has($resource)) {
$resource = null;
}

if (!$this-_acl-isAllowed($role, $resource, $action)) {

/*** Now if we ARE allowed the next if/else will be skipped  
***/


if (!$this-_auth-hasIdentity()) {
$module = $this-_noauth['module'];
$controller = $this-_noauth['controller'];
$action = $this-_noauth['action'];
} else {
$module = $this-_noacl['module'];
$controller = $this-_noacl['controller'];
$action = $this-_noacl['action'];
}
}

/***
* So we end up still with...
* $module = 'default'
* $controller =  'auth'
* $action = 'index'
* ...which is still the original action that _forwards()
* and we are just resetting the following to what it already is.
*  There lies the loop.
*/

$request-setModuleName($module);
$request-setControllerName($controller);
$request-setActionName($action);
}
}

Hope that is useful. Now to go sort it in my code.

Thanks for your help,

Nick


--

Simon Mundy | Director | PEPTOLAB


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

http://www.peptolab.com