[fw-general] Zend_Session::start causes Apache to hang after the session is created

2010-02-12 Thread Andy Baird
I'm having an issue after installing a Zend Framework application on a
shared host environment.

The app itself works fine until I try to login. I'm using Zend_Session as
the session mechanism. As soon as I try to log in, the application
completely indefinitely hangs.

This happens after a session object has been created on the server for a
client. I've narrowed it down to the second Zend_Session::start() call that
gets made.

I know the site worked perfectly fine on my own server (CentOS5.3 with php
5.2)

Anyone ever had any similar problems?


Re: [fw-general] Is there a way to suppress specific validator error messages?

2010-02-12 Thread Jurian Sluiman
On Friday 12 Feb 2010 18:37:59 Ryan Lange wrote:
> My specific concern is with Zend_Validate_EmailAddress and host name
> validation. In the case of an input like "exam...@examplecom" (missing
> period in the host name), the validator returns 3 distinct error messages.
> Zend_Validate_EmailAddress sets its own message for host name validation
> failure, but it also pulls in all error messages (in this case, 2) from the
> Zend_Validate_Hostname instance it uses.
> 
> Now, showing the user 3 error messages that say essentially the same thing
> ("Your email address appears to be invalid") seems a bit much.
> 
> Keep in mind that this is not a question about *customizing* validator
> messages. I use Zend_Translate for that purpose, but, in my case, I'm still
> left with 3 identical error messages. I'm wondering if anyone knows of a
> way to simply "throw away" specific error messages. (On a whim, I tried
> setting the message templates to NULL, but that just ends up returning an
> empty string.)
> 
> Thanks in advance,
> Ryan

Looking at the code, there is no way to configure it.

I'd create my own EmailAddress validator, overriding the isValid() method to 
disable the error messages from the hostname validator.

Regards, Jurian
-- 
Jurian Sluiman
CTO Soflomo V.O.F.
http://soflomo.com


Re: [fw-general] Migrate old project for use with Zend_Tool?

2010-02-12 Thread Maghiel Dijksman
But, given that the user kept himself a bit to the recommended 
structure, this should not be too hard?
Especially for the controllers and action; controller classes are 
postfixed with Controller, and action methods with Action.


Regards,
Maghiel

On 12-2-2010 16:18, Ralph Schindler wrote:
Not currently, that is a interesting an difficult task- and it's on 
the backlog of things to do.  Given that we've gotten so far in the 
1.10 release, this might be a feature addition for 1.11


The problem is that any static script would have to look at the 
existing project and try to guess what things are "what is a 
controller", "what is an action", "what is a view script", and "what 
is a layout script". This is not easy to accomplish.


-ralph

Maghiel Dijksman wrote:

Hello all,

Is it possible to migrate an old project so it can be used with 
zend_tool (zf command)?


Regards,
Maghiel








[fw-general] the reference guide is really getting on my nerves

2010-02-12 Thread Mark Wright
Every time I go to a page in the reference guide that I have not
already been to I just get a blank page. Sometimes it happens even if
I have already been to that page, like when hitting the back button. I
know that a reload will fix it (sometimes it takes two or three
reloads), but why on earth do have have to do that with every single
page?



Mark

-- 
Have fun or die trying - but try not to actually die.


[fw-general] Re: How can we pass a Zend_Barcode image to a Zend_PDF?

2010-02-12 Thread rpsimao

Perfect, thanks Mickael.
That's what I needed.

Regards
Ricardo


On Feb 12, 2010, at 7:54 PM, mikaelkael [via Zend Framework Community] wrote:

