[fw-general] Re: zftool failed: "I cannot access the API of github" (windows environment)
I do get the same error although I do have the extension active. $ echo '' | php 2>&1 |grep -i ssl Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, tls openssl OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.0.1 14 Mar 2012 OpenSSL Header Version => OpenSSL 1.0.1 14 Mar 2012 Native OpenSSL support => enabled using: $ zf version ZFTool - Zend Framework 2 command line Tool The ZFTool is using Zend Framework 2.1.5 -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/zftool-failed-I-cannot-access-the-API-of-github-windows-environment-tp4659138p4659836.html Sent from the Zend Framework mailing list archive at Nabble.com. -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] performance of ZF
I've read about this performance benchmark and I want to know your opinions. For most of the people performance is a really important thing. http://www.yiiframework.com/performance/ -- View this message in context: http://www.nabble.com/performance-of-ZF-tp20913061p20913061.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] understanding Zend_Db_Table_Select();
I have this object: $select = $this->_db->select() ->from( 'table') ->order('id ASC') ->orWhere('type = 1') ->orWhere('type = 2') ->where('country = 1') ; _die( $select->__toString() ); This one generates this sql string SELECT `table`.* FROM `table` WHERE (type = 1) OR (type = 2) AND (country = 1) ORDER BY `id` ASC. But this is not what I wanted or imagined that the orWhere() will give me. What I want is this: $select = $this->_db->select() ->from( 'table') ->order('id ASC') ->where('type = 1 OR type= 2') ->where('country = 1') ; _die( $select->__toString() ); Meaning the OR conditions work in a group of their own, SELECT `table`.* FROM `table` WHERE (type = 1 OR type= 2) AND (country = 1) ORDER BY `id` ASC Is there a way of generating the OR condition without preparing the link by hand? -- View this message in context: http://www.nabble.com/understanding-Zend_Db_Table_Select%28%29--tp20249345p20249345.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] zend_form_element_checkbox required
$agreement = new Zend_Form_Element_Checkbox('agreement'); $agreement ->setLabel('I agree to terms and conditions') ->addValidator( new Zend_Validate_NotEmpty()) ->setRequired(true); I do this in my code and the form is submitted adn validated even if the $agreement field is 0. The setRequired should be sufficient by itself without the need to add the validator. I remember doing this several times in the past and it worked. Could be an error with the 1.61 version or is just me being tired after all? -- View this message in context: http://www.nabble.com/zend_form_element_checkbox-required-tp19925592p19925592.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Introducing Zend_Paginator_Adapter_TableSelect
I think is a very good idea. Now the paginator only returns an ArrayIterator object even if you used an Zend_Paginator_Adapter_DbSelect and the Zend_Db_Select->from() only accepts a Zend_Db_Expression and maybe it will be a good idea to accept also a Zend_Db_Table. I would like to have directly the Row objects to play with them :) Jurriën Stutterheim wrote: > > Hi all, > > > A few minutes ago I committed a new adapter for Zend_Paginator: > Zend_Paginator_Adapter_TableSelect. As you would suspect, judging by > the name, this adapter specializes in dealing with > Zend_Db_Table_Select objects. The result of this specialization is > that this new adapter is able to return Zend_Db_Table_Rowsets to the > Paginator, which in turn is home to a collection of Zend_Db_Table_Rows. > The DbSelect adapter will continue to work as expected, even with > Zend_Db_Table_Select instances being passed to it. In fact, the > Paginator's factory method will continue to return a Paginator with > the DbSelect adapter, even if you feed it a Zend_Db_Table_Select > object! This has been done to preserve backward-compatibility for > Zend_Paginator. > > To resolve this minor inconvenience, I would like to propose a minor > BC break for the Zend Framework 1.7 release. If the > Zend_Paginator::factory() method is supplied with a > Zend_Db_Table_Select object, I would like it to return a Paginator > with a TableSelect adapter. You would still be able to use the > DbSelect adapter with your Zend_Db_Table_Select objects if you wish, > just not through the factory method : ) > > Please let me know what you think about this proposal! > > Enjoy the new adapter! > > > - Jurriën > > > P.S.: You can find the new adapter on SVN > -- View this message in context: http://www.nabble.com/Introducing-Zend_Paginator_Adapter_TableSelect-tp19785352p19896831.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend_Acl_Assert_Interface Usage
Could this sentence: $this->allow('role', 'resource', 'permission', new My_Acl_Assert_Rule()); be translated in English like this: "Create an allow rule for this role, resource and permission WHEN My_Acl_Assert_Rule returns TRUE? I want a way to allow access just if My_Acl_Assert_Rule filter is satisfied and I want a way to restrict access UNLESS My_Acl_Assert_Rule is not in the same time. Thanks. -- View this message in context: http://www.nabble.com/Zend_Acl_Assert_Interface-Usage-tp19668142p19668142.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Acl_Assert_Interface Usage
Hi and thanks for replying It's not an error that I've used the registry. I have an already constructed ACL object there. Your example is identical with mine only that you construct the ACL in place and I get it from a class. But in my case the second return is "true" which is very wrong. Also my object is more complex in terms of resources and roles both with inheritace levels. I read something about assertions breaking when inheritance is used and I think this could be the real problem. Because otherwise I did understand the mechanisms of Assertions. http://framework.zend.com/issues/browse/ZF-1722 http://framework.zend.com/issues/browse/ZF-1722 Martijn Korse wrote: > > Hi valugi > > Let's review your code first > > You're using Zend_Registy in your example, but i'm not sure why. I think > you're confusing it with the Role-Registry? Zend_Registry is a different > thing and not part of Zend_Acl. > Also, you forget to instantiate proper roles and resources (through > Zend_Acl_Role and Zend_Acl_Resource). > > I've rewritten your example: > > > class My_Acl_Assert_Test implements Zend_Acl_Assert_Interface > { > public function __construct($test) > { > $this->test= $test; > } > > public function assert(Zend_Acl $acl, >Zend_Acl_Role_Interface $role = null, >Zend_Acl_Resource_Interface $resource = null, >$privilege = null) > { > return $this->_test(); > } > > protected function _test() > { > return $this->test; > } > } > > //controller code > $acl = new Zend_Acl(); > $acl->addRole(new Zend_Acl_Role('client')); > $acl->add(new Zend_Acl_Resource('resource')); > $bool = $acl->isAllowed('client', 'resource'); > var_dump($bool); > $assertRule = new My_Acl_Assert_Test( false ); > > // new rules > $acl->allow('client', 'resource', null , $assertRule ); > $bool = $acl->isAllowed('client', 'resource' ); > var_dump($bool); > > > This outputs the boolean 'false' twice, as expected. > > In case you're still unsure how assertions work: you should see them as a > dependency on the rule. If the assertion returns false it means acl should > ignore the rule. It will then then look if it can find another rule > through inheritance and if no such rule can be found it will return the > default 'false' > > i hope that clears things up for you -- View this message in context: http://www.nabble.com/Zend_Acl_Assert_Interface-Usage-tp19668142p19684326.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Models and folder grouping
I think the most elegant way is to create your Loader // in the bootstrap require_once 'Zend/Loader.php'; Zend_Loader::registerAutoload( 'My_Loader' ); //Your class in library class My_Loader { public static function loadClass( $class) { // autodiscover the path from the class name } } -- View this message in context: http://www.nabble.com/Models-and-folder-grouping-tp19412763p19458193.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Class attribute of label and element
If you are constructing the element with Zend_Form_Element you can use $element->setAttrib('class', false ); -- View this message in context: http://www.nabble.com/Class-attribute-of-label-and-element-tp19429978p19454369.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Problem with Zend_View initialisation...
I think you should also check in the bootstrap for an existing dispatch check plugin which checks the request object and if it founds it malformed redirects this error controller/failure action. -- View this message in context: http://www.nabble.com/Problem-with-Zend_View-initialisation...-tp19453716p19454175.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend_Dojo_Form errors
1. Request object error If you have errors in the request object when trying to make your forms to use dojo, here is some clue. Dojo dijits uses some html templates and .htaccess usually is not prepared for this. .htaccess code: RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css|html)$ index.php 2. There is some error in the distribution that I have from zf. 1.6 I jave requests to this path: http://zf.mysite.com/js/dojo/dijit/form/nls/en/validate.js But then english version of this script is not there, is in the parent folder.. just the english one. http://zf.mysite.com/js/dojo/dijit/form/nls/validate.js Can someone point how to make a good compilation of the dojo library so we wont have this problems? 3. I want to validate a text field for emails. The below sintax is correct as Zend_Dojo_Form_Element inherits from regular Zend_Form_Element to which I can add validators for email. This means that dojo should make use of this validator on user side or I have to add a special validator plugin of Dojo itself in order to do the validation? $email = new Zend_Dojo_Form_Element_TextBox( 'email' ); $email ->setLowercase( true ) ->setMaxLength(40) ->setFilters( array( new Zend_Filter_StringToLower(), new Zend_Filter_StringTrim() ) ) ->setLabel('Email') ->addValidator( new Zend_Validate_EmailAddress()) ->setRequired( true ) ; Thanks -- View this message in context: http://www.nabble.com/Zend_Dojo_Form-errors-tp19453531p19453531.html Sent from the Zend Framework mailing list archive at Nabble.com.