Re: [fw-general] Zend Framework 1.12.14, 2.4.6, and 2.5.2 Released!

2015-08-03 Thread Julian Vidal
Hey Matthew, there's a small typo in the link. It says bit.li but I think you meant bit.ly. http://bit.li/zf2015-06 vs http://bit.ly/zf2015-06 Cheers! On Mon, Aug 3, 2015 at 4:25 PM, Matthew Weier O'Phinney matt...@zend.com wrote: We've just released each of: - Zend Framework 1.12.14 -

[fw-general] Package ZF2 in phar

2015-02-04 Thread Julian Vidal
I have a ZF2 app that only has console routes that I would like to package as a PHAR but I've only seen *web* apps packaged like this, not CLI apps. When I attempt to use the examples in the PHP docs http://php.net/manual/en/phar.buildfromdirectory.php I get an error when ZF2 tries to do a chdir()

Re: [fw-general] Bouncing emails?

2014-06-26 Thread Julian Vidal
I got the same email and now all the list's messages are being marked as phishing attempts. On Thu, Jun 26, 2014 at 12:57 PM, Philip G guice...@gmail.com wrote: I just got a notice from ZFW list bot saying emails are bouncing from my address. I've subscribed using my direct gmail address (vs

Re: [fw-general] Is that a good/bad/neutral practice to pass variables to Controller methods?

2014-06-10 Thread Julian Vidal
Dennis, Methods that end in Action are supposed to be called automatically by the framework, not by you directly. You can create your own methods with any signature that you need. You don't have to suffix them with Action though; you can name them whatever you like. On Tue, Jun 10, 2014 at 4:20

Re: [fw-general] Zend\Cache\Pattern

2014-06-05 Thread Julian Vidal
-generateKey('filter')); Seems a bit too much, is there an easy way? Von: Julian Vidal [mailto:jul...@julianvidal.com] Gesendet: Mittwoch, 4. Juni 2014 21:37 An: Marc Tempelmeier Cc: Zend Framework General Betreff: Re: [fw-general] Zend\Cache\Pattern Normally you'd call $filter-filter('some/path

Re: [fw-general] Zend\Cache\Pattern

2014-06-04 Thread Julian Vidal
/var/path/../../mypath'); On Wed, Jun 4, 2014 at 4:07 AM, Marc Tempelmeier m.tempelme...@bqs-institut.de wrote: Can you provide a simple example for hmmm, the ObjectCache incl. saving and loading? *Von:* Julian Vidal [mailto:jul...@julianvidal.com] *Gesendet:* Dienstag, 3. Juni 2014 23

Re: [fw-general] Zend\Cache\Pattern

2014-06-04 Thread Julian Vidal
:* Julian Vidal [mailto:jul...@julianvidal.com] *Gesendet:* Mittwoch, 4. Juni 2014 10:22 *An:* Marc Tempelmeier *Cc:* Zend Framework General *Betreff:* Re: [fw-general] Zend\Cache\Pattern There's one in the documentation but you need to scroll all the way down as the first example at the top

Re: [fw-general] How to render ViewModel immediately (preventing future events)

2014-05-27 Thread Julian Vidal
Have you tried using the render() method on a rendererhttp://framework.zend.com/manual/2.0/en/modules/zend.view.renderer.php-renderer.html ? use Zend\View\Model\ViewModel;use Zend\View\Renderer\PhpRenderer; $renderer = new PhpRenderer(); $model= new ViewModel();$model-setVariable('foo',

Re: [fw-general] Deploy an ZF2 app

2014-05-07 Thread Julian Vidal
I'm currently using a service called DeployHQ which receives a hook from the repository and executes a deployment. Haven't had any problems with it so far. On Thu, May 8, 2014 at 12:41 AM, Ralf Eggert r.egg...@travello.de wrote: Hi, I wonder how all of you deploy your ZF2 applications to

Re: [fw-general] Upload a zf2 module from user interface (similar to wordpress plugin upload/installation)