> I just tested this code without any problems (the file is located in 
> Zend test directory): 
> 
> ini_set('include_path', '../library/'); 
> require_once 'Zend/Loader/Autoloader.php'; 
> Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true); 
> 
> $pdf = new Zend_Pdf(); 
> //... your work 
> 
> //a font is mandatory for Pdf 
> Zend_Barcode::setBarcodeFont(dirname(__FILE__) . 
> '\Zend\Barcode\Object\_fonts\Vera.ttf'); 
> 
> $barcodeOptions = array('text' => 'ZEND-FRAMEWORK-1'); 
> $rendererOptions = array('topOffset' => 50); 
> $pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
> $barcodeOptions, $rendererOptions)->setResource($pdf)->draw(); 
> 
> $barcodeOptions = array('text' => 'ZEND-FRAMEWORK-2'); 
> $rendererOptions = array('topOffset' => 100); 
> $pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
> $barcodeOptions, $rendererOptions)->setResource($pdfWithBarcode)->draw(); 
> 
> $barcodeOptions = array('text' => 'ZEND-FRAMEWORK-3'); 
> $rendererOptions = array('topOffset' => 150); 
> $pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
> $barcodeOptions, $rendererOptions)->setResource($pdfWithBarcode)->draw(); 
> 
> // and the end render your Zend_Pdf 
> $pdfWithBarcode->save('testBarcode.pdf'); 
> 
> Mickael 
> 
> Le 12/02/2010 20:43, Ricardo Simão a écrit :
> 
> > 
> > But I'm loading the Pdf with Zend_Pdf. How can I chain the barcode? 
> > That's what I'm trying to do, but haven't figured it out yet. 
> > 
> > Sent from my iPhone 
> > 
> > On 2010/02/12, at 19:25, mikaelkael <[hidden email]> wrote: 
> > 
> >> Of course, if your PDF isn't loaded (or loadable) with Zend_Pdf, this 
> >> solution doesn't work ;) 
> >> 
> >> If loadable with Zend_Pdf, you can chain the barcode generation and 
> >> render your Pdf without problem. 
> >> 
> >> Mickael 
> >> 
> >> Le 12/02/2010 20:04, Ricardo Simão a écrit : 
> >>> 
> >>> Hi Mickael 
> >>> 
> >>> That also doesn't work for what I need. 
> >>> I'm loading a base Pdf with some content already. I need to inject 
> >>> several barcodes into that file. 
> >>> The values are passed via a Post form. 
> >>> Then the Pdf is rendered to the browser for printing. 
> >>> 
> >>> But thanks for your reply. If you have another solution please let 
> >>> me know. 
> >>> Thanks 
> >>> Ricardo 
> >>> Sent from my iPhone 
> >>> 
> >>> On 2010/02/12, at 13:35, mkk <[hidden email]> wrote: 
> >>> 
>  Hello, 
>  
>  You don't need to create a temporary image. The Pdf renderer exists: 
>  $pdf = new Zend_Pdf(); 
>  ... // your work 
>  
>  //a font is mandatory for Pdf 
>  
>  //statically 
>  Zend_Barcode_Object::setBarcodeFont('my_font.ttf'); 
>  //or with your options 
>  $barcodeOptions = array('text' => 'ZEND-FRAMEWORK', 'font' 
>  =>'my_font.ttf'); 
>  $rendererOptions = array(); 
>  
>  $pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
>  $barcodeOptions, $rendererOptions)->setResource($pdf)->draw(); 
>  
>  Mickael 
>  
>  > Message du 12/02/10 13:31 
>  > De : "rpsimao" 
>  > A : [hidden email] 
>  > Copie à : 
>  > Objet : [fw-general] Re: How can we pass a Zend_Barcode image to 
>  a Zend_PDF? 
>  > 
>  > 
>  > 
>  > Found the solution. 
>  > 
>  > Must create a image and pass to the 
>  Zend_Pdf_Image::imageWithPath() method. 
>  > so : 
>  > // Only the text to draw is required 
>  > $barcodeOptions = array('text' => 'ZEND-FRAMEWORK'); 
>  > 
>  > // No required options 
>  > $rendererOptions = array(); 
>  > 
>  > // Draw the barcode in a new image, 
>  > $imageResource = Zend_Barcode::draw( 
>  > 'code39', 'image', $barcodeOptions, $rendererOptions 
>  > ); 
>  > 
>  > imagejpeg($imageResource, 'barcode.jpg', 100); 
>  > 
>  > // Free up memory 
>  > imagedestroy($imageResource); 
>  > 
>  > $image = Zend_Pdf_Image::imageWithPath('barcode.jpg'); 
>  > 
>  > ... 
>  > $page->drawImage($image, $x1, $y1, $x2, $y2); 
>  > ...
> 
> 
> 
> 
> 
> View message @ 
> http://n4.nabble.com/How-can-we-pass-a-Zend-Barcode-image-to-a-Zend-PDF-tp1478435p1489600.html
>  
> To unsubscribe from Re: How can we pass a Zend_Barcode image to a Zend_PDF?, 
> click here.
> 


