Re: [fw-general] CMS for Zend Framework
I know two: http://www.redsparkcms.de http://www.pimcore.org/ On Tue, 05 Jul 2011 22:47:38 +0200 Jawad jawad.sto...@gmail.com wrote: You should also have a look at the Centurion Project (http://centurion-project.org/) which is a quite powerful self-defined CMF (content management framework powered by Zend Framework). Le 05/07/2011 22:33, zen...@gmail.com a écrit : How about MODx ? Sent from my iPod On Jul 5, 2011, at 4:16 PM, Stephan Stapelstephan.sta...@web.de wrote: Hi, I am searching for a decent php CMS system which basically just provides an API and an administration backend for creating new content. I'd like to create the presentation for the content on my own (using Zend Framework). Ideally, the CMS would also be implemented using Zend Framework for smoother access. Does such a system exist? Can you recommend any of them? cheers, Stephan -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com
Re: [fw-general] session problem on multiple ajax request
you can add the ajax request onto a stack and execute them in a predefined order, so that they are not simoultaneously. On Mon, 21 Feb 2011 16:01:33 +0200 Serkan Temizel serkantemi...@gmail.com wrote: Hi zenders, I have a session problem. On a page I load 8 to 30 simultaneous ajax requests to update the page. When the first request completed all of the following request get 401 authorization required error! I guess the following session regenerate causes this in the bootstrap. protected function _initRegenerateSession() { $idt = Zend_Auth::getInstance ()-getIdentity (); if ($idt-rememberme) Zend_Session::rememberMe ( 864000 ); else if ($idt ! $idt-rememberme) Zend_Session::regenerateId (); else return false; } When I disable this method in bootstrap everything is OK. Can you imagine a solution with regenerating sessions. Serkan
Re: [fw-general] Is Zend_Soap_Server/PHP slow or the network?
You can use KCachegrind and Xdebug to find out exactly what functions of PHP your app take that long. Its either the query, the array to xml transformation or something entirely new ;) On Sat, 12 Feb 2011 15:26:48 +0900 Simon Walter simon.wal...@hokkaidotracks.com wrote: Hi all, I've made a few SOAP services with Zend_Soap_Server by now. The most recent one is very simple. However, the data returned is quite large. I've done some tests: write out to a log a file with a timestamp at variuos places in the execution flow. From that I know the DB (MySQL) is returning the data quickly. The data is on a server on the WAN. However, I am developing the SOAP service on a server on the LAN. In both cases, the data is returned fairly quickly: WAN server (data is local): 0.00317716598511 - fetching query 0.463740110397 - query fetched - returning data LAN server (data is remote): 0.168507099152 - fetching query 1.93645906448 - query fetched - returning data So I know the bottleneck is not that. These numbers are the interesting ones. WAN server: 0.0345900058746 - creating soap server 27.5670559406 - soap finished LAN server: 0.0059220790863 - creating soap server 4.71519494057 - soap finished In case you want to see where these numbers are coming from: fwrite($log, (string)(microtime(true) - $starttime) . ' - creating soap server' . PHP_EOL); $soap = new Zend_Soap_Server('http://' . $_SERVER['SERVER_NAME'] . '/' . basename(dirname(__FILE__)) . '/server.php?wsdl'); // this current wsdl file here $soap-setClass('HTCache'); $soap-handle(); fwrite($log, (string)(microtime(true) - $starttime) . ' - soap finished' . PHP_EOL); Wether or not it is because of data transfer, I can't tell. The response is about 14MB. So it's possible that the network is to blame. However, over 20 seconds for 14MB is pretty slow for my 100MB fiber connection. Is this kind of performance expected? Another thing is that data being returned from the db is being sent over the wire as is. So it's an array: fwrite($this-log, (microtime(true) - $this-starttime) . ' - fetching query' . PHP_EOL); $result = $this-db-fetchAll($select); fwrite($this-log, (microtime(true) - $this-starttime) . ' - query fetched - returning data' . PHP_EOL); return $result; This makes a pretty big SOAP response because of the item structure of array in SOAP XML: item key xsi:type=xsd:stringdate/key value xsi:type=xsd:string2011-04-01 00:00:00./value /item Perhaps this is all quite normal, and 14MB of data is a lot. I admit, I was surprised. However, there will be times when that amount of data is being transfered. Perhaps rather than returning an array, I can return something that would take up less space as XML - if indeed the network is the bottleneck. Does anyone know how I could go about avoiding the large structure of arrays in SOAP/XML? Would making each row into an object waste even more resources and take longer to execute? One more questions: how can I test how long Zend_Soap_Server is taking create the response? I think my testing on two separate servers shows it's the network, but I can't be sure as one is Gentoo and the other is Debian. Using tcpdump it looks like the response starts being returned in multiple packets quite soon. Though all of them need to be put together on the client side to have the complete response. Does that make sense? Is that how Zend_Soap_Server does it's work? Wireshark runs out of memory (1.5GB free is not enough?!?) parsing the dump file. So I can't really be sure what is happening. Any ideas? Sorry for the long email. Thanks! Simon
Re: [fw-general] How to create “Dynamic” Zend Navigation
You have to create your own page types for this, its described in the docs. On Sat, 29 Jan 2011 21:30:29 -0800 (PST) jiewmeng jiewm...@gmail.com wrote: With Zend_Navigation, I can do something like Home Projects Collaborators but What if I want something more useful Home Project name Collaborator name How can I acheive this? Is it a good idea? Possibly, there would be performance issues? Cos it got to query up the hierarchy? But whatever it is, how can I achieve this? -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/How-to-create-Dynamic-Zend-Navigation-tp3246882p3246882.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Re: [zf-contributors] Re: [fw-general] Re: [zf-contributors] Discontinuing Maintenance of ZendX JQuery - Suggest drop for 2.0
Well bad-practice is the fact that currently each form element generates its own javascript code. If there were a bunch of zf jQuery plugins that are integrated and those are used through classes then the extension might be more helpful, but this requires a complete rewrite and stricter focus on separation of JS and PHP, where form elements only render additional classes and these are hooked into by general selectors on the jQuery side. I doubt that just the bootstrapping enabling/disabling and such is a helpful procedure, it requires a 600 loc php script just to inject 2 lines of html code into the view based on some variables. In any case from a deployment perspective it is worse to ship each javascript code rqeuired of a single page in the page rather than shipping one application wide javascript file that is minified and delivered gzipped (prefered approach!). The first approach is what ZendX jQuery plugin currently does and there is just no way to go from that approach to a javascript based file approach without starting from the beginning. On Tue, 18 Jan 2011 10:39:39 -0330, Adam Lundrigan alundri...@gmail.com wrote: My two cents say that ZendX_Jquery should remain a part of ZF. For me, some users may use it incorrectly is not a valid reason to drop it. The compoment does have a few good things going for it, as previous messages have attested to. I find the view integration and form elements very helpful, and use them in most - if not all - of my projects. Sure, it's possible that the component might allow people to fall into bad practices, but I don't think it's the only component that could be accused of that. Perhaps we could provide a best practices user guide to help keep users from falling into the aforementioned traps when using this component? I would be willing to write the guide, with input from the community, and even take over maintenance of this component if necessary. We could also look at restructuring the component to make it more difficult to use incorrectly...or easier to use correctly...or both. - Adam Lundrigan a...@lundrigan.ca Sent from my Google Nexus One On Jan 18, 2011 10:18 AM, Jurian Sluiman subscr...@juriansluiman.nl wrote:
[fw-general] Discontinuing Maintenance of ZendX JQuery - Suggest drop for 2.0
Hello everyone, 2 years ago I was pretty sure of the Dojo and jQuery components/integration into ZF. I have since changed my mind radically. I do maintained the jQuery component but I would suggest to drop it for 2.0 for the following reasons: 1. It encourages writing no JS code at all, this will bite you in the ass heavily if you find out that you need to customize the jQuery logic. 2. It does not encourage javascript code re-use (jQuery plugins are the way to go here) 3. Heavy usage causes technical debt, it becomes impossible to rewrite your app using proper jquery/javscript code. 4. The PHP code required to write ZendX JQuery code is often more than the jQuery required alone. Since only people that don't know javascript benefit from this extension (in the short run) I suggest to drop it not to encourage people to run into the wrong direction by using it (they will thank us later). I won't attempt to rewrite ZendX jQuery for 2.0 and i understand that this means it will be dropped automatically. I suggest nobody to take over maintenance for the previously discussed arguments. greetings, Benjamin
Re: [fw-general] XPath vs Query / Zend Test
xpath would be '//*[id=message]' afaik On Sun, 12 Dec 2010 18:50:30 -0700, Aaron Murray netl...@hotmail.com wrote: Hi Everyone, Just having a quick problem that probably is due to lack of XPath knowledge. This works: $this-assertQueryContentContains(#message, default); This does not work: $this-assertXpathContentContains(id('message'), default); Any thoughts? Aaron
Re: [fw-general] Re: ZF 2.0 when and what?
Hey Nick, Doctrine does not rely on getters and setters for hydration. It only uses reflection to set and get the values. That is why we cannot implement your requested support for dynamic fields. However the functionality you want from Doctrine 2 exists in 2.0 already and is planned to be hugely optimized for 2.1, but in a totally different way that you requested in that ticket I closed. For an Article entity in your CMS you could add a collection of ArticleProperty instances that define your dynamic data. Dynamic data is in a second database table anyways. Just define it as collection of attributes and there you go. It would simply provide ORM 'out of the box' is a statement easily made, but developing an ORM takes lots of time. I already had invested about half a year into Zend Entity before dropping it and am now working on Doctrine 2 for over a year (but development started about 2 and a half years ago). I doubt you will find enough man-power to write an ORM that covers 80% of the use-cases in less than a year. ORMs are not called the vietnam of computer science for a reason, they are either not simple (and therefore take lots of careful planning and development) or they are simple and just serve 50-60% of use-cases with a database. greetings, Benjamin On Tue, 16 Nov 2010 15:34:17 -0700, Nick Daugherty ndaugherty...@gmail.com wrote: Hi Jurian, I'm not sure if Benjamin's reasons for stopping were 'very good'...to me it sounds like it came down to him not having enough time to flesh everything out and get it as functional as Doctrine, rather than real reasons for excluding it from Zend. If we find additional interest in the project, it should be revisited. Just to be clear...Zend\Db would not be changed in any way, the new ORM would simply be a separate layer that leveraged it's power. And of course Doctrine integration should still exist...the Zend_Entity (or whatever it turned out to be) would be an option for Developers...nobody would be forced to use it. It would simply provide ORM 'out of the box' in a native Zend Framework implementation. Those that preferred Doctrine would be free to use that. I'm not sure why you say an ORM is 'too much'...if ORM is too much, do you consider MVC to be 'too much'? It controls how your entire application is written, not just the persistence. On Tue, Nov 16, 2010 at 3:20 PM, Jurian Sluiman subscr...@juriansluiman.nlwrote: On Tuesday 16 Nov 2010 22:45:42 Nick Daugherty wrote: Regardless, I think Zend is important enough to have it's own ORM. If it had a performant and above all, easy to use, ORM, it could be THE killer framework. Right now, Symfony is easily coupled with Doctrine (and Doctrine requires parts of it) and seems to be gaining momentum. ORM would definitely be one of the killer components of the ZF and significantly lower the barrier to entry for new developers. A complete ORM for ZF is way too much. It is tried by Benjamin and this process stopped because of some very good reasons [1]. The more or less low-level implementation of Zend\Db to use it as an ORM is just perfect I think. When someone wants a more specific tool, Doctrine is the right way to go. Therefore my suggestion is to keep Zend\Db as it is now (in its functionality) and make proper tools to integrate Doctrine2 into ZF2 really easy. Then a developer can choose which db layer s/he wants. Regards, Jurian [1] http://www.mail-archive.com/fw-general@lists.zend.com/msg25412.html -- Jurian Sluiman Soflomo - http://soflomo.com
Re: [fw-general] ZF 2 and project structure
Hello, I think that one big advantage of zf actually is to be very flexible with project structure and we have the liberty to choose a hierarchy that fit at best with our internal logic and development habits. Depending on project we don't have the same structure. And i like to be able to map my own namespaces to some root directories. IMHO, namespaces are a POO matter but project structure is organisation of files.For example, if the structure fit exactly the namespaces logic, i will not be able to do : app/ domain/ entities/ User.php -- namespace Entity; And that means the end of the project structure flexibility. That's a choice, but the good one ? I'm not sure, i don't even know, that's why i bring this question up :) From there, the problem is that namespaces as they were introduced in PHP 5.3 can't be considered as packages like many other languages. br, Benjamin. 2010/8/30 Ralph Schindler ralph.schind...@zend.com 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] Re: Zend_Soap calls returning NULL
eAccelator optimizes doc block comments away, making usage of Autodiscover infeasible if you don't generate the WSDL files statically before deployment. On Fri, 25 Jun 2010 09:51:25 -0400, robert mena robert.m...@gmail.com wrote: Hi, I ma facing the same problem (all my calls return null) and I am using e-accelerator. While changing to APC is possibile I can't do it right now. Is there any workaround? I've disabled the cache of wsdl in ini and removed the /tmp/wsdl-* cache file. On Mon, Apr 12, 2010 at 9:08 AM, Andrew Ballard aball...@gmail.com wrote: On Sat, Apr 10, 2010 at 3:49 AM, Benjamin Eberlei kont...@beberlei.de wrote: Hello Andrew, what kind of op-code cache are you using? I have heard from people that this what you are describing is happening with e-accelerator, personally I never had a problem with APC. We are using eAccelerator on that (development) system. The answer hit me during lunch as I was mulling around how it was possible that two identical calls to the exact same functions could produce different results. Thinking about what could possibly be different from one request to another, it occurred to me that it had to be the caching. The production servers are using the Wincache extension, so I don't know how it might impact them. However I should really update the documentation, the WSDL is not something to be generated dynamically upon each request, static serving is much better (of course if you keep it in sync with your real server implementation). I figure when this hits production I'll probably switch to a static document, but this was my first look at SOAP and I just wanted to see how it would fit into a project I'm developing right now. Auto discovery was ideal because it allowed me to experiment easily with creating different functions with different parameters and return types. Andrew
[fw-general] Release of the ZF + Doctrine 1 Integration
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
Re: [fw-general] Re: Zend_Soap calls returning NULL
Hello Andrew, what kind of op-code cache are you using? I have heard from people that this what you are describing is happening with e-accelerator, personally I never had a problem with APC. However I should really update the documentation, the WSDL is not something to be generated dynamically upon each request, static serving is much better (of course if you keep it in sync with your real server implementation). greetings, Benjamin On Fri, 9 Apr 2010 14:28:23 -0400, Andrew Ballard aball...@gmail.com wrote: On Fri, Apr 9, 2010 at 1:00 PM, Andrew Ballard aball...@gmail.com wrote: I set up a very basic client and server using autodiscover to try out SOAP in ZF. For some reason, all of the functions are returning NULL. The problem seems to be that the operation node in each of the portType nodes is missing an output on successive requests. They are in the WSDL the first time I run the autodiscover after changing the model. It also seems that the documentation node contains the name of the method instead of the description in the header block. To test, I added a new method to the model and then saved the WSDL generated by autodiscover on the next request. I then changed the WSDL in both the client and server to point to this static XML file -- all the methods returned exactly what was expected. Does anyone have any idea why Zend_Soap_AutoDiscover is doing this? Andrew I think I may have figured this out during lunch. I think the issue is the opcode caching on the server. Whenever the page is updated, PHP grabs the new version from source code -- including comments. Subsequent requests would come from the cache, and since it is just opcode it doesn't have any comments to direct Zend_Soap_AutoDiscover. Andrew
Re: [fw-general] Re: Doctrine 2.0 - Entities/Models - Naming and Autoloading
the SPL Autloader implementation allows registering multiple autoloaders at the same time, i.e. why not use a Doctrine\Common\ClassLoader for the entities when they are namespaced and use Zend_Loader_Autoloader for the Zend stuff only? You are free to choose what combination of autoloaders you want :) On Tue, 23 Mar 2010 13:27:58 +0100, Loïc Frering loic.frer...@gmail.com wrote: The problem is that Zend_Loader_Autoloader_Resource and, as a consequence, Zend_Application_Module_Autoloader does not support PHP5.3 namespaces for now. There is an issue related to this problem in ZF Jira: http://framework.zend.com/issues/browse/ZF-8205 (vote for it ;) ) In the meantime, you should use old fashion namespaces with underscores or extend Zend_Loader_Autoloader_Resource to make it support PHP5.3 namespaces (see the proposed patches in Jira issue). The last solution allows to use Doctrine convert mapping tool as it would not let generate a class named Application_Model_User in a file named User.php from an XML or YAML mapping file. Regards. On Tue, Mar 23, 2010 at 1:36 AM, David Muir davidkmuir+z...@gmail.comdavidkmuir%2bz...@gmail.com wrote: They should be namespaced IMO. Also, the example given here uses namespaces: http://www.doctrine-project.org/blog/doctrine-2-give-me-my-constructor-back -- View this message in context: http://n4.nabble.com/Doctrine-2-0-Entities-Models-Naming-and-Autoloading-tp1678427p1678528.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Using application resources from Zend_Tool
Hey Jurien, This is awesome, from my POV the next step would be to replace the configuration you gave with explicit resources in a Zend Tool Project context. My idea would be: zf create doctrine.project --for-module=blog It would then create the schema, sql, fixtures, migrations and models folders inside the blog module (if it exists) if they don't already exist and register them inside the .zfproject.xml file. I have a question about your approach though. Can models of different modules communicate to each other in your approach? Could they have relations to each other? Or are they completely separate? Migrations on a per module basis would probably require lots of Doctrine modifications. greetings, Benjamin On Thu, 24 Dec 2009 13:36:39 +0100, Jurian Sluiman subscr...@juriansluiman.nl wrote: Hi all, I did a commit to put the provider online. It's now at my Google code repository: http://code.google.com/p/sozfo/source/browse/trunk/library/Sozfo/Tool/Doctrine/Provider. Still pre-pre-pre-alpha ;) Please note it's at the very beginning and meant to provide very basic functionality: * create db based on doctrine connections * drop db based on doctrine connections * migrate db * generate (php) models (from yaml or db) * generate (db) tables (from php models or yaml) * generate (yaml) schema files (from php models or db) * load data (fixtures) * dump data (fixtures) All on a modular base. A part of the config looks like this: paths.modules.schema = configs/schema paths.modules.sql = configs/data/sql paths.modules.fixtures = configs/data/fixtures paths.modules.migrations = configs/migrations paths.modules.models = models This means zf generate doctrine.models --module=blog --from=yaml loads application/modules/blog/configs/schema/ and put the models in application/modules/blog/models/ I'm now thinking of two issues: * what if you don't provide the module parameter? You could use the global application models (use application/ instead of application/module/$module as prefix). An option is to point to the default module, or loop all modules and execute the code for each module individually. * I'd like to migrate my db on a modular base. Each module should be have it's own version number. I'm not sure how to cover this in Doctrine. Regards, Jurian
Re: [fw-general] Using application resources from Zend_Tool
Hello Jurian, The Doctrine 2 Resource I have actually has Zend Tool Project support already. The code isn't published yet though. You won't be able to share code between DC1 and DC2 though, they are too different. You could of course extend the zf create doctrine.project command to optionally accepting a deviating path for a certain resource directory. Additionally there could be a zf config doctrine.project --resource /path provider action that allows to re-configure the values and also copies the directory if necessary. greetings, Benjamin On Thu, 24 Dec 2009 14:39:07 +0100, Jurian Sluiman subscr...@juriansluiman.nl wrote: On Thursday 24 Dec 2009 14:25:33 Benjamin Eberlei wrote: Hey Jurien, This is awesome, from my POV the next step would be to replace the configuration you gave with explicit resources in a Zend Tool Project context. My idea would be: zf create doctrine.project --for-module=blog It would then create the schema, sql, fixtures, migrations and models folders inside the blog module (if it exists) if they don't already exist and register them inside the .zfproject.xml file. Good idea! When I have this ready, it's time to work towards Zend_Tool_Doctrine 2.0 with your modification in mind (still Doctrine 1.2 and Zend 1.x though ;) ). It's a trade-off you need to consider. I'd like to have the paths configurable. The counterpart is Zend_Tool isn't aware of these contexts (am I right?). Your proposal means .zfproject.xml knows about Doctrine, but it's much harder to configure the paths (again, am I right?). I have a question about your approach though. Can models of different modules communicate to each other in your approach? Could they have relations to each other? Or are they completely separate? Woops, you're right. This is something I didn't think of at all. I'm not sure if Doctrine likes this approach, but it's something I absolutely need to look at :) Migrations on a per module basis would probably require lots of Doctrine modifications. I'll talk to the Doctrine people if they have a solution for this specific issue. greetings, Benjamin Regards, Jurian PS. Though Jurriën is also Dutch, my name has an a instead of an e ;)
Re: [fw-general] Using Connection Mock with Zend_Test_PHPUn it_ControllerTestCase
Hey Jake, take a look at this section in the Zend_Test manual, it describes how to integrate Database and Controller TestCases: http://framework.zend.com/manual/en/zend.test.phpunit.db.html#zend.test.phpunit.db.testing.controllerintegration On Sat, 19 Dec 2009 07:37:17 -0800 (PST), dmitrybelyakov shiftplatf...@gmail.com wrote: Jake McGraw wrote: I'm digging into some TDD, and I've managed to convert all of my Models to use Zend_Test_PHPUnit_DatabaseTestCase and it works wonderfully. My question is, is there any way to integrate Connection Mocking, like that with my model testing to work within the Zend_Test_PHPUnit_ControllerTestCase? I see that PHPUnit has a whole suite dedicated database mocking, but I really enjoy the simplicity and tight integration between Zend_Db and Zend_Test_PHPUnit_DatabaseTestCase. Thanks, - jake Hi Jake, I am also iterested in such testing topic and may have some thoughts on the topic. Whould you please explain what do you mean by Connection Mocking? Do you whant to use a mock database adapter? Or maybe a mock database for testing? I wonder what's your approach to testing. As far as i can tell PHPUnit's suite for database mocking is exactly what Zend_Test_PHPUnit_DatabaseTestCase is (it's an extension). Dmitry.
Re: [fw-general] Zend_Tool in 1.10
Hey Ralph, I was thinking about this issue too, and I think its very easy to implement in a multi-step procedure. You would combine human- and machine input to find a module for example: zf detect project controller-directory /path/to/controllerDir zf detect project view-directory /path/to/viewdir zf detect project config-directory /configdir zf detect project BootstrapFile /path/to/BootstrapFile and so on and so forth. This can be easily implemented for flat directories and files by using the Context Resource names and maybe check for uniqueness if this is necessary. The module or applicatno directory detection would be more complex, i propose to detect only the main-folder automatically, say: zf detect project module /path/to/moduledirectory Would only add the moduleDirectory context and do not traverse deep. Same with ApplicatonDirectory. This way you can interatively add up missing resources to your project.xml For View and Controller directories we might need an additional refresh method to resync the stuff in already existing folders. On Fri, 18 Dec 2009 09:46:07 -0600, Ralph Schindler ralph.schind...@zend.com wrote: prodigitalson wrote: # ability to persist alternate namings of things # ability to scan existing projects (lower priority, and harder to do) # ability to use alternate config type (moderate complexity, low priority) Its ironic that the 3 things i want/use most are not complete and have been ranked low in priority. Not that im complaining pre se, Id agree in comparison to the things you have implemented/fixed they are indeed low priority. I just like to whine without contributing :-) Awesome work though. things are shaping up nicely id say. The alternate naming facilities are in place, the only problem is that nothing exposes them yet (this is a matter of finding the use case). The only use case that myself and Benjamin came up with was to let thing work with existing project... which brings me to the next point. Existing projects are higher on my list now that all other new features are out the door. As you can imagine, scanning files and determining their context is not an easy task. I'll start thinking about this. Alternate config type- by this I assume you mean XML? -ralph
Re: [fw-general] Re: Zend Framework 1.9.6 missing Zend/Queue/Adapter/Stomp/IO.php and other files
You have to run phpunit from the tests directory, best using the bootstrap like the following: cd tests phpunit --bootstrap TestHelper.php Zend_AllTests On Tue, 8 Dec 2009 06:03:40 +0100, Andrea Turso trashofmast...@gmail.com wrote: I downloaded the Zend Framework from trunk using svn and ran phpunit tests/ It stops testing almost immediately with the following output: PHP Fatal error: Class 'Zend_CodeGenerator_Php_Docblock_Tag' not found in /tmp/ZF/library/Zend/CodeGenerator/Php/Docblock/Tag/Param.php on line 35 Fatal error: Class 'Zend_CodeGenerator_Php_Docblock_Tag' not found in /tmp/ZF/library/Zend/CodeGenerator/Php/Docblock/Tag/Param.php on line 35 running phpunit for one directory at once seemed to work (e.g. phpunit tests/Zend/Acl/) So I used this awk to run phpunit in each directory and see the phpunit results for each directory: ls -l tests/Zend/ | awk '$8 !~ /(^All)|(^_)|(.php$)/ {print phpunit tests/Zend/ $8}' | sh 1 tests.log the complete output is here http://pastebin.com/m23a273e0 I would like to understand why some files needed to run the complete test suite are missing from the Full Package. I guess that this is normal in the trunk where new code is pushed frequently, but having missing files in a release should break the build. Right? Looking forward for replies Regards - Andrea On Tue, Dec 8, 2009 at 12:22 AM, Andrea Turso trashofmast...@gmail.com wrote: I just downloaded Zend Framework 1.9.6 full package from the Zend CDN to test it under PHP 5.3.1, but when running $ phpunit tests/ the following error appears: Warning: require_once(Zend/Queue/Adapter/Stomp/IO.php): failed to open stream: No such file or directory in ~/Downloads/ZendFramework-1.9.6/tests/Zend/Queue/Adapter/StompIOTest.php on line 38 Fatal error: require_once(): Failed opening required 'Zend/Queue/Adapter/Stomp/IO.php' (include_path='~/Downloads/ZendFramework-1.9.6/tests/../library:~/Downloads/ZendFramework-1.9.6/tests/../tests:/usr/lib/php5/PHPUnit:.:/usr/share/php:/usr/share/pear') in ~/Downloads/ZendFramework-1.9.6/tests/Zend/Queue/Adapter/StompIOTest.php on line 38 I tried with PHP 5.2.6-2 (ubuntu4.5 with Suhosin-Patch 0.9.6.2 (cli)) and with PHP 5.3.1 (cli) but it's the same. It seems that some files are missing. Any suggestion? In the meanwhile I'll try with the trunk version. Regards - Andrea
Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine integration
Hello, Its not a failure to recognize that a proposal generates lots of duplicate code, which is currently better solved in other projects. This also has nothing to do with Zend, since the component was approved under the premise that its community contributed. An ORM is a huge undertaking and it creates lots of code that has to be maintained and I as a community member decided that its probably not doable. Xyster ORM maybe existing for some time, however i haven't seen it in use. Additionally although they claim not be ActiveRecord you have to extend a certain base class for your entities to work with it. This is the root of all evil in ORMs and the reason why enterprise ORMs don't require it. The lead developer of Doctrine is indeed paid by SensioLabs, however the Source Code is under the LGPL, which is a perfectly compatible license with New BSD and doesn't restrict the use of the code. There is also no effort whatsoever by SensioLabs to control Doctrine. Looking at it the other way, Doctrine is already several years old, plus it benefits from lots of experience of the PEAR MDB2 component aswell as others (eZ Components, ZF). The code basis is pretty robust and there are people working on its perfection full time, which makes it a pretty good choice for Enterprises. Going for Integration with Doctrine in my opinion is one step further to professionaling php as an enterprise language. The different PHP communities where cooking their own soups for the last 10 years. Although I like competition very much, one should also make rational decisions when it is better not to reinvent the wheel. greetings, Benjamin On Wed, 25 Nov 2009 00:51:38 -0800 (PST), Arié Bénichou arie.benic...@gmail.com wrote: I don't understand why you did not use http://xyster.libreworks.net/ Xyster ORM It makes use of the Data Mapper Pattern and comes with a Unit of Work. Doctrine is shifting to this approach for the version 2.0, but it's still an alpha release. It's a pity for you to have failed this way, because, Doctrine is associated to SensioLabs, the french agency who developps the Symfony Framework.
[fw-general] ZendX_MooTools_View_Helper_MooTools Component Proposal
Hello I am proposing a new component to use mootools in Zend Framework, the link is http://framework.zend.com/wiki/display/ZFPROP/ZendX_MooTools_View_Helper_Moo Tools+-+Benjamin+Gonzales All comments are welcome Benjamín Gonzales http://codigolinea.com
[fw-general] Documentation
Hi as I do to compile the Zend manual to pdf? Benjamin
Re: [fw-general] zfproject.xml
On Tuesday 10 November 2009 10:01:16 pm Matthew Weier O'Phinney wrote: -- Ed Lazor edla...@internetarchitects.biz wrote (on Tuesday, 10 November 2009, 12:56 PM -0800): Is there a way to rebuild the zfproject.xml file with Zend_Tool? How do you keep it updated on a project with others when some people use Zend_Tool and others don't? Or is this not a big concern? Ralph is working on some support for that, but I'm not sure what the timeframe is for it; right now, it's unsupported. You can edit the zfproject.xml by hand its pretty easy. Also Zend Tool works with all the Zend Tool Project created resources nonetheless. The most important resources are applicationDirectory, configsDirectory, BootstrapFile and the controller and view directory stuff for a module. You can resync zfproject.xml easily by adding them and be able to generate controllers, actions and views for a module. greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Integration of Zend Tool and Doctrine 1
Hello everyone, I made a first attempt to formulate a possible way to integrate Zend Tool and Doctrine 1. This heavily depends on the Doctrine Zend_Application resource proposal by Matthew Lurz (See References Section of the proposal) aswell as on comments and discussions I had with several people from both Doctrine and Zend Framework background. http://framework.zend.com/wiki/display/ZFPROP/Doctrine+1+and+Zend_Tool+Integration+-+Benjamin+Eberlei I would be very happy to get feedback from both communities on this proposal, any flaws it might have but also additional features or ideas that might follow under this proposal. Sorry for me cross-posting this mail on so many lists, but I feel all might be equally interested in this issue. greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Zend_Text_Tree proposal ready for review
Hello everyone, while discussion some of the 1.10 features for Zend_Tool Ralph and I discussed Tree views of datastructures on the console. Examples would be displaying the ZF User Config, a Zend Project Structure or the Zend Application config. We came to the conslusion that some code that was written already for this task should be generally refactored to allow to print treets on the console using a Tree structure (like the unix command tree generates). Here is a simple proposal for this: http://framework.zend.com/wiki/display/ZFPROP/Zend_Text_Tree+-+Benjamin+Eberlei greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Tool_Framework Customization
Persistent properties for filenames if they deviate from the default filename would be really awesome. Otherwise its nearly impossible to build a custom project profile. Additionally there should be additional basic types like Directory, PhpFile, OtherFile which can be used as placeholders for non-application critical resources that need representation though. greetings, Benjamin On Monday 02 November 2009 04:56:08 pm Ralph Schindler wrote: I am tackling several of these features now, in preparation for the 1.10 release (this code is and will be in the incubator.) Can anyone elaborate on the .zf.ini properties that are respected or what one needs to do to set up custom profiles? Custom profiles are pretty much completely, they mostly need documenting. Overall, the docs need to be better organized. Currently if you put a project file in your storage directory at (for example): .zf/project/profiles/custom.xml Then with 1.10 zf client, you'll be able to use it like zf create project -n custom ./directory This works on my system, but needs to be more throughly tested. Ultimately id like to change the project layout a bit. But for now ill settle for enabling certian things. For example these are the key things i want by default in every project: - Config file format should be XML not INI - Data dir with log, cache, and uploads - Public dir with images, js, css It seems like all this is doable with jsut certain attribs set on the .zfproject.xml and pointing to that xml in the .zf.ini but i cant seem to get it to work. These types of things can definitely be handled by a custom profile. TO that though, there are probably a few places where having attributes persist into the context object make sense (this would make it easier to customize things like the name of a directory or file). I'll keep you updated via the mailing list on the new features I'll be pushing out this week. -ralph -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Discontinuing Zend Entity in favour of Doctrine integration
Hello everyone, I just want to inform everyone that I will discontinue development on Zend Entity and in return invest time to integrate Doctrine with Zend Framework on a large scale. I changed my mind for several reasons 1. It drains up all my free time and I got quite a blockade from it. 2. I am the only major contributor, and compared to Doctrine 2 the feature set is probably only at 50-60%. 3. A realistic estimate for a first production ready release of Zend Entity would be 4-6 month, a time where ZF is probably starting to think heavily of PHP 5.3 adoption in regards with the 2.0 release. This is not a good time for another major component that starts of in 1.x I've discussed the decision with Matthew, and while we both liked the idea of having a native ORM in ZF, we also both feel that helping improve an existing project and providing good integration with it will likely be better for the entire ecosystem. If you are interested, please contact us to help us start planning this initiative. I hope this step isn't a disappointment to anyone, personally I had lots of fun developing Zend Entity and learnt quite a bit that I can hopefully contribute to Doctrine also. Also special thanks to all those that offered help, feedback and contributions. greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Discontinuing Zend Entity in favour of Doctrine integration
Hello Keith, you should take a look at Doctrine 2. As Zend Entity it implements the JPA specification and is a true data mapper with models decoupled from Database completly. greetings, Benjamin On Thursday 29 October 2009 09:19:50 pm keith Pope wrote: 29 Matthew Weier O'Phinney matt...@zend.com: -- Antonio José García Lagar a...@garcialagar.es wrote (on Thursday, 29 October 2009, 08:17 PM +0100): 2009/10/29 Matthew Weier O'Phinney matt...@zend.com Ideally, we'll have both Doctrine 1.x and 2.x integration, for this very reason - though likely as separate implementations (Zend_Doctrine, Zend_Doctrine2). There are some commonalities between them that we can leverage immediately (application resources, in particular), and others that will require more collaboration between the two projects (e.g., shared cache objects and loggers, etc.). I must say its a shame that ZE is going, I thought it was too bigger a project for one person, not fair asking for that much commitment from anyone. Time to go back to using Doctrine then :( bye bye nice models. Do you think it would be a good idea to update the Quickstart guide now to not use the Data Mapper pattern and use doctrine instead? Do you think this will be available for the 1.10 release? You should update the roadmap at http://framework.zend.com/roadmap/1.10.0 I hope to see an early proposal to start to help. We're in the very early stages of gathering requirements; I honestly don't see it being ready for 1.10. -- Matthew Weier O'Phinney Project Lead| matt...@zend.com Zend Framework | http://framework.zend.com/ -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] setClassmap in Zend_Soap_AutoDiscover
Hello, can you open up a ticket for this issue in jira please? So that i can review it at a later stage. On Wednesday 14 October 2009 02:41:57 pm Renan de Lima wrote: hi, i dont know any workaround for that what do you think keep old class on in the project? but this one should extend new class something like this: class OldName extends NewName {} this way you can provide class services using both names 2009/10/14 Mark Hage m.c.h...@gmail.com: Hi, I had to rename a class in my project. This class is used in a soap server. Now I don't want the outer world to have to bother with a different classname and want to use the setClassmap in Zend_Soap_Server. But I also do use the Zend_Soap_AutoDiscover to generate the wsdl file. Is it possible to use some kind of classmapping here? Thanx, Mark -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Zend Form Element PluginLoader for Validators
Hello everyone, I want to use non-Zend validators for my elements and use the array options notation to build my form, where i realized that i can't really set the plugin loaders for the validators of each field. However while browsing through the code I saw that every element creates its own plugin loader if none is given, so its very hard to use a global approach. Is there a nice way to use a single plugin loader for all my elements and configure it through the array notation of Zend_Form? greetings, Benjamin
[fw-general] Re: [fw-db] Modeling MySQL enum
You shouldnt use Mysql ENUMS, they have some ugly properties. Any change in the list of allowed fields requires a complete rebuild of the table, which can take ages. Using a Char and filtering in the application is much better! greets, Benjamin On Tue, 22 Sep 2009 02:27:02 -0700 (PDT), umpirsky umpir...@gmail.com wrote: Hi. I wonder what is the best way to model MySQL enums? Class with constants, or array of constants, or maybe sth else? You need to render options in templates (select) or to use enum values a over the code. So, what is the right way to go? Regards, Saša Stamenković.
Re: [fw-general] PDO_MYSQL vs. Pdo_Mysql ZF 1 .9.3
sorry but that i dont understand. The factory makes certain assumptions about what is possible and what not in creating an adapter. Changing the assumptions is a B/C break. Of course its a bug that ZendX Firebird cannot be loaded from the previous assumptions but that is not a valid cause to overthrow them. There has to be a BC way to solve both cases. Additionally this is a change in a mini version, breaking code that was perfectly valid and should still be valid in all versions from 1.0 to 1.9.2 updates. I cant understand that reasoning. greets, Benjamin On Tue, 22 Sep 2009 11:46:27 -0400, Matthew Weier O'Phinney matt...@zend.com wrote: -- till klimp...@gmail.com wrote (on Tuesday, 22 September 2009, 05:09 PM +0200): On Tue, Sep 22, 2009 at 11:39 AM, Jonathan Maron jonathan.a.ma...@gmail.com wrote: This modification is important to note in ZF 1.9.3: http://framework.zend.com/issues/browse/ZF-5606 The change will probably break some (older) applications. Correct: $db = Zend_Db::factory('Pdo_Mysql', $params); Incorrect (as of ZF 1.9.3) $db = Zend_Db::factory('PDO_MYSQL', $params); I'm just wondering why this was fixed now and not in 2.0? Because it was leading to other issues. BC breaks, while regrettable, are allowed if they fix a more fundamental issue.
Re: [fw-general] PDO_MYSQL vs. Pdo_Mysql ZF 1 .9.3
a BC change for this bug is simple, just exclude adapterNamespace from the word-wise ucwords reasoning and append it to the canonical database adapter name AFTER the changes: http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Db.php One should just take the adapter namespace out of the normalizing procedure: Behaviour = 1.9.2 $adapterName = strtolower($adapterNamespace . '_' . $adapter); $adapterName = str_replace(' ', '', ucwords(str_replace('', ' ', $adapterName))); Should be behaviour: $adapterName = strtolower($adapter); $adapterName = str_replace(' ', '', ucwords(str_replace('', ' ', $adapterName))); $adapterName = $adapterNamespace._.$adapterName; This way the BC break is on the Adapter Namespace and not on the Adapter Name. But since the Namespace implies that is prepended to the classname there was the assumption that this had to be written correctly, whereas the adapter name is said to be case-insensitive from the API docs: First argument may be a string containing the base of the adapter class name, e.g. 'Mysqli' corresponds to class Zend_Db_Adapter_Mysqli. This is case-insensitive. Which it is now not anymore! On Tue, 22 Sep 2009 18:02:12 +0200, Benjamin Eberlei kont...@beberlei.de wrote: sorry but that i dont understand. The factory makes certain assumptions about what is possible and what not in creating an adapter. Changing the assumptions is a B/C break. Of course its a bug that ZendX Firebird cannot be loaded from the previous assumptions but that is not a valid cause to overthrow them. There has to be a BC way to solve both cases. Additionally this is a change in a mini version, breaking code that was perfectly valid and should still be valid in all versions from 1.0 to 1.9.2 updates. I cant understand that reasoning. greets, Benjamin On Tue, 22 Sep 2009 11:46:27 -0400, Matthew Weier O'Phinney matt...@zend.com wrote: -- till klimp...@gmail.com wrote (on Tuesday, 22 September 2009, 05:09 PM +0200): On Tue, Sep 22, 2009 at 11:39 AM, Jonathan Maron jonathan.a.ma...@gmail.com wrote: This modification is important to note in ZF 1.9.3: http://framework.zend.com/issues/browse/ZF-5606 The change will probably break some (older) applications. Correct: $db = Zend_Db::factory('Pdo_Mysql', $params); Incorrect (as of ZF 1.9.3) $db = Zend_Db::factory('PDO_MYSQL', $params); I'm just wondering why this was fixed now and not in 2.0? Because it was leading to other issues. BC breaks, while regrettable, are allowed if they fix a more fundamental issue.
Re: [fw-general] ZF 1.9.3 and phpunit 3.4.0 zf_tool prob lem
do you have phpunit on your include path twice? On Tue, 22 Sep 2009 18:06:15 +0200, Ladislav Prskavec ladis...@prskavec.net wrote: If run zf tool: zf version Fatal error: Cannot redeclare class phpunit_framework_testsuite_dataprovider in /usr/local/zend/share/pear/PEAR/PHPUnit/Framework/TestSuite/DataProvider.php on line 64 Using Ubuntu 9.04 with Zend Server CE 4.0.5 (php 5.2.10, tested zf 1.9.2 and 1.9.3 ) Ladislav
Re: [fw-general] spaces in url with Zend_http
On Tuesday 22 September 2009 09:38:37 pm Derk wrote: Hello, Is it true that Zend_Http can't deal with spaces in the uri? I got some exceptions with the message ... is not a valid HTTP path. I know spaces in urls are not valid, but a site serves some redirects with spaces in the location. Firefox and IE don't have a problem with it, they do maybe some encoding self. valid issue that you are getting this from other sites header locations. I will file an issue for this problem and discuss it with the maintainer :-) greets, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Db_Select::union() behaving
On Monday 21 September 2009 10:29:59 pm william0275 wrote: I just noticed this and wasted some time trying to debug my code until I found this bug in the documentation. I'm not sure why and how they added this change. hello, the API docs are wrong about how union works. It has to be used: $selectA = $db-select()-...; $selectB = $db-select()-...; $unionSelect = $db-select()-union(array($selectA, $selectB)); the docs where changed only recently on this issue, so expect this problem to be vanished in 1.9.3, aswell as this absurd bug you mentioned. greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Entity Entity instantiation quest ion
The createEntity() method in the loader is pretty much internal, what exactly do you want to inject into a specific entity? You can overwrite the Mapper however, which instantiates the loaders and overwrite the method in entity loader. The Aggregate metadata map has the disadvantage that you either specify dependencies between different modules or you don't. In either way you do or don't couple the modules which would speak for specifying them in either one metadata map, or use two different entity managers. greetings, Benjamin On Fri, 11 Sep 2009 14:25:49 +0100, keith Pope mute.p...@googlemail.com wrote: Hi, I am just having a look at Zend_Entity, I was wondering how it handles object/entity instantiation, having a look through the code the Zend_Db_Mapper_Loader_LoaderAbstract has a createEntity() method which instantiates the entity. Is it planned that we will be able to override this and provide custom instantiation code/loaders for the entity manager? I am coming from the angle that it would be nice to be able to inject a DI container into the manager, maybe I am thinking about it wrong? Other than that the docs were really good and I was able to get everything working very quickly, good work :) Thx Keith
Re: [fw-general] Zend_Entity: Using it in a fully model-driven manner
The approach you are describing is misusing Zend Entity as a data access layer only, however its purpose is really managing of object identities. Although its possible to dynamically set a different metadata model based on properties its really not recommended at all and there will be no support with whatever problems might occur with this use case. Instead a good use-case would be nest the ACL inside your entities and allow the request of certain data/relations only if these acls are meet. This way you push the access of different properties to the domain model and abstract from the persistence, which is what Zend Entity is about. It seems however with what you describe Zend_Db_Table is a pretty good access strategy for your relational data, Zend_Entity however is about objects that are instantiated completly. Partially loaded objects won't be supported. greetings, Benjamin On Wed, 9 Sep 2009 16:43:19 -0700 (PDT), Chris Murray cmur...@murtek.com wrote: Chris Murray wrote: So I need to be able to dynamically set the property list in Zend_Entity Another possible approach would be to create my own def object generator. I already have my definitions in my model and they are used for other purposes, such as form element configs, formatting, and display properties. So, I could build the def object and pass it to Zend_Entity_MetadataFactory_Code (rather than passing in a file path). That way, I don't have to create multiple def files for each unique combination of properties that are used in my application. Instead, just build the def object dynamically based on already existing, multi-purpose object property lists and their individual attributes. Is that a better way to do it?
Re: [fw-general] Zend_Entity: Using it in a fully model-driven manner
Hello Keith, yes there are plans, however i haven't found somebody for this task yet :-) Do you have time? :-) From the Zend_Db_Mapper_SqlQuery and SqlQueryBuilder objects you can already see that building your own query object is not too complex and can be done as a standalone task. greetings, Benjamin On Thu, 10 Sep 2009 13:05:29 +0100, keith Pope mute.p...@googlemail.com wrote: 2009/9/10 Benjamin Eberlei kont...@beberlei.de: The approach you are describing is misusing Zend Entity as a data access layer only, however its purpose is really managing of object identities. Although its possible to dynamically set a different metadata model based on properties its really not recommended at all and there will be no support with whatever problems might occur with this use case. Instead a good use-case would be nest the ACL inside your entities and allow the request of certain data/relations only if these acls are meet. This way you push the access of different properties to the domain model and abstract from the persistence, which is what Zend Entity is about. It seems however with what you describe Zend_Db_Table is a pretty good access strategy for your relational data, Zend_Entity however is about objects that are instantiated completly. Partially loaded objects won't be supported. greetings, Benjamin Are there any plans to have a criteria type object for creating repositories? On Wed, 9 Sep 2009 16:43:19 -0700 (PDT), Chris Murray cmur...@murtek.com wrote: Chris Murray wrote: So I need to be able to dynamically set the property list in Zend_Entity Another possible approach would be to create my own def object generator. I already have my definitions in my model and they are used for other purposes, such as form element configs, formatting, and display properties. So, I could build the def object and pass it to Zend_Entity_MetadataFactory_Code (rather than passing in a file path). That way, I don't have to create multiple def files for each unique combination of properties that are used in my application. Instead, just build the def object dynamically based on already existing, multi-purpose object property lists and their individual attributes. Is that a better way to do it?
Re: [fw-general] zf tool: no way to delete yet?
Don't underestimate yourself :-) We are always happy for any help and ralph would probably mentor you through the process if you would dedicate yourself to implementing this (and he hasn't started yet). If you seperate the Provider and the actual deletion, you can probably get this working by writing some tests for all the possible cases you can up with without too many problems. You should check out the Trunk documentation on Writing Providers it got several updates that should help you with some of the details on how to write a provider. I am thinking about updating it further to include details on the Project specific provider options. Anyhow, if you ask on IRC #zftalk.dev you probably get all the details you need much faster on how you can help. greets, Benjamin On Wed, 9 Sep 2009 09:30:24 -0400, David Mintz da...@davidmintz.org wrote: On Tue, Sep 8, 2009 at 11:55 PM, Ralph Schindler ralph.schind...@zend.comwrote: Hey David, [delete] functionality is slated for 1.10. It was left out of the 1.8 and 1.9 release for a couple of good reasons. Since deleting is a pretty irreversible action, and sometimes is also a recursive action- we wanted to ensure that the console/cli interface at least had the capability to ask the user if deleting is OK, in other words confirming the decision to delete something. This way, people will not accidentally delete things they will not be able to recover. I wonder -- how hard is it to implement? I ask because I might like to contribute, but if you guys are black belts, I am like, a yellow belt -- maybe green on a good day -- so don't know if I am equal to the task.
Re: [fw-general] zf tool: no way to delete yet?
On Wednesday 09 September 2009 06:47:49 pm David Mintz wrote: On Wed, Sep 9, 2009 at 10:13 AM, Benjamin Eberlei kont...@beberlei.dewrote: Don't underestimate yourself :-) We are always happy for any help and ralph would probably mentor you through the process if you would dedicate yourself to implementing this (and he hasn't started yet). If you seperate the Provider and the actual deletion, you can probably get this working by writing some tests for all the possible cases you can up with without too many problems. You should check out the Trunk documentation on Writing Providers it got several updates that should help you with some of the details on how to write a provider. I am thinking about updating it further to include details on the Project specific provider options. First noob question: when you say check out the trunk documentation, you mean svn checkout http://framework.zend.com/svn/framework/standard/trunk, cd into documentation/manual/your_language and build as per the README. Right? yes, but its only in EN right now, so your_language=en. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Data Mappers and Relational Modelling
Hello Chris, there is an example/readme at www.beberlei.de/zendentity which is a quickstart rewrite of the bug model in the Zend_Db manual. It has some quirks, but a working (though slightly different) demo is in the http://framework.zend.com/svn/framework/standard/incubator/demos/Zend/Entity repository. Sadly ZendCon and the development of zend Entity are on a bad timeline, i haven't tried to get any talk about it into, and since i am from germany i won't be at ZendCon unless someone (Zend ;)) pays me to come ;) greetings, Benjamin On Thu, 3 Sep 2009 16:49:34 -0700 (PDT), Chris Murray cmur...@murtek.com wrote: Yes, it is difficult, especially doing complex validation on nested forms. I'm in the late stages of building an ORM/MDA framework on top of ZF. It's quite functional, but I'd much prefer to work with others doing the same thing and use a common code base that is certainly going to be more robust and sophisticated than what I've built. I've downloaded the latest Zend_Entity code. Is there an example or readme somewhere so I can try to map my MDA definitions into Zend_Entity? BTW, I'll be attending ZendCon so hope to learn more about it there.
[fw-general] Re: [fw-mvc] Understanding 'Service Layer' and 'Domain Model'
There are two kinds of services: 1. The Service Layer, which is kind of the public API of the model/business logic/domain towards the controller and views. This is what fowler describes as Service Layer pattern. 2. Domain Services, objects that are not entities or value objects, but still belong to the domain, for example a BillingService or something. These services are not necessarily public to the controller or view, but may be used by the service layer and domain objects internally. greetings, Benjamin On Wed, 2 Sep 2009 07:38:00 +0100, keith Pope mute.p...@googlemail.com wrote: 2009/9/1 Colin J colin.john...@johnguest.co.uk: Avi Thanks for the reply. Does this mean that the service layer should simply hand things over to a method on the model, unless it needs to do some work on access control for example? I suppose I am having trouble distinguishing between 'business logic' in the domain model and whatever needs to go in the service layer. Is it just that there aren't particularly any rules about what goes where but good practice might be ACL in the service layer? Colin Technically services are part of the domain, they have a bit of a special place in the domain though, they provide services that do not naturally fit into the domain. (this is how I read the DDD book anyway) I have things like IO services as well as things that extend my core domain models like JSON services that transform the models output into JSON. Services are great for keeping things out of the main domain models. ACL in a service layer makes sense, much more than the in the application layer as you can then use it outside the MVC triad. Avi Block wrote: The service layer is helpfulc in shielding your controller from nasty logic involving one or more domain objects. For example, if there is some complicated logic involved in creating a new event (let's say there's a difference between whether an administrator is creating it or an organization is creating it, that would go in the service layer. Or perhaps if you need to do some ACL checks while looking retrieving some resources, that would go in the service layer. On Tue, Sep 1, 2009 at 7:48 AM, Colin J colin.john...@johnguest.co.ukwrote: -- View this message in context: http://www.nabble.com/Understanding-%27Service-Layer%27-and-%27Domain-Model%27-tp25238912p25243385.html Sent from the Zend MVC mailing list archive at Nabble.com.
Re: [fw-general] zend_mail wrong charset
On Wednesday 02 September 2009 04:57:51 pm Alessandro Camilli wrote: Hi, I'm trying to send an e-mail with zend_mail. The mail was delivered but Zend valdidate hostname.php at line 513 generates this exception: iconv_strlen: wrong charset, conversion from 'UTF-8' to 'UTF-32' is not allowed. This is my code $mail = new Zend_Mail(); $mail-setFrom('webmas...@mydomain.it', 'webmas...@mydomain.it'); $mail-addTo('alex_...@dest.it', $this-_dscDest); $mail-setBodyText($testo); $mail-setSubject('Registrazione'); $mail-send(); please help me can you please give the complete getTraceAsString() output and put that into an issue in the jira bug tracker at framework.zend.com/issues? i can have a look at it then this weekend. greetings, benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Best practice to share identity map across mappers? Static registry?
hello, If you dont instantiate your mappers through a factory you probably will have lots of work to do if you dont make access to the identity map global via a static method. greetings, Benjamin On Sunday 30 August 2009 04:58:32 pm Marian Meres wrote: Hi All, I have many domain models where each has its own data mapper. These mappers are spread across many places as a) services use mappers, b) mapper x uses mapper y, c) and even models use mappers (only in the case of lazy loading). I want mappers to utilize the identity map pattern (which is itself pretty straightforward). I guess the whole pattern makes more sense when used as a shared map across the mappers rather than for each to have its own. Since the mappers usage (and instantiation) is wide spread (at least in my case), the only solution I could think of is always a sort of a static one (either through static members, or static managers, or even some injectable containers which default to static Zend_Registry). What would you suggest, other than the static way? Thank you in advance. M. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Data Mappers and Relational Modelling
Hello, lazy loads are implemented by some underyling magic. Say you have a Quiz with questions and you load the quiz. Instead of adding an array of all the questions right away, you build a collection class which implements ArrayAccess, Iterator and Countable and takes a PHP Callback which is fired upon the first acces of any of those functions. See here: http://framework.zend.com/svn/framework/standard/branches/user/beberlei/Zend_Entity/library/Zend/Entity/LazyLoad/Collection.php In your example it would look like: $quiz = $quizMapper-findById(1); // Inside QuizMapper building the quiz: $questionsMapper = new QuestionsMapper(); $state['questions'] = new Zend_Entity_LazyLoad_Collection( array($questionsMapper, loadByQuizId), array($state['id']) ); This way you have a collection inside your quiz, its just not loaded yet though. Only upon first access of this pseudo array all the data is loaded. Implementing LazyLoad for querying is easy, there are some tricks to do it right when saving the collection then if you dont want to completly load it. greetings, Benjamin On Saturday 29 August 2009 08:06:06 am Hector Virgen wrote: Thank you for the replies, Dmytro and Keith. I just finished reading over the Zend_Db_Mapper proposal, and it is looking really nice. It seems to be similar to what I've been putting together, which makes me feel confident that I'm at least somewhat on the right track. I can agree that the entity should not know about the mapper, but without it I wasn't able to figure out a way for the entity to support lazy loading (where would it load from?). This was the part I struggled with the most, because I wanted my entities to know about their relationships: $quiz-getOwner(); // lazy loads the owner as a User entity Unless I'm missing something, it seems important that a quiz knows about its owner if even just for saving purposes: class QuizMapper { /* ... */ public function save(Quiz $quiz) { $data = array( 'title' = $quiz-title, 'owner_id' = $quiz-owner-id ); // add code to save to persistent storage } } I suppose I could just test if the quiz has an owner object, and save its ID if it does, but then I have to account for a quiz that doesn't have an owner -- would its value be set to false? I think maybe shadow data can help in this case by resorting to the shadow value if owner object doesn't exist, allowing me to re-save an entity without ever having to load the owner object at all. Dmytro, regarding your question about where the collection gets its IDs, it is provided by the mapper. For example, my QuizMapper may have a method that returns all quizzes owned by a user. But instead of returning an array of instantiated Quiz objects, it returns a single Collection object that produces Quiz entities when iterated: class QuizMapper { /* ... */ public function findByUser(User $user) { $db = $this-getDatabase() $select = $db-select() -from('quizzes', array('quiz_id')) -where('user_id = ?', $user-id) ; $ids = $db-fetchCol($select); $collection = new My_Entity_Collection(); $collection-setMapper($this); $collection-setIds($ids); return $collection; } } This allows me to create specialty methods that return entities based on any criteria (like for searches, etc) and the collection can be paginated with Zend_Paginator. From what I understand, the Zend_Db_Mapper proposal also has a collection that is similar to this one. What I was also thinking of doing was expanding on the Collection idea and making a class that contains information on how to build a reference entity using an implementation of the Value Holder type of lazy loading. All this class would contain is a mapper, an ID, and a factory method to use the mapper to create the entity. Something like this: class My_Entity_Reference { protected $_id; protected $_mapperClass; public function __construct($id, $mapperClass) { $this-_id = $id; $this-_mapperClass = $mapperClass; $this-_method = $method; } public function getValue() { $mapper = new $this-_mapperClass(); return $mapper-find($this-_id); } } I could then use this reference object to give the entity a way to lazy-load a single resource without giving the entity access to a mapper. Perhaps this would be a good alternative to giving the entity a mapper to work with? Or should I be relying on shadow data? Maybe I could use both ideas together and use the Reference object as a shadow data by adding a getId() method. So many ways to go! :) -- Hector On Fri, Aug 28, 2009 at 4:45 PM, keith Pope mute.p...@googlemail.comwrote: 2009/8/28 Hector Virgen djvir...@gmail.com: Thanks for the reply, Tim. So you're saying I'll need one or more
Re: [fw-general] Zend Amazon not working anymore
hey, the API was changed by amazon. you need to provide a private key as third argument to the constructor. The documentation has an example how to do this and your Amazon WS account has the private key somewhere in the admin console. greetings, Benjamin On Friday 28 August 2009 09:35:27 pm PHPScriptor wrote: Hello, a time ago I made a script with zend amazon. It worked fine. It tried the same script today. And it's not working anymore. Something changed on Amazon? $amazon = new Zend_Service_Amazon_Query('MYKEY','US'); $amazon-category('Books') -Keywords(php) -ResponseGroup('Large') -ItemPage($this-_getParam('page')); $books = $amazon-search(); output: Fatal error: Uncaught exception 'Zend_Service_Exception' with message 'An error occurred sending request. Status code: 400' in C:\wamp\www\_phpscriptor\public_html\library\Zend\Service\Amazon.php:110 Stack trace: #0 C:\wamp\www\_phpscriptor\public_html\library\Zend\Service\Amazon\Query.php( 96): Zend_Service_Amazon-itemSearch(Array) #1 C:\wamp\www\_phpscriptor\public_html\app\modules\books\controllers\IndexCon troller.php(24): Zend_Service_Amazon_Query-search() #2 C:\wamp\www\_phpscriptor\public_html\library\Zend\Controller\Action.php(502 ): Books_IndexController-indexAction() #3 C:\wamp\www\_phpscriptor\public_html\library\Zend\Controller\Dispatcher\Sta ndard.php(293): Zend_Controller_Action-dispatch('indexAction') #4 C:\wamp\www\_phpscriptor\public_html\library\Zend\Controller\Front.php(946) : Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Reques t_Http), Object(Zend_Controller_Response_Http)) #5 C:\wamp\www\_phpscriptor\public_html\application.php(182): Zend_Controller_Front-dispatch() #6 C:\wamp\w in C:\wamp\www\_phpscriptor\public_html\library\Zend\Service\Amazon.php on line 110 - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Using Zend_Db_Select without a db connection
hello hector, you can use Zend_Test_DbAdapter, which is a testing adapter that does not connect to the database. greetings, Benjamin On Wednesday 19 August 2009 06:50:52 pm Hector Virgen wrote: Hello, I am currently working on an older project that is not in ZF, but I'd like to use Zend_Db_Select to help me build some complex select queries. I don't want to open a new connection to the database since this application already has one open using good ol' mysql_connect(). My question is, since Zend_Db uses lazy-loading to create the actual connection, would it be safe to create a dummy Zend_Db object to build my selects with? $db = Zend_Db::factory('Pdo_Mysql', array( 'host' = '127.0.0.1', 'username' = 'fakeuser', 'password' = 'fakepassword', 'dbname' = 'mydefaultdb' )); $select = $db-select() -from('users'); $sql = $select-toString(); *echo $sql; // this works and outputs SELECT * FROM `users`* $select = $db-select() -from('users') *-where('username = ?', 'test'); // throws exception: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 111* It seems that quoteInto() is attempting to connect to the database. Is this necessary? Is there a way to stub in a fake database connection in order to use Zend_Db_Select? -- Hector -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Unit Testing ZFW
hello matthew, i have been able to generate a whole coverage report on the test-suite with xdebug and php memory set to 2-3gb. greetings On Sunday 16 August 2009 11:16:32 pm Matthew Weier O'Phinney wrote: -- Ralph Schindler ralph.schind...@zend.com wrote (on Tuesday, 11 August 2009, 11:36 AM -0500): Are you testing trunk? Are you using the standard TestConfiguration.php.dist file? Are you enabling any exotic components that are disabled by default? Where is it dying? One way to find this out, btw, is to run phpunit with the --tap switch. This will produce a line of output for each test run -- and thus you'll know what test was run immediately prior to the process dying. We used this extensively when preparing for 1.9.0 to identify problematic test suites. As Ralph noted, we have been running the suite regularly, on what is basically stock hardware and a stock PHP install. One extension that I *know* is problematic when running the entire suite is XDebug. Because of all the profiling information it tracks, it can often use substantially more memory and run into circular references that don't occur under normal PHP usage -- causing the suite to crash. (Which sucks, because it'd be really, really nice to get a full coverage report of the entire test suite at some point. (-: ) Enable XDebug only when trying to profile individual component test suites within ZF. I would try commenting out the test run for the larger components first (Zend_Pdf, Zend_Memory, Zend_Search) to see if that affects the runtime. To do this, comment out the top level component in Zend_AllTests. Once you find the root cause, we'll have to see if its a system specific issue. I don't currently have any issues with running the default tests in under 384 megs. And I am using PHP 5.2.10. -ralph Ryan Chan wrote: Hello, On Mon, Aug 3, 2009 at 10:08 PM, Tim Fountaint...@tfountain.co.uk wrote: When you increased the memory limit, did the error above change to Allowed memory size of 1073741824 bytes exhausted...? If not, remember that the command line version of PHP has its own php.ini file, so make sure you're editing the correct one. -- Yes, when memory is increased to 1GB, then it will die at another place. I have verified my memory setting using php -i | grep memory Anyone can run the unit test successfully? -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Session Garbage Collections Works?
are you running on debian? it disables the php session gc and uses its own cronjob to cleanup, which sometimes is not running correctly.. On Monday 10 August 2009 09:05:46 pm Alex wrote: Any idea why the GC isn't running? I setup a .php file that runs by bootstrap then outputs phpinfo() and everything looks right. Still, the GC is not running. - Alex On Mon, Aug 10, 2009 at 3:58 PM, Peter Warnock petewarn...@gmail.comwrote: On Mon, Aug 10, 2009 at 11:20 AM, Alex outroa...@gmail.com wrote: As an aside: would using the DbTable save handler be more efficient than the file handler? - Alex The file handler is faster, but the db handler can provide persistence across multiple servers and is potentially more secure depending on the hosting environment. - pw -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Proposal for Extensions to Zend_Db_Expr
Hello everyone, in combination with the Zend_Entity and Zend_Db_Mapper proposals I felt the need for an extension of Zend_Db_Expr. This functionality would also be a huge step for Zend_Db_Select to abstract vendor specific functionality even more. A common expression object offers access to abstract from vendor specfic syntax of building database queries, conditions, functions and such. It should implement as much common functionality of the current supported database drivers as possible. http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Expr+Extension+-+Benjamin+Eberlei The expression object utilizes Zend_Db_Expr when necessary and offers convenience functionality to escape the inputs correctly. I hope you can give me valuable feedback! Additionally, this is a funny request, but I would be glad if anyone would take this proposal from me and implement it, so I can focus on the Entity and Mapper proposals. I guess its easy to implement, unittest and document once you have found the subset of functionality that should be supported and the public API is fixed. greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Application and Unit Testing wi th phpunit make inlude_path growth without limits
for exactly the cases you describe there is the concept of dataproviders which is a loop around your test method, which is then allowed to accept different input parameters based on an outside data source. http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers On Wed, 22 Jul 2009 06:17:20 -0700 (PDT), fab2008 f.napole...@gmail.com wrote: I read the post you linked and I'm agree with some of the aspects discussed there. In every case the number of my assertions is so high because in some cases I use a for to test a method against every possible input, so I have some tests which have 40-60 assertions. In other I need to check the final result after a certain number of method calls, and in that case I inserted also intermediate asserts, this make assertion count high. Moreover some tests has this kind of situation plus it has to be valid for three fixed type of input, in that case I also inserted a for cycle that tests the condition for all three types. I don't know if this is a bad practice but I feel safer with this approach. In the other (normal) cases I have a pretty small number of assertions, I think about 2-4 per test. Dalibor Karlović wrote: On Wednesday 22 July 2009 03:51:29 fab2008 wrote: I am able to run all tests with a single command: .I.I... 60 / 177 .I.. 120 / 177 .I...I..I Time: 16 seconds OK, but incomplete or skipped tests! Tests: 177, Assertions: 1876, Incomplete: 7. Unrelated, but those numbers don't seem right to me, you have about 10 assertions per test which is, as I've read discussed, WAY above what it should be. Some [1] argue that you should have one assertion per test, I personally find that too rigid and average at about 1.5 - 1.7. [1] http://is.gd/1HmFL -- Dado
Re: [fw-general] Get Curl handle ressource when use Zend_Http_Client with Zend_Http_Client_Adapter_Curl
On Tuesday 16 June 2009 06:36:58 pm MARTIN Nicolas wrote: Hi all, I use Zend_Http_Client with Zend_Http_Client_Adapter_Curl and I would like to get more informations and so use curl_getinfo($ch) [$ch is handle ressource] This handle ressource is the _curl property in Zend_Http_Client_Adapter_Curl. How get it ? For the moment I create my own My_Http_Client_Adapter_Curl and add method class My_Http_Client_Adapter_Curl extends Zend_Http_Client_Adapter_Curl { public function getInfo() { return curl_getinfo($this-_curl); } } Is it the best way to do? Or something can be change directly in the framework in a future release ? Thanks hello, this cannot be done currently, but would be nice probably. Can you add a feature request in Jira Issue Tracker? I'll pick it up then. greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Using a DI Container with Zend_Application
Hello, I have written a blog post on how to integrate the Yadif DI container with Zend_Application (to replace Zend_Registry). It uses Application Resources as instances of the DI container and allows to use them as dependencies for any objects that are instantiated through the container. http://www.whitewashing.de/blog/articles/117/ Any other DI container that uses __isset, __set and __get can also be integrated with Zend_Application. Very awesome! :) Greetings, Benjamin -- Benjamin Eberlei http://www.beberlei.de
[fw-general] A Zend_Db Adapter for ext/mysql (mysql_*)
Hello everyone, I have a project that i slowly want to migrate to Zend Framework. This project uses ext/mysql all over the place and therefore requires an adapter of this type to keep the number of database connections small. I wrote this adapter using soley mysql_* functions, which emulates prepared statements and works exactly like any other Zend_Db adapter, even works with Zend_Db_Table. Its passing all unittests of the Zend_Db test suite so should be pretty stable. If anyone needs this, i put it up on GitHub: http://github.com/beberlei/Zend_Db-Adapter-for-ext-mysql/tree/master -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Test-driven development does not work properly with Zend_Test
do you use phpunit 3.4? this might be a problem indeed. otherwise, zend_test is doing integration testing and using that soley for test-driven-development is probably a bad idea, since you test too many components in conjunction rather than unit-testing a single component in isolation. greetings, Benjamin On Monday 08 June 2009 03:18:26 pm Ralf Eggert wrote: Hi Tim, I think setting throwExceptions to true on your front controller in test mode only should fix this, but you won't then be able test some of the error controller functionality. That did not help at all. I turned of the ErrorHandler and that worked partly. Now I don't get any error at all, i.e. the test passes although the IndexController::showAction() method does not exist yet. This is annoying since I worked Test-driven for ages with ZF and now after moving to 1.8.2 my approach is not possible any more. Any one any ideas? Thanks, Ralf P.S. Maybe the upgrade to a new PHPUnit version caused this issue? -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] ZF CLI slow
On Sunday 31 May 2009 10:38:46 am admirau wrote: tfk wrote: Does running regular php(-cli) is just as slow? If so, I'd run php -m and disable module after module until you find the offender. Thanks. I have already tried that. Disabling all the modules in php.ini does not help. There are left some pre-compiled modules, but I don't think so it could be one of those. Any other way to debug? -- regards takeshin enable xdebug profiler and see with kcachegrind what took so long. my guess is the recursive search for all providers in your includepath is the problem. greets, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Does Zend_Json_Expr work?
Have you enabled the enableJsonExprFinder option? http://framework.zend.com/manual/en/zend.json.advanced.html#zend.json.advanced.expr you have to add the option: $jsonObjectWithExpression = Zend_Json::encode( $data, false, array('enableJsonExprFinder' = true) ); On Mon, 18 May 2009 23:44:32 -0500, Deanna Bonds deanna.bo...@gpcartel.net wrote: I tried enabling Zend_Json::$useBuiltinEncoderDecoder = true; and using json context switching. When ever I try to send an Zend_Json_Expr('js code here'); it comes out handler:{__className:Zend_Json_Expr} in the output. I have tried disabling multibyte utf-8 settings. I tried moving the object around just to see if I had it nested to deep before. Nothing seems to make it output the javascript code. Deanna
Re: AW: [fw-general] Zend JSON umlaut (special chars)
That advice on the Mysql Init Attribute is dangerous. Its not just adding this easily, because if the app is already in production and running on another charset you might break it. On Saturday 11 April 2009 10:52:34 Stefan Gehrig wrote: Hi Andrei, please make sure that your data is UTF-8 encoded. Either run your retrieved data through utf8_encode() or make sure that the result returned from the database is UTF-8. When using MySQL (Zend_Db_Adapter_Pdo_Mysql) you can easily do this by adding a 'driver_options' key to your database configuration with 'driver_options' = array( PDO::MYSQL_ATTR_INIT_COMMAND = SET NAMES utf8 ) Best regards Stefan Von: Andrei Iarus [mailto:poni1...@yahoo.com] Gesendet: Samstag, 11. April 2009 00:26 An: Zend Framework Betreff: [fw-general] Zend JSON umlaut (special chars) Hello there, I have a problem with encoding an array retrieved from DB. I use this: $states = Zend_Registry::get('db')-fetchAll('SELECT state_id AS id, name_en AS name FROM core_states WHERE country_id = ?', $this-_getParam('countryId')); echo Zend_Json::encode($states); If the name_en field has an umlaut (from a german state), the encoding will return null. So [{id:124,name:null},{id:125,...] is an example (with only the first element), but when I var_dump the encoded var, I get array(16) { [0]= array(2) { [id]= string(3) 124 [name]= string(17) Baden-Württemberg } ... I see the last version (1.7.8). Did you encounter the same problem? Thank you -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend Mail encoding
there is no difference. they both do the same, the first method setEncodingOfHeaders is marked @deprecated. It sadly got into a 1.7 release, but is not following the consistent naming schema of ZF. It will be removed in 2.0. So you should really just only use setHeaderEncoding(). On Thursday 09 April 2009 12:51:43 debussy007 wrote: Hi, What is the difference between: Zend_Mail setEncodingOfHeaders (string $encoding) Zend_Mail setHeaderEncoding (string $encoding) Both methods are defined in the Zend_Mail class. And what should the string be ? utf8 / utf-8 / UTF8 / UTF-8 / ... And finally third and last question, is it a good idea to encode mail headers in utf8 ? Do all mail boxes support this encoding ? Thank you for any help ! -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Caching the SoapClient
What authentication? If you authenticate via a token (which is common for stateless SOAP servers) you can of course cache the token. But when the SOAP Server is authenticating via stateful sessioning then you don't need to authenticate in each request. In either case you don't need to cache the SOAP Client itsself. Can you give an example how you authenticate on each request? On Thu, 9 Apr 2009 13:12:13 -0700 (PDT), ArthurZend arthur_nonos...@yahoo.com wrote: It appears that I can't cache the SoapClient using Zend_Cache and you can't in the session either. Since it takes a second or two to authenticate I was hoping to cache it. Any suggestions? Thanks in advance, Arthur. -- View this message in context: http://www.nabble.com/Caching-the-SoapClient-tp22978404p22978404.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Caching the SoapClient
Then you have probably disabled WSDL caching. The WSDL is of course fetched via HTTP and therefore takes some time to execute. you should look for the wsdl caching ini options in your php.ini On Thu, 9 Apr 2009 13:23:01 -0700 (PDT), ArthurZend arthur_nonos...@yahoo.com wrote: Actually I just checked...the time is spent just on the instantiation of the SoapClient: new SoapClient( https://aaa.aaa.com/some.wsdl;, array('exceptions' = 0)); Just this line is taking 1 to 2 seconds. beberlei wrote: Can you give an example how you authenticate on each request? -- View this message in context: http://www.nabble.com/Caching-the-SoapClient-tp22978404p22978590.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Caching the SoapClient
On Thursday 09 April 2009 23:00:04 till wrote: On Thu, Apr 9, 2009 at 10:58 PM, ArthurZend arthur_nonos...@yahoo.com wrote: Hmmm.. I have soap.wsdl_cache_enabled = 1 so it should be cachedmaybe the directory is wrong. Did you restart Apache? Put this in your view: WSDL Cache: ?=ini_get('soap.wsdl_cache_enable')? another tip, if you know the WSDL is not changing you can also copy it to disc and intialize it from there. This saves one HTTP call for everytime the wsdl is not cached and only goes to the disc. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] How to contact the Zend Framework team about OOP bad practices/suggestions?
hello, you should create an account at http://framework.zend.com/issues and file issues against Zend_Db, put their alert level up based on what you think is necessary. Also make sure not to put all the things into one issue, but split them up so that they are unique items to be worked at. greetings On Wed, 11 Feb 2009 08:58:56 -0800 (PST), william0275 nab...@metayer.info wrote: The more I look at the source code of some Zend Framework elements, the more I see bad OOP practices and worse... For example, Zend_Db_Statement and Zend_Db_Statement_Pdo are a frankenstein of OOP. There are methods accessed by the abstract, parent class that *are not* defined in the parent and are expected to exist in the inherited class. These methods should be declared in the parent class as abstract methods at least... A second example, the use of a variable that has *the same* name as a method defined in the inherited class... some ugly 'overloading' right there between an array and a method... I would like to alert the Zend Framework team about this but have absolutely no clue how. -- View this message in context: http://www.nabble.com/How-to-contact-the-Zend-Framework-team-about-OOP-bad-practices-suggestions--tp21958265p21958265.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend_Amf and Caching
wrap a caching proxy around your real webservice class. On Tuesday 10 February 2009 17:26:21 Josh Team wrote: I know I've been blowing up the mailing list lately with my Zend_Amf stuff, but I have yet another question :) I am trying to add a caching layer onto my Zend_Amf server. And if I could see the request coming in through some means I could cache my $server-handle() response based on the incoming footprint. Anyone know of a clever way to do this? Thanks in Advance, Josh Team -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Problemas with ZendX_JQuery Datepicker - CSS and autocomplete
Hello Wesley, for me the CSS works correctly when downloading a theme. Are you sure, that you that the CSS is correctly included and the css theme versions of DatePicker and the UI JS DatePicker match? is there an error in the theme maybe that the DatePicker related nodes are missing? On the autcomplete, the jQuery UI Team removed it from the 1.6 release candidate in the beginning of january, which is a problem for using the autocomplete. It should be mentioned in the current docs, but it seems they havent been updated just yet. You can probably get the AutoComplete from the jQuery UI SVN Trunk or an Old Release Candidate of 1.7, but that is not really a solution. I am sorry for that problem :-( greetings, Benjamin On Wednesday 04 February 2009 16:16:14 wesleywillians wrote: Hi folks, I am doing many experiences with Datepicker. Its working fine, but the CSS is been applying. I have downloaded a theme in ui.jquery.com and i call this: link rel=stylesheet type=text/css href=/styles/theme/ui.all.css / All efects which I am expecting dont appear. Any Idea? About the autcomplete i receive a message saying: autocomplete is not a function Where can i download the correct plugin to work together with the helper autocomplete? all the best! Wesley -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Problemas with ZendX_JQuery Datepicker - CSS and autocomplete
Hey, from the paste it seems your link to the stylesheet is missing a dot in the zf.schoolof.net part. On Wednesday 04 February 2009 16:34:10 wesleywillians wrote: Yep. I saw the source and pasted the css file path. Its Ok. I am sure. But no effects, colors, etc. I am using in my view a sample of zend docs: ?=$this-datePicker(startDate,'',array('defaultDate' = '+7','minDate' = '+7'));? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; dir=ltr lang=pt-BR head meta http-equiv=Content-Type content=text/html; charset=UTF-8 / titleTrabalahndo com JQuery/title link rel=Stylesheet href=http://zf.schoolofnet/styles/thema/ui.all.css; type=text/css / script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js;/scr ipt script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.2/jquery-ui.min.js; /script script type=text/javascript //!-- $(document).ready(function() { $(#startDate).datepicker({defaultDate:+7,minDate:+7}); }); //-- /script/head body input type=text name=startDate id=startDate value=br / /body /html beberlei wrote: Hello Wesley, for me the CSS works correctly when downloading a theme. Are you sure, that you that the CSS is correctly included and the css theme versions of DatePicker and the UI JS DatePicker match? is there an error in the theme maybe that the DatePicker related nodes are missing? On the autcomplete, the jQuery UI Team removed it from the 1.6 release candidate in the beginning of january, which is a problem for using the autocomplete. It should be mentioned in the current docs, but it seems they havent been updated just yet. You can probably get the AutoComplete from the jQuery UI SVN Trunk or an Old Release Candidate of 1.7, but that is not really a solution. I am sorry for that problem :-( greetings, Benjamin On Wednesday 04 February 2009 16:16:14 wesleywillians wrote: Hi folks, I am doing many experiences with Datepicker. Its working fine, but the CSS is been applying. I have downloaded a theme in ui.jquery.com and i call this: link rel=stylesheet type=text/css href=/styles/theme/ui.all.css / All efects which I am expecting dont appear. Any Idea? About the autcomplete i receive a message saying: autocomplete is not a function Where can i download the correct plugin to work together with the helper autocomplete? all the best! Wesley -- Benjamin Eberlei http://www.beberlei.de -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Generate PDF, DOCX, DOC and RTF with ZF
This looks awesome! I would really be happy if you would propose that as an addition to the ZF. :) You have to sign the CLA and then make a proposal on the Proposal Wiki http://framework.zend.com/wiki/display/ZFPROP What about arrays or Iterators and simple IF statements. Are they supported or could they be implemented? That would make the solution very powerful. On the blog you only show DocX examples, how are Doc and Rtf supported? greetings, Benjamin On Thursday 29 January 2009 10:02:50 Jonathan Maron wrote: Hello all Zend_Pdf is a great component to generate PDF files with ZF. If you want to populate PDF templates with text, however, it can be very time consuming to get the positioning of the text fields just right. I wrote about this issue here: http://tinyurl.com/bym43f After having developed several ZF applications in which text had to be inserted into PDF templates, I knew there must be a better way and went about developing one. The result is a project called phpLiveDocx, which is an unofficial component for ZF. (If it were to become official component some day, I would be thrilled.) The idea is really simple: 1. You design a template in a word processing package (such as Open Office or Word). In the template, you define any number of text fields, into which data will be later inserted (same idea as mail-merge). 2. Using phpLiveDocx, you assign data to the template. 3. You generate and save the populated document as a PDF, DOCX, DOC or RTF file. The great advantage of this approach is that you uncouple the formatting of the template and the position of the text fields. In other words, should a designer change the layout of a template, there is no need for a developer to update the positioning of the text fields. Of course, the other great advantage is that you can save the resulting document as DOCX, DOC or RTF, in addition to PDF. Here is a really basic example, which illustrates how phpLiveDocx works: http://tinyurl.com/ao9c2v (The template and resulting document can be download from the bottom of the post.) Here is a very short getting started guide and download links: http://tinyurl.com/db23fc If you need any help or want to talk about phpLiveDocx, just follow up here or post me a message: http://tinyurl.com/culdpj Thank you Jonathan Maron http://www.phpLiveDocx.org -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Db_Mapper Proposal - Ready for Review
Hello, i don't have any source code to look at currently. Since this is still a proposal and final features can have a huge impact on how the query select and persist engine will look like. I am trying to get a prototype and an example running for this proposal though to add some more advanced Use-Case snippets for public review. greetings, Benjamin On Wednesday 28 January 2009 07:34:22 Ken Chau wrote: Do you have any source code laying around anywhere for us to look at? I had some aspirations to write an ActiveRecord component, but my recent experience with models (well, and PHP's lack of late static binding support) has led me searching for other model components. I would love to replace Zend_Db_Table with yours in my applications! beberlei wrote: Hello everyone, I finished up a new proposal that would greatly enhance domain driven development with the ZF: A generic data mapper component. http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Mapper+-+Benjamin+E berlei Its a contrasting proposal to Zend_Db_Table, for handling the underlying persistence of your application layer. Its aiming at enterprise developers that need to do more than the usually siple BlogPosts - Comments - Tags examples. The core concept is the Record (Entity Pattern) centric datastrcuture, rather than the SQL datastructure. You build your applications domain logic of record objects that communicate to each other and then persist them into the database at the end of your session with following a defined mapping scheme. This component therefore tries to achieve the separation of Business logic from the underlying persistence. comments are greatly appreciated, Benjamin -- Benjamin Eberlei http://www.beberlei.de -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Zend_Db_Mapper Proposal - Ready for Review
Hello everyone, I finished up a new proposal that would greatly enhance domain driven development with the ZF: A generic data mapper component. http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Mapper+-+Benjamin+Eberlei Its a contrasting proposal to Zend_Db_Table, for handling the underlying persistence of your application layer. Its aiming at enterprise developers that need to do more than the usually siple BlogPosts - Comments - Tags examples. The core concept is the Record (Entity Pattern) centric datastrcuture, rather than the SQL datastructure. You build your applications domain logic of record objects that communicate to each other and then persist them into the database at the end of your session with following a defined mapping scheme. This component therefore tries to achieve the separation of Business logic from the underlying persistence. comments are greatly appreciated, Benjamin -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_JQuery and form select element.
The UiWidgetElement decorator is only for jQuery UI elements, not for other elements such as Zend_Form_Element_Select. You need to use the default Zend_Form_Decorator_ViewHelper for such elements. On Friday 23 January 2009 15:42:35 Paweł Chuchmała wrote: HI. I use ZF 1.7.0. If I try to create JQuery_Form, element select isn't properly rendered. In JQUery_Form_Decorator_UiWidgetElement in method render is: $elementContent = $view-$helper($name, $value, $jQueryParams, $attribs); where: $attribs = $this-getElementAttribs(); so, helper for render FormSelect is called with paramters: array 0 = string 'name' (length=20) 1 = string 'value' (length=2) 2 = array empty /* our attribs*/ 3 = array 'options' = array empty /* our empty values, or array if set */ 'listsep' = string 'br /' (length=6) 'id' = string 'name' (length=20) In html: select name=name id=name optgroup label=options /optgroup option value=listsep label=lt;br /gt;lt;br /gt;/option option value=id label=namename/option /select It's a bug, or I doing something wrong? regards, pch -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Best Practices: Eliminate redundancy within various controller init methods?
I would extend Zend_Controller_Action and make an application wide action controller that has the init function which centralizes all the duplicated code. btw, having the Database connection in the Controller is not best practice at all. You have to separate controllers and model, hence it being MVC not VC. I suggest a Service Layer between them or Model classes that have an public API that says nothing about Databases and stuff. greetings, Benjamin On Friday 23 January 2009 21:08:14 jasonzfw wrote: Hi, Many many thanks for the great set of responses. This helps to clarify nicely. I've created a custom action helper, integrated it into the site, and confirmed the framework is able to recognize and execute it. However there remains one perplexing matter: how do I initialize this action helper in a way that makes several of its variables automatically available to all controllers? The idea is to completely remove all redundant code from the various controllers' init() methods, thereby making the variables within the controller available in each controller's $this context. Based on your varied responses regarding the action helper, surely there's some way to do this? The goal is to use this action helper to make the following variables automatically available to all controllers: $this-config = Zend_Registry::get('config'); $this-cache = Zend_Registry::get('cache'); $this-db = Zend_Registry::get('db'); Thanks for all of your help! Jason Ionut Gabriel Stan-2 wrote: On 1/8/2009 12:05, Rob Allen wrote: On 8 Jan 2009, at 09:26, Bart McLeod wrote: You can of course have a base custom controller, but you do not need to. Depending on what you need exactly you can use either an action helper in the init method or a plugin or both a plugin and an action helper. public function init(){ $this-_helper-myInit(); //instead of your six lines of code } Actually, if you have a My_Controller_Action::init(), you don't need to define and init() at all in the child classes, whereas if you use a helper, you do need to define the init() in the controllers where you need the myInit(). Depends on the place where you register the helper, because HelperBroker::__construct() will call the init() method of all registered helpers at the time Zend_Controller_Action is instantiated. Then, the same HelperBroker will call the preDispatch() and postDispatch() method of all helpers before and, respectively, after Zend_Controller_Action::dispatch(). There's a nice representation of this process here: http://surlandia.com/wp-content/uploads/2008/11/zf-dispatch-lifecycle-bw. jpg So, IMHO, a helper could be the solution, the only issue remaining might be the place to register the helper and then what callback method to use, init() or preDispatch(). Regards, Rob... -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Is Cal Evan's Globals.php a recommended approach
great post ralph! this is a step into a brighter future ;-D my two cents though. 1. having __construct(array $options); is cool from a simplicity point but it hides dependencies, since in an array you couldinclude ANYTHING. Most components also don't require the dependencies to be set in constructor, they take all sort of options and set them but don't raise an exception when a depdenency xyz misses. When you have a sensible default depdenency this would make sense though. ezcComponents uses constructor struct objects for configuration. You would have an object Zend_Controller_Config which enforces some variables and is given to the constructor. I like this alot, since objects always allow for more checks on variables than arrays. 2. component registries are a great thing IF they are not singletonized. They allow for type checking and consistency checks where the Zend_Registry does not. You could always make a container go into Zend_Registry to make it global, but this should be optional, and pleeease let us just forget the singleton antipattern. :-) If component registries are used we should make sure that all dependencies are overwritable with them, for example the PluginLoader of Zend_Controller for helpers is hardcoded into the front controller. The component registry should include all objects that might impliciltly be set deep in the object graph of the component. That would be super! 3. Implicit dependencies and work in the Constructor Dependency Injection is also about not having implicit dependencies or much work in the constructor. We should evaluate all components based on this. Having a new Something() inside an object constructor is evil, aswell as doing lots of stuff that you cannot influence. greetings, Benjamin On Tuesday 13 January 2009 16:55:57 Ralph Schindler wrote: Comments inline: The better solution is dependency injection, and one facet of this is removing I disagree (if you are talking about DI as a container model) explicit references to Registry/global items from source code. This is a I agree. feature the ZF has yet to include but Bradley Holt has ressurected the idea in the form of Zend_Container ( http://framework.zend.com/wiki/display/ZFPROP/Zend_Container+-+Bradley+Ho lt ) and I really really hope it, or an evolution of it (Zend_Application plugin?), I agree makes it into the library. The last time something like this was proposed it was bogged down by ever expanding requirements and complexity - True, as DI Containers tend to get. simpler is better. +1000 here :) .. Now onto the explanation. To sum it up, I do think we need a solution here that will fit the framework, specifically our components- framework wide, as well as application wide. But, DI Containers (to me) have always introduced a level of indirection that is extremely uncommon for PHP. There are two ideas, I would love to see explored, and both of them would be rooted in what I would call a component development convention, but only at the most forward facing API layer. First, the __construct($options = array()) {} convention for the most forward facing component API constructor adds a level of consistency that makes each and every component look and feel similar in style. This would makes it easy to move from component to component and have a good understanding of what is expected. Zend_Form does this, and to me, it make for the most flexible of components. In each case, $options can be a Zend_Config object, and assoc array of configuration values which can then be pushed down into the varios setXXX() methods, or $options can be the single most well used value, (if this were a Zend_Service component, it could be the API key). I believe this convention is very much used in Solar and its becoming more popular in ZF as we see more components hit the library. Second, I propose we look at creating a Registry class that can be extended (maybe its just a glorified ArrayObject), that can be used and defined by each component. This would allow components to have a *Component Level Registry*. How would this help? Well, instead of there being a dbAdapter key in the Application space registry, Zend_Db_Registry would contain a getDefaultAdapter() method. It might also have a getAdapter($name) method. Also, now the Zend_Db component can manage is component level registry and made the best decisions on how to lazyload and expose its individual pieces to the application layer, or user layer. For Zend_Controller, the api might look like this: Class Zend_Controller_Registry { public function getFront(); public function getDispatcher(); public function getRouter(); public function getRequest(); public function getResponse(); /* .. Others .. */ } Again, this delegate the responsibility down into the actual component of wiring dependencies, and either throwing an exception or lazy
Re: [fw-general] Is Cal Evan's Globals.php a recommended approach
Hello matthew, i would subscribe to such a component based registry thing :-) ok its not up to me, but i think its a very good mixture between DI and simplicity and especially the Controller component would really benefit from the more flexibility. :-) On Tue, 13 Jan 2009 16:38:48 -0500, Matthew Weier O'Phinney matt...@zend.com wrote: -- Benjamin Eberlei kont...@beberlei.de wrote (on Tuesday, 13 January 2009, 06:11 PM +0100): great post ralph! this is a step into a brighter future ;-D my two cents though. 1. having __construct(array $options); is cool from a simplicity point but it hides dependencies, since in an array you couldinclude ANYTHING. Most components also don't require the dependencies to be set in constructor, they take all sort of options and set them but don't raise an exception when a depdenency xyz misses. When you have a sensible default depdenency this would make sense though. It would be the job of the constructor to ensure that required options are passed, then -- or to provide defaults (potentially through an overloaded accessor that lazyloads a default). ezcComponents uses constructor struct objects for configuration. You would have an object Zend_Controller_Config which enforces some variables and is given to the constructor. I like this alot, since objects always allow for more checks on variables than arrays. However, this adds another dependency to using the objects -- you then need a value object before you can even use the object. If we allow either an array or a Zend_Config object, we give more flexibility in userland code for how the options are retrieved and passed to the constructors (they could be subtrees of an application-wide configuration object, or a serialized JSON array stored in memcached, etc). 2. component registries are a great thing IF they are not singletonized. They allow for type checking and consistency checks where the Zend_Registry does not. If you look closely at Ralph's example, you'll notice it wasn't static. :) He and I have discussed this a fair bit, and the idea is that factories and other gateway classes would push themselves and/or the registry down into the subcomponent objects. You could always make a container go into Zend_Registry to make it global, but this should be optional, and pleeease let us just forget the singleton antipattern. :-) If component registries are used we should make sure that all dependencies are overwritable with them, for example the PluginLoader of Zend_Controller for helpers is hardcoded into the front controller. The component registry should include all objects that might impliciltly be set deep in the object graph of the component. That would be super! 3. Implicit dependencies and work in the Constructor Dependency Injection is also about not having implicit dependencies or much work in the constructor. We should evaluate all components based on this. Having a new Something() inside an object constructor is evil, aswell as doing lots of stuff that you cannot influence. I've been pushing the setOptions/setConfig paradigm for a while, and it works really well with DI. Your constructor then passes the options on to setOptions() which attempts to call setters named after the keys. The result is that it allows you to push your dependencies in at instantiation -- leaving the constructor needing to simply check for required settings (if any) only. On Tuesday 13 January 2009 16:55:57 Ralph Schindler wrote: Comments inline: The better solution is dependency injection, and one facet of this is removing I disagree (if you are talking about DI as a container model) explicit references to Registry/global items from source code. This is a I agree. feature the ZF has yet to include but Bradley Holt has ressurected the idea in the form of Zend_Container ( http://framework.zend.com/wiki/display/ZFPROP/Zend_Container+-+Bradley+Ho lt ) and I really really hope it, or an evolution of it (Zend_Application plugin?), I agree makes it into the library. The last time something like this was proposed it was bogged down by ever expanding requirements and complexity - True, as DI Containers tend to get. simpler is better. +1000 here :) .. Now onto the explanation. To sum it up, I do think we need a solution here that will fit the framework, specifically our components- framework wide, as well as application wide. But, DI Containers (to me) have always introduced a level of indirection that is extremely uncommon for PHP. There are two ideas, I would love to see explored, and both of them would be rooted in what I would call a component development convention, but only at the most forward facing API layer. First, the __construct($options = array()) {} convention for the most forward facing component API constructor adds a level of consistency
Re: [fw-general] Re: Re[fw-general] comendation to solve problem with ZendJsonExprFinder in Zend_Json::encode()
hello mezoni, thanks for the report, i'll look into it. haven't thought about UTF-8 so much in the keys. On Sun, 11 Jan 2009 15:46:29 -0800 (PST), mezoni 819...@mail.ru wrote: These code will be passed to json_encode {modal:true,buttons:{Zend_Json_Expression_Index_0:Zend_Json_Expression_Value_0,Zend_Json_Expression_Index_1:Zend_Json_Expression_Value_1,Zend_Json_Expression_Index_2:Zend_Json_Expression_Value_2}} str_replace() work with this patterns fine. -- View this message in context: http://www.nabble.com/Recomendation-to-solve-problem-with-ZendJsonExprFinder-in-Zend_Json%3A%3Aencode%28%29-tp21405959p21406038.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] contributing to Zend Search Lucene
Hello Matt, this sounds like a great addition. You should make an SVN diff of all your changes and put it into a Patch Issue into the ZF Jira Issue Tracker. Additionally you should provide unit-tests for your changes and make sure that old functionality is not broken. Post all this attachments into your jira issue and post the link back into this issue to get people voting for it. This should generate some momentum for it to be included in one of the next versions. greetings, Benjamin On Mon, 12 Jan 2009 09:12:06 -, Matt Pearson mpear...@lizearle.com wrote: Hi there, I'm currently working on a search function for my employer using Zend Search Lucene. The idea is to display search results in much the same way as Google/Nutch I've had to extend the existing ZSL code to be able to create 'snippets' (highlighted document fragments) with a fragmenter, and some (very small) changes to the highlighter. I was wondering if this would be of any use to the framework, or whether somebody is already working on this. I've noticed quite a few people asking for this kind of functionality on the net. Thanks Matt Pearson Internet Solutions Developer Liz Earle Beauty Co. 01983 813884 Work with the environment... think before you print Liz Earle Naturally Active Skincare The Green House Ryde IOW PO33 1BD Telephone +44 (0)1983 813913. Fax +44 (0)1983 813912. Email naturallyact...@lizearle.com mailto:naturallyact...@lizearle.com Web www.lizearle.com http://www.lizearle.com Liz Earle Naturally Active Skincare is a trading name of Liz Earle Beauty Co. Limited. Registered in England No. 3070395 Registered address: 8-10 New Fetter Lane London EC4A 1RS.
Re: [fw-general] Is Cal Evan's Globals.php a recommended approach
the registry is global too and it has no type checking, which makes a global class that has setter and getter for specific types winner over a general registry in my opinion. static classes that contain objects and are used inside dynamic objects are always an obstacle to testing, singletons more than registries but the problem does not disappear. a registry is nothing different than a global $arrayWithObjects; inside a function, just object oriented. The recommended approach (that is independend of Zend or whatnot) should always be explicit dependency injection. greetings, Benjamin On Fri, 9 Jan 2009 23:31:38 -0500, Matthew Weier O'Phinney matt...@zend.com wrote: -- swilhelm st...@studio831.com wrote (on Friday, 09 January 2009, 12:26 PM -0800): I have been Reading Cal Evan's Guide to Zend Framework Programming. In it he describes a Globals.php file for creating a single class to encapsulate access to global resources like the database connection, cache connection, config, etc. This seems useful, particularly if you use it in conjunction with his Controller_Request_Cli class for exposing some of your Zend-based application via command line or cron jobs. I was wondering if this is the recommended approach to exposing global resources or is there a Zend Framework approved method? I've had some back and forth with Cal on his Globals class. :) I personally feel that this is primarily the realm of a registry or dependency injection; a class of static methods is typically difficult to test against, and makes it more difficult to determine what the actual dependencies are for classes that pull from it. Zend_Application may very well make such a Globals class obsolete, as it will make it easier to handle your dependencies and push them either into the registry or directly into the objects that need them. -- Matthew Weier O'Phinney Software Architect | matt...@zend.com Zend Framework | http://framework.zend.com/
Re: [fw-general] Question regarding dojo forms rendered in templates called via xhr.
that is a javascript specific problem. If you load stuff via XHR you have to reattach all the events to it, because they have not been registered. all the content inside the loaded div has not been dojo eventized lets call it, so no javascript is happening there. you have to reattach all events to that specific elements. greetings, Benjamin On Thursday 08 January 2009 12:22:31 Mustafa A. Hashmi wrote: Hi all, I am in the process of switching our application to make use of dojo forms, however, am having some issues with forms which are rendered via xhr requests. In a nutshell: a) Layout is rendered and the index action renders a dojo form which works perfectly fine. b) After submitting the form, the user manually follows a link which calls a JS function and loads the required action template in a specified div. c) The loaded dojo form in the resulting div however doesn't seem to be 'dojo enabled'. The form does render, albeit without any styles or dijit functionality. Please note: initialization of application is based on Matthew Weier O'Phinney's excellent pastebin app. I pasted the relevant sections @: http://www.pastebin.ca/1303381 The entire application source can be viewed at: http://bazaar.launchpad.net/~mhashmi/zivios/devel/files (please see the 'installer' module). Also: I had made quite a few attempts to selectively load the required dojo modules (with dojo.addOnLoad), but for some reason I am not getting it right. I am also confused about setting dojo to declarative mode in the view template when we have already done so in the predispatch action... Any help would be much appreciated. Thanks, -- Mustafa A. Hashmi -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Is javascript framework integration into ZF really that beneficial?
Hello Robert, Hello Josh, thanks for the comments on jQuery. I do see the point in your criticism and share it a bit. Personally I think when the jQuery integration plays best is when you are using it for prototyping, admin areas and scaffolding generation. If you want to use the jQuery or Dojo for a community like website or very heavy workflow optimized behaviour website (like modern enterprise applications) you probably always have to get your hands dirty with js code yourself. From my personal experience I can say this gives very good results with jQuery although i am a very bad frontend programmer. :-) @Robert: What are your thoughts about javascript/view coupling? Any more comments on your idea? Maybe its worth integrating. greetings, Benjamin On Monday 05 January 2009 23:09:14 sprynmr wrote: Thanks Matt, I think I'm coming to pretty much the same conclusion you have, although I think I might favor keeping my form validation in a separate jquery plugin for great flexibility. Definitely going to leverage the JS integration as far as the scaffolding goes and building the script tags (although we may overload that function and run the javascript files through some sort of minify.) Best, Bob -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Http_Client vs cURL
You can also use cURL as adapter for Zend_Http_Client. There is a version in the SVN incubator. The Socket Adapter of Zend_Http_Client has far less functionality than cURL. You need Zend_Http_Client for certain components that rely on it (Service_* for example, Zend_Rest). On Mon, 22 Dec 2008 00:57:11 +0100, till klimp...@gmail.com wrote: On Mon, Dec 22, 2008 at 12:23 AM, Luiz A Brandao Jr fromv...@gmail.com wrote: Hello, What's the reason to use Zend_Http_Client over the cURL extension? Do you know how Zend_Http_Client performs comparatively to curl? Thank you, Luiz If performance is your #1 priority over maintainable code then it's probably cURL. Just benchmark it. However the advantage you gain by using the Zend class is a very easy API, easy customization (through options and by extending the API), etc. pp.. You can't really compare the two. Point taken, you can use both to get the job done, but Zend_Http_Client provides a lot of convenience which you don't get with pure PHP/cURL -- as usually when you turn to a framework. Also, by default Zend_Http_Client uses sockets -- which are omnipresent in 99% of all PHP installs, whereas cURL is not always around. Till
Re: [fw-general] Zend_Soap_AutoDiscover and document literal
Setting document/literal will be possible with the AutoDiscover component that will be shipped with the ZF 1.8 release in february next year. Until then, you should extend and override the specific functions (setClass, addFunction) to gain the desired functionality. greetings, Benjamin On Sun, 14 Dec 2008 16:18:48 -0800 (PST), krytie juli...@lifeevents.com.au wrote: Hello, I'm wanting to use the cool AutoDiscover library to produce document/literal compliant WSDLs, but looking at the setClass() method of Zend_Soap_AutoDiscover, it looks like it is hard coded to use RPC/encoded. What's the best way of allowing document/literal? 1) Hacking Zend_Soap_AutoDiscover to accept document/literal or 2) Sub Class Zend_Soap_AutoDiscover and override the setClass method Cheers -- View this message in context: http://www.nabble.com/Zend_Soap_AutoDiscover-and-document-literal-tp21006481p21006481.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Help with Zend_Soap_AutoDiscover and array of complex types
Hello Krytie, the ArrayOfTypeComplex strategy is not ignored. Its used for the first level and then replaced by the DefaultComplexType for the second level. I havent thought about deeper levels. This is a bug. I have added an issue to Jira and will look into it for the next release. Maybe you should think about writing your own complex strategy that handles this issue for you in the meantime. best regards, Benjamin On Wednesday 03 December 2008 06:04:50 krytie wrote: Hi, How would I go about defining an array of complex types as a property of another complex type? The code below gives me the error. Cannot add a complex type MyComplexTypeB[] that is not an object or where class could not be found in 'DefaultComplexType' strategy. function wsdlAction(){ $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex'); $autodiscover-setClass('MyClass'); $autodiscover-handle(); } class MyComplexTypeB{ /** * @var string */ public $FirstName; /** * @var string */ public $LastName; } class MyComplexTypeA{ /** * @var MyComplexTypeB[] */ public $Answers=array(); } class MyClass{ /** * @param MyComplexTypeA * @return MyComplexTypeB[] */ function testRequest($request){} } It appears to be ignoring the Strategy that I set, when dealing with properties of complex types. Thanks -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] QUestion about jQuery ajaxLink- can anyone take a look on this please?
we are already that far. The problem is javascript within that ajax generated html that is not interpreted correctly when using ajaxLink and inline onClick rendering. On Wednesday 03 December 2008 17:49:31 Daniel Latter wrote: Hi again, You may want to look at Ajaxcontent and ContextSwitches in the manual , with these you can fire of an ajax request to a controller action and have it return HTML you can then use in your current view: class CommentController extends Zend_Controller_Action { public function init() { $ajaxContext = $this-_helper-getHelper('AjaxContext'); $ajaxContext--addActionContext('process', 'html') // processAction method -initContext(); } public function processAction() { $this-_helper-viewRenderer-setNoRender(); $form = new BlogCommentForm(); // Process a new comment // Return the results as JSON; simply assign the results as // view variables, and JSON will be returned. if ($this-_request-isPost()) { $formData = $this-_request-getPost(); if ($form-isValid($formData)) { $posts = new BlogComments(); $row = $posts-createRow(); $row-comment = $form-getValue('comment'); $row-postID = $form-getValue('postID'); $row-save(); $this-view-comment = Your comment has been added; } else { $form-populate($formData); } } } } On Dec 3, 2008, at 16:13, vladimirn [EMAIL PROTECTED] wrote: Hello Benjamin, thanks for your response. Are you saying that ajaxLInk could be used only to display pages which must not have javascipt inside? So, only plain text and html without javascript will work? If so, i really dont see real use for it except to play and have ONE quickly loaded page. Also, no one told me WHY link name is out of href tags. I copied that part of page source above, so i think that i have ajaxLink inside ajaxLink requested page, but its missformated. I dont know. So i must abandon jQuey for now, considering i dont have any knowledge about javascript and dont know to write any. Thanks, V beberlei wrote: Hello vladimirn, this is just not possible as i said earlier. You have to find a generic jQuery by hand written solution for this. I have tested myself if its possible with the inline argument, but that gives javascript errors. The problem is the following. The ajaxLink helper puts jQuery code onto the jQuery Helper stack. When you render from ajax the stack has already been outputted to the view, so its missing the hooks for the new links. If you write some generic javascript yourself you can circumvent this problem rather easy. greetings, Benjamin On Wednesday 03 December 2008 16:36:02 vladimirn wrote: Thank you Daniel, i already have this added in my bootstrap. At least you have read my post :) ajaxLink works ok . But i need to have ajaxLink inside requested ajaxLInk content. Is my english to bad, or no one here can give me an answer? :) I really want thats about my english and that i dont know to explain :) If anyone thinks that could help on this, i will explain it over and over, and make things clear :0) Thanks in advance, V dan.latter wrote: you need $view-addHelperPath(ZendX/JQuery/View/Helper, ZendX_JQuery_View_Helper); in your view I think as this is JQuery related. Thank You Daniel Latter 2008/12/2 vladimirn [EMAIL PROTECTED]: Anyone pls? -- View this message in context: http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a - look-on-this-please--tp20732925p20795245.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Benjamin Eberlei http://www.beberlei.de -- View this message in context: http://www.nabble.com/QUestion-about-jQuery-ajaxLink--can-anyone-take-a-l ook-on-this-please--tp20732925p20816016.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Calling non-php library
no that is not possible. however it should be realitvly straightforward to compile the c++ library into your php and offer a frontend to PHP for it. This is not as hard as it sounds, you should find some information by googling that issue :) On Mon, 1 Dec 2008 21:37:32 -0700, Bin Hu [EMAIL PROTECTED] wrote: Hello, I have been using ZF for sometime and really enjoyed it. Now I am trying to develop a more complex web application. For performance and some other reasons, I want to call an external library written in C++. Is it possible to do so from PHP? Thanks. Bin
Re: [fw-general] Zendx Jquery Datepicker custom viewscript
when you want to seperate design and programming with zend form you can remove all markup decorators from the elements and just place them with ?= $form- element1; ? i think (or was it ?= $form-getElement('element1'); ?). designers can then build the markup while the programmers just build forms that dont have markup decorators (like htmltag, label, dd/dt). On Friday 28 November 2008 00:37:46 aSecondWill wrote: aSecondWill wrote: Ill try and find a different way to wrap it with a div. OK, seem to be a bit cleverer this morning. informed by mats post : http://www.nabble.com/addDecorator-and-dijit-element-td19860515.html mats post i did this: $dateEventEnd-addDecorator(array('analias'='HtmlTag'), array('tag'='div','id'='date_event_end_div')); previously i was trying to do this sort of thing: $dateEventEnd-setDecorators($inputDecorators); but that removes the datepicker decorators, and i wasn't quite sure how to add them back in manually. We have a few teams working on the same site here, and would like to find a way to keep markup of forms in the control of the design / front end team rather than having the backed team programing them, whilst still using the good bits of zend_form. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Validating JQuery forms via AJAX
Hello Manuel, there is currently no way to validate your form via ajax unless you implement that yourself. I might implement that someday, but the form plugin is not part of jQuery or jQuery UI, so I havent integrated that yet. best regards, Benjamin On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera [EMAIL PROTECTED] wrote: Hi, I've created a ZendX_JQuery_Form which has some fields with validators. The submit's click event is linked to a javascript function, where I want to check if the input entered is valid or not. When I did this using dojo forms, it was easy through form.isValid(), but I can't figure the way it's done using JQuery. Is there a way to use the validators before sending the data to the server? -- View this message in context: http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Validating JQuery forms via AJAX
Hello, you could open up an Enhancement/Feature issue in Jira for me (http://framework.zend.com/issues) and attach the changes. I can review and test them, and we could then think about how to integrate them into ZF. I am very interested to contribute an ajax validation, it should be very robust though, so I cannot guarantee that i can include it. On Wed, 26 Nov 2008 15:36:42 +0100, Xavier Vidal [EMAIL PROTECTED] wrote: I have an inherited form class from Zend_Form that can validate Ajax forms and render the error messages using JQuery, if someone is interested, i can share my code and we can promote it to ZF. -Mensaje original- De: Benjamin Eberlei [mailto:[EMAIL PROTECTED] Enviado el: miércoles, 26 de noviembre de 2008 14:50 Para: fw-general@lists.zend.com Asunto: Re: [fw-general] Validating JQuery forms via AJAX Hello Manuel, there is currently no way to validate your form via ajax unless you implement that yourself. I might implement that someday, but the form plugin is not part of jQuery or jQuery UI, so I havent integrated that yet. best regards, Benjamin On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera [EMAIL PROTECTED] wrote: Hi, I've created a ZendX_JQuery_Form which has some fields with validators. The submit's click event is linked to a javascript function, where I want to check if the input entered is valid or not. When I did this using dojo forms, it was easy through form.isValid(), but I can't figure the way it's done using JQuery. Is there a way to use the validators before sending the data to the server? -- View this message in context: http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.h tml Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
Hello, i have looked at the issue again, and what you try to achieve is not really possible. Because ajaxLink generally creates jQuery javascript and attaches it to the jQuery stack which you render with ?= $this-jQuery(); ? in your view. Wenn you call the ajax content and return new links that are created with ajaxLink() their javascript cannot be attached to the jQuery stack anymore, because that has been rendered before. What you could try is the following, in the two links that are generated through the ajax request set in the options 'inline' = true, and in the previous linke set: 'dataType' = 'script', so that it would look like: Normally generated link: array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='script' ) Ajax Requested Link: ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'inline' = true, 'method' = 'POST')); On Wednesday 26 November 2008 17:27:37 vladimirn wrote: Well, i added dataType to all 3 links, but no changes at all vladimirn wrote: THank you for your quick reply. Can you show me how to this, or point me somewhere where i can learn that please? And where to add that? array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='html' ) Like that? beberlei wrote: You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end --- - and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-thi s--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] jQuery Ajax link inside container- how to make this?
br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-thi s--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Benjamin Eberlei http://www.beberlei.de -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zendx Jquery Datepicker custom viewscript
datepicker needs the UiWidgetElement Decorator, NOT the ViewHelper decorator. On Thursday 27 November 2008 07:03:25 aSecondWill wrote: Hi, I had a jquery datepicker working with my options set like this: $time_event_end = new ZendX_JQuery_Form_Element_DatePicker( 'time_event_end', array('jQueryParams' = array( 'showOn' = both , 'buttonImage' = /images/jquery/calendar.gif, 'dateFormat' = 'yy-mm-dd', 'buttonImageOnly' = 'true')) ); But i wanted to add a div around the whole element, dt label dd input, everything. so i set my custom viewscript like this: $time_event_end-setDecorators(array(array('ViewScript', array( 'viewScript' = '_element.phtml', 'id' = 'time_event_end_div' ; and then made a element.phtml that looked like this: div id=?= $this-id ? dt ?= $this-formLabel($this-element-getName(), $this-element-getLabel()) ? /dt dd ?= $this-{$this-element-helper}( $this-element-getName(), $this-element-getValue(), $this-element-getAttribs() ) ? /dd ?= $this-formErrors($this-element-getMessages()) ? div class=hint?= $this-element-getDescription() ?/div /div now my datepicker dosn't have any options set because the onload function for it as changed from $(#time_event_end).datepicker({showOn:both,buttonImage:\/images\/j query\/calendar.gif,dateFormat:yy-mm-dd,buttonImageOnly:true}); to $(#time_event_end).datepicker({helper:datePicker,jQueryParams:{sho wOn:both,buttonImage:\/images\/jquery\/calendar.gif,dateFormat:yy- mm-dd,buttonImageOnly:true},options:[]}); What have i done wrong? i don't think its in the .phtm file right? its the way ive used setDecorators? Any and all help gratefully recieved! Will -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zendx Jquery Datepicker custom viewscript
i dont know about the layout and phtml file, this is not a topic of the datepicker. what i said is, you have to change your setDecorators call to: $time_event_end-setDecorators(array(array('UiWidgetElement', array( 'viewScript' = '_element.phtml', 'id' = 'time_event_end_div' ; DatePicker does not work with ViewHelper but with UiWidgetElement helper. On Thursday 27 November 2008 08:19:56 aSecondWill wrote: hmm, ok. thanks. so can't i specify a phtml file to manage the layout with that? beberlei wrote: datepicker needs the UiWidgetElement Decorator, NOT the ViewHelper decorator. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] ZendX Jquery reports Zend_Dojo error???
but you enabled the View for Dojo support? Because having both Dojo and jQuery helpers in your view will probably not work! you can try this by doing: $view-getHelperPaths() or $view-getPluginLoader()-getPaths() greetings, Benjamin On Tuesday 25 November 2008 15:55:30 vladimirn wrote: I grab this code from documentation and tried to reporoduce some result. So, this is a code: public function indexAction() { $form = new ZendX_JQuery_Form ( ); $form-setDecorators ( array ('FormElements', array ('AccordionContainer', array ('id' = 'tabContainer', 'style' = 'width: 600px;', 'jQueryParams' = array ('alwaysOpen' = false, 'animated' = easeslide ) ) ), 'Form' ) ); $form-setAction ( 'formdemo.php' ); $form-setAttrib ( 'id', 'mainForm' ); $form-setAttrib ( 'class', 'flora' ); $subForm1 = new ZendX_JQuery_Form ( ); $subForm1-setDecorators ( array ('FormElements', array ('HtmlTag', array ('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array ('containerId' = 'mainForm', 'title' = 'DatePicker and Slider' ) ) ) ) ); $subForm2 = new ZendX_JQuery_Form ( ); $subForm2-setDecorators ( array ('FormElements', array ('HtmlTag', array ('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array ('containerId' = 'mainForm', 'title' = 'AutoComplete and Spinner' ) ) ) ) ); // Add Element Date Picker $elem = new ZendX_JQuery_Form_Element_DatePicker ( datePicker1, array (label = Date Picker: ) ); $elem-setJQueryParam ( 'dateFormat', 'dd.mm.yy' ); $subForm1-addElement ( $elem ); // Add Element Spinner $elem = new ZendX_JQuery_Form_Element_Spinner ( spinner1, array ('label' = 'Spinner:' ) ); $elem-setJQueryParams ( array ('min' = 0, 'max' = 1000, 'start' = 100 ) ); $subForm1-addElement ( $elem ); // Add Slider Element $elem = new ZendX_JQuery_Form_Element_Slider ( slider1, array ('label' = 'Slider:' ) ); $elem-setJQueryParams ( array ('defaultValue' = '75' ) ); $subForm2-addElement ( $elem ); // Add Autocomplete Element $elem = new ZendX_JQuery_Form_Element_AutoComplete ( ac1, array ('label' = 'Autocomplete:' ) ); $elem-setJQueryParams ( array ('data' = array ('New York', 'Berlin', 'Bern', 'Boston' ) ) ); $subForm2-addElement ( $elem ); // Submit Button $elem = new Zend_Form_Element_Submit ( btn1, array ('value' = 'Submit' ) ); $subForm1-addElement ( $elem ); $form-addSubForm ( $subForm1, 'subform1' ); $form-addSubForm ( $subForm2, 'subform2' ); $formString = $form-render ( $view ); } AFTER pointing url to the page, i am getting quite strange error: Fatal error: Call to undefined method Zend_Dojo_View_Helper_TabContainer::addPane() in D:\wamp\www\singlescash\library\ZendX\JQuery\View\Helper\TabPane.php on line 72 I think i dont call any Zend_Dojo view helper in here? Or i do? I am using Zend_dojo forms on web site, but not within this directory and this controller -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] ZendX Jquery reports Zend_Dojo error???
you have to make sure, that the jQuery Helper path gets added BEHIND the dojo helper path in the particular module that you are using it in. You have to read the PluginLoader and View Helper manuals on how to make this work. On Tuesday 25 November 2008 17:25:31 vladimirn wrote: Yes, dojo is enabled in bootstrap file. How to avoid this conflict? I am not sure that i know how to use $view-getHelperPath() and $view-getPluginLoader()-getPaths(); Will using this make use of Dojo An JQeury at the same time? Thanks, V beberlei wrote: but you enabled the View for Dojo support? Because having both Dojo and jQuery helpers in your view will probably not work! you can try this by doing: $view-getHelperPaths() or $view-getPluginLoader()-getPaths() greetings, Benjamin On Tuesday 25 November 2008 15:55:30 vladimirn wrote: I grab this code from documentation and tried to reporoduce some result. So, this is a code: public function indexAction() { $form = new ZendX_JQuery_Form ( ); $form-setDecorators ( array ('FormElements', array ('AccordionContainer', array ('id' = 'tabContainer', 'style' = 'width: 600px;', 'jQueryParams' = array ('alwaysOpen' = false, 'animated' = easeslide ) ) ), 'Form' ) ); $form-setAction ( 'formdemo.php' ); $form-setAttrib ( 'id', 'mainForm' ); $form-setAttrib ( 'class', 'flora' ); $subForm1 = new ZendX_JQuery_Form ( ); $subForm1-setDecorators ( array ('FormElements', array ('HtmlTag', array ('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array ('containerId' = 'mainForm', 'title' = 'DatePicker and Slider' ) ) ) ) ); $subForm2 = new ZendX_JQuery_Form ( ); $subForm2-setDecorators ( array ('FormElements', array ('HtmlTag', array ('tag' = 'dl' ) ), array ('TabPane', array ('jQueryParams' = array ('containerId' = 'mainForm', 'title' = 'AutoComplete and Spinner' ) ) ) ) ); // Add Element Date Picker $elem = new ZendX_JQuery_Form_Element_DatePicker ( datePicker1, array (label = Date Picker: ) ); $elem-setJQueryParam ( 'dateFormat', 'dd.mm.yy' ); $subForm1-addElement ( $elem ); // Add Element Spinner $elem = new ZendX_JQuery_Form_Element_Spinner ( spinner1, array ('label' = 'Spinner:' ) ); $elem-setJQueryParams ( array ('min' = 0, 'max' = 1000, 'start' = 100 ) ); $subForm1-addElement ( $elem ); // Add Slider Element $elem = new ZendX_JQuery_Form_Element_Slider ( slider1, array ('label' = 'Slider:' ) ); $elem-setJQueryParams ( array ('defaultValue' = '75' ) ); $subForm2-addElement ( $elem ); // Add Autocomplete Element $elem = new ZendX_JQuery_Form_Element_AutoComplete ( ac1, array ('label' = 'Autocomplete:' ) ); $elem-setJQueryParams ( array ('data' = array ('New York', 'Berlin', 'Bern', 'Boston' ) ) ); $subForm2-addElement ( $elem ); // Submit Button $elem = new Zend_Form_Element_Submit ( btn1, array ('value' = 'Submit' ) ); $subForm1-addElement ( $elem ); $form-addSubForm ( $subForm1, 'subform1' ); $form-addSubForm ( $subForm2, 'subform2' ); $formString = $form-render ( $view ); } AFTER pointing url to the page, i am getting quite strange error: Fatal error: Call to undefined method Zend_Dojo_View_Helper_TabContainer::addPane() in D:\wamp\www\singlescash\library\ZendX\JQuery\View\Helper\TabPane.php on line 72 I think i dont call any Zend_Dojo view helper in here? Or i do? I am using Zend_dojo forms on web site, but not within this directory and this controller -- Benjamin Eberlei http://www.beberlei.de -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Cannot consume SOAP Service
this is very valueable input. thank you very much. I have to look into that. Unfortunatly the AutoDiscover and WSDL internals are in very bad shape to extend without easily breaking backwards compability, so i cannot assure you that I can include it in the next mini or minor release. Do i understand you correctly, that it worked for you with Java, when you switched from encoded to literal? greeetings Benjamin On Tuesday 25 November 2008 21:23:30 Jan Pieper wrote: Hi guys, I created a small soap service with Zend_Soap_Server and Zend_Soap_AutoDiscover but I cannot consume its data via a java soap client. I tried it all the day but it won´t work. - SNIP - class MyFooService { /** * @return string */ public function getStaticString() { return 'Hello World'; } } - SNAP - It is accessable (for me!) via http://jason/Laboratory/JMS/service.php which is the service and http://jason/Laboratory/JMS/service.php?wsdl which will show wsdl definition. The created wsdl definition looks like this: - SNIP - ?xml version=1.0? definitions xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://jason/Laboratory/JMS/service.php; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap-enc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; name=MyFooService targetNamespace=http://jason/Laboratory/JMS/service.php; portType name=MyFooServicePort operation name=getStaticString input message=tns:getStaticStringRequest / output message=tns:getStaticStringResponse / /operation /portType binding name=MyFooServiceBinding type=tns:MyFooServicePort soap:binding style=rpc transport=http://schemas.xmlsoap.org/soap/http; / operation name=getStaticString soap:operation soapAction=http://jason/Laboratory/JMS/service.php#getStaticString; / input soap:body use=literal namespace=http://jason/Laboratory/JMS/service.php; / /input output soap:body use=literal namespace=http://jason/Laboratory/JMS/service.php; / /output /operation /binding service name=MyFooServiceService port name=MyFooServicePort binding=tns:MyFooServiceBinding soap:address location=http://jason/Laboratory/JMS/service.php; / /port /service message name=getStaticStringRequest / message name=getStaticStringResponse part name=getStaticStringReturn type=xsd:string / /message /definitions - SNAP - As you can see I do not use Zend_Soap_AutoDiscover in its original version (see attached MyAutoDiscover.diff, could not extend and use my own class because I need access to private class properties). I needed to change soap:body use=encoded encodingStyle=... / to soap:body use=literal namespace=... / because wsimport (small tool included in jdk) cannot handle encoded. So I used following command to create java classes from wsdl definiton: # wsimport -keep http://jason/Laboratory/JMS/service.php?wsdl So I got this two java classes: # jason.laboratory.jms.service.MyFooServicePort.java # jason.laboratory.jms.service.MyFooServiceService.java After that I created a soap client using these classes (jdk1.6.0_10): - SNIP - package jason.laboratory.jms.myfooclient; import jason.laboratory.jms.service.*; public class MyFooClient { /** * @param args */ public static void main(String[] args) { MyFooServiceService mfss = new MyFooServiceService(); MyFooServicePortmfsp = mfss.getMyFooServicePort(); String result= mfsp.getStaticString(); if (result != null) { System.out.println(Result: + result); } else { System.out.println(Result is NULL); } } } - SNAP - I expected Result: Hello World but I always get Result is NULL. Zend_Soap_Client has no problems consuming the service. It looks like an java problem, but we also tested the same soap server using a Microsoft Dynamics AX soap client and got the same result. Okay we do not get NULL as return value from service, the Microsoft soap client shows 1 as result. So I am searching for a solution how to get it working. I am absolutly clueless why I do not get the correct result. Is there someone who can verify or solve my problem? :-) If there are any questions or if there are more information needed, please ask! If needed I can upload my sources. -- Jan -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] AjaxLink in ZendX_JQuery
Hello Xavier. This is already possible, you can plug the option 'dataType' = 'javascript' into the ajaxLink helper. For example: ?= $this-ajaxLink(test, hello.html, array('dataType' = 'script'), array()); ? This would switch to interpreting the response to execute included javascript. Important is to use 'script', not javascript. As it proxies directly to the dataType options that can be given to jQuery $.get and $.post. On Wednesday 19 November 2008 09:15:02 Xavier Vidal Piera wrote: Hi I think it could be useful to have an extra datatype option in AjaxLink View Helper: the javascript option to eval the server's response in the client. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] PDF, IE7 and sessions
maybe this helps: http://fpdf.org/en/FAQ.php#q3 it should be the same problem. On Wednesday 19 November 2008 16:07:42 Mon Zafra wrote: Hi list, This might be off-topic as I couldn't tell if the problem is caused by IE, PHP, Zend_Pdf or Adobe Reader. Using PHP 5.2.4, ZF trunk r12700, IE7, Adobe Reader 9 ?php require_once 'Zend/Pdf.php'; $pdf = new Zend_Pdf(); $pdf-pages[] = $pdf-newPage(Zend_Pdf_Page::SIZE_A4); session_start(); header('Content-Type: application/pdf'); echo $pdf-render(); This should render a PDF with a single blank page. However, IE7 returns a general error Internet Explorer cannot display the webpage. If I comment the session_start() line, the PDF is rendered fine. My problem is that I need to get some session variables first before rendering the PDF. Has anyone come across this problem, and how did you solve it? -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] jQuery, jqGrid and ZF - pager doesn't work
Hello Pawel, cool that you used ZendX_JQuery as basis :-) The problem is described very simple. Zend_Json cannot handle javascript expressions. Its escaping everything like it were a string. Sadly the Zend_Json_Expr proposal didn't make it into the 1.7 release. To fix this you have to hack your Zend_Json output with preg_replace somehow to strip the around the pager: value. greetings, Benjamin On Friday 14 November 2008 16:35:46 Paweł Chuchmała wrote: Hi. I want to use jqGrid with ZF, so I wrote simple helper based on ZendX_JQuery helpers. I have a problem with some params. As result I must have: jQuery(#list2).jqGrid({ url: '/artist/list/format/json/', datatype: 'json', viewrecords: true, *pager: jQuery('#pager2'),* rowNum:20, rowList:[10,20,30], imgpath: /css/themes/sand/images, sortname: 'id', colNames: ['Id', 'Nazwa'], colModel: [ {name: 'artist_id', index:'artist_id', width:55}, {name: 'artist_name', index:'artist_name', width:300} ], }); so I make array with this options. $params = array( ... 'pager' = jquery('#pager2'), ... ); After Zend_Json::encode($myarray) i have: ... pager: jquery('#pager2') ... from jqGridDocumentation: pager defines that we want to use a pager bar to navigate through the records. This must be a valid html element; In my example it's a string. What is the best solution for this? regards, -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] Zend_Search_Lucene is very sloooooow
ezcomponents has an ready to go solr service component, if you are eager to use solr in your php application. On Sat, 8 Nov 2008 13:21:49 +, keith Pope [EMAIL PROTECTED] wrote: Talking of solr maybe Zend_Service_Solr would be a good addition to the Zend Core? 2008/11/8 Ralf Eggert [EMAIL PROTECTED]: Hi again, thanks to Keith, Matthew and Hakan so far for their feedback about Zend_Search_Lucene. So it seems that ZSL is not yet enterprise ready so far. Is there anybody that did manage to build a search with ZSL and a really large index and can provide us with his findings or best practices? Thanks and best regards, Ralf -- -- [MuTe] --
Re: [fw-general] Database Migrations - Yes, No, Maybe?
does not exist and is not planned from what i can see in the proposals (there is one proposal, but its inactive for many months). if you want to use a formal migration system use Doctrine, Propel or ezcDatabaseSchema. All great components. Since ZF does not enforce a model component on you, its very easy to switch them in. Benjamin On Friday 07 November 2008 19:15:24 Phoenix wrote: Coming to ZF from a Rails background (because I'm much stronger in PHP than in Ruby), one of the things that irks me is the *apparent* lack of a formal database migration system. In Rails, you create migration files, define the structure and/or changes in a DB-neutral context, then run the migration to have the changes made to your database, be it MySQL, Oracle, MSSQL, etc. Does this functionality exist with Zend Framework at all? I haven't seen any mention of it in tutorials or other information, but since I'm new, I figure chances are I'm missing something. If this doesn't exist, is it planned? Thanks. -- Benjamin Eberlei http://www.beberlei.de
[fw-general] Anyone on PHP Conference in Mainz?
Hello, i wanted to ask if anyone is going to be on the international PHP conference in mainz next week? Would be great to get together with some of the ZF users/devs.