2014-04-04 Thread Julian Vidal
My 2 cents (though by no means a thorough answer): application.config.php contains just an array. You can load it and modify at will. One thing that I use over and over to manage separating config files is this: public function getConfig() { $config = array();

[fw-general] How to get list of queries that go through db adapter

2014-03-18 Thread Julian Vidal
I'm looking for a way to get a list of queries that my app executes. I'm not looking for profiling, timing info, or anything like that; just a list. I was hoping that the DB adapter triggered an event that I could catch but I can't find anything. How can this be achieved?

Re: [fw-general] How to get list of queries that go through db adapter

2014-03-18 Thread Julian Vidal
. Thanks! On Tue, Mar 18, 2014 at 1:56 PM, Marco Pivetta ocram...@gmail.com wrote: Did you try using BjyProfiler? https://github.com/bjyoungblood/BjyProfiler Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 18 March 2014 18:53, Julian Vidal jul

Re: [fw-general] Was Zend PDF Deprecated?

2014-02-24 Thread Julian Vidal
I've used this in the past with great success: http://www.tcpdf.org Don't know if it is still maintained... On Mon, Feb 24, 2014 at 3:35 PM, dennis-fedco dmatve...@fedco-usa.comwrote: I do not see Zend PDF library in ZF2. Most links lead me towards ZF1 in my searches. Was PDF library

[fw-general] Per-item cache TTL

2014-02-11 Thread Julian Vidal
As mentioned in this pull requesthttps://github.com/zendframework/zf2/pull/5386ZF2 does not provide per-item cache TTL like ZF1 did. I'm using per-item TTL all throughout a ZF1 app which I'm currently migrating to ZF2 and desperately need to be able to do this. If I need to configure another

Re: [fw-general] Per-item cache TTL

2014-02-11 Thread Julian Vidal
-baby time! On Tue, Feb 11, 2014 at 3:05 PM, Marc Bennewitz z...@marc-bennewitz.dewrote: Julian, Am 11.02.2014 18:41, schrieb Julian Vidal: As mentioned in this pull requesthttps://github.com/zendframework/zf2/pull/5386ZF2 does not provide per-item cache TTL like ZF1 did. That's

[fw-general] How to make confg file local.php overwrite global.php (instead of merging it)?

2014-02-07 Thread Julian Vidal
I have a situation in which an app is deployed into Amazon Beanstalk, Rackspace, and of course the local development environments. As it turns out, each environment will use a different cache adapter (Rackspace and Amazon will use memcached, and development will use filesystem). My global.php

[fw-general] Render 2 different view models in the same action

2014-01-22 Thread Julian Vidal
In some of my actions I need render two different pages; one for desktop and one for mobile. With regular pages catch the onFinish event and send the rendered version to a message queue for later processing. My problem is that sometimes I need to render *both* versions of the page in one shot and

Re: [fw-general] How to change the layout based on a cookie?

2014-01-15 Thread Julian Vidal
\Mvc\MvcEvent $event) { if ($someCondition) { $event-getTarget()-layout('layout/layout1.phtml'); }else { $event-getTarget()-layout('layout/layout2.phtml'); } } On 15/01/14 03:36, Julian Vidal wrote: My app has the same URLs for the desktop and mobile versions

[fw-general] How to change the layout based on a cookie?

2014-01-14 Thread Julian Vidal
My app has the same URLs for the desktop and mobile versions. People don't hit it directly, they go though Akamai first and Akamai in turn sets a cookie to true or false whether the user is is using a mobile device or not. So the real detection is carried out by Akamai. I'm currently detecting

Re: [fw-general] ZF2 Do i have to create a model for a data base view?

2014-01-06 Thread Julian Vidal
Diego, Model can mean many things. When you say model for every table do you mean a RowGateway object for every table? Also, when you say i created a view un my data base do you mean that you stored the actual HTML/PHP in a particular column on your database? It will be easier for me to help you

Re: [fw-general] How to unit test a method that creates a Zend\Db\Sql\Sql object?

2013-12-12 Thread Julian Vidal
PM, Julian Vidal jul...@julianvidal.com wrote: I have this method that I would like to unit test. Since it's creating the Sql object inside the method, I can't mock it up. Initially I thought about making Sql be an instance property except that I'd have to reset it every time I use

Re: [fw-general] How to unit test a method that creates a Zend\Db\Sql\Sql object?

2013-12-12 Thread Julian Vidal
) { if (is_null($adapter)) { $adapter = $this-getMasterDbAdapter(); } $sql = new Sql($adapter); return $sql-delete(); } } On Thu, Dec 12, 2013 at 1:48 PM, Julian Vidal jul...@julianvidal.comwrote: Matthew, Thanks for your answer. Going a little step further

Re: [fw-general] Removing require_once() from PHPUnit Tests

2013-12-11 Thread Julian Vidal
Looks like your MachinistController is extending zfcUser's UserController but the autoloading is not kicking in because you haven't specified that particular module's path in your standard autoloader. In your posted code look for StandardAutoloader::LOAD_NS and pass it an array (you are currently

[fw-general] How to unit test a method that creates a Zend\Db\Sql\Sql object?