-- 
View this message in context: 
http://n4.nabble.com/How-can-we-pass-a-Zend-Barcode-image-to-a-Zend-PDF-tp1478435p1490426.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Hot to get cacheManager resource from anywhere?

2010-02-12 Thread Pádraic Brady
The problem is largely that the bootstrap registers itself, acting as a 
Registry (or Service Locator even since it is a dynamic resource loader). If 
you split the bootstrap from the registry role, you'd have something better 
scoped for testing perhaps.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Hector Virgen 
To: Zend Framework General 
Sent: Fri, February 12, 2010 6:23:26 PM
Subject: Re: [fw-general] Hot to get cacheManager resource from anywhere?

One of the problems I've found with pulling the bootstrap from the front 
controller (besides the singleton issue) is that the front controller in my 
test environment didn't have the bootstrap param. I had to manually set it 
within my appBootStrap() for my tests to work:

public function appBootStrap()
{
$this->_application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$this->_application->bootstrap();
$this->frontController->setParam('bootstrap', 
$this->_application->getBootstrap());
}

A better approach would be to inject your model with its dependencies:

// in controller
$model = new MyModel();
$cacheManager = $this->getInvokeArg('bootstrap')->getResource('cachemanager');
$model->setCacheManager($cacheManager);
// do stuff with model

But again, in the testing environment, you'll need to manually inject the 
bootstrap into the front controller.
--
Hector



On Fri, Feb 12, 2010 at 5:17 AM, Pádraic Brady  wrote:

>
>Simplest method from anywhere:
>
>Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager');
>
>It's downfall is it adds a dependency on a singleton, but without knowing how 
>your model works it's difficult to suggest a better alternative without the 
>singleton.
>
> Pádraic Brady
>
>http://blog.astrumfutura.com
>>http://www.survivethedeepend.com
>OpenID Europe Foundation Irish Representative
>
>
>
>
>
>

 >From: Marko78 
>To: fw-general@lists.zend.com
>Sent: Fri, February 12, 2010 12:38:11 PM
>Subject: [fw-general] Hot to get cacheManager resource from anywhere?
>
>>
>
>
>Hi,
>
>I have set up cacheManager in my application.ini and I want to get it from
>my Model.
>
>How can I get it?
>
>br, Marko
>-- 
>View this message in context: 
>http://n4.nabble.com/Hot-to-get-cacheManager-resource-from-anywhere-tp1478479p1478479.html
>>
>Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: How can we pass a Zend_Barcode image to a Zend_PDF?

2010-02-12 Thread mikaelkael
I just tested this code without any problems (the file is located in 
Zend test directory):


ini_set('include_path', '../library/');
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);

$pdf = new Zend_Pdf();
//... your work

//a font is mandatory for Pdf
Zend_Barcode::setBarcodeFont(dirname(__FILE__) . 
'\Zend\Barcode\Object\_fonts\Vera.ttf');


$barcodeOptions = array('text' => 'ZEND-FRAMEWORK-1');
$rendererOptions = array('topOffset' => 50);
$pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
$barcodeOptions, $rendererOptions)->setResource($pdf)->draw();


