Re: [fw-general] help with Zend\Db\Sql\Expression
Hi, I am having trouble reading through your code sample, do you have an example with a stack trace/error? Or some kind of reproduction case? -ralph On 11/8/13 3:07 AM, Steve Rayner wrote: I'm getting Object of class Zend\Db\Sql\Expression could not be converted to string with the following code; $select-join(*array*('tt' = 'discuss_thread_tag'), 'tt.tag_id = discuss_tag.tag_id', *array*(), 'left') -join(*array*('t' = 'discuss_thread'), 't.thread_id = tt.thread_id', *array*(*new *Expression('COUNT(thread_id) AS thread_count')), 'left') -join(*array*('m' = 'discuss_message'), 'm.thread_id = t.thread_id', *array*(*new *Expression('MAX(post_time) AS last_post')), //'*', 'left') -group(*array*('discuss_tag.name', 'discuss_tag.slug', 'discuss_tag.description')); seems ok if i remove the expressions. what am i doing wrong? -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: Making a Integer table row unsigned with Zend\Db\Sql\Ddl\Column\Integer
Currently, this is not possible. Although, it would be fairly easy to implement. The relative classes are: The Integer type: https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/Ddl/Column/Integer.php The Column base type: https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/Ddl/Column/Column.php And the CreateTable decorator for MySQL https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/Platform/Mysql/Ddl/CreateTableDecorator.php Do you want to file an improvement or issue a pull request for this on the github issue tracker? -ralph On 8/8/13 12:11 PM, jimmysole wrote: Hey Matt, I've been trying everything and I can't seem to get Zend\Sql\Ddl to make the column unsigned and auto increment. I know I'm probably missing something, I just don't know what at this point. Any help would be greatly appreciated Jimmy -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Making-a-Integer-table-row-unsigned-with-Zend-Db-Sql-Ddl-Column-Integer-tp4660679p4660704.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
Re: [fw-general] Pls help with unwanted quotes in db-queries
$select-join(array('m' = 'media'), m.foreignKey = p.id and m.belongsTo='product', array('mediaType', 'media' = $paths), $select::JOIN_LEFT); The on-part of this join produces: `m`.`foreignKey` = `p`.`id` and `m`.`belongsTo` = `'product'` - the backticks around product are actually invalid in pdo_mysql. How can I avoid them? It looks like you want a complex ON part to your JOIN statement. For anything non-trivial (meaning anything that requires expressions that might contain values or SQL expressions), you may want to use the Expression object to ensure exactly what you want. Here is an example with an Expression as the ON part: https://github.com/zendframework/zf2/blob/master/tests/ZendTest/Db/Sql/SelectTest.php#L952-L958 And here is an example of the ON part with predicates and predicate sets: https://github.com/zendframework/zf2/blob/master/tests/ZendTest/Db/Sql/SelectTest.php#L952-L958 And on a related issue: In Zf1 you were able to provide a data-type with any query-part, so you were able to actually use optimal data-types for your database (i.e. an int was treated as int). Now even an int gets quoted, which hinders performance on columns that contain the int-datatype. Is there Can you find me some documentation on this assertion? And, which platform you're talking about? (I assume MySQL?) -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: Pls help with unwanted quotes in db-queries
is, I think, much slower than select * from xyz where id=534, especially if the id is datatyped as int in Mysql, and even more so when there is an index on that column. Where does mysql document this performance optimization? Everything I see says this is a micro-optimization at best. -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: Pls help with unwanted quotes in db-queries
Hi, So the deal here (in my case): if I want to join on numeric columns (and that are datatyped as such in mysql), the conversion doesn't take that much time in small tables; however, in large ones, it will add up. It's just that I don't know the reasoning behind the omission of this feature going from Zf1 to Zf2. If you're building a statement to be prepared, none of this should be of too much consequence to you, here why ... Let's say you create the proper expression for you ON clause, that describes an expression that has a value: (for reference) https://github.com/zendframework/zf2/blob/master/tests/ZendTest/Db/Sql/SelectTest.php#L951-L961 $select-from('foo') -join('tableA', new Predicate\Operator('id', '=', 1)); In this case, the query is being prepared separate from the data, b/c this is the resulting query passed in (assuming PDO/mysql for example) is: SELECT foo.*, tableA.* FROM foo INNER JOIN tableA ON id = :join1part1 Then when that statement is executed, your PHP integer will be passed into $pdoStatement-bindParam(). The only time you'll see actual quoting is if you decided to getSqlString() on that $select object, which one would only do for debugging/profiling etc. The actual statement is a prepared and executed statement with values separate from the SQL which are evaluated after (IIRC) the query/execution plan has been assembled. In short, always use prepare execute / (parameritized queries). Hope this helps, Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Help using predicate and nesting conditions
The code below generates the following sql statement: * EXAMPLE2:* SELECT persons.* FROM persons WHERE givenName LIKE '%john%' OR surname LIKE '%john%' OR givenName LIKE '%doe%' OR surname LIKE '%doe%' AND active = 1 ORDER BY surname ASC LIMIT '2' OFFSET '0' $spec = function (Where $where) use ($keywords) { foreach( $keywords as $value ) { $where-like('givenName',%$value%); $where-OR; $where-like('surname',%$value%); $where-OR; } }; Not exactly like yours but: $select = new Sql\Select('foo'); $where = $select-where; $where-NEST-like('givenName',%Ralph%) -OR-like('surname',%Schindler%) -UNNEST; $where-AND-NEST-literal('active = 1')-UNNSET; $select-order('surname ASC'); $select-offset(5); $select-limit(10); produces something *like*: SELECT foo.* FROM foo WHERE (givenName LIKE '%Ralph%' OR surname LIKE '%Schindler%') AND (active = 1) ORDER BY surname ASC LIMIT '10' OFFSET '5' Anyone have insights? Basically, you're talking about nested predicate sets: simple example: https://github.com/ralphschindler/Zend_Db-Examples/blob/master/example-13.php Where the magic happens: https://github.com/ralphschindler/zf2/blob/master/library/Zend/Db/Sql/Predicate/Predicate.php Think of that class a class full of macros for doing the actual object graphing. Hope this helps, Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Struggling with Zend\Db
On the surface, it appears that Zend\Db\TableGateway corresponds to Zend_Db_Table, Zend\Db\ResultSet to Zend_Db_TableRowset, and Zend\Db\RowGateway to Zend_Db_Table_Row. If so, should I use the ZF2 classes the same way I did their counterparts in ZF1, or has the whole paradigm shifted? This is more or less correct. Now, they are not completely coupled, they all can be used independent of one another. One of the stronger use cases for this independence is that in many cases, you don't necessarily want a RowGateway object as a result from a TableGateway object. But in the ZF2 User's Guide, the example code appears to have Album\Model\Album taking the place of the Zend_Db_Table_Row in ZF1. If that's correct, where does Zend\Db\RowGateway fit in? In that particular example, the Table objects are implementing the Table Module pattern: http://martinfowler.com/eaaCatalog/tableModule.html and are composing TableGateway objects to do their work. The distinction here is a that the Table Module API deviates from that of purely TableGateway (very database-ish) and moves closer to the models API. Also in the User's Guide, the Album\Model\AlbumTable seems to be a very thin Mapper. Wouldn't a concrete TableGateway have worked just as well in this simple app? If so, would we still use the AlbumTableGateway factory in Module-getServiceConfig()? There's no right or wrong answer here. Every modeling pattern comes with pro's and con's. A concrete TableGateway would work as well, instead of passing it off as a Mapper. And wouldn't the default ArrayObject prototype work just as well as Album\Model\Album? What's the advantage of that class? I'm probably making this harder than it needs to be, but it seems that while the Guide does a fairly good job of explain WHAT is going on, it just doesn't explain the WHY. Help me Obi-Wan-ZendObi. You're my only help. ArrayObject would work, but you dont get the same kind of data type validation you would get by using a concrete-type Entity, like Album. For example, in the AlbumTable-save() method, you'll note that it only accepts an Album. If all the various table modules used ArrayObject, then you'd have to do additional checking to ensure the right table is getting the right kind of ArrayObject. You might also want to have a look at Rob Allens approach, which this tutorial was lightly based off of: https://github.com/akrabat/zf2-tutorial/ Hope that helps getting you started. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] ZF2_PATH and ZEND_SERVER_MODULES_PATH
X-Powered-By: PHP/5.3.21 ZendServer/5.0 I think you need Zend Server 6 for this to work out of the box. Zend Server 6 will ship with the ZendServerGateway module with the ZEND_SERVER_MODULES_PATH environment variable set and pointing to the correct place. Sure enough, /vendor is totally empty. The ZF2 environment was set up properly. I tried commenting it out, but it looked like the Module Loader was not happy. I am running on my new Zend Studio Local Server. What module should I load to make this code happy?? The ZendServerGateway module was not opensourced yet, but I have a few emails about this, and it might happen any day. I'll update you here. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] zend 2 Authentication The supplied parameters to DbTable failed to produce a valid sql statement
Are you using 2.1.1? This was an issue in 2.1.0: https://github.com/zendframework/zf2/issues/3623 -ralph On 2/14/13 7:12 AM, whisher wrote: Hi, I'm getting this error playing around with Authentication The supplied parameters to DbTable failed to produce a valid sql statement, please check table and column names for validity. the code global.php return array( 'db' = array( 'driver' = 'Pdo', 'dsn'= 'mysql:dbname=album;host=localhost', 'driver_options' = array( PDO::MYSQL_ATTR_INIT_COMMAND = 'SET NAMES \'UTF8\'' ), ), 'service_manager' = array( 'factories' = array( 'Zend\Db\Adapter\Adapter' = 'Zend\Db\Adapter\AdapterServiceFactory', ), ), ); Moule.php public function getServiceConfig() { return array( 'factories' = array( 'Auth\Model\User' = function($sm) { $tableGateway = $sm-get('UserTableGateway'); $table = new User($tableGateway); return $table; }, 'Auth' = function ($sm) { $dbAdapter = $sm-get('Zend\Db\Adapter\Adapter'); $authAdapter = new AuthAdapter($dbAdapter); $authAdapter -setTableName('user_auth') -setIdentityColumn('username') -setCredentialColumn('password'); return $authAdapter; }, 'UserTableGateway' = function ($sm) { $dbAdapter = $sm-get('Zend\Db\Adapter\Adapter'); $resultSetPrototype = new ResultSet(); $resultSetPrototype-setArrayObjectPrototype(new RegisterInputFilter()); return new TableGateway('user_auth', $dbAdapter, null, $resultSetPrototype); } ), ); } AuthController.php public function loginAction() { $sm = $this-getServiceLocator(); $authAdapter = $sm-get('Auth'); $form = new Login('frm-sign-in'); $form-get('submit')-setValue('Login'); $request = $this-getRequest(); if ($request-isPost()) { $filter = new LoginInputFilter(); $form-setInputFilter($filter-getInputFilter()); $form-setData($request-getPost()); if ($form-isValid()) { $filter-exchangeArray($form-getData()); $authAdapter -setIdentity($filter-username) -setCredential($filter-password); $result = $authAdapter-authenticate(); //if($result-isValid()){} \Zend\Debug\Debug::dump($result-isValid()); \Zend\Debug\Debug::dump($authAdapter-getResultRowObject(null,'password')); } } // \Zend\Debug\Debug::dump($this-getEvent()-getResult()); return array('form' = $form); } Can anyone point me out whare I'm wrong,please ? -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/zend-2-Authentication-The-supplied-parameters-to-DbTable-failed-to-produce-a-valid-sql-statement-tp4659161.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
Re: [fw-general] Join on different database
You would need to use the TableIdentifier as your $table where $table is accepted: https://github.com/zendframework/zf2/blob/master/library/Zend/Db/Sql/TableIdentifier.php This is supported in Zend\Db\Sql\Select, Insert, Update, Delete. -ralph On 1/10/13 3:52 AM, natix wrote: Hi, I have 3 databases on the same server with the same login credentials for each database. I am trying to write a query in zf2 that selects from database A but joins in a table from database B. This query works perfectly if I execute it from the command line but I can't get it into zf2. The query is basically: SELECT * FROM dbA.table1 AS a LEFT JOIN dbB.table2 AS b; The problem is how the zf2 Select class quotes. When I try to add the database name I get the following: SELECT `table1`.*, FROM `table1` AS `a` LEFT JOIN `dbB.table2` AS `b` The problem is the backticks around dbB.table2. I need them to be `dbB`.`table2`. How can I write this query in zf2? -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Join-on-different-database-tp4658711.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
Re: [fw-general] Combine TableGateway, RowGateway and Entity classes
Can you help me reproduce this? I have this repository here: https://github.com/ralphschindler/Zend_Db-Examples That has a database already setup. I'd like to get to the bottom of that error you have there. I've used TableGateway to produce entity objects without problem, so I'd need to see the code you are trying to use to see why its not possible for you. -ralph On 12/6/12 9:42 AM, Ralf Eggert wrote: Hi Matthew, thanks for your reply. Unfortunately, I can not get it to work. It actually _is_ supported. The way to make it happen is to inject a HydratingResultSet into the table gateway object; this object will then be used when results are returned. The HydratingResultSet allows you to specify both a hydrator as well as a prototype object to use when hydrating. I've used this combination several times to create a poor man's mapper. As an example: https://github.com/weierophinney/PhlyPeep/blob/master/src/PhlyPeep/Model/PeepTable.php -- this class uses the HydratingResultSet with the ArraySerializable hydrator, and a custom entity, PhlyPeep. When I select rows using that table gateway, I now get a result set that returns PhlyPeep objects as I iterate over it. (I also built in pagination into that TDG extension.) I looked at your example, but did not see that you use the RowGatewayFeature in that table. When I pass the HydratingResultSet to the TableGateway and the RowGatewayFeature I get a fatal error -- Fatal error: Uncaught exception 'Zend\Db\TableGateway\Exception\RuntimeException' with message 'This feature Zend\Db\TableGateway\Feature\RowGatewayFeature expects the ResultSet to be an instance of Zend\Db\ResultSet\ResultSet' in /home/devhost/project/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/RowGatewayFeature.php:42 -- So the combination of TableGateway, RowGateway and custom Entity classes does not seem to work. -- $db = new Adapter(array( 'driver' = 'Pdo_Sqlite', 'database' = APPLICATION_ROOT . '/data/db/pizza.sqlite3.db', )); $resultSet = new HydratingResultSet( new ReflectionHydrator(), new ToppingEntity() ); $rowGatewayFeature = new RowGatewayFeature('id'); $toppingsTable = new TableGateway( 'toppings', $db, $rowGatewayFeature, $resultSet ); $rows = $toppingsTable-select(array('costs' = 1.5)); -- Regards, Ralf -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] [ZF2] Paginator DbSelect not counting rows as expected
What database are you using? It might be an issue, but it's hard to tell: * what database? (it looks like mysql quoting) * do you think it's an issue that you're also using `c` just like the dbselect adapter as an alias? does it change the output if you change your alias? (Paginator uses c) https://github.com/zendframework/zf2/blob/master/library/Zend/Paginator/Adapter/DbSelect.php#L115 -ralph On 11/20/12 10:54 AM, Jean Rumeau wrote: Hello, today i started addings records to a database to test the pagination component. The dbselect query im passing to the adapter as string is this: SELECT `i`.*, `c`.`name` AS `categoryName`, CASE WHEN COUNT(bhi.id) 0 THEN 1 ELSE 0 END AS `used` FROM `items` AS `i` INNER JOIN `categories` AS `c` ON `c`.`id` = `i`.`category` LEFT JOIN `budget_has_item` AS `bhi` ON `bhi`.`item` = `i`.`id` GROUP BY `i`.`id` This query gets the items from a table 'items', its parent category name from 'categories', and the column 'used' to see if this item has childs in a table 'budget_has_items'. This is working well to retrieve the rows, but the problem comes when i try to paginate this results. I passed the select query as an object to the adapter, and here the count fails because it adds the count field as another field to the row. In ZF1 the DbSelect adapter wrapped the query as a subselect, ie: SELECT COUNT(1) as zend_paginator_row_count FROM (*SUBSELECT*) But now the select generated is: SELECT COUNT(1) AS `c`, `c`.`name` AS `categoryName`, CASE WHEN COUNT(bhi.id) 0 THEN 1 ELSE 0 END AS `used` FROM `items` AS `i` INNER JOIN `categories` AS `c` ON `c`.`id` = `i`.`category` LEFT JOIN `budget_has_item` AS `bhi` ON `bhi`.`item` = `i`.`id` GROUP BY `i`.`id` What i want to know if this is an issue with the adapter or im executing an invalid query. If i wrap the above query to make it look like the ZF1 one, it works well. Thanks. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-Paginator-DbSelect-not-counting-rows-as-expected-tp4658186.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] Webinar this Thursday on Modeling with Zend\Db
Hey all, I just wanted to drop a line to promote a webinar I'll be doing this Thursday. It will be based partly on the two ZendCon talk's I was involved in: * First, the last 3rd of our patterns talk where I walked through this application: https://github.com/ralphschindler/PatternsTutorialApp Where we explore modeling and using Zend\Db for persistence. * Second, from my Zend\Db talk where we explored the Zend\Db Select API. The link to the webinar is here: http://www.zend.com/en/company/news/event/1151_webinar-zenddb-usage-in-architecting-models Thanks! Ralph Schindler -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Executing manually built SQL queries - Is there an easier way?
The third and forth lines (prepare*() execute()) seem needlessly verbose. Can't it be simplified down into a single execute() function on the Select object? On the select object, probably not. The Select object by itself does not do SQL abstraction, only when prepared with a Sql object will you get SQL abstraction. The Select by itself will produce ANSI-compatible-ish queries, specific to the adapter and the platform. I think there is a feature request in there though. Perhaps the Sql object could have an execute() which would be similar in nature to Zend\Db\Adapter\Adapter::query(). The downside is that you are throwing away the statement produced in favor of just the result. While that may seem like what you're really after in most cases, this also means you cannot change a parameter in the ParameterContainer and then execute (again) and already prepared statement. Finally, I get back some weird Result object which I need to do yet another operation on before I can even access the query data in a useful way. Again, it seems needlessly verbose and not very useful. ZF1 made this pretty easy from memory. I personally would love to write code like this: $sql= $table-getSql(); $select = $sql-select()-columns(Array('count' = new Expr('count(id)'))); $results = $select-execute(); \Zend\Debug\Debug::dump($results); I will see about this. It would look more like this though (just stabbing in the dark): $select = $table-getSql()-select(); $select-columns(['count' = new Expr('count(id)')]); $results = $table-getSql()-execute($select); var_dump($results-toArray()); -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Issue Tracking now moved to GitHub
Hey Everyone, Zend Framework 2 has officially cut over our issue tracking needs to GitHub in accordance with the proposal approved 2 weeks ago. We've also ported all open issues to the GH issue tracker, and labeled them as best we could (including tagging as many usernames we could logically find). See here: https://github.com/zendframework/zf2/issues Currently, the issues in Jira will be closed, and no new issues will be accepted there. Triage will commence on the issues that were ported over. There were roughly 170 issues that came over from Jira. Happy Bug Fixing! (and I suppose Bug-reporting too..) ;) -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Check ACL on routing
You effectively have 2 options: First, and I am sure least favorite option from a framework perspective: Put your acl check in an onDispatch() method inside of the routed controller (that means at least a controller was dispatched). Inside of this method, you could do whatever check you need. At this point, you'd make sure to call parent::onDispatch() as it is responsible for calling the appropriate action. This is all assuming you're extending the AbstractActionController. THE BETTER SOLUTION: Is to get familiar with Event system, write a listener and listen in on a particular event. I think this list is up to day and complete (but I am not sure, best to check in IRC with Rob or Evan): http://akrabat.com/zend-framework-2/a-list-of-zf2-events/ also: http://akrabat.com/zend-framework-2/an-introduction-to-zendeventmanager/ the actual event manager: http://framework.zend.com/manual/2.0/en/modules/zend.event-manager.event-manager.html Hope this helps get you started, Ralph On 9/11/12 9:12 AM, Ralf Eggert wrote: Hi Marc, Marc Tempelmeier schrieb am 11.09.2012 08:56: in ZF1 I solved this with checking if the route is dispatchable and if not screw the whole ACL check. I didn´t check if there is something like that in ZF2 though. I did not find any isDispatchable method yet though I think it is not there. So I am still looking for a solution. Regards, Ralf -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Array support in TableGateway
I don't see why this would be a problem, could you fork the repository and issue a pull request for the feature? -ralph On 7/17/12 2:52 AM, henit wrote: Hi. In ZF2 beta5, Zend\Db\Sql\Select has been extended to support an array as argument for from. This is very good, for instance for table alias like: $select-from('t' = 'table'); However, the table argument for the contructor in Zend\Db\TableGateway\TableGateway still only support string and TableIdentifier (like Select did in beta4). I use TableGateway with selectWidth, but since the table identifier of the select object sent to selectWidth must be identical to the one sent to the constructor of TableGateway, I can't use array for the select object. So my suggestion is to extend TableGateway to support array the same way as Select. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Array-support-in-TableGateway-tp4655789.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
Re: [fw-general] ZF2 DB Result position forwarded?
throw new Exception\RuntimeException('This result is a forward only result set, calling rewind() after moving forward is not supported'); This occurs because $this-position is set to 5, as if it has allready traversed the results before it gets to the view. I only use the result object one time, and the object has position set to -1 before it is sent to $menu-setVariable but when the object is available in the view, it is position=5. Sound like someone is traversing it for some reason. It looks like the variable object is traversed when sent to a child model but not to the main view. Any idea what could cause this? This sounds like an odd problem, in general, unless there is good reason to do so, no one should be travsersing the dataset. I'll have to ask Matthew whats going on here. This happens b/c you're using mysqli, and by default, Mysqli only does forward-moving result sets. If you plan on using Mysqli and know that memory is not going to be an issue, you'll either need to $resultSet-getDataSource()-buffer(); In the future, we'll have an option that you can opt to have fully buffered result sets from mysqli. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Fixing Zend_Db_Statement::_stripQuoted() seg-faults on large SQL strings in ZF 1.x
Hi all, In the past we've been reluctant to solve an issue inside Zend_Db_Statement::_stripQuoted() that caused PHP's PCRE to seg-fault and crash. http://framework.zend.com/issues/browse/ZF-5063 http://framework.zend.com/issues/browse/ZF-10209 We've been reluctant for a number of reasons: * the problem is not directly in ZF, but in PHP's PCRE * the problem is only exposed on certain architectures * fixing the problem might cause unintended BC issues That said, given the amount of research a number of contributors have put into the matter, primarily by Bart McLeod, we feel comfortable moving forward with this fix for ZF 1.12 as it gives developers some flexibility in avoiding the problem, and the fix is fairly well tested against BC issues. I will let Bart get into the complexities of the fix, but I would like everyone to test what is currently in _trunk_ if you have large SQL that is being passed through Zend_Db. Thanks! Ralph Schindler -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] ZF2 Db\Sql\Select WHERE `name` LIKE 'cmp%' breaks the query
Based off of what is in master, I can confirm that this works: https://github.com/ralphschindler/Zend_Db-Examples/blob/master/example-15.php What is the error/exception you are getting? -ralph On 5/13/12 9:51 PM, cmple wrote: Hi, It seems like the LIKE expression cannot accept the '%' symbol when using mysqli, it just breaks the query: this works: LIKE 'cm' this doesn't: LIKE 'cm%' Is there a work around for this? Thanks! -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-Db-Sql-Select-WHERE-name-LIKE-cmp-breaks-the-query-tp4631367.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
Re: [fw-general] ZF2 Db\ResultSet-toArray() algoritm
In general, if you have a toArray() method, it is generally accepted that the return value of that method will be a PHP type array. If you are wanting to get the objects in your view, simply iterate over the ResultSet. The default return type in the default ResultSet is a RowObject which is actually an extension of ArrayObject. foreach ($resultSet as $row) {} as opposed to: foreach ($resultSet-toArray() as $row) {} -ralph On 3/26/12 2:35 AM, duke wrote: why in this function we transform data instance of RowObjectInterface to array? Not only ResultSet object? That we remove advantage of object access in View (like echo $row-id). code: /** * Cast result set to array of arrays * * @return array * @throws Exception\RuntimeException if any row is not castable to an array */ public function toArray() { $return = array(); foreach ($this as $row) { if (is_array($row)) { $return[] = $row; } elseif (method_exists($row, 'toArray')) { $return[] = $row-toArray(); } elseif ($row instanceof ArrayObject) { $return[] = $row-getArrayCopy(); } else { throw new Exception\RuntimeException('Rows as part of this datasource cannot be cast to an array'); } } return $return; } I guess it should be loop without transforming RowObject to array access only: public function toArray() { $return = array(); foreach ($this as $row) { if ($row instanceof RowObjectInterface) { $return[] = $row; } elseif (method_exists($row, 'toArray')) { $return[] = $row-toArray(); } else { throw new Exception\RuntimeException('Rows as part of this datasource cannot be cast to an array'); } } return $return; } I tested, it don't emit mysql out of sync error too. Otherwise we should create additional function to avoid mysql out of sync error. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-Db-ResultSet-toArray-algoritm-tp4505005p4505005.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
Re: [fw-general] Re: ZF2 Db\ResultSet-toArray() algoritm
You should be choosing the proper mysql extension based on your needs. Mysqli is great for scripts that do alot of data-warehouse type of iterations (due to its forward-only moving cursor by default). PDO on the other hand is great for object model kind of stuff because by default, it buffers result sets. You have two options: * Use PDO OR * Instruct Mysqli to buffer your result sets $resultSet-getDataSource()-getResource()-store_result(); Be advised though that doing this will tend to use more application memory since your database results are now in PHP memory space. -ralph On 3/26/12 9:37 AM, duke wrote: I know but you suggestion: foreach ($resultSet as $row) {} as I've wrote, will emit mysql out of sync error when another module (or event) use db driver. To resolve that we must loop at resultSet and get data, but not convert all row object to array. On 26/03/12 17:12, ralphschindler [via Zend Framework Community] wrote: In general, if you have a toArray() method, it is generally accepted that the return value of that method will be a PHP type array. If you are wanting to get the objects in your view, simply iterate over the ResultSet. The default return type in the default ResultSet is a RowObject which is actually an extension of ArrayObject. foreach ($resultSet as $row) {} as opposed to: foreach ($resultSet-toArray() as $row) {} -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Zend\Db Refactored in Beta3
Hey all, This is a followup on the status of Zend\Db. As of today, Zend\Db is code-complete for the list of tasks I planned on completing for the Beta3 release of Zend Framework. In no special order, and not an exhaustive list, those tasks included: * Zend\Db\Adapter: * Driver - abstraction for extension integration * Platform - abstraction for vendor nuisances (including some aspects of the SQL dialect, like quoting) * Has the ability to execute or prepare queries * Has the ability to determine if a result set is produced, and iterate * Has the ability to abstract the parameterization type: named, positional etc. * Zend\Db\ResultSet * Simply, provides a container that allows for result set iteration * Allows for a row prototype object that will clone for iteration of data * Zend\Db\TableGateway * Table Gateway pattern implementation * Zend\Db\Sql * Minimal initial implementation of SQL abstraction component * Has the ability to produce a full SQL or parameterized statement * Zend\Db\Metadata * Abstraction API for retrieving information about a schema/database * Includes Tables, Columns, Constraints (Primary, Unique, FK) Currently, this is awaiting merging into master. The pull request is located here: https://github.com/zendframework/zf2/pull/819 All of this can be demonstrated by my example set located here: https://github.com/ralphschindler/Zend_Db-Examples That said, there is still plenty to do === More Drivers! === Currently, I support this set: * MySQL through ext/mysqli extension * Sqlite through ext/Pdo_Sqlite extension * SQL Server through ext/sqlsrv extension Conceivably, more drivers should work though PDO, since all the pieces are in place, but I have not tested them out. More drivers will be available in Beta4. * Postrgres, Oracle, Db2 (and in iSeries) to name a few === Better Zend\Db\Sql abstraction Zend\Db\Sql\Ddl Abstraction === DDL abstraction is crucial for building out a better unit testing suite. It is also useful for development time database object creation. === Better Unit Testing === Currently, there are no unit tests. That is because to do this correctly, we really need Zend\Db\Sql\Ddl. For the reasoning, see the original RFC document: http://framework.zend.com/wiki/display/ZFDEV2/RFC+-+Zend+Db At this point, I'd encourage everyone to have a look and play with the code, either directed at the pull request, in master (when it is merged), or at Beta3 release. I will also have a phar available, in my Zend_Db examples repository. Send all your feedback! Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Zend_Db_Adapter_Sqlsrv::limit() not compatible with SQL Server 2000
How different is the LIMIT implementation different from SQL Server 05 and 08? I fear that since ZF1 is approaching its final minor version and that there are far fewer people running 2000 in production over 2005, it might night make sense for this in ZF1. -ralph On 2/10/12 10:19 AM, Andrew Ballard wrote: The implementation of the limit() method relies on RowNumber() which did not exist prior to SQL Server 2005. SQL Server 2000 is pretty old by now, but there are still some databases running on that platform. I wrote a custom db adapter to extend Zend_Db_Adapter_Sqlsrv that appears to fix this issue and make the method compatible with SQL Server 2000. If I enter a bug with the fix, would someone be interested in reviewing it for inclusion? (Also, I noticed when searching the issue tracker that there are component labels for several Zend_Db_Adapter_* classes but this was not one of them.) Andrew -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Re: Naming of Classes / Interfaces / Traits in ZF2 Poll
Special note: this Poll closes today in 1 hour. Cheers, -ralph On 2/1/12 3:39 PM, Ralph Schindler wrote: Hi all, I've closed off the editing of the poll verbiage and opened up the naming poll for all framework.zend.com users to vote in. Url below. Some notes-- You can edit your vote after you've made it if you've changed your mind. This poll will close before the next ZF2 meeting (next wednesday 18:00 UTC), so you roughly have 7 days to discuss and come to a conclusion. Before you vote, I suggest you read my RFC as to why this is coming up again: http://framework.zend.com/wiki/x/jQHbAQ any try to understand the issues that the current scheme have brought to the forefront. I'd also suggest that if you're a casual observer of ZF2, seek out any of the individuals inside #zftalk.2 on freenode to gain a bit of insight and perspective - one way or the other. and, THE POLL URL: http://framework.zend.com/wiki/x/bQDKAg Happy polling, Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Naming of Classes / Interfaces / Traits in ZF2 Poll
Hi all, I've closed off the editing of the poll verbiage and opened up the naming poll for all framework.zend.com users to vote in. Url below. Some notes-- You can edit your vote after you've made it if you've changed your mind. This poll will close before the next ZF2 meeting (next wednesday 18:00 UTC), so you roughly have 7 days to discuss and come to a conclusion. Before you vote, I suggest you read my RFC as to why this is coming up again: http://framework.zend.com/wiki/x/jQHbAQ any try to understand the issues that the current scheme have brought to the forefront. I'd also suggest that if you're a casual observer of ZF2, seek out any of the individuals inside #zftalk.2 on freenode to gain a bit of insight and perspective - one way or the other. and, THE POLL URL: http://framework.zend.com/wiki/x/bQDKAg Happy polling, Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Re: [zf-contributors] Naming of Classes / Interfaces / Traits in ZF2 Poll
I'll try and sum up what we discussed in #zftalk.2 today. For instance; I am having some issues understanding some of the votes. My main concern is ultimately consistency in the naming of itself and there seems like there might be an option missing as well. From my point of view having an AbstractClient and then a ClientInterface does I'd like to first point out that, anecdotally speaking, when it comes to standards in both Java and PHP (talking mature-ish projects), AbstractFoo and FooInterface seem to be the more popular scheme. For example, PHPUnit, Assetic (uses Base instead of Abstract, but its a prefix), Doctrine and Symfony to name a few. There is a difference in naming because these two things are not fundamentally the same. One is an incomplete class whereas the other is a contract. The thread in common is that they are types. But more importantly, I feel like since the API of PHP is English, English rules have applied, and feel more correct for a number of developers. In the case of AbstractFoo, for example, this relationship between an adjective and noun/subject, Abstract being the adjective and Foo being the noun/subject. The word Abstract is modifying the noun Foo. http://www.edufind.com/english/grammar/adjectives_form.php In the case of FooInterface though, I think we have a case of a compound noun, where the primary subject is the Interface and it is modified by a type, in this case Foo. http://www.edufind.com/english/grammar/nouns4.cfm It is for those reasons I think you see the votes tallying the way they are. But, I am only guessing here, I have no hard evidence as to why people vote the way they do, and why the status-quo in other languages is the way it is.. Or at least, I have not found a source to fall back on. not make a ton of sense (other than they read better when sounding them out). Either they should all be prefixed or all be suffixed. Having a mix of the two just complicates things and does not add to a specific linguistic pattern. See the above for the English grammar patterns at play here. I also believe an option is missing for traits to follow the AClient, IClient and there should be a TClient. Basically I feel like any pattern should be followed as if it should be a suffix or a prefix and There was not a lot of support in the IRC channel today for Hungarian notation, and as such no one suggested TFoo as a pattern for traits. would just like to understand others point of view regarding the naming convention. A great thing about doing this is within file searching by pattern; you could now do a ^(A|I|T)[A-Z] for a regular expression or replacing the A|I|T with Abstract|Interface|Trait. Not doing this also feels a bit like haystack needle or needle haystack. :) I think people fall back on what feels natural, even in cases where they don't fully understand the how's and why's of one preference over another. The links I've posted above I think might answer why in the English language, you'll see people favor the AbstractFoo and FooInterface patterns. Hope that helps with the reasoning. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] What is the recommended way of using Doctrine2 with ZF1?
Check out these two branches: https://github.com/ralphschindler/NOLASnowball/tree/doctrine2-managed and https://github.com/ralphschindler/NOLASnowball/tree/doctrine2-managed-crud You may also want to check out: https://github.com/guilhermeblanco/ZendFramework1-Doctrine2 -ralph On 12/13/11 2:32 PM, mbneto wrote: Hi, I've found few posts about the use of Doctrine2 and ZF1. I was wondering before trying those if anyone in this list would recommend another method. Regards. -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Tools going down for upgrading.
Hey all, I will be taking the tools down for an hour or so while I upgrade them. I'll ping back when everything is running again. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Re: Tools going down for upgrading.
Hey All, Tools have been updated: Jira, Crowd and Confluence. Unfortunately, the Vote plugin for confluence has seemed to have lost its historical data on previous votes. I am sure its in there, and I've contacted the author of that plugin to see if there is a way to re-sync. As we don't have any open polls and since the upgrade process is actually kind of complex, I decided to move forward without the historical data, as opposed to rolling back completely. Poke around otherwise and let me know of you see any issues in either: framework.zend.com/issues/ or framework.zend.com/wiki Thanks, Ralph On 12/9/11 10:12 AM, Ralph Schindler wrote: Hey all, I will be taking the tools down for an hour or so while I upgrade them. I'll ping back when everything is running again. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: Zend coding style and multiline string concatenation
On 11/18/11 1:44 AM, janroald wrote: weierophinney wrote: We typically recommend the second format, or the usage of heredocs/nowdocs (latter is PHP 5.3 only, though). However, our CS does not dictate either way. heredoc/nowdocs I would discourage unless there is a fantastic reason to use them in library code for the following reasons: * it pushes text up against the left margin (in the least the here/nowdoc label) * if you're trying to beautify your code, you'd be adding additional spaces after a newline (both of which are probably unnecessary) * you cannot be explicit about your line ending types, it just so happens to include whatever your setting is in your IDE/editor Many developers find unnecessary concatenation very annoying. I'm curious why Zend would recommend this practice. I'm not criticizing, its all just details, I'm just curious if there's any good reason for it. Lets take your above example: Basically, is following allowed? 1. $sql = SELECT `id`, `name` FROM `people` 2. WHERE `name` = 'Susan' 3. ORDER BY `name` ASC ; Or should it be always like this? 1. $sql = SELECT `id`, `name` FROM `people` 2. . WHERE `name` = 'Susan' 3. . ORDER BY `name` ASC ; These two things are not equivalent. In the context of a database connection where whitespace is removed and the SQL is parsed and executed they are equivalent. To a person who wants to push this statement through a logger, they former includes newlines and whitespace that they might otherwise not want in their SQL statement. So, while it's pretty in the context of your IDE/editor, and in the context of the database it does not care, inside your log file, you'll have unsightly whitespace and newlines. I, personally, take this a step further and only use double quotes if my intention is to interpolate values, otherwise I stick with a single quote (by seeing a doublequote (), my brain automatically says to me: there must be a variable or control character being injected into that somewhere. Have a good one! Ralph Schindler -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Auto Generated Admin App/Plug-in
We have nothing of the sort built-in. Perhaps in ZF2 there will be more opportunity to have standardized modules that do what you are anticipating. In short, there are many architectural issues with attempting to provide both some form of simplified model (like Django's attempt at ActiveRecord) and the ability to build forms, ACLs and admin screens for a particular set of metadata rules. We also have no baked in views/styles that can be utilized. ZF is very much a blank slate, we provide an MVC layer for you to build your applications, but we have no opinion on how you might go about modeling your data and your applications needs. Have a look at the component list in our manual and decide for yourself if there is enough there so that you can create the application you are envisioning. If a quick CRUD app is what you want to build, you might be served by checkout out some other projects that specialize in that http://framework.zend.com/manual/en/ -ralph On 8/31/11 1:13 PM, Julio Castillo wrote: I'm sorry I wasn't to clear on my question. This CLI is yes an admin console to Zend. This is not what I was looking for. I'm looking for a Auto Generated GUI screens (HTML) that will allow me to CRUD the models created. Other frameworks like Django provide automatically those views and are very helpful for admin and bootstrapping purposes. All the views look and feel the same way, they are generic and can deal with relationships. thanks On 8/30/2011 11:52 PM, Gabriel Croitoru wrote: Hello, Take a look at the CLI tool. http://framework.zend.com/manual/en/zend.tool.framework.clitool.html Gabriel On 30.08.2011 19:37, Julio Castillo wrote: I'm new with ZF, I've been searching within ZF and have not found an app or plugin that can automatically generate views on all models that are created for the purpose of seeding or bootstrapping my app (e.g. Admin App). Something similar exists with Django or RoR, where the framework automatically creates such views and then builds a simple Admin App around them. The views cover each model and provides listing and entry/update forms. Is there such app? -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Multiple spl_autoload registered handlers
Again, why is this a problem, exactly? What if you have another autoloader registered later that _can_ handle it? If the first dedicated autoloader for that namespace couldn't handle it, chances are no other handler will (or should not). Thats not true. Autoloaders that are shipped with code should only be responsible for loading the code they are responsible for (in the least). Try as we might, the one class per file / 1:1 mapping of namespace/classname to filesystem name is still just a suggested best practice, and we cannot cover every mapping a developer might come up with. That's not to say their code (that you might want to consumer in your ZF application) is not useful, it just means we cannot autoload things that are not of a standard mapping. I've still seen: * devs put class in the file name SomeClass.class.php * devs put multiple classes in a file * devs don't use logical prefixes or namespaces Simply put, the best practice here is to let the 3rd party autoloader handle the 3rd party code. Each autoloader should short-circut/return early if it is being asked to handle a class it is not responsible for. The CONSUMER is ultimately responsible for properly organizing their spl_autoload_ stack in some bootstrapping process and ensuring the code they are consuming actually does play nice with other code. But spl_autoload _IS_ a stack I realize that, the point was that the application code cannot break out of the execution loop if desired. By the time you are executing your application, you should not be concerned with either the who, what, why, or how a class is located an utilized. Simply put, that's too much information for the application layer. This is the whole point of delegation. This is probably a good read for you: http://en.wikipedia.org/wiki/Java_Classloader Things are not so completely different with regards to how JVM and PHP have decided to solve the problem of dynamic class resolution. Ultimately, if you're trying to influence which class of the SAME NAME your application is attempting to use, you probably have some bigger architectural issues to be dealing with. As much as I appreciate that the zf2-quickstart example, is exactly that, but it does somewhat exemplify the point I'm trying to make since in that example, the StandardAutoloader would execute given the namespaces registered even though there are class maps also - I realize it is just example code. My original post was more to draw awareness to potential overhead that could be incurred if the we're not cognitive of the implications (depending on how and what is being used). What exactly is the overhead? In all of my research, multiple small concise autoloaders are always faster than one monolithic autoloader. The idea behind the Zend\Loader component is to give developers options. The options allow developers the ability to write code that will play nice with older 3rd party code (think prefixed code) as well as newer 3rd party code (namespaced). Also also give developers to option to compile classmaps in situations where performance is a top priority. -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Multiple spl_autoload registered handlers
I think you might have meant to post this to the zf-contributors maillist where most ZF2 discussions are happening. if (false === class_exists('ClassA')) { //dynamically check to see if a local overriding class exists via the autoloader $class = new DefaultClass(); } else { $class = new ClassA(); } What is an overriding class? The idea in PHP 5.3 and ZF2 is that all classes exist within some namespace. You should never have a class of the same name in the same namespace but on different places on the filesystem. Having multiple registered spl_autoload handlers will incur unnecessary cycles, and the developer will not have the ability of controlling the autoloading stack (e.g circumventing it), I'm wondering if it would be better to have one registered handler similar to the ZF1 plugin priority stack. If you are concerned with multiple code-bases playing nice together, you can always fore-go the Autoloader::register() method that most autoloaders have to to auto-register themselves, and simply pass the autoloader object to spl_autoload_register yourself. By doing that, you can be sure that the stack of autoloaders is exactly as you expect it to be. You can also use the PHP 5.3 only feature of spl_autoload_register prepend flag to ensure things are in the order you expect them to be in: http://php.net/manual/en/function.spl-autoload-register.php -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Getting a The Zend Framework was not found error in Drupal
I think this is probably a question for the Drupal list. If I HAD to guess what was going on.. You need to install the module and ALSO download/install Zend Framework 1.x. Once you do this, you need to one of the three things on the drupal install page: * Install the Zend Framework in your PHP include path. One way to do this is via Pear. * Install the libraries module and place the Zend folder of the Zend Framework download in a libraries folder. * Download the Zend Framework to an alternate location and set that location in the zend_path variable or on the Zend Framework configuration page. If you've done that, and you still have issues, check you dont have an open_basedir restriction on your web server. Beyond that, you might want to see help from the plugin author. -ralph On 7/10/11 11:55 PM, silexmulti wrote: I have installed the Zend Framework using various methods and even the Plugin manager module. It reports that it installs fine. But when I go to Reports - Status report, I get that error for the Zend framework. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Getting-a-The-Zend-Framework-was-not-found-error-in-Drupal-tp3658705p3658705.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
Re: [fw-general] Looking for help for suffix .html and public/ folder out of the url
I have not fully tested this, but this is the route I would explore. It seems you're going to have to replace the default route. If you want to do this in your application.ini, it might look something like this: ;; Controller / Router resources.router.routes.default.route = /:controller/:action.html/* As you can see, there might be some oddness with the page parameters being listed after your action.html, but this might be able to help you get started. -ralph On 7/1/11 5:43 PM, damdamien wrote: *Hello every one*, I *don't speak english very well* but i need help so i'm trying to explain what's my problem. I was working before on /Codeigniter PHP framework/. Now i would like to use something more powerful ! I choosed ZEND Framework but when you're starting to use it the documentation is really hard to understand. So now what I'm trying to do ? *I would like to get a .html suffixe in my website url. * Why? Because it's a better way to optimise searchengine's referencement. i thought there was something to put in the application.ini and that's all. something like : routes.default.route.suffix = .html But apparently, it's not this at all. Someone could explain to me how to do that's please ? *Secondly, my url is like : http://localhost/mysite/public/* What have we to do to get out this public folder from the url ? thank to read me damien -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Looking-for-help-for-suffix-html-and-public-folder-out-of-the-url-tp3639481p3639481.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
Re: [fw-general] Re: Several form on one page
It sounds like you want subforms: http://framework.zend.com/manual/en/zend.form.forms.html#zend.form.forms.subforms Each top-level form is responsible for a single submission (POST or GET) to an new url. To have 3 forms on a page means that your submit will only submit what is in the scope of the form Being processed. With sub-forms, you can be a bit more creative in how you display various forms, and how you've crafted your forms (as classes) on the backend. This might be worth a look for you. -ralph On 7/8/11 7:24 AM, Echol wrote: I want to show on one page three forms. Each form your submit. To each form processed separately from the other (validation, data storage in a database, etc.). The code that showed above, have a problem. When being validated form is not valid, then it is only displayed, and I need to also displayed other two forms. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Several-form-on-one-page-tp3649452p3653936.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] Next ZF 1.11.x Release, Bug-hunt wrap up Sanity Check
Hello Everyone! Right now I am having a Blue Moon with a slice of orange. Why? Well, in part b/c I like Blue Moon, but also in part celebratory as the last few days (long days) have culminated in one of the most successful bug-hunts we've ever had. It's true that in the past we've closed more issues (like last November we closed over 110). But this time around, we actually had more bugs Fixed as opposed to closed as Not an Issue or Won't Fix or The Issue Tracker Is not The Mailing List. Around 60% of the closed issues were Fixes. Fixed means patches. These patches were provided by the community. Meaning, this time around, the community helped us fix *real* issues (however larger or small) that plagued ZF users. To get a sense of what issues were closed, visit: http://framework.zend.com/issues/secure/IssueNavigator.jspa?mode=hiderequestId=11777 To get a sense of what some of the 140(-ish) commits looked like: http://framework.zend.com/code/log.php?repname=Zend+Frameworkpeg=24013sr=24013er=1max=141 All that said, we will be rolling out a new release in the next day or so. Before then *I urge everyone* to pull down release branch 1.11 and give it a go to see if there are any changes that might affect you or your projects. Here are some of the more notable changes that I'd like everyone to test out: * ZF-3527: Zend_Controller_Request_Http url encoded BASE_URL http://framework.zend.com/issues/browse/ZF-3527 * ZF-11253: Zend_Db_Table_Abstract allows offset in fetchRow() http://framework.zend.com/issues/browse/ZF-11253 * MANY Zend_Dojo Fixes * SEVERAL Zend_Form Fixes * ZF-10964: Zend_Rest_Route correctly uses urldecode() http://framework.zend.com/issues/browse/ZF-10964 * ZF-10042: Zend_View accepts variables at construction time http://framework.zend.com/issues/browse/ZF-10042 With that, this is shaping up to look like a pretty good next mini release, all thanks to the community! Congrats everyone, and if you have any issues, please report ASAP. Thanks again! -ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: Strange File does not exist in apache log
I think more information is needed. Which apache log file is it? access_log? error_log? or is it a special file to log php errors? Is it a php error? What does the full line look like? -ralph On 4/8/11 9:01 AM, xmariachi wrote: Has this been resolved? I'm having a similar issue. TIA -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Strange-File-does-not-exist-in-apache-log-tp654109p3436365.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
Re: [fw-general] Re: Zend_Dom out of memory
Can you create a small reproduction case? Also, what is the memory_limit of this script? -ralph On 4/13/11 1:21 PM, Kevin Z wrote: Hi, I can confirm this issue still exists. My version : PHP 5.3.3 (cli) (built: Jul 26 2010 17:37:00) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans with Zend Extension Manager v5.1, Copyright (c) 2003-2010, by Zend Technologies - with Zend Data Cache v4.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [disabled] - with Zend Utils v1.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [enabled] - with Zend Optimizer+ v4.1, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [disabled] The memory usage goes up about 30k for each of loop until make changes to the query() following Matthew's suggestion. Is it something we should make improvements inside of ZF ? - Kevin -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Dom-out-of-memory-tp656962p3447908.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
Re: [fw-general] Re: Troubles with login
Thanks for the heads up! I've fixed the url in crowd, it should now give the correct url to the password reset utility. Glad you can now get in, -ralph On 4/1/11 7:36 PM, Fabio Napoleoni wrote: I reset the password for the third time and this time has worked... Maybe also the unlock made by Matthew (I missed his post) Anyway the link sent by atlassian on password reset is wrong, it uses http://localhost:8095 as hostname, obviously changing that to http://framework.zend.com solves the issue. Thank you both for your help. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Troubles-with-login-tp2527302p3421433.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
Re: [fw-general] Zend_Auth storage
Since you are using Zend_Auth_Adapter_DbTable, and calling $adapter-getResultRowObject(); .. The resulting object is simply a stdClass. If you'd like you can add information to that identity object. $identity-someProperty = $someValue; Then write that to the authentication storage medium. If the information is not related to authentication, I'd simply put it inside your own slice of Zend_Session_Namespace; Hope this helps, -ralph On 4/1/11 9:15 AM, Steve Rayner wrote: I have this to store persistent data for an authenticated user; // We're authenticated! Store details. $identity = $adapter-getResultRowObject(); $authStorage = $auth-getStorage(); $authStorage-write($identity); I would like to add one extra bit of info to the persistent storage. Is there any way i can append this to the stored $identity? -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: Troubles with login
Hey Fabio, It appears your around is marked as active. Perhaps a password reset? -ralph On 3/7/11 8:04 AM, Fabio Napoleoni wrote: Same happens to me. Tried to reset password but with no luck. My ZF account is fabio Please unlock me. Thanks. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Troubles-with-login-tp2527302p3339030.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] Re: [zf-contributors] Tools going down for upgrade
All the tools are back online and up to latest version- Jira, Crowd Confluence. Everything seems to be performing very well. If you find any inconsistencies, please let me know immediately! Thanks for your patience! -ralph On 3/30/11 10:00 AM, Ralph Schindler wrote: Over the next few hours, you will notice the Atlassian tools will be down. During this time, we'll be doing an upgrade and will alert you when the tools have been upgraded and are back online. Thanks! Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] Tools going down for upgrade
Over the next few hours, you will notice the Atlassian tools will be down. During this time, we'll be doing an upgrade and will alert you when the tools have been upgraded and are back online. Thanks! Ralph -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
[fw-general] The March 2011 Bug-Hunt is Underway
Hey all, In case you haven't seen the news, we are running the March 2011 bug hunt today, tomorrow and saturday. More information here: http://devzone.zend.com/article/13388 Need an issue to attack? There is no shortage: http://framework.zend.com/issues/secure/IssueNavigator.jspa?requestId=11385sorter/field=issuekeysorter/order=ASC I'll be in #zftalk.dev if there is an issue that needs discussion. Happy hunting! Ralph Schindler -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Re: [zf-contributors] ZF tools and SVN going offline briefly
Seems like it could have been a momentary problem. Things seem fine right now. Please post back if you see see the issue. -ralph On 3/18/11 5:56 AM, Bert Van Hauwaert wrote: It seems like the wiki is still not available. I got this response: Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /wiki/display/ZFPROP/Doctrine+1+and+Zend_Tool+Integration+-+Benjamin+Eberlei. Reason: Error reading from remote server Apache/2.2.3 (CentOS) Server at framework.zend.com Port 80 On 16 Mar 2011, at 16:50, Matthew Weier O'Phinney wrote: We've migrated to the new data center, and public DNS has been updated. At this time, if you still cannot access the tools, likely you simply need to wait for your DNS to update. -- Matthew Weier O'Phinneymatt...@zend.com wrote (on Wednesday, 16 March 2011, 09:33 AM -0500): We're migrating to a new data center today. As such, we're taking down the developer tools (wiki, issue tracker, single-sign-on, and subversion) for a short time. We should be back up and running within the hour. Thanks for your patience! -- Matthew Weier O'Phinney Project Lead| matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com .. be.coded cvoa Bert Van Hauwaert Zend Certified Engineer mobile : +32 (0) 486 66 38 72 website: http://www.becoded.be email : b...@becoded.be office : Keukelstraat 37, 8750 Wingene, Belgium .. -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] Reflection: get docblock for constants
Hey Jan, Currently, no. http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Reflection/Class.php (there is a getProperty, but no getConstant) It appears constant support was never added (I guess no one ever really thought of needing to get the doccomment from a constant?) If you want to file an issue and add the feature, this week is the monthly bughunt. I don't see any reason why this feature cannot be added. -ralph On 3/14/11 8:44 AM, Jan Pieper wrote: Hi guys, is it possible to get the docblock comment for a class constant with Zend_Reflection and/or Zend_Server_Reflection? with regards, Jan Pieper -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Reflection-get-docblock-for-constants-tp3353893p3353893.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
Re: [fw-general] Comparison between frameworks
Hey Robers- Better yet, How about describe what you will be attempting to do, with some specifics and we can give you some insight on which framework to use. ZF and Symfony can be used together, you can pick and choose the various components that fit your needs. Running through the quickstart for each (usually like 10 mins a peice) often give you more than enough insight on the application framework each offers. So you'll be able to determine which style you like. -ralph On 2/17/11 6:36 PM, robert mena wrote: Hi, I'd like to know if there is a comparison of features, requirements between frameworks (like ZF, Symfony etc). I am trying to decide which one to use for a given project. Regards.
Re: [fw-general] ZF2 - Will there be a Zend\View\ViewEngine
Hey Kevin, The Dojo component will need to be refactored at a later date. Currently, our MVC Interfaces proposal was approved and we are moving towards building an MVC implementation over the next months. Once we know what the C (Controller) and V (View) look like, we'll apply that to the components that consume it. So, in a nutshell, it is best to wait to see what happens before putting any effort into refactoring this component with regards to MVC integration points. -ralph On 2/10/11 12:52 PM, kncedwards wrote: While moving some code further towards ZF2, the dojo application resource uses Zend\View\ViewEngine in the following function: public static function enableView(View $view) { if (false === $view-getPluginLoader('helper')-getPaths('Zend\Dojo\View\Helper')) { $view-addHelperPath('Zend/Dojo/View/Helper', 'Zend\Dojo\View\Helper'); } } Is a ViewEngine class still in the works, or does this resource need some fixing. regards, Kevin
Re: [fw-general] Re: Troubles with login
Your activity flag has been updated, please try it now and let me know if you still cannot get in. -ralph On 1/29/11 10:02 PM, zamanphp wrote: help me plz!
Re: [fw-general] Sharing the session among different Controllers
There is no need to both start the session with Zend_Session and also call $session = new Zend_Session_Namespace();. What I suggest is this following: First decide on a sensible name that all your controllers can share, some kind of name that suits the purpose of the data that is being shared. Then, inside the controllers that need to share the data, something like this: class SomeController extends Zend_Controller_Action { protected $session = null; public function init() { $this-session = new Zend_Session_Namespace('SomeSharedName'); } /** ... actions using $session here ... */ } This is the entire idea behind the namespaced feature of Zend_Session, so that individual application components can have some sense of security and ownership over a piece of the global $_SESSION. Hope this helps, Ralph On 1/29/11 10:52 AM, AmirBehzad Eslami wrote: Hi, I'm looking for a ZF-way to share the session among different Controllers. Before ZF, the famous global $_SESSION was available everywhere, and still is. But I'm trying to access the session data from ZF's API. In My bootstrap, I have: class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initSession() { Zend_Session::start(); $session = new Zend_Session_Namespace(); } Now how can i access to the session data in the other Controllers? How do you handle this in your ZF appliactions? Please let me know. Thanks in advance, -behzad
Re: [fw-general] why Zend_Db_Adapter happened to be much slower than mysql_query
Which adapter are you using? Mysqli or Pdo_Mysql? The only thing that perhaps I see that is an immediate difference is that you are using quote() that does userland quoting in some instances (depending on the adapter you are using). Multiply that by 1000 and perhaps that might be where you are getting the discrepancy. -ralph On 1/27/11 4:23 AM, Oleg_201080 wrote: I need to insert multiple records and I found that Zend_Db suprisingly slower thatn my_sql query (several times), that made me think I did something wrong. Here are two examples. I have a tables subscribers and I try to insert many rows in it. With Zend_Db_Adapter it took 14.8 seconds to insert 1 rows in subscribers tables. $startTime = microtime(true); $db = Zend_Db_Table::getDefaultAdapter(); $db-beginTransaction(); $dateAdded = date('Y-m-d H:i:s'); $lastChanged = $dateAdded; foreach ($importDataNamespace-data as $subscriberNum = $subscriber) { foreach ($fieldsMap as $fieldNumber = $fieldTag) { if (isset($subscriber[$fieldNumber])) { $subscriberData[$fieldTag] = $subscriber[$fieldNumber]; } else { $subscriberData[$fieldTag] = ''; } } $query = 'INSERT INTO subscribers (list_id, account_id, email_address, first_name, last_name, date_added, last_changed) ' . 'VALUES (' . 52 . ', ' . 29 . ', ' . $db-quote($subscriberData['EMAIL']) . ', ' . $db-quote($subscriberData['FNAME']) . ', ' . $db-quote($subscriberData['LNAME']) . ', ' . $db-quote($dateAdded) . ', ' . $db-quote($lastChanged) . ')'; $db-query($query); } $db-commit(); $this-view-time = microtime(true) - $startTime; With mysql_query it took 3.8 seconds: $startTime = microtime(true); $user = 'root'; $password = 'password'; $db = 'database'; $connect = @mysql_connect('localhost',$user,$password) or die(Failed to connect database); @mysql_select_db($db) or die(Failed to select database); $dateAdded = date('Y-m-d H:i:s'); $lastChanged = $dateAdded; $result = mysql_query('SET autocommit = 0'); foreach ($importDataNamespace-data as $subscriberNum = $subscriber) { foreach ($fieldsMap as $fieldNumber = $fieldTag) { if (isset($subscriber[$fieldNumber])) { $subscriberData[$fieldTag] = $subscriber[$fieldNumber]; } else { $subscriberData[$fieldTag] = ''; } } $query = 'INSERT INTO subscribers (list_id, account_id, email_address, first_name, last_name, date_added, last_changed) ' . 'VALUES (' . 52 . ', ' . 29 . ', \'' . mysql_real_escape_string($subscriberData['EMAIL']) . '\', \'' . mysql_real_escape_string($subscriberData['FNAME']) . '\', \'' . mysql_real_escape_string($subscriberData['LNAME']) . '\', \'' . $dateAdded . '\', \'' . $lastChanged . '\')'; mysql_query($query); } $result = mysql_query('SET autocommit = 1'); $result = mysql_query('COMMIT;'); $this-view-time = microtime(true) - $startTime;
Re: [fw-general] Does everyone use zf.sh?
Hey Jurian, Zend_Tool is in exactly the state you describe. It's main purpose is project creation and immediate prototyping. Beyond the basics, there is/has been too much variation to be able to successfully model all developers workflows. 1) Not able to use with existing projects (scan files and add to xml) This is one of those big TODO's. It's not simple as the tool has to be able to find out the context of every file in a project if possible. THat means some kind of really smart scanner. It's not impossible to create, but it is a challenge. 2) Not able to delete objects (and remove from xml) This is also challenging, but mostly done. While the actions for delete() are not in the provider, we did add interactivity support some releases ago. This is important b/c if you were to run a delete command, it should prompt you to ask you if you are sure you want to to delete it. 3) Not able to configure base classes (e.g. My_Controller_Action instead of Zend_Controller_Action, same for forms). This and other project specific configurations are also on the TODO. I'd love to have a Doctrine (esp. for migrations) integration and a deployment tool. Both were proposed at the wiki (for deployment Zend_Build is proposed) but they aren't finished. An integrated deployment tool would ease the process of testing, staging and production environments. Since Doctrine 2 just went out the door, we'll look into what it will take to make the doctrine cli work with zf's cli. Perhaps when ZF2 reaches a stable state, the proposals can be developed further. I'm willing to support the development of these tools. Regards, Jurian
Re: [fw-general] Does everyone use zf.sh?
Hey koji, Recently I used zf command(zf.sh), but it's hard to use. I guess you mean that it doesn't have all the features you'd like :) I think that usually something like controller class have their parent class custmized for each project or company. But the class files generated from zf command extend Zend_Controller_Action. I need to fix it. Form and DbTable are as well. It does lack some project specific customizations, this is on the TODO. See my full list in the response to Jurian. I think there is no need to use zf command. I'm using code generator I made. It has customizable skelton file. You should have a look at Zend_CodeGenerator. THis is a stand alone component that does non-template generation of object oriented assets like files/classes/methodsproperties/etc. It might reduce the amount of work in your toolset. -ralph
Re: [fw-general] Error handling in Zend
Hey Jeremy, Ultimately, it all depends on what kind of exceptions are thrown, where they are thrown, and how the framework is setup to handle them. There's lot of moving parts, and a default application already takes care of them form you for the most part. Out of the box, the Front Controller is set to NOT throw exceptions. Instead, it catches any exceptions thrown during dispatch, stores them in the response object, and forwards the dispatch loop to the ErrorHandler/ErrorController (which is on by default). Furthermore, while you are in 'development mode' (as setup by your index.php, typically by an environment variable), your application will instruct the ErrorController to display exceptions, you'll see this line in your application.ini: resources.frontController.params.displayExceptions = 1 which is overriding the default from production which is false. I would suggest sticking with the initial project structure and default values in all honesty. The setup is quite good, and very informative when there are errors occurring. So lets look at where exceptions are thrown: [index.php is hit] $application is created. $application-bootstrap() is run. * exceptions can be thrown here form any resource that could not be setup either by configuration (resource.* values) or by Bootstrap::_init*() methods. Either way, you can't trust you have any part of your application setup, in this case, this is beyond a 500 error. These types of exceptions should never be thrown in production anyway. If you are getting exceptions from bootstrapping, you need to take care of the problem sooner. $application-run() is called. * This effectively is Zend_Controller_Front::getInstance()-run(); For all intents and purposes, any exception thrown here is a 500 or 404 error, and generally can be handled by ErrorController. * The only exceptions that make it hard to display a full page would be exceptions thrown FROM the ErrorController, or exceptions throw FROM the Layout. As you can see, if neither of those are in good working order, it's hard to use them to build a page. If you want to use a try/catch block in your index.php, I would use it only on the -bootstrap() call of the $application, not run() as nothing will be emitted. If you insist on throwing exceptions and catching them in the index.php, add this value to you application.ini: resources.frontcontroller.throwExceptions = 1 Hope all that helps, Ralph Schindler On 12/15/10 3:43 PM, jalexander3 wrote: Hello, I have read about the ErrorController that comes standard with the framework. It seems to only handle certain errors pertaining to missing MVC components--that's fine, I can use that. However, for my purposes I think I need a better understanding of URL rewriting and how the framework works in general. Anyway, here is what I have done in terms of error handling. It's pretty simplistic. My application entry point is wrapped in a try-catch. When an exception pops anywhere in the application, I run a couple of procedures that then send an email and log the message, etc. /* Wrap the entire application in an error handler*/ try { $application-bootstrap() -run(); } catch (Exception $e) { require_once 'ErrorHandler.php'; HandleException($e); } What I really want to do is just pop a jquery dialog box on the page that pops the error (or the previous page if there is something like a 404 error). In order to do this I am trying the following: catch (Exception $e) { //require_once 'ErrorHandler.php'; //HandleException($e); /* Get the current layout and relocate to it, passing a flag to display the error dialog */ $currentLayout=$application-getBootstrap()-getResource('layout')-getLayoutPath(); header('Location: ' . $currentLayout . '?action=error'); } The problem is, I don't understand enough about what is going on behind the scenes. $currentLayout points to the layouts directory. The querystring is lost as http://localhost/TAW/application/layouts?action=error; then points back to a valid page. At the end of the day, it doesn't make sense to point back to a valid page...I would probably point to an error page that utilizes a defined layout. But in any case, I still need to maintain that querystring. Does anyone have any thoughts about this entire process? Some best practices? Or more specifically, how to resolve the issue I am having concerning the querystring? Much appreciated! Jeremy
Re: [fw-general] Re: Keeping .zfproject.xml up to date with Zend_Tool
That feature has still yet to be completed. Effectively, you are talking about a tool that will scan existing application assets, determine their context (is it a controller, model, etc?) and then write a new zfproject.xml file. Not an easy task. But, since Zend_Tool has become so stable, these kind of features are high priority for ZF2. -ralph On 11/29/10 8:21 PM, stevebor1 wrote: I too am looking for that feature. I've deleted so many controllers/views and they are all still listed in my xml. On a side note, I deleted my xml once on a large project, and there was not way to recreate the xml from the existing project.
Re: [fw-general] Intermittent Subversion Server Problems
This has been fixed now, can you please try it? -ralph On 11/29/10 12:34 PM, brent wrote: Ever since Friday last week I've been having intermittent problems doing checkouts and updates from the ZF Subversion server. Sometimes a checkout will work and other times I get an error like the one below. Anyone have any ideas why this started happening? [bthei...@app01 ~]$ svn co http://framework.zend.com/svn/framework/standard/tags/release-1.11.0/library/Zend Zend svn: PROPFIND request failed on '/' svn: PROPFIND of '/': 200 OK (http://framework.zend.com) [bthei...@app01 ~]$ svn --version svn, version 1.4.2 (r22196) compiled Aug 10 2009, 17:54:46 Copyright (C) 2000-2006 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) modules are available: * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol. - handles 'http' scheme - handles 'https' scheme * ra_svn : Module for accessing a repository using the svn network protocol. - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme [bthei...@app01 ~]$ uname -a Linux app01 2.6.24-24-xen #1 SMP Tue Aug 18 18:15:39 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux [bthei...@app01 ~]$ cat /etc/redhat-release CentOS release 5.4 (Final)
Re: [fw-general] ZFApp?
Hey Mike, This was not released today.. I think when it was converted to google documents powerpoint/slidedeck format, the current date was injected into every slide. Fact of the matter is that this is VERY old.. probably based on Zend Framework 1.0 or 1.5, sometime between 2006 and 2008ish. Most of the assertions made by this slidedeck have been invalidated by Zend_Application, Zend_Tool, and countless other components that have been made part of the current Zend Framework. So, to answer your question, ... there is nothing more about it :) -ralph On 11/24/10 10:28 AM, Mike A wrote: Saw this released today: http://docs.google.com/viewer?a=vq=cache:852AJoQlyHoJ:framework.zend.com/svn/framework/laboratory/Primitus/docs/ZFApp-preview-intro.ppt+zend+error+controller+parametershl=enpid=blsrcid=ADGEESjwuKIVWrhgEs_SEFJB6F2poaLjt_l3H-o8tnv1_AaaVeDzuo7J7gYJgz97onrp-GFiL7e019bJ1B6xbA7cEQroYLhsG9g7ieUS1BHkKq3iyOk0glLsIVXej2utrq0wB83XrPT5sig=AHIEtbTIb9e9Adqg98X_nu8Qxrei7Cadqw It seems to come from Zend labs but I do not see it listed in http://framework.zend.com/svn/framework/laboratory/. Interesting stuff - is there more about it? Mike A.
[fw-general] Announcing the November 2010 Zend Framework Bug-Hunt
Reprinted from http://dz.zend.com/a/12785 For those who haven't put the reoccurring event in their calendar, this announcement is for you: Zend Framework Monthly Bug-hunt is here again! This *Thursday*, *Friday* and *Saturday* of November (the 18th, 19th and 20th 2010), we'll be hosting our monthly bug hunt. For those of you unfamiliar with the event, each month, we organize the community to help reduce the number of open issues reported against the framework. This is an important bug-hunt for us. As you might be aware, we released our final minor point release in the past month: Zend Framework 1.11 (and ZF 1.11.x README). This means that this branch will be the final release branch of the 1.x series. So help us make this release branch rock solid by closing as many issues as we can in this up-coming bug-hunt! All in all, bug hunt days have helped us close 100's of issues in Zend Framework since their inception. These bug hunts have proved vital to keeping up the bug squashing momentum in this project. So, whether they are big bugs or small bugs, remember this: all bugs worthy of being squashed. Not convinced you should join in yet? Here are some more reasons: * Improve your coding skillz by being around some of PHP's top developers in #zftalk.dev while hunting for bugs. * Win *THE* Zend Framework t-shirt -- the individual who resolves or assists in resolving the most issues wins a Zend Framework t-shirt! (This is the same t-shirt so many people were asking for at ZendCon 2010 worn by Matthew and Ralph during the ZF2 live talk.) * Help improve the overall quality of the code you're already using. * Fix issues that have been affecting you. * Save you and your company time spent managing your own patches to ZF, and move the maintenance upstream by patching the framework itself. * Learn valuable Quality Assurance skills. * All the cool kids are doing it. Are you cool? If you want to help out, please make sure you have a CLA on file with us, and then join us in the #zftalk.dev channel on Freenode on Thursday, Friday, Saturday. If you would like more information on specifics of participating, read our guide. Looking forward to seeing you at this month's Bug Hunt Days! Cheers! Ralph Schindler [links] * http://framework.zend.com/download/latest * http://framework.zend.com/svn/framework/standard/branches/release-1.11/README.txt * http://framework.zend.com/cla * http://zftalk.com/ * http://framework.zend.com/wiki/display/ZFDEV/Monthly+Bug+Hunt+Days
Re: [fw-general] Zend_Acl 1.11 broken my code
Hi All, I've uploaded a patch to Zend_Acl that covers this use case while being completely backwards compatible. I'd really like to see everyone test this so we can feel good about including it ASAP. Issue: http://framework.zend.com/issues/browse/ZF-10649 Patch: http://framework.zend.com/issues/secure/attachment/13431/ZF-10649.patch -ralph On 11/11/10 6:50 PM, Terre Porter wrote: So I've taken a look since this problem affected my code also. If I understand the problem correctly would it not be better to just adjust the isAllowed code to support the changes to the setRule? if (null !== $resource) { // keep track of originally called resource $this-_isAllowedResource = $resource; $resource = $this-get($resource); if (!$this-_isAllowedResource instanceof Zend_Acl_Resource_Interface) { $this-_isAllowedResource = $resource; } // if resource is null, and resources exist then add them instead } elseif ($resource === null count($this-_resources) 0) { foreach (array_keys($this-_resources) as $k = $v ) { if (null !== ($result = $this-isAllowed($role, $v, $privilege))) { return $result; }; } } The follow now works as expected. $acl = new Zend_Acl(); $acl-addRole(new Zend_Acl_Role('role')); $acl-addResource(new Zend_Acl_Resource('res')); $acl-allow('role','res', 'privilege'); echo $acl-isAllowed('role','res','privilege')? allowed : denied; // returns allowed $acl-removeAllow('role',null,'privilege'); echo $acl-isAllowed('role',null,'privilege')? allowed : denied; // returns denied And the second code $acl = new Zend_Acl(); $acl-addRole(new Zend_Acl_Role('role')); $acl-addResource(new Zend_Acl_Resource('res')); $acl-allow('role'); echo $acl-isAllowed('administrator') ? allowed : denied; // returns allowed Would be the same as : (since null resource is all defined resources) $acl-allow('role', 'res'); echo $acl-isAllowed('administrator') ? allowed : denied; // returns allowed Hope that helps. Terre -Original Message- From: Ralph Schindler [mailto:ralph.schind...@zend.com] Sent: Thursday, November 11, 2010 12:50 PM To: fw-general@lists.zend.com Subject: Re: [fw-general] Zend_Acl 1.11 broken my code I've been looking at this over the past day and I am attempting to find a solution. As you can see it was a fix for a previous issue: http://framework.zend.com/issues/browse/ZF-9643 Fixing the previous issue did not break any existing unit tests. I will get to the bottom of it and figure out a solution that works for everyone. -ralph On 11/11/10 12:32 AM, Valentin wrote: Hi, I'm impressed, is exactly the problem reported at bug http://framework.zend.com/issues/browse/ZF-10649 Thanxx 2010/11/10 Emmanuel Boutongot...@gmail.com Hi, A bug has been created for that : http://framework.zend.com/issues/browse/ZF-10649 I suggest you to vote for its fix ;) Manu 2010/11/10 Valentinvalen...@valclip.com Hi, New version 1.11 have only one change in Zend_Acl line 636: Old line $resources = array($resources); change for this $resources = ($resources == null count($this-_resources) 0) ? array_keys($this-_resources) : array($resources); I've been studying (and debug) all day and how it affects the code and not understand what happens. Any ideas? Thanks
Re: [fw-general] Zend_Acl 1.11 broken my code
I've been looking at this over the past day and I am attempting to find a solution. As you can see it was a fix for a previous issue: http://framework.zend.com/issues/browse/ZF-9643 Fixing the previous issue did not break any existing unit tests. I will get to the bottom of it and figure out a solution that works for everyone. -ralph On 11/11/10 12:32 AM, Valentin wrote: Hi, I'm impressed, is exactly the problem reported at bug http://framework.zend.com/issues/browse/ZF-10649 Thanxx 2010/11/10 Emmanuel Boutongot...@gmail.com Hi, A bug has been created for that : http://framework.zend.com/issues/browse/ZF-10649 I suggest you to vote for its fix ;) Manu 2010/11/10 Valentinvalen...@valclip.com Hi, New version 1.11 have only one change in Zend_Acl line 636: Old line $resources = array($resources); change for this $resources = ($resources == null count($this-_resources) 0) ? array_keys($this-_resources) : array($resources); I've been studying (and debug) all day and how it affects the code and not understand what happens. Any ideas? Thanks
Re: [fw-general] Auto discovering/loading project providers.
Hey Ellis, Can you try the 1.11RC1 that just came out? A patch to ensure this works was included in this release. Let me know if it meets your expectations. -ralph On 10/20/10 2:26 AM, ellis wrote: Hello, I'm trying to figure out how i can auto discover/load some project providers. IIRC, this is something that was disabled in 1.10. I don't see much benefit in project providers if they cant be operated without registering them in a user/enviroment config file, unrelated to the project. Btw, http://framework.zend.com/manual/en/zend.tool.framework.writing-providers.html is still saying that IncludePathLoader is used when registering providers, and not BasicLoader.
[fw-general] Status of Exceptions Milestone in ZF2
Hey All, We are coming to the end of the exceptions milestone of zf2, and I wanted to take a moment to see where everyone is on their contributions. The last ones on my plate are: Zend\CodeGenerator Zend\Reflection Zend\Session Zend\InfoCard (needs only to be merged) Zend\XmlRpc (needs only to be merged) The final two of that list I will merge last since there are a few lingering file name case translations which generally give me problems when attempting to merge in pull requests that have been branched after a file name case change. Here are the ones people have committed to that need a status update: Zend\Cache (Paul Katsande) Zend\Feed (Pádraic Brady) Zend\GData (?) Zend\Ldap (Andreas Heigl) Zend\Mail (Mickael Perraud) Zend\OAuth (Pádraic Brady) Zend\OpenId (Torio Farazdagi) Zend\Paginator (Wil Moore) Zend\Pdf (Alexander Veremyev) Zend\Queue (Torio Farazdagi) Zend\Test (Sascha-Oliver Prolic) If you feel like you cannot finish, let me know and I can either help or take it over. Zend\Service components, as per usual, that are not committed to will be on the chopping block for 2.0 as previously noted. The status document is located here: http://framework.zend.com/wiki/display/ZFDEV2/Milestone+Exceptions Thanks! -ralph
Re: [fw-general] Firefox - double request
I just wanted to add to this note Matthew pointed out.. This is the behavior of the stock rewrite rules that we suggest you use.. it is basically a catch all rewrite. It probably looks like this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] That basically states that if the request file does not exist on the filesystem, then index.php (ZF Framework Entry point) should handle it. A better RewriteRule might be: RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php [NC,L] Where the rewrite rule will exclude paths that have those file suffixes. So, in a nutshell, this has very little to do with ZF, more to do with the rewrite rule you decide to employ. Our default (created with Zend_Tool), is all encompassing. --ralph On 10/12/10 2:39 PM, Matthew Weier O'Phinney wrote: -- debussy007debussy...@gmail.com wrote (on Tuesday, 12 October 2010, 11:05 AM -0700): I have a very strange error with my ZF application. Firefox create two requests when a specific action is being called. Nor Chrome nor Opera do this. I tested it just by logging the actions called. What a very odd error ... I also noticed that I have this behaviour when I am fetching cache files, but anyway this is server side, shouldn't make any difference but seems it does ... Anyone can help me debug this error ? I am clueless on this one Make sure you have a favicon.ico file, and/or a rewrite rule that will resolve it. ZF is configured to act as a 404 handler by default, meaning that calls to favicon.ico by your browser hit your page as well. Additionally, since you say it's FF specific, you may want to check what debugging extensions you have enabled; one of them may be making a second request to get metadata and other information.
Re: [fw-general] Re: Select object behaviour
What is intuitive to all though? Since Zend_Db is an abstraction layer around various vendor databases, it has to encapsulate the general perspective of all the database targets. Since LIMIT in SQL is far from standardized, and since no predominant understanding of LIMIT across all databases.. there can be no intuitive solution for everyone. When we talk about LIMIT, we are generally talking from a MySQL perspective. Other database developers know this feature as FETCH FIRST, TOP n, and for the unfortunate of developers, the (IMO) dreadful sub-select paginator (MSSQL). I think if BC weren't an issue, limit(0) should probably throw an exception. The userland caller should know better. -ralph On 10/5/10 8:56 AM, Hector Virgen wrote: So zero equals infinity? Interesting... But with ZF being object-oriented, I think we can expect more intuitive behavior. -- Hector Virgen Sent from my Droid X On Oct 5, 2010 4:56 AM, David Muir davidkmuir+z...@gmail.comdavidkmuir%2bz...@gmail.com wrote:
Re: [fw-general] Re: Select object behaviour
Right, but currently, people rely on this behavior. Not b/c they believe that limit(0) should return Zero rows, but because in our loosely-typed world, limit(null) or limit(false) means return everything. Unfortunately, limit() current casts everything to an integer, so someone calling limit(null) is the same as calling limit(0). limit(null) semantically DOES look like don't set a limit, and that would be the BC break here. Trust me, I understand the argument both ways, and I see the bad behavior in the current implementation.. but I think we have our hands tied here until ZF2 which is right around the corner. Since there is an easy userland workaround for this (to those who see it as bad behavior.. (the if($count 0) { $select-limit($count) } trick), I think waiting on a fix to this is the right path. Cheers, -ralph On 10/5/10 9:35 AM, Hector Virgen wrote: FETCH FIRST 0... SELECT TOP 0... SELECT... LIMIT 0 I'm having trouble believing that anyone would expect more than zero rows to be returned. I agree with you about throwing an exception for limit zero, but since we can't have a BC break, the next best thing IMO would be to honor the developer's intentions as much as possible. -- Hector Virgen Sent from my Droid X
Re: [fw-general] Select object behaviour
There is some more discussion here: http://framework.zend.com/issues/browse/ZF-7666 I'd follow up on that thread. The problem is that LIMIT is not an SQL standard, and there is no standard approach. http://troels.arvin.dk/db/rdbms/#select-limit As such, our API in ZF1 needs to remain as consistent for possible for the main API. What I fail to see is why this cannot be implemented in userland? Instead of: $select-from()- -limit($limit); You dont just use: $select-from()- ; if (is_int($limit) $limit 0) { $select-limit(0); } Doesn't that (semantically) make more sense? -ralph On 10/4/10 9:43 AM, Daniel Latter wrote: not yet, will do later. Daniel On 4 October 2010 15:42, Hector Virgendjvir...@gmail.com wrote: I agree; iterating over a limit 0 result set should result in no more than 0 iterations. Have you filed a bug report? -- Hector Virgen Sent from my Droid X On Oct 4, 2010 2:17 AM, Daniel Latterdan.lat...@gmail.com wrote: what i meant was if you do happen to pass a zero to the limit method, then say loop over the (possibly millions of rows it will return) returned rows, couldn't this potentially bring down a server? Daniel. 2010/10/3 Valeriy Yatskod...@design.ru Good day Yes, but it doesnt seem right to assume someones app will have the same amount or rows that is equesl to the max integer the os can hold? You really have table larger than 2 000 000 000 entries on 32-bit servers? :) Let's see... int = 4 bytes on 32 bit systems: 2 000 000 000 x 4 = 8 000 000 000 = ~ 8 gb minimum per table :) Let's add here at least varchar(255): 2 000 000 000 x (4 + 255) = 518 000 000 000 = ~ 518 gb per table :) Try to search some data through this table. :) There are some architecture solutions for this, like splitting tables into smaller (or shards). -- Валерий Яцко __ d...@design.ru | http://www.artlebedev.ru
Re: [fw-general] Status (or any known limitations/problems) with Ms sql and zend_db
In the past 1.5 years, we've added support for Sql Server 2005+ via the Micrsoft driver Sqlsrv. More information on that here: http://msdn.microsoft.com/en-us/library/ee229551%28v=SQL.10%29.aspx This is a stable production ready driver that utilizes the Microsoft Native Client to communicate from PHP to SQL Server. Of course, I assume that your program will be running on PHP on windows talking to an SQL Server. The driver is available in Zend Server and in the Microsoft Web Tools Platform installer. If you are planning on running the application from a *nix server, talking to MS SQL Server, then things will get a bit hairier. -ralph On 9/24/10 5:06 PM, robert mena wrote: Hi, I am about to start a new project that will involve access a Microsoft Sql server 2005 (if I recall correctly). Since I plan to do it using Zend_Db I'd like to know if there are any know problems, limitations or special points that I should be aware of while using the driver from zend_db.
Re: [fw-general] Committing to milestones branch
As far as I know, you can make the pull request and I'll still get it. What I suggest is that you put a message in there that refers to the branch of milestones/exceptions. There are not alot of pull requests coming in currently, so it is easy enough to see what is what. Thanks! Ralph On 9/24/10 7:47 AM, Michael Ridgway wrote: There is currently a bug in Github's pull request system that doesn't allow us to make a request using the milestone/exception branch as a base: http://support.github.com/discussions/repos/4165-bug-in-pull-request-base-selection Is there another option that we have until this is fixed? - Michael Ridgway On Fri, Sep 24, 2010 at 8:43 AM, Matthew Weier O'Phinney matt...@zend.comwrote: -- Daniel Latterdan.lat...@gmail.com wrote (on Friday, 24 September 2010, 09:12 AM +0100): I have made the amendments you suggested. Sorry to say I only scan read the post you linked to the other day on zfdev so im gonna read that properly tonight :) I am using Git Bash for windows with Github as my remote repo. I currently have all the changes in a separate branch of my master zf2 branch (forked from zendFramework). Should I commit my changes to milestones/exceptions branch on Github? If so how do I commit to a branch on Github using Git Bash, cant seem to get do it? No -- issue a pull request to the zendframework/zf2 repo, indicating the milestones/exceptions branch. Ralph will then review, merge, and push. Thanks in advance! -- Matthew Weier O'Phinney Project Lead| matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
Re: [fw-general] Template Fall Back
Can you explain in a bit more detail what you are attempting to accomplish (or see accomplished?) Given what you are asking, it seems like you are talking about default template in behavior and/or automatically selected view scripts? If you are talking themes, that is more of a concern for your application layer code to somehow solve. -ralph On 9/24/10 10:23 AM, ZED MASTER wrote: Hi, Is there any implementation of Template Fall Back to Zend Framework? Or any library for PHP (using in ZF)? Thanks Zed
Re: [fw-general] query the database. Uhh..where do those go?
Hey Shawn, Now I would like to query the database to return specific data. For a simple example SELECT comment, email FROM Guestbook; Where would that go? The controller?, or the Mapper models/guestbookMapper.php, The model maybe? It's ok, common question. Your answer? It depends. If you have a 2 tier application that is just built with a controller like layer and a view like layer. Then it goes in the controller. That's generally not the case though. What you have in the guestbook application is a standard, yet, lightweight 3 tier MVC application. V C you know, but M is the model. This is a conceptual layer of code best describe by what its NOT. It's not environment specific (like the controller), and it does not handle representation or interface concerns (like the view). It's the model: where any environment agnostic / interface agnostic code would go. It's called the model b/c you are modeling your business processes, or a better word would be domain logic. Since your domain is made of data... and this data needs to be persisted.. persistence of the data becomes a problem of the model. Since the classic persistence mechanism is a relational database, which you utilize SQL to interact with the database, this would mean your SQL belongs in your model.. somewhere. Where exactly is another subject that is completely dependent on the patterns you decide to employ. In our example, we employ a mapper approach. http://martinfowler.com/eaaCatalog/dataMapper.html This can be used in conjunction with a domain model http://martinfowler.com/eaaCatalog/domainModel.html and these domain models can be found via a service layer http://martinfowler.com/eaaCatalog/serviceLayer.html your service layer can employ the use of an identity map to ensure it doesn't duplicate objects during a request http://martinfowler.com/eaaCatalog/identityMap.html but you might also decide not to use SQL inside your mapper and instead utilize Zend_Db_Table, our db table gateway and row gateway solutions. http://martinfowler.com/eaaCatalog/tableDataGateway.html http://martinfowler.com/eaaCatalog/rowDataGateway.html BTW, active record is also one such persistence solution that also, generally, also mergers its concerns with the domain model and service layer: http://martinfowler.com/eaaCatalog/activeRecord.html .. in your controller, you might want to convert your models to either an array of data, or a value object (also known in some circles as a data access object) http://martinfowler.com/eaaCatalog/valueObject.html http://en.wikipedia.org/wiki/Data_access_object Ultimately, your SQL goes in the model layer. There are enough links and terms above though so you can start educating yourself on the variety of patterns that are employed in building applications great and small. Try searching the mailing list for modeling, you'll get some interesting discussions. -ralph
Re: [fw-general] Best way to pass an array between two actions
Hey debussy007, I am not sure what you mean by doing something wrong. If the data is not being passed, you might want to try gotoSimpleAndExit(). This will force a redirect immediately, which is probably what you want. $bookings needs to be something that can be represented in a url. As for the other issue, if you need to pass information between requests, you should look into using Zend_Session or some equivalent.. that is what it is there for. -ralph On 9/21/10 12:58 PM, debussy007 wrote: Hi, I need to pass an array between two actions. Below is the code I tried : in action 1 : return $this-_redirector-gotoSimple('time-slots', NULL , NULL, array('bookings' = $bookings)); in action 2 (timeSlotsAction) : $bookings = $this-_getParam('bookings'); Unfortunately this won't work. I am doing something wrong. So I thought I should serialize the array but I am afraid that the serialized output will be to big for a GET param. Thank you for any help !!
Re: [fw-general] Zend_Auth storing special characters
I've not seen this before, although I don't think i've had that situation before either.. Can you create a small reproduction script? -ralph On 9/15/10 9:47 AM, keith Pope wrote: Hi, Has anyone ever had any problems with Zend_Auth failing to store/serialize data that has ü etc in. I seem to be losing the auth session for all users with names containing utf-8 chars Thx Keith
[fw-general] Monthly Bughunt Days Starts NOW!
Hey all, announcing the bug hunt for this month! ** Special Note: As of this month, there will be no more 1.10.x series releases. As such, there is no need to merge any commits from trunk to the release-1.10 branch. Our next major release will be 1.11.0. ** Taken from: http://dz.zend.com/a/12576 Yep, it's the third week of the month again- and you know what that means: Zend Framework Monthly Bughunt! Today, Tomorrow and Saturday of September (the 16th, 17th and 18th 2010), we'll be hosting our monthly bug hunt. For those of you unfamiliar with the event, each month, we organize the community to help reduce the number of open issues reported against the framework. Last month 28 issues were closed in 3 days. Ramon Henrique Ornelas brought home the victory. This is a back to back win for him as he was one of the 1st place developers during the month of July. Thanks again Ramon, for your hard work! All in all, bug hunt days have helped us close 100's of issues in Zend Framework since their inception. These bug hunts have proved vital to keeping up the bug squashing momentum in this project. So, whether they are big bugs or small bugs, remember this: all bugs worthy of being squashed. Not convinced you should join in yet? Here are some more reasons: * Improve your coding skillz by being around some of PHP's top developers in #zftalk.dev while hunting for bugs. * Win a t-shirt -- the individual who resolves or assists in resolving the most issues wins a Zend Framework t-shirt! * Help improve the overall quality of the code you're already using. * Fix issues that have been affecting you. * Save you and your company time spent managing your own patches to ZF, and move the maintenance upstream by patching the framework itself. * Learn valuable Quality Assurance skills. * All the cool kids are doing it. Are you cool? If you want to help out, please make sure you have a CLA on file with us, and then join us in the #zftalk.dev channel on Freenode on Thursday, Friday, Saturday. If you would like more information on specifics of participating, read our guide. Looking forward to seeing you at this month's Bug Hunt Days! --- -ralph
Re: [fw-general] ZF2: Community Involvement in the Next Major Milestone
Hey Paul, Have you filled out the CLA and have a Jira account? If not, thats the place to start. After that, checkout the git documentation to understand how to get up and running with the ZF2 repository: http://github.com/zendframework/zf2/blob/master/README-GIT.txt As for Cache, I don't believe anyone has claimed it yet.. to be sure, you should join #zftalk.dev on IRC and check with the various developers in there. Let me know if that helps you get started! -ralph On 9/13/10 8:37 AM, Paul Katsande wrote: Hi Ralph, I would like to have a go at the Cache component to start off with, if no one is working on it. Not having contributed before (but I having used ZF extensively), do I need approval to start work on this or do I just jump in? Paul -- katsande.com http://katsande.com He who thinks little errs much - Leonardo Da Vinci
Re: [fw-general] ZF2: Community Involvement in the Next Major Milestone
Hey Daniel, You should log into #zftalk.dev today so we can discuss, I know that the MVC component will be going through some re-factoring soon and I'd like to coordinate your effort with matthew's. If you cannot make it into IRC, I'll ask Matthew which parts he feels you can work on without worry that your work wont be dismissed as part of a larger ongoing effort. -ralph On 9/10/10 2:12 PM, Daniel Latter wrote: I'd like to do the view section if that's any help? Keen to get involved, let me know what I have to do. Daniel. On Friday, September 10, 2010, Wil Moore IIIwil.mo...@wilmoore.com wrote: Ralph Schindler-2 wrote: Either reply to this email thread or fine me in #zftalk.dev to discuss what component you'd like to work on. As mentioned via IRC, I'll take on Uri, Rest\Route, and Pagination. Wanted to post here in case people want to know what is already being worked on. Ralph, should those interested expect to see the finished example (Zend\Authentication) at this point or is that still to come? - -- Wil Moore III Why is Bottom-posting better than Top-posting: http://www.caliburn.nl/topposting.html -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-Community-Involvement-in-the-Next-Major-Milestone-tp2533454p2534740.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Re: Troubles with login
Try now. I've set to active. -ralph On 9/13/10 9:43 AM, Maurício Meneghini Fauth wrote: Hi, I've had the same problems that Carlos had. I've tried to reset my password, but I could not. I think maybe my account could be inactive. Thanks 2010/9/13 Carlos Medinadeve...@simply-networks.de: Am 11.09.2010 05:19, schrieb mauriciofauth: The same is happening with me. Hi Mauricio, try to reset your password. Here the link to reset your password http://framework.zend.com/crowd/console/forgottenpassword!default.action If doesnt work, contact the list for reseting your account because maybe is deactivate Regards Carlos
[fw-general] ZF2: Community Involvement in the Next Major Milestone
Hey all! We are moving into development on our next major milestone in ZF2 and as such, we are looking for your help. This milestone focuses on converting the existing exception code to the new set of standards. These standards are discussed in the following proposal by Matthew: * http://framework.zend.com/wiki/display/ZFDEV2/Proposal+for+Exceptions+in+ZF2 To see the overall goals for this milestone, you can consult the ZF2 Milestones document: * http://framework.zend.com/wiki/display/ZFDEV2/Zend+Framework+2.0+Milestones#ZendFramework2.0Milestones-Milestone%3AExceptions So what is there for you to do? I've gone through and refactored Zend\Authentication to conform to the new Exception standards and expectation. I will be moving onto Zend\AccessControl next and both it and Authentication can act as a blueprint for rest of the components. All work is being done inside the milestones/exceptions branch for this milestone. If you are interested in jumping into ZF2 development, now is a good time to start coding and getting familiar with the code base. Either reply to this email thread or fine me in #zftalk.dev to discuss what component you'd like to work on. Thanks Happy ZF(2)ing! -ralph -- Ralph Schindler Software Engineer | ralph.schind...@zend.com Zend Framework| http://framework.zend.com/
Re: [fw-general] Troubles with login
Hi Carlos, Your account was marked in-active. This happens sometimes and I am unsure what causes it. In any case, I've marked it as active again, please try to see if it works for you- -ralph On 9/7/10 1:05 AM, Carlos Medina wrote: Hi Matthew, the i have reset my password three times but nothing happend. When i want to login the answer ist, username or password incorrect (over crowd the message is: invalid login). Mybe is my account not active (i dont know why).What can i do? Regards Carlos Am 05.09.2010 16:51, schrieb Matthew Weier O'Phinney: -- Carlos Medinadeve...@simply-networks.de wrote (on Sunday, 05 September 2010, 03:17 PM +0200): i have problems to login in the Jira Issue tracker or Wiki. The Failure message is: your username and password are incorrect - please try again. But at friday was ok. Please tell me where i can get help (reminder? etc?) You can get a password reset sent via this form: http://framework.zend.com/crowd/console/forgottenpassword!default.action
Re: [fw-general] Re: Guidance on storing passwords securely
It's always good to be extremely (perhaps even overly) concerned with security, particularly passwords when it comes to securing applications. There's a couple of thoughts I wanted to throw into this discussion that I think it is important to remember. * No implementation of computer security is ever full-proof The goal of security is not to build a completely impenetrable wall. To attempt to do that is futile because all walls are penetrable. The goal is to build a big enough wall such that invaders, with a realistic amount of resources, cannot intrude. Over time, the wall will need repairs and upgrades, this is a given. In computing, given enough time, computing power, advances in technology, and in some cases, enough desire, all security precautions can be defeated. * When hashing, choose a reasonably secure enough, yet supported method of hashing. That basically means don't try to create your own hashing scheme, and also, don't try to use a completely obscure hashing scheme. Wikipedia is good at discussing the strength and availability of a particular hashing scheme, and that is generally enough information to decide if a particular scheme is for you. This might include information on computation power needed to iterate, how prone it is to dictionary attack and if collisions can be found, and if so, how easily. * Salt each row. It doesn't matter where it's stored. I usually store the salt in the row with the password. The thing is, if they are keen enough to get your database, they are probably keen enough to get the code running the site- at this point, it doesn't really matter where things are stored, all of the ingredients are available. So, why salt each row? The best analogy is that since, in computers, building a wall is easy, the idea here is that instead of building a single wall around the city, we'll build walls of equals strength around each person. This means that basically if an attacker gains access to everything, they still need to start demolishing each wall that was built. In hash based security, attackers are typically going to use a dictionary attack. Generally, unless they have access to large amounts of computation power, they are not trying to crack the password, they are simply trying to find a way to reproduce the hash in your database. This is typically done via a dictionary attack. Now, since you've created a salt per user, instead of them caching the results of a single salt through the known algorithm and checking those results against all the hashs in your password table, they will need to do this process for each and every user since the salt per user is different. The difficulty basically went from: difficulty = computational resources * hash speed to difficulty = computational resources * hash speed * number of users As you can see, the difficulty went up linearly per user of the site that is added. This alone might sometimes prove as a deterrent to attackers when it comes to security. Another thing to remember, not that this is much of a consolation, is that at this point, the attacker has extrapolated a collision for the hashed password, there might be a good chance (depending on the algorithm used) that the source of this collision is not actually their password. And hopefully, their bank is using a different algorithm than you, so the source for this collision wont log the attacker into their bank account. -ralph On 8/31/10 7:39 AM, Peter Sharp wrote: I think that storing a per user salt and a site salt and using both in your password hashing scheme is about the best you can really do. If a hacker gets into your database in a way that allows them to reveal structure and uncover your salt value, then they still won’t be able to replicate the original password without knowing the site salt, which is stored in code, not the database (unless your site salt is too simple). If they can access code and database then all is lost anyway. But this fear that a hacker might be able to get the value for the user salt if it’s just in a column names salt in the user table is a little bit redundant really. If they can get the salt value, then they’ll pretty much be able to access everything else so they no longer really need your site at all. Why try to find the key when you’ve already busted down the door? Also, and I hate to say it, but if a user is for some reason using their banking password for any other public site, then they must wear the lions share of the responsibility if or when it is discovered and used by a malicious user. I mean, you have a role to play in the users security, but so do they. *From:* Hector Virgen [mailto:djvir...@gmail.com] *Sent:* Tuesday, 31 August 2010 3:56 PM *To:* Bill Karwin *Cc:* fw-general General *Subject:* Re: [fw-general] Re: Guidance on storing passwords securely Bill, do you have any concerns about hackers recovering the user's original (raw)
Re: [fw-general] Modular Application
Rafael, I am not sure what you are asking actually. Are you asking how to make an application modular aware? If that is the case, this is achieved by adding something like this to your application.ini file: resources.frontController.moduleDirectory = APPLICATION_PATH /modules resources.modules[] = If you are asking how to get a module specific ini file, that is not something that is provided by Zend_Application. This is something you can do on your own since you can do virtually anything you need inside the Module's bootstrapper. Paddy has a good writeup here on module specific configs as part of a larger article: http://blog.astrumfutura.com/archives/415-Self-Contained-Reusable-Zend-Framework-Modules-With-Standardised-Configurators.html You can also have a look at this: http://blog.vandenbos.org/2009/07/07/zend-framework-module-config/ Ultimately, the reason it's not explicitly supported is that the use cases for modular configuration are not well defined. Do you want to incur the cost of loading a config during bootstrap, or do you want to incur the cost only when the module is actually used? Those questions are only determined by the purpose of the module itself. Hope that helps, Ralph On 8/30/10 11:24 AM, Rafael wrote: Hello, I have been setting up an modular application however it is not clear in the manual how it is done.I've monted skeleton as in manual says, configured the module directory but it doesn't load application.ini from each module. Anyone knows how to load an application.ini from each module? Thanks
Re: [fw-general] ZF 2 and project structure
Interesting you bring this up. Currently, nothing like this has been decided yet. First we need to get the autoloading strategy in place, then beyond that start working on an MVC (Front Controller, View, Layout, etc) prototype. Personally, I've started favoring the former of what you suggested: Application/Controller/Index.php - Application\Controller\Index Over the years, I've come to dislike complex mappings and plural names. Plural names don't generally translate well in other languages.. also and the question ultimately becomes if the word is referring to the collection of things or the domain of the things. I've personally favored the latter since it is more explicit, requires no pluralization, and is generally easier to map when mapping is needed. For example: The user table vs. The users table The Controller directory vs. The controllers directory It is generally understood that a table is already a collection of rows, and a directory is a collection of files. The name thus referrers to the domain of the collection of things, hence the user. Also, when users is pluralized, it introduces the question of possessiveness. Singular, IMO, solves all those problems, and keeps a 1-1 conceptual mapping to all of the concepts involved. I know this could be argued either way, and I am sure people are pretty passionate about the scheme here. This I'm sure will be discussed more in the near future ;) My 2c submitted, -ralph On 8/30/10 11:34 AM, dbenjamin wrote: Hello, I have some question regarding project structure with ZF 2 and the namespaces. It seems that with ZF 2 you wish to keep the PEAR conventions where each part of a namespace corresponds to a node into directory structure. But even with ZF1, if we look at a default project structure, the ZF autoloader maps some basic namepaces to directories into the project, so it's not really PEAR-like, or we should have something like : Application/ Controller/ Index.php-- class Application_Controller_Index instead of : application/ controllers/ IndexController.php-- class IndexController I was wondering if you planned to keep going that way or planned to propose a new project structure which fit better with these conventions ? br, Benjamin.
Re: [fw-general] ZF 2 and project structure
Hi Yue, There is a milestone release of 2.0. Should you use it? I would not use it for a real application anytime soon.. 1.x is still the tried, tested, and truely stable release to use for app development. The API is and will be over the next few milestones a moving target. After it has been finalized we'll be working on migration tools and compatibility layers. More info on it here, including the current codebase as well as dev milestones and dev documents linked: http://devzone.zend.com/article/12385 Cheers, Ralph On 8/30/10 11:44 AM, Yue Yuanyuan wrote: do we have the download version of 2.0 now? When could it be available? If there are big changes, should I continue using 1.x? Thank you. On Mon, Aug 30, 2010 at 12:34 PM, dbenjamin bd.web...@gmail.com mailto:bd.web...@gmail.com wrote: Hello, I have some question regarding project structure with ZF 2 and the namespaces. It seems that with ZF 2 you wish to keep the PEAR conventions where each part of a namespace corresponds to a node into directory structure. But even with ZF1, if we look at a default project structure, the ZF autoloader maps some basic namepaces to directories into the project, so it's not really PEAR-like, or we should have something like : Application/ Controller/ Index.php -- class Application_Controller_Index instead of : application/ controllers/ IndexController.php -- class IndexController I was wondering if you planned to keep going that way or planned to propose a new project structure which fit better with these conventions ? br, Benjamin. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF-2-and-project-structure-tp2400401p2400401.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend Framework 1.10.8 Released
The Zend Framework team announces the immediate availability of Zend Framework 1.10.8, our eighth maintenance release in the 1.10 series. This release includes around 22 bug fixes. A special reminder to those users of Zend_Service_Twitter/code, please ensure you upgrade to 1.10.6, 1.10.7, or 1.10.8 ASAP. These releases introduce a change in the Zend_Service_Twitter API that enforces the use of OAuth by default when using methods that require authentication. The change was introduced to help prepare Zend Framework users for the Twitter OAuthcalypse scheduled in 6 days from now on August 31, 2010: http://techcrunch.com/2010/06/17/twitter-oauthcalypse-moved-to-august-thanks-to-the-world-cup/ For those that cannot upgrade, there are other ways to integrate Zend_Oauth with Zend_Service_Twitter: http://blog.astrumfutura.com/archives/411-Writing-A-Simple-Twitter-Client-Using-the-PHP-Zend-Frameworks-OAuth-Library-Zend_Oauth.html You may download ZF 1.10.8 from the Zend Framework site: http://framework.zend.com/download/latest For a full list of resolved issues, you can visit the changelog: http://framework.zend.com/changelog/1.10.8;http://framework.zend.com/changelog/1.10.8/a I'd like to thank everyone who contributed code to these releases, including those who submitted patches, translated documentation, or reported issues. Keep your eyes peeled for another maintenance release at the end of next month! -- Zend Framework 2.0 Dev Release We are actively working on ZF 2.0 at this time, and if you missed the announcement, our first milestone was reached when we tagged our first dev release. We continue to work hard and we encourage everyone to visit our roadmap for 2.0 to get a better understanding of the direction of the framework and plan out how you will become part of the ZF 2.0 effort. http://devzone.zend.com/article/12385-First-Development-Milestone-of-ZF-2.0-Released -- 1.11.0 Release Planned In related news, we are planning a 1.11.0 release for the end of September. This will incorporate bugfixes from the 1.10 series, updates and normalization to validator translation strings, and a variety of new features. So stay tuned! -Ralph Schindler -- Ralph Schindler Software Engineer | ralph.schind...@zend.com Zend Framework| http://framework.zend.com/
Re: [fw-general] Improve Zend_Application: moving out the stateless world
Hey Jurian, This is an interesting discussion, but the bigger question is: to what end? PHP (and other scripting languages) are largely successful b/c the conceptual application is completely encapsulated inside of a web request. This is also called a shared-nothing architecture. I have a post on this: http://ralphschindler.com/2010/05/06/phpundamentals-series-a-background-on-statics-part-1-on-statics It sounds like you want a persistent application stack like Java or .Net. This, in general, is not the PHP Way so to speak. Much of PHP's ability to scale horizontally on demand is much due to it's shared-nothing architecture. More notes inline: application instance into a session. My thoughts were it would only be necessary to run the app ($app-run();). The session is not a good place for putting a Zend\Application instance. Reason being is that all the expense of creating the objects that make up the Zend\App object graph are still gonna have to be serialized and unserialized on each request. So, you are basically trading __construct() on an object for a __wakeup() on an object to return it to its live state. This miserly failed because several files couldn't be loaded. I have not investigated it further, but it looks to me it'd pretty cool if it was possible. Yep.. That is b/c you have created a chicken-and-egg problem. The objects require application state to be set (like autoloaders and include_paht settings), but now you've serialized that state into the session. How do you expect to be able to load files when their autoloader is serialized with the objects you want ot unserialize. Is it an idea to look at Zend\Application for ZF2.0 to make this possible? It would save a lot of resource: complete configuration, loading of config files and so on are done once. I think the bigger question here is how can we speed up an application within the confines of PHP. I would say that right now we are doing just that. We've identified the slowest parts of ZF1 based applications as the autoloader, loading of files, and plugin loading. These key pieces are being benchmarked and prototyped to be as fast as possible in ZF2. Furthermore, I think we can look at how ZF2 based applications play with performance technologies like apc and zend optimizer to create a faster ZF2 based MVC application. Those are my thoughts off the top of my head. -ralph
Re: [fw-general] Cannot use object of type Zend_Session_Namespace as array
No, it sounds like you are actually using PHP 5.2.3. Are you sure it's PHP 5.2.10 (clean)? Can you provide a backtrace of th exception? This is one of the main reasons why the minimum version of PHP is 5.2.4. There was an issue in 5.2.3 with how handled nested arrays when using magic methods $_SESSION. -ralph robert mena wrote: I am facing the same problem. Zend 1.10.7 and PHP 5.2.10 (centos with backported patches). Any ideas? On Sun, Oct 4, 2009 at 1:04 PM, Ralph Schindler ralph.schind...@zend.com mailto:ralph.schind...@zend.com wrote: What version of Zend Framework and what version of PHP are you running? -ralph Jakobud wrote: I'm new to Zend, so I'm not sure if I'm doing anything wrong... Here is my test code: ? require_once(Zend/Loader.php); Zend_Loader::loadClass('Zend_Session'); Zend_Loader::loadClass('Zend_Session_Namespace'); Zend_Session::start(); $user = new Zend_Session_Namespace('user'); $user-id = 123; ? and my error: Fatal error: Cannot use object of type Zend_Session_Namespace as array in /.../ZendFramework/library/Zend/Session/Abstract.php on line 159 I found an old forum post from 2007 that mentions this error. Is this seriously still an outstanding bug after all this time? Or am I just doing something wrong?
Re: [fw-general] Errors persisting Doctrine 2 entity once user is logged in with Zend_Auth
I honestly cannot see how Zend_Auth is the issue here. To help debug the situation, you should try deleting the session files to ensure that your session is clean. As for your exception message, that is a tough one. The exception (by looking at the youtube video) appears to say that the problem originated in the $em-flush() call inside your indexAction(). Unfortunately, that exception message that you got is probably best answered on the Doctrine mailing list, as it originates from their code. Where do you think the stdClass being referred to is being generated from? -ralph jiewmeng wrote: i am having problems persisting a Doctrine 2 entity (Post) when the User is logged in with Zend_Auth. i am quite sure its the login as the code runs, when the user is logged out, and fails once the user is logged in. and it seems that the identity returned from the Zend_Auth::authenticate() plays a role in affecting the error message. ok my setup is as follows ... a clean zend framework app generated with zend tool - zend framework 1.10.7 - doctrine 2 - http://pastebin.com/rzSzNDVS bootstrap.php - bootstrapping doctrine autoloaders, config setup entity manager - http://pastebin.com/1F00Cw0q Application_Auth_Adapter - simply returns a very basic Zend_Auth_Result - http://pastebin.com/TgDRqzP7 IndexController - indexAction - where i try to insert a new post - loginAction - where i login with Zend_Auth - logoutAction - where i logout - http://pastebin.com/9r0VB5eP Application\Models\Post - the post model class - http://pastebin.com/c4FRM0QK Application\Models\User - the user model class when i return stdClass in authenticate() i will get an error message like A new entity was found through a relationship that was not configured to cascade persist operations: stdcl...@6ba9d69307857036. Explicitly persist the new entity or configure cascading persist operations on the relationship. return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, new StdClass); // notice the error msg reflects the class returned as the identity (2nd) parameter when i return a string, the error i get, A new entity was found through a relationship that was not configured to cascade persist operations: @. Explicitly persist the new entity or configure cascading persist operations on the relationship. when i return a Application\Models\Post, i get A new entity was found through a relationship that was not configured to cascade persist operations: application\models\u...@0aea1b5f28c32e2c. Explicitly persist the new entity or configure cascading persist operations on the relationship. how can i proceed from here? how do i debug this? for those who like to see a video of it in action (the error), i have it on http://screenr.com/1U0 screenr and http://www.youtube.com/watch?v=BeWKm74-4yM youtube (with annotations)
Re: [fw-general] String to Zend_Db_Select Object
This is not possible. For that to happen, you'd need an SQL parser/tokenizer, which there is not one in ZF. Moreover, the SQL you have is probably somewhat specific to a particular vendor implementation of SQL which, again, would make it really hard to build a parser/tokenizer that knows about these variances in SQL. There are only a few major parts that need to be really looked at, and for most cases, you can use Zend_Db_Expr to fill in parts where you do not want to parameterize them. (For example $select-where(new Zend_Db_Expr('a = 500 AND b LIKE FOO));) Why do you want to do this anyway? Do you need to be able to mutate your current query? If that is the case, then creating your query as a Zend_Db_Select might be worth it in the long run. -ralph Andrei Iarus wrote: Hello to all, Any ideas on how to cast/transform a string to an object of type Zend_Db_Select? Ideally, without rewriting it by hand. Thank you very much
Re: [fw-general] project planning
As Matthew pointed out, yes, the state of ZF2 is still very much a work in progress. I would not pin a real project on it anytime before 2011. Stick with the tried and true when it comes to building project, right? That said, we are getting the API's in order now and testing out techniques that will both improve usability (from a developer perspective) as well as performance concerns. What does this mean? Minimally, it means that some API's will change, some class names will move around etc. I have built a prototype of a tool that will automate as much as possible. I plan on giving it a rewrite in the next 3 months, and creating some rules that will help developers convert ZF1 applications to ZF2. You can look for this tool in my github repository. In short, we'll have a detailed migration guide and as many automated tools as we can produce. :) -ralph Okay, it is to be feared that we must go with the zf1 and migrate later to the zf2 code base ;-) Thank you for the answer. Mario How painful should we expect migration to be? I know: it depends. But still...
[fw-general] July Bughunt Starts Today!
Hey contributors ZFers, Just wanted to remind everyone that today, tomorrow and saturday are our monthly bughunt days. I'll be online to help anyone sort through bugs, or get their jira/svn accounts setup. So ping me on #zftalk.dev on Freenode. Below is the copy from the announcement earlier this week. Cheers! -ralph -- visit: http://devzone.zend.com/article/12304 for more info -- Yep, it's the third week of the month- you know what that means: Zend Framework Monthly Bughut! This Thursday, Friday and Saturday of July (the 15th, 16th and 17th 2010), we'll be hosting our monthly bug hunt. For those of you unfamiliar with the event, each month, we organize the community to help reduce the number of open issues reported against the framework. The last two months of bug hunts collectively closed 63 issues. The May bug hunt saw new first-time winner Jan Pieper step up and take first. Then in June, Christian Albrecht (a previous bug hunt winner) took home first again. Congratulations Jan Christian and thanks for making the bug hunt for May and June a success. If you have not already done so, please contact Ralph Schindler or Matthew Weier O'Phinney for details on claiming your prize. All in all, bug hunt days have helped us close 100's of issues in Zend Framework since their inception. These bug hunts have proved vital to keeping up the bug squashing momentum in this project. So, whether they are big bugs or small bugs, remember this: all bugs worthy of being squashed. Not convinced you should join in yet? Here are some more reasons: * Improve your coding skillz by being around some of PHP's top developers in #zftalk.dev while hunting for bugs. * Win a t-shirt -- the individual who resolves or assists in resolving the most issues wins a Zend Framework t-shirt! * Help improve the overall quality of the code you're already using. * Fix issues that have been affecting you. * Save you and your company time spent managing your own patches to ZF, and move the maintenance upstream by patching the framework itself. * Learn valuable Quality Assurance skills. * All the cool kids are doing it. Are you cool? If you want to help out, please make sure you have a CLA on file with us, and then join us in the #zftalk.dev channel on Freenode on Thursday, Friday, Saturday. If you would like more information on specifics of participating, read our guide. Looking forward to seeing you at this month's Bug Hunt Days!
Re: [fw-general] remember me and session cookies
Response inline.. scs wrote: Hello, I have 3 questions: 1. How can I find about a logged-in user's session data? I would like to see when was the session started, how long has the user been idle? and how much time left for session expire? That is a tough one if you are using files. PHP's garbage collector will run on a specific interval looking for files that have old timestamps (outside of a specificed range), and once it finds them, it will delete them. If you wanted to iterate the session's file directory, you can get the last modification or last access time of the files (whichever is available) and you might get some information for when the last time the session was active. You'd also have to actually open the files and unserialize the data in order to determine who that session file belongs to. Your other option is to put sessions in the database, that might give you a bit more flexibility to do this kind of introspection at the application level. 2. I have a session setting in my application.ini file related to session's save_path as below: resources.session.save_path = path_to_project/data/sessions is path_to_project a constant? only PHP constants are replaced in ini files, we typically use APPLICATION_PATH whcih is typically defined in the public/index.php If its the same as APPLICATION_PATH, then the files will be stored at APPLICATION_PATH . '/data/sessions'. That directory will need to be read/write by the web server. Otherwise, the data is going somewhere else, typically into /tmp/ However, the session cookie files are not saved on this location. How can I force this location? 3. I tried to implement remember me functionality for logins as below: //if login successfull Zend_Session::rememberMe($rememberMeSeconds);//remember me for 1 month. But this code sends the user to login form and does not give any error. However, when debugging via webdeveloper plugin, i see a cookie that is valid through the rememberMeSeconds. But still i have one more default cookie for the domain which is firstly created. What is the correct way to implement rememberme functionality? Can you determine why the cookie is not staying set? Are you calling this only after authentication or on every request? It should only be during authentication that you call this method. -ralph
Re: [fw-general] Zend_Scheduler
I dont think Zend_Scheduler has been created as of yet. This is merely a proposal. What you might be interested in is taking existing components to do this job. For example, you could use Zend_Queue to schedule or create a queue of jobs, then write a script that is triggered to create and send mails with Zend_Mail. URLS: http://framework.zend.com/manual/en/zend.queue.html http://framework.zend.com/manual/en/zend.mail.html hope that helps, ralph Abi wrote: I would like to use Zend_Scheduler, Please tell me how to use, I have got a URL on working of zend_scheduler to send emails, But i dont know how to use that material,Please tell me how to use it. http://framework.zend.com/wiki/display/ZFPROP/Zend_Schedule+-+Mark+Corti View this message in context: Zend_Scheduler http://zend-framework-community.634137.n4.nabble.com/Zend-Scheduler-tp2280682p2280682.html Sent from the Zend Framework mailing list archive http://zend-framework-community.634137.n4.nabble.com/Zend-Framework-f634138.html at Nabble.com.
Re: [fw-general] Any Zend employee around? Trying to get support to BUY one of your products (Zend_Guard)
You've posted to this forum: http://forums.zend.com/memberlist.php?mode=viewprofileu=1166 I see there are a number of posts on centos http://forums.zend.com/search.php?st=0sk=tsd=dkeywords=centosfid[]=57 also, they seem quite responsive, if you tell me which post is yours, I can alert the proper person to it and see if we can find you an answer. -ralph robert mena wrote: Hi, I am sorry about the OT but I've been posting in Zend.com forums trying to get an answer for almost a month regarding Zend_Guard. If you know a zend employee please forward this to him and ask him/her to contact me. Essentially I want to know if a x86_64 Centos 5. (with the php 5.2.10 rpm) is compatible and if the Zend framework itself can be encoded using such tool (or should I go with ioncube encoder). Regards.
Re: [fw-general] Release of the ZF + Doctrine 1 Integration
This is great! Nice work to you and all others involved in making it happen! -ralph Benjamin Eberlei wrote: Hello everyone, I completed a first version of Zend + Doctrine 1 integration today and want to share it with all you. Since currently the status on a 1.11 release is unclear I contacted all the contributors to various Doctrine-related components and combined them into a single release and wrote some documentation on all the different parts and how they relate to each other. http://github.com/beberlei/zf-doctrine The code is under the New BSD License. There is a comprehensive getting started guide shipped with the Github Project. The following parts are included in this release: * Application Resource contributed by Matt Lurz * Dynamic Form Generation contributed by Jani Hartikainen * Paginator Adapter contributed by Matt Lurz and Juozas Kaziukenas * Zend Tool Provider and modular Zend Project Style Support Thanks to all the contributors and various other people that contributed ideas and code. For any feedback regarding this integration, you can use the issue tracker on Github. This release depends on Doctrine 1.2.2 to allow model code-generation from YAML files that supports Zend Framework Modular projects and their directory structure. Most of the current glue code out there is made obsolete by generating Models that follow the Zend Framework naming conventions, into Zend Framework models/ directories. Additionally there is also support for modular applications whose model classes should follow the PEAR naming schema. Additionally the dynamic form support allows to create simple forms that allow to create and edit Doctrine_Record instances and their relations. This is a great help to rapidly prototype admin forms (however support for more complex forms is not yet included). Since both projects are currently very focused on their 2.0 releases, this release aims to glue all the existing code for Doctrine 1.x and Zend Framework integration 1.x together, giving them a platform to flourish. greetings, Benjamin
[fw-general] Zend Framework Bughunt Days Today and Tomorrow!
Hey ZF Devs! It's that time of the month again! Thursday and Friday, 20-21 May 2010, Zend Framework will host its monthly bug hunt. For those of you unfamiliar with the event, each month, we organize the community to help reduce the number of open issues reported against the framework. Past events have netted over a 100 issues closed in just two days. We'd like to see that kind of momentum in this week's bug hunt. Whether they are big bugs or small bugs, remember: all bugs worthy of being squashed. So why should you be interested? * You didn't have a chance to go to TEK·X and want to commiserate with fellow developers in #zftalk.dev. * It's Thursday at TEK·X and you haven't touched code in a week. * Win a t-shirt -- the individual who resolves or assists in resolving the most issues wins a Zend Framework t-shirt! * Help improve the overall quality of the code you're already using. * Fix issues that have been affecting you. * Save you and your company time spent managing your own patches to ZF, and move the maintenance upstream by patching the framework itself. * Learn valuable Quality Assurance skills. * Interact with other ZF developers. * Squashing bugs feels good! If you want to help out, please make sure you have a CLA on file with us, and then join us in the #zftalk.dev channel on Freenode on Thursday and Friday. If you would like more information on specifics of participating, read our guide. Looking forward to seeing you at this month's Bug Hunt Days! [links] CLA - http://framework.zend.com/cla #zftalk.dev - http://freenode.net/ Guide - http://framework.zend.com/wiki/display/ZFDEV/Monthly+Bug+Hunt+Days
[fw-general] ZendCon CFP Ends Today!
Just a reminder, everyone: The ZendCon 2010 Call for Papers ends today! http://dz.zend.com/a/12105 Get your abstracts in -- and hopefully I'll get a chance to meet you in November! -ralph
Re: [fw-general] create tree from arrays
There are a couple of ways to go about buiding and recursing trees in PHP. Utilizing functions to do it is one route. The more object-oriented route would be to build a tree structure around SPL's RecursiveIterator, and RecursiveIteratorIterator. A component in Zend Framework that does this is Zend_Navigation. It can have infinitely deep nodes. http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Navigation.php http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Navigation/ Another component to look at is Zend_Tool_Project_Profile. This creates a Tree based off an xml file that can then be searched and iterated. http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Tool/Project/ It might take some time to wrap your head around RI and RII, but in the end you might find its worth it to have each node as an object. I makes your tree code more maintainable. -ralph shahrzad khorrami wrote: hi all, I want to create an array from another array to create json file in my format and pass it to a js libraryok. I just know that I have to use recursive function... but how? it's hard for me to create the new array.. main array: Array ( [0] = Array ( [nid] = 1 [parentID] = 0 [text] = Dashboard [cls] = x-btn-icon [icon] = lib/extjs/resources/images/default/icon/Dashboard.png [singleClickExpand] = 1 [leaf] = 0 [id] = Dashboard ) [1] = Array ( [nid] = 2 [parentID] = 1 [text] = Dashboard [cls] = firstExpanded [icon] = lib/extjs/resources/images/default/tree/s.gif [singleClickExpand] = 1 [leaf] = 0 [id] = ) [2] = Array ( [nid] = 3 [parentID] = 2 [text] = Dashboard [cls] = x-btn-icon [icon] = lib/extjs/resources/images/default/tree/s.gif [singleClickExpand] = 1 [leaf] = 1 [id] = dashboard ) ... -- The array I want to create: [0] = Array ( [nid] = 1 [parentID] = 0 [text] = Dashboard [cls] = x-btn-icon [icon] = lib/extjs/resources/images/default/icon/Dashboard.png [singleClickExpand] = 1 [leaf] = 0 [id] = Dashboard [children] = Array( [0] = Array ( [nid] = 2 [parentID] = 1 [text] = Dashboard [cls] = firstExpanded [icon] = lib/extjs/resources/images/default/tree/s.gif [singleClickExpand] = 1 [leaf] = 0 [id] = [children] = Array( [0] = Array ( [nid] = 3 [parentID] = 2 [text] = Dashboard [cls] = x-btn-icon [icon] = lib/extjs/resources/images/default/tree/s.gif [singleClickExpand] = 1 [leaf] = 1 [id] = dashboard ) ) ) ) ) . wow! it means that by nid and parentID, I'll notice where I must add children item to array... Thanks, Shahrzad
Re: [fw-general] Zend_Db quoting issue
$select-where('field2 = ?', 'foo', Zend_Db::PARAM_STR); This is not the type of values you are expected to provide here. $type, in this case, is expected to be one of these: Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, and Zend_Db::FLOAT_TYPE As mentioned here in the quote() documentation: http://framework.zend.com/manual/en/zend.db.adapter.html#zend.db.adapter.quoting.quote The proper usage is more than likely not providing anything at all, after all it works as expected like that right? :) The default is to quote values. BTW, what DB platform are you using? -ralph
Re: [fw-general] Zend_Tool bug of Case Sensitivity or is this a feature?
(index) message. When I call http://myproject/bar it works fine. So a module with a capital letter cannot be found by the router. If I change the directory path from /application/modules/Foo to /application/modules/foo everything works fine again. So, from this point I think having a capital letter in a module is not a good idea. I actually ran into this too recently, and thus started thinking... Now, the two model classes have the names bar_Model_Foo and Foo_Model_Bar. The model class for the module bar starts with a small This is a bug. The module name should be capitalized when creating models inside modules. I think the question that should be asked is, what is the canonical naming format for a module. This should be considered from the how do I code with this name perspective, and not from the how do I route to this name perspective. Should modules be expected to be dash-separated, CamelCased? I think the trend is that our application directory should contain elements that are CamelCased so that there is minimal conversion going on with respect to autoloaders. We can then put the onus onto the router to find valid routes and convert those url names to code paths (controllers, actions and modules). letter and the other class with a capital letter. I would love the class to be called Bar_Model_Foo but this only works if I create a module with Zend_Tool which has a capital letter. The name for the model itself doesn't take care if the model name has a capital or not when created by Zend_Tool. This is weird. Is this just a bug or is this a feature which I don't understand? There are lots of moving parts I hate to confess. We should discuss what we'd expect this to do, and all the technical limitations we are working within. -ralph