2013-12-10 Thread Julian Vidal
I have this method that I would like to unit test. Since it's creating the Sql object inside the method, I can't mock it up. Initially I thought about making Sql be an instance property except that I'd have to reset it every time I use it in other methods and this will most likely lead to hard to

[fw-general] Why doesn't RowGateway include a reference to it's parent TableGateway like on ZF1?

2013-11-20 Thread Julian Vidal
I'm migrating an app from ZF1 to ZF2 and found that I could previously grab any Zend_Db_Table_Rowset object and by doing $row-getTable() I'd get a reference to the implementation of Zend_Db_Table_Abstract that created it. This is no longer the case in ZF2. In my case this is very important since

[fw-general] ACL in the Service Layer

2013-11-01 Thread Julian Vidal
In a recent Zend Training class, Evan Coury made the point of putting your ACL in the Service Layer as opposed to sticking it in each Controller. While I agree with this, I'm running into an issue with this design and would need some advice on how to solve it. My system needs to run a few cron

Re: [fw-general] Upgrading from Zend_Db_Table to Zend\Db\TableGateway

2013-10-26 Thread Julian Vidal
nice to learn Zend\Db but there is also a zf2 module called DoctrineORMModule for doctrine which are a lot of people are using. On Fri, Oct 25, 2013 at 2:31 PM, Julian Vidal jul...@julianvidal.comwrote: Next week I'll be attempting a migration from an old ZF1 app that relies heavily on Zend_Db's

[fw-general] Upgrading from Zend_Db_Table to Zend\Db\TableGateway

2013-10-25 Thread Julian Vidal
Next week I'll be attempting a migration from an old ZF1 app that relies heavily on Zend_Db's table gateway pattern into a ZF2 app. I've already migrated one app to ZF2 before (so I know how to do it) but in that case the app wasn't using Zend_Db. Has any one found any gotchas or things to look

Re: [fw-general] Unit testing triggered events

2013-10-22 Thread Julian Vidal
Artur, Julian: If you just care if any event is fired at all, use the Mock that Marco suggested. You mean Norbert :) On Tue, Oct 22, 2013 at 2:08 PM, Artur Bodera abod...@gmail.com wrote: On Tue, Oct 22, 2013 at 8:06 PM, Artur Bodera abod...@gmail.com wrote: If you want to test if

[fw-general] Unit testing triggered events

2013-10-03 Thread Julian Vidal
I'm trying to make sure that my events are indeed getting fired and I came up with this unit test. The test works but asserting that true equals true seems like a hack. Is there a proper way to test this? $eventManager-attach('mymethod.post', function() { $this-assertTrue(true); }); Julian.

[fw-general] Understanding trigger()

2013-09-26 Thread Julian Vidal
I'm trying to get a deeper understanding of events in ZF2. After a lot of reading and experimentation I think I have come up with an optimal solution that will satisfy my requirements: 1) Allow listeners to modify the calling params 2) Allow called method to be short circuited by a listener 3)

[fw-general] ZF2: Proper way of executing code on first run only

2013-03-15 Thread Julian Vidal
I'm developing an app that will be deployed automatically into cloud servers. Is there a proper pattern to perform some setup on first run only? By setup I mean running something as simple as an action in a controller inside the same app. But of course this has to only happen once in the lifetime

Re: [fw-general] Zend_Form textarea quoting issue

2012-11-19 Thread Julian Vidal
Hi, Alayn, Yep, they're off. :( On Mon, Nov 19, 2012 at 5:09 AM, Alayn Gortazar al...@irontec.com wrote: - Mensaje original - I have a form that only has one textarea and one submit button (no filters and no validators). So far I haven't added any functionality to it but as I

[fw-general] Zend_Form textarea quoting issue

2012-11-18 Thread Julian Vidal
I have a form that only has one textarea and one submit button (no filters and no validators). So far I haven't added any functionality to it but as I was trying it I noticed that quotes get added incrementally with every submit on the rendered textarea's content. If I enter a single quote, the

[fw-general] ZfcUser\Service\User dependency injection pattern explanation

2012-11-13 Thread Julian Vidal
After attending ZendCon 2012 I saw how a lot of classes in ZF2 that implemented DI and had their dependencies passed to them through the constructor. I understand that ZF2 has a Service Manager that helps with this. I'm trying to learn how to implement this and learn its best practices. And

Re: [fw-general] ZfcUser\Service\User dependency injection pattern explanation

2012-11-13 Thread Julian Vidal
Artur, Thank you for your input. It's been very informative! Julian. It's not against it. It's still an Inversion of Control way of doing things, which is a good thing. ZF2 DI has been in active development in late 2011 and has gained a lot of traction among contributors. At some point