$barcodeOptions = array('text' => 'ZEND-FRAMEWORK-2');
$rendererOptions = array('topOffset' => 100);
$pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
$barcodeOptions, $rendererOptions)->setResource($pdfWithBarcode)->draw();


$barcodeOptions = array('text' => 'ZEND-FRAMEWORK-3');
$rendererOptions = array('topOffset' => 150);
$pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
$barcodeOptions, $rendererOptions)->setResource($pdfWithBarcode)->draw();


// and the end render your Zend_Pdf
$pdfWithBarcode->save('testBarcode.pdf');

Mickael

Le 12/02/2010 20:43, Ricardo Simão a écrit :


But I'm loading the Pdf with Zend_Pdf. How can I chain the barcode? 
That's what I'm trying to do, but haven't figured it out yet.


Sent from my iPhone

On 2010/02/12, at 19:25, mikaelkael  wrote:

Of course, if your PDF isn't loaded (or loadable) with Zend_Pdf, this 
solution doesn't work ;)


If loadable with Zend_Pdf, you can chain the barcode generation and 
render your Pdf without problem.


Mickael

Le 12/02/2010 20:04, Ricardo Simão a écrit :


Hi Mickael

That also doesn't work for what I need.
I'm loading a base Pdf with some content already. I need to inject 
several barcodes into that file.

The values are passed via a Post form.
Then the Pdf is rendered to the browser for printing.

But thanks for your reply. If you have another solution please let 
me know.

Thanks
Ricardo
Sent from my iPhone

On 2010/02/12, at 13:35, mkk  wrote:


Hello,

You don't need to create a temporary image. The Pdf renderer exists:
$pdf = new Zend_Pdf();
... // your work

//a font is mandatory for Pdf

//statically
Zend_Barcode_Object::setBarcodeFont('my_font.ttf');
//or with your options
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK', 'font' 
=>'my_font.ttf');

$rendererOptions = array();

$pdfWithBarcode = Zend_Barcode::factory('code39', 'pdf', 
$barcodeOptions, $rendererOptions)->setResource($pdf)->draw();


Mickael

> Message du 12/02/10 13:31
> De : "rpsimao"
> A : fw-general@lists.zend.com
> Copie à :
> Objet : [fw-general] Re: How can we pass a Zend_Barcode image to 
a Zend_PDF?

>
>
>
> Found the solution.
>
> Must create a image and pass to the 
Zend_Pdf_Image::imageWithPath() method.

> so :
> // Only the text to draw is required
> $barcodeOptions = array('text' => 'ZEND-FRAMEWORK');
>
> // No required options
> $rendererOptions = array();
>
> // Draw the barcode in a new image,
> $imageResource = Zend_Barcode::draw(
> 'code39', 'image', $barcodeOptions, $rendererOptions
> );
>
> imagejpeg($imageResource, 'barcode.jpg', 100);
>
> // Free up memory
> imagedestroy($imageResource);
>
> $image = Zend_Pdf_Image::imageWithPath('barcode.jpg');
>
> ...
> $page->drawImage($image, $x1, $y1, $x2, $y2);
> ...






[fw-general] Re: How can we pass a Zend_Barcode image to a Zend_PDF?

2010-02-12 Thread rpsimao

Hi Mickael

That also doesn't work for what I need.
I'm loading a base Pdf with some content already. I need to inject several
barcodes into that file.
The values are passed via a Post form.
Then the Pdf is rendered to the browser for printing.

But thanks for your reply. If you have another solution please let me know.
Thanks
-- 
View this message in context: 
http://n4.nabble.com/How-can-we-pass-a-Zend-Barcode-image-to-a-Zend-PDF-tp1478435p1487135.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Unit Testing Problem with ZF project

2010-02-12 Thread Hector Virgen
Generally, the autoloader is not set up until the setUp() method is called,
meaning you'll need to require_once the file manually or set up an
autoloader.

--
Hector


On Fri, Feb 12, 2010 at 3:41 AM, greg606  wrote:

>
> Hi,
> I have a problem with running Unit Tests in my application in Zend Studio
> 7.1
>
> I use test code from here:
> http://maff.ailoo.net/2009/04/set-up-a- ... nit-setup/
> http://maff.ailoo.net/downloads/zf_1.8b1_app.zip
>
> and I get:
> Fatal error: Class ‘ControllerTestCase’ not found in C:\Program Files
>
> (x86)\Zend\Apache2\htdocs\ekorki\tests\application\controllers\IndexControllerTest.php
> on line 3
>
> I tried with the order of include paths but it doesn't seem to help
> Tests run normally when they're generated by Zend Studio and put alongside
> the tested controller. Not when I try to run them from the folder tests
> as it should be...
>
> Could you help me? PLEASE
> --
> View this message in context:
> http://n4.nabble.com/Unit-Testing-Problem-with-ZF-project-tp1478430p1478430.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Hot to get cacheManager resource from anywhere?

2010-02-12 Thread Hector Virgen
One of the problems I've found with pulling the bootstrap from the front
controller (besides the singleton issue) is that the front controller in my
test environment didn't have the bootstrap param. I had to manually set it
within my appBootStrap() for my tests to work:

public function appBootStrap()
{
 $this->_application = new Zend_Application(
 APPLICATION_ENV,
 APPLICATION_PATH . '/configs/application.ini'
 );
 $this->_application->bootstrap();
 *$this->frontController->setParam('bootstrap',
$this->_application->getBootstrap());*
}

A better approach would be to inject your model with its dependencies:

// in controller
$model = new MyModel();
$cacheManager =
$this->getInvokeArg('bootstrap')->getResource('cachemanager');
$model->setCacheManager($cacheManager);
// do stuff with model

But again, in the testing environment, you'll need to manually inject the
bootstrap into the front controller.

--
Hector


On Fri, Feb 12, 2010 at 5:17 AM, Pádraic Brady wrote:

> Simplest method from anywhere:
>
>
> Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager');
>
> It's downfall is it adds a dependency on a singleton, but without knowing
> how your model works it's difficult to suggest a better alternative without
> the singleton.
>
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative
>
>
> --
> *From:* Marko78 
> *To:* fw-general@lists.zend.com
> *Sent:* Fri, February 12, 2010 12:38:11 PM
> *Subject:* [fw-general] Hot to get cacheManager resource from anywhere?
>
>
> Hi,
>
> I have set up cacheManager in my application.ini and I want to get it from
> my Model.
>
> How can I get it?
>
> br, Marko
> --
> View this message in context:
> http://n4.nabble.com/Hot-to-get-cacheManager-resource-from-anywhere-tp1478479p1478479.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: How can we pass a Zend_Barcode image to a Zend_PDF?

2010-02-12 Thread mikaelkael

Hi,

You don't need to create a temporary image, there is a PDF renderer:

$pdf = new Zend_Pdf();
... // your work

$barcodeOptions = array('text' => 'MY-TEXT', 'font' => 
'path/to/my-font.ttf');

$rendererOptions = array();

$pdfResource = Zend_Barcode::factory('code39', 'pdf', $barcodeOptions, 
$rendererOptions)->setResource($pdf)->draw();


Mickaël

Le 12/02/2010 13:31, rpsimao a écrit :

Found the solution.

Must create a image and pass to the Zend_Pdf_Image::imageWithPath() method.
so :
// Only the text to draw is required
$barcodeOptions = array('text' =>  'ZEND-FRAMEWORK');

// No required options
$rendererOptions = array();

// Draw the barcode in a new image,
$imageResource = Zend_Barcode::draw(
 'code39', 'image', $barcodeOptions, $rendererOptions
);

imagejpeg($imageResource, 'barcode.jpg', 100);

// Free up memory
imagedestroy($imageResource);

$image = Zend_Pdf_Image::imageWithPath('barcode.jpg');

...
$page->drawImage($image, $x1, $y1, $x2, $y2);
...
   







[fw-general] Is there a way to suppress specific validator error messages?

2010-02-12 Thread Ryan Lange
My specific concern is with Zend_Validate_EmailAddress and host name
validation. In the case of an input like "exam...@examplecom" (missing
period in the host name), the validator returns 3 distinct error messages.
Zend_Validate_EmailAddress sets its own message for host name validation
failure, but it also pulls in all error messages (in this case, 2) from the
Zend_Validate_Hostname instance it uses.

Now, showing the user 3 error messages that say essentially the same thing
("Your email address appears to be invalid") seems a bit much.

Keep in mind that this is not a question about *customizing* validator
messages. I use Zend_Translate for that purpose, but, in my case, I'm still
left with 3 identical error messages. I'm wondering if anyone knows of a way
to simply "throw away" specific error messages. (On a whim, I tried setting
the message templates to NULL, but that just ends up returning an empty
string.)

Thanks in advance,
Ryan


Re: [fw-general] Migrate old project for use with Zend_Tool?

2010-02-12 Thread Jurian Sluiman
On Friday 12 Feb 2010 16:18:05 Ralph Schindler wrote:
> The problem is that any static script would have to look at the existing
> project and try to guess what things are "what is a controller", "what
> is an action", "what is a view script", and "what is a layout script".
> This is not easy to accomplish.
> 
> -ralph

I did notice creating a module which already exists on the filesystem is quite 
simple. The folders which don't exist (in my case most view/fiters folders) are 
added, the rest is still the same (so in the controllers directory all files 
are still there).

Regards, Jurian
-- 
Jurian Sluiman
CTO Soflomo V.O.F.
http://soflomo.com


Re: [fw-general] Migrate old project for use with Zend_Tool?

2010-02-12 Thread Ralph Schindler
Not currently, that is a interesting an difficult task- and it's on the 
backlog of things to do.  Given that we've gotten so far in the 1.10 
release, this might be a feature addition for 1.11


The problem is that any static script would have to look at the existing 
project and try to guess what things are "what is a controller", "what 
is an action", "what is a view script", and "what is a layout script". 
This is not easy to accomplish.


-ralph

Maghiel Dijksman wrote:

Hello all,

Is it possible to migrate an old project so it can be used with 
zend_tool (zf command)?


Regards,
Maghiel



Re: [fw-general] Re: bootstrap & include path confusion

2010-02-12 Thread Núria
The constant APPLICATION_PATH refers to the path of your application folder,
so this include path definition would work for a structure like:

application/
library/
...

In your case, however, the library is within the application folder itself.
I guess the include path would rather be:

includePaths.library = APPLICATION_PATH "/library"

2010/2/11 tonystamp 

>
> Thanks for the reply.
>
> Had a look at a simple project created with Zend_Tool. Seems to be very
> similar to what i have, except i have an extra library of code created
> under
> application:
>
> application/library/Zend
> application/library/MyRepo
>
> I have this in the application.ini already:
> includePaths.library = APPLICATION_PATH "/../library"
> ...but it still does not seem to find files located in MyRepo ??? Which is
> why i thought it might be something to do with setting up a namespace for
> application/library/MyRepo?
> --
> View this message in context:
> http://n4.nabble.com/bootstrap-include-path-confusion-tp1475010p1477891.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Zend_Mail exhaust memory reading multipart mail with large attachment

2010-02-12 Thread Jens Wabnitz
Hello Michael,

due to timing restrictions i stay using the php imap functions.
But i would also like to see the missing functions in the Zend Imap classes.

Maybe we can build a two men task force to contribute it.
But has at least to wait until i have finished my current project.

Thanks for your help
Jens

Am 11.02.2010 12:03, schrieb Michael Kliewe:
> Hello Jens,
>
> exactly, I extended both Zend_Mail_Storage_Imap and
> Zend_Mail_Protocol_Imap because I need many functions that both
> classes don't provide, for example I work only with unique ids, not
> sequence numbers. So I had to change many of the functions.
>
> For example it is also not possible to search or sort at the moment in
> Zend_Mail_Storage_Imap, so I had to add the missing functions. 
> Have a look at
> http://framework.zend.com/issues/browse/ZF-8858
> http://framework.zend.com/issues/browse/ZF-9138
> and here I added the possibility to copy many mails with just one imap
> command (because calling copy() 1000 times is very slow)
> http://framework.zend.com/issues/browse/ZF-8513
>
> Would be cool if someone patches this functionality into the library.
>
> I used "Iloha MIME Library (IML)" for parsing the response of the
> BODYSTRUCTURE request. Just 3 of the functions in it are needed. It is
> from 2002, but I didn't find a better solution until now, and it is GPL.
>
> Perhaps you have a better way to solve it?
>
> Michael
>
>
> On Feb 11, 2010, at 1:01 AM, Jens Wabnitz wrote:
>
>> Hello Michael,
>>
>> thanks for the hint.
>> How do you send the command to imap server?
>> Tried to do it with the Zend_Mail_Protocol_Imap Instance but failed.
>> Got the information with imap_fetchstructure() but only for the cost
>> of another connection.
>>
>> Shouldn't the Imap classes be modified to lazy load content?
>>
>> Thanks again
>> Jens
>>
>>
>> Am 10.02.2010 14:56, schrieb Michael Kliewe:
>>> Hi,
>>>
>>> I had the same problem, and I solved it with the imap command
>>> FETCH BODYSTRUCTURE
>>>
>>> There you get the headers of all parts of a mail (or of specific
>>> parts if you set more parameters to the request). You can also
>>> request headers of many mails by one request. 
>>> The only "problem" is to parse that result, because it looks like
>>>
>>> * 2 FETCH (BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "us-ascii")
>>> NIL NIL "7BIT" 1120 1) ("TEXT" "HTML" ("charset" "us-ascii") NIL NIL
>>> "QUOTED-PRINTABLE" 3874 1) 
>>> Michael
>>> 
>>> http://www.phpgangsta.de
>>>
>>>
>>> On Feb 10, 2010, at 2:06 PM, Jens Wabnitz wrote:
>>>
 Hello,

 i'm building an application with mail reading
 capabilities using Zend_Mail_Storage_Imap.

 It seems that the RecursiveIterator for Messages and even the
 countParts
 Method fetch the whole content of the parts.
 For mails with larger attachments calling these functions leads to a
 "Fatal error: Allowed memory size of 67108864 bytes exhausted ...".

 Is there any way to get the headers of message parts without
 fetching the content?

 Thanks in advance
 Jens


>>>
>>>
>>
>



[fw-general] Re: bootstrap & include path confusion

2010-02-12 Thread tonystamp

Thanks for the reply.

Had a look at a simple project created with Zend_Tool. Seems to be very
similar to what i have, except i have an extra library of code created under
application:

application/library/Zend
application/library/MyRepo

I have this in the application.ini already:
includePaths.library = APPLICATION_PATH "/../library"
...but it still does not seem to find files located in MyRepo ??? Which is
why i thought it might be something to do with setting up a namespace for
application/library/MyRepo?
-- 
View this message in context: 
http://n4.nabble.com/bootstrap-include-path-confusion-tp1475010p1477891.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Hot to get cacheManager resource from anywhere?

2010-02-12 Thread Pádraic Brady
Simplest method from anywhere:

Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('cachemanager');

It's downfall is it adds a dependency on a singleton, but without knowing how 
your model works it's difficult to suggest a better alternative without the 
singleton.

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Marko78 
To: fw-general@lists.zend.com
Sent: Fri, February 12, 2010 12:38:11 PM
Subject: [fw-general] Hot to get cacheManager resource from anywhere?


Hi,

I have set up cacheManager in my application.ini and I want to get it from
my Model.

How can I get it?

br, Marko
-- 
View this message in context: 
http://n4.nabble.com/Hot-to-get-cacheManager-resource-from-anywhere-tp1478479p1478479.html
Sent from the Zend Framework mailing list archive at Nabble.com.


[fw-general] Hot to get cacheManager resource from anywhere?

2010-02-12 Thread Marko78

Hi,

I have set up cacheManager in my application.ini and I want to get it from
my Model.

How can I get it?

br, Marko
-- 
View this message in context: 
http://n4.nabble.com/Hot-to-get-cacheManager-resource-from-anywhere-tp1478479p1478479.html
Sent from the Zend Framework mailing list archive at Nabble.com.


[fw-general] Re: How can we pass a Zend_Barcode image to a Zend_PDF?

2010-02-12 Thread rpsimao

Found the solution.

Must create a image and pass to the Zend_Pdf_Image::imageWithPath() method.
so :
// Only the text to draw is required
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK');

// No required options
$rendererOptions = array();

// Draw the barcode in a new image,
$imageResource = Zend_Barcode::draw(
'code39', 'image', $barcodeOptions, $rendererOptions
);

imagejpeg($imageResource, 'barcode.jpg', 100);

// Free up memory
imagedestroy($imageResource);

$image = Zend_Pdf_Image::imageWithPath('barcode.jpg');

...
$page->drawImage($image, $x1, $y1, $x2, $y2);
...




-- 
View this message in context: 
http://n4.nabble.com/How-can-we-pass-a-Zend-Barcode-image-to-a-Zend-PDF-tp1478435p1478470.html
Sent from the Zend Framework mailing list archive at Nabble.com.


[fw-general] How can we pass a Zend_Barcode image to a Zend_PDF?

2010-02-12 Thread rpsimao

How can we pass a Zend_Barcode image to a Zend_PDF?

With this:
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK');
$rendererOptions = array();

// Draw the barcode in a new image,
$imageResource = Zend_Barcode::draw(
'code39', 'image', $barcodeOptions, $rendererOptions
);

I pass the $imageResource to the Zend_Pdf_Page::drawImage() method:

...
$page->drawImage($imageResource, $x1, $y1, $x2, $y2);

...
Zend Server throws: "PHP Catchable fatal error:  Argument 1 passed to
Zend_Pdf_Page::drawImage() must be an instance of Zend_Pdf_Resource_Image,
instance of Zend_Barcode_Renderer_Image given, ."

Please advice
thnks
-- 
View this message in context: 
http://n4.nabble.com/How-can-we-pass-a-Zend-Barcode-image-to-a-Zend-PDF-tp1478435p1478435.html
Sent from the Zend Framework mailing list archive at Nabble.com.


[fw-general] Unit Testing Problem with ZF project

2010-02-12 Thread greg606

Hi,
I have a problem with running Unit Tests in my application in Zend Studio
7.1

I use test code from here:
http://maff.ailoo.net/2009/04/set-up-a- ... nit-setup/
http://maff.ailoo.net/downloads/zf_1.8b1_app.zip

and I get:
Fatal error: Class ‘ControllerTestCase’ not found in C:\Program Files
(x86)\Zend\Apache2\htdocs\ekorki\tests\application\controllers\IndexControllerTest.php
on line 3

I tried with the order of include paths but it doesn't seem to help
Tests run normally when they're generated by Zend Studio and put alongside
the tested controller. Not when I try to run them from the folder tests
as it should be...

Could you help me? PLEASE
-- 
View this message in context: 
http://n4.nabble.com/Unit-Testing-Problem-with-ZF-project-tp1478430p1478430.html
Sent from the Zend Framework mailing list archive at Nabble.com.