Re: [fw-general] HeadMeta

2009-10-12 Thread Hector Virgen
Another way around this would be to set your default description early (like
in a bootstrap init method) and let your view scripts override it
when necessary.
--
Hector


On Mon, Oct 12, 2009 at 7:07 PM, Ian Warner
wrote:

> Further to this I have been examining the Code to try and get at a property
> to see if it already exists:
>
> I see this in: abstract class
> Zend_View_Helper_Placeholder_Container_Standalone
>
> /**
>  * Overloading: retrieve property
>  *
>  * @param  string $key
>  * @return mixed
>  */
> public function __get($key)
> {
> $container = $this->getContainer();
>
> if (isset($container[$key])) {
> return $container[$key];
> }
>
> return null;
> }
>
> However as the Container is a sequential object it would be lucky to get
> the property I want based on the key wouldn't it as I need to pass in an int
> value
>
> Zend_View_Helper_Placeholder_Container Object ( [0] => stdClass Object (
> [type] => name [name] => title [content] => Content. [modifiers] => Array (
> ) ) [2] => stdClass Object ( [type] => name [name] => keywords [content] =>
> keywords [modifiers] => Array ( ) ) [3] => stdClass Object ( [type] => name
> [name] => description [content] => description [modifiers] => Array ( ) ) )
>
> What i want is the property based on the name.
>
> Sorry if I am missing a trick here but just need to see if Description is
> already set if it is then do not set again.
>
>
> 2009/10/13 Ian Warner 
>
> I would have thought though that there can only be one Description so I
>> need to do
>>
>> // Layout Call
>> if ($config->meta->description) {
>> $this->headMeta()->setName('description', $config->meta->description);
>> }
>>
>> // View Call
>> $this->headMeta()->setName('description', 'Words words words.');
>>
>> Trouble is the Layout call is getting processed afterwards and overwriting
>> my view call - can I check if something exists in the array first and then
>> decide to call the layout setName?
>>
>> Cheers
>>
>> 2009/10/10 Matthew Weier O'Phinney 
>>
>> -- Ian Warner  wrote
>>> (on Saturday, 10 October 2009, 02:38 AM +0900):
>>> > I have this in my Layout script - setting some default Meta Data:
>>> >
>>> > // Setting META Headers come from the Config File
>>> > if ($config->meta->keywords) {
>>> > $this->headMeta()->appendName('keywords', $config->meta->keywords);
>>> > }
>>> >
>>> > if ($config->meta->description) {
>>> > $this->headMeta()->appendName('description',
>>> $config->meta->description);
>>> > }
>>> >
>>> > echo $this->headMeta() . PHP_EOL;
>>> >
>>> >
>>> > Now in a View I want to overide so I call:
>>> > $this->headMeta()->setName('description', 'Words words words.');
>>> >
>>> > I would expect there to be only one description on the site - but two
>>> are
>>> > printed the default and the one from the view.
>>> > Is this a bug or expected behaviour - if so how do I make sure only one
>>> is
>>> > visible.
>>>
>>> Expected behavior; setName() sets the first element in the array.
>>>
>>> You can *clear* what's in the array by passing an empty array to
>>> exchangeArray(), as the containers extend ArrayObject:
>>>
>>>$this->headMeta()->exchangeArray(array());
>>> $this->headMeta()->setName('description', 'Words words words.');
>>>
>>> --
>>> Matthew Weier O'Phinney
>>> Project Lead| matt...@zend.com
>>> Zend Framework  | http://framework.zend.com/
>>>
>>
>>
>


Re: [fw-general] HeadMeta

2009-10-12 Thread Ian Warner
Further to this I have been examining the Code to try and get at a property
to see if it already exists:

I see this in: abstract class
Zend_View_Helper_Placeholder_Container_Standalone

/**
 * Overloading: retrieve property
 *
 * @param  string $key
 * @return mixed
 */
public function __get($key)
{
$container = $this->getContainer();

if (isset($container[$key])) {
return $container[$key];
}

return null;
}

However as the Container is a sequential object it would be lucky to get the
property I want based on the key wouldn't it as I need to pass in an int
value

Zend_View_Helper_Placeholder_Container Object ( [0] => stdClass Object (
[type] => name [name] => title [content] => Content. [modifiers] => Array (
) ) [2] => stdClass Object ( [type] => name [name] => keywords [content] =>
keywords [modifiers] => Array ( ) ) [3] => stdClass Object ( [type] => name
[name] => description [content] => description [modifiers] => Array ( ) ) )

What i want is the property based on the name.

Sorry if I am missing a trick here but just need to see if Description is
already set if it is then do not set again.


2009/10/13 Ian Warner 

> I would have thought though that there can only be one Description so I
> need to do
>
> // Layout Call
> if ($config->meta->description) {
> $this->headMeta()->setName('description', $config->meta->description);
> }
>
> // View Call
> $this->headMeta()->setName('description', 'Words words words.');
>
> Trouble is the Layout call is getting processed afterwards and overwriting
> my view call - can I check if something exists in the array first and then
> decide to call the layout setName?
>
> Cheers
>
> 2009/10/10 Matthew Weier O'Phinney 
>
> -- Ian Warner  wrote
>> (on Saturday, 10 October 2009, 02:38 AM +0900):
>> > I have this in my Layout script - setting some default Meta Data:
>> >
>> > // Setting META Headers come from the Config File
>> > if ($config->meta->keywords) {
>> > $this->headMeta()->appendName('keywords', $config->meta->keywords);
>> > }
>> >
>> > if ($config->meta->description) {
>> > $this->headMeta()->appendName('description',
>> $config->meta->description);
>> > }
>> >
>> > echo $this->headMeta() . PHP_EOL;
>> >
>> >
>> > Now in a View I want to overide so I call:
>> > $this->headMeta()->setName('description', 'Words words words.');
>> >
>> > I would expect there to be only one description on the site - but two
>> are
>> > printed the default and the one from the view.
>> > Is this a bug or expected behaviour - if so how do I make sure only one
>> is
>> > visible.
>>
>> Expected behavior; setName() sets the first element in the array.
>>
>> You can *clear* what's in the array by passing an empty array to
>> exchangeArray(), as the containers extend ArrayObject:
>>
>>$this->headMeta()->exchangeArray(array());
>> $this->headMeta()->setName('description', 'Words words words.');
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead| matt...@zend.com
>> Zend Framework  | http://framework.zend.com/
>>
>
>


Re: [fw-general] HeadMeta

2009-10-12 Thread Ian Warner
I would have thought though that there can only be one Description so I need
to do

// Layout Call
if ($config->meta->description) {
$this->headMeta()->setName('description', $config->meta->description);
}

// View Call
$this->headMeta()->setName('description', 'Words words words.');

Trouble is the Layout call is getting processed afterwards and overwriting
my view call - can I check if something exists in the array first and then
decide to call the layout setName?

Cheers

2009/10/10 Matthew Weier O'Phinney 

> -- Ian Warner  wrote
> (on Saturday, 10 October 2009, 02:38 AM +0900):
> > I have this in my Layout script - setting some default Meta Data:
> >
> > // Setting META Headers come from the Config File
> > if ($config->meta->keywords) {
> > $this->headMeta()->appendName('keywords', $config->meta->keywords);
> > }
> >
> > if ($config->meta->description) {
> > $this->headMeta()->appendName('description',
> $config->meta->description);
> > }
> >
> > echo $this->headMeta() . PHP_EOL;
> >
> >
> > Now in a View I want to overide so I call:
> > $this->headMeta()->setName('description', 'Words words words.');
> >
> > I would expect there to be only one description on the site - but two are
> > printed the default and the one from the view.
> > Is this a bug or expected behaviour - if so how do I make sure only one
> is
> > visible.
>
> Expected behavior; setName() sets the first element in the array.
>
> You can *clear* what's in the array by passing an empty array to
> exchangeArray(), as the containers extend ArrayObject:
>
>$this->headMeta()->exchangeArray(array());
> $this->headMeta()->setName('description', 'Words words words.');
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
>


[fw-general] ZF 1.9.4 sanity check tarballs available

2009-10-12 Thread Matthew Weier O'Phinney
Sanity check tarballs of ZF 1.9.4 are now available here:

Full:

http://framework.zend.com/releases/preview/ZendFramework-1.9.4/ZendFramework-1.9.4.zip

http://framework.zend.com/releases/preview/ZendFramework-1.9.4/ZendFramework-1.9.4.tar.gz

Minimal:

http://framework.zend.com/releases/preview/ZendFramework-1.9.4/ZendFramework-1.9.4-minimal.zip

http://framework.zend.com/releases/preview/ZendFramework-1.9.4/ZendFramework-1.9.4-minimal.tar.gz

We also have tarballs for all documentation and API docs, GData, AMF,
and InfoCard available should you want to test those; ping me for URLs
if you do.

We plan to release sometime mid- to late afternoon (EST) tomorrow,
Tuesday, 13 October 2009.

-- 
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/


Re: [fw-general] getActionName() in bootstrap

2009-10-12 Thread Chris Murray

I built an ACL similar to yours about a year ago, before I really understood
how to use ZF properly.
My simple solution was to extend Zend_Controller_Action and put a series of
init functions in this class. This solved a number of problems like you are
having, especially the need to know what the action is, whether it exists,
and whether the user is authorized to see it, and centralized redirect
logic. I can't recommend this approach because generally you should directly
use existing ZF classes as much as possible before extending them, but can
say that it has served me well, and has not introduced any issues, thus far.

scss wrote:
> 
> Hello again,
> In the code I posted about dynamic acl rules from db,
> (http://pastie.org/650296)
> there is a disadvantage that I could not solve yet (just found it a
> few hours ago).
> 
> The problem is that,
> if the user not logged in and the resource requires logged in member,
> then the plugin sends the user to the login page.
> If the page is a not found/non-existing controller or action, then the
> same rule is applied if the user is not logged in.
> 
> In other words, if not logged in, the user is forwarded to the login
> page whether the page is existing or not(non-existing page).
> I think that the correct way is to check if the page exists or not and
> then redirect the user to the login page if it exists.
> if not, redirect the user to not found page.
> I am not sure where and how to check if the page is non-existing
> page/action and put a condition there.
> I checked all the methods of dispatch mechanism but not quite clear
> how to apply this patch.
> 
> Any help or comments..
> Thanks,
> scs
> 
> On Sun, Oct 11, 2009 at 5:01 PM, scs  wrote:
>> Hello,
>> I found a bug in the code I pasted below. To fix it, please remove
>> line 30 which is:
>> $this->_linkRole = 'guest'; in __construct function
>>
>> scs
>>
>> On Sun, Oct 11, 2009 at 2:12 PM, scs  wrote:
>>> Hi,
>>> Here is the finished plugin code. Yet, it still needs some cleaning
>>> and improvements..
>>> http://pastie.org/650296
>>>
>>> Best,
>>> scs
>>>
>>> On Sun, Oct 11, 2009 at 2:03 PM, holografix . 
>>> wrote:
 Hi

 It would be nice if you share your code.

 Cheers
 holo

 2009/10/11 scs 
>
> Matthew, thank you for your comment and explanation.
>
>
> I removed the My_Acl class and used directly $acl = new Zend_Acl
> And then moved everything to the plugin using custom methods for
> getting/setting resources. And then
> in plugin-native methods, I created the rules and check if user is
> allowed or not.
> That works fine now. I can paste the code in pastie if anybody would
> like to see or comment on it..
>
> Thanks all,
> scs
>
> On Fri, Oct 9, 2009 at 9:14 PM, Matthew Weier O'Phinney
>  wrote:
> > -- scs  wrote
> > (on Friday, 09 October 2009, 08:50 PM +0300):
> >> Thank you all.
> >> In fact I am aware of that the routing does not take place in
> >> bootstrap but only with the help of plugins.
> >>
> >> This is the short story why i needed it:
> >> I was implementing a zend_acl system which is stored on db.
> >> In this system, every page has a record in db and every page is
> given
> >> a role (a common role: guest, member etc.).
> >> sample table:
> >> fields: id, name, module, controller, action, role
> >> values:1, contact, default, contact, index, guest
> >>
> >> To initiate the acl, I have a function _initAcl() in bootstrap
> file:
> >> {
> >>     //get frontcontroller and auth
> >>    ...
> >>    $acl = new My_Acl();
> >>    $frontController->registerPlugin(new My_Plugin_Acl($acl,
> $auth));
> >> }
> >>
> >>
> >> The  class My_Acl has the function:
> >> __construct() {
> >>  1. get roles and resources from db (private functions of this
> >> class): No Problem
> >>  2. add them to acl ($this->addResource/addRole): No Problem
> >>  3. find the requested page from the db and gets its role ???
> >>  4. set allow rule for the page: $this->allow(page_role_name,
> >> resource, action) ???
> >> }
> >>
> >> The problem is in the 3rd step; I need to find the controller name
> and
> >> action name so that
> >> I can fetch the page's role_name from the db with the requested
> >> controller and action name. And then go on 4th step above.
> >
> >
> > I'd say you're doing too much in your constructor.
> >
> > Move 3 and 4 to a separate method, and call that method from
> > routeShutdown() or dispatchLoopStartup(). At that point you'd know
> the
> > actual controller/action pair, and will have no problems.
> >
> >
> >> Lets say the requested page is url/contact/index
> >>
> >> To get this page record from the db,
> >> I need to know the controller_name and action_name so that
> >>

Re: [fw-general] Getting Started - Issues on CentOS

2009-10-12 Thread Simon TITE
On Mon, 12 Oct 2009 16:35:11 +0200, Jeremy Clifton   
wrote:


I'm trying to get started with Zend Framework and running into some  
issues. I'mworking on a virtual machine with CentOS 5.3. It's running  
PHP 5.3.0.


I've been following the instructions in the "Getting Started with Zend  
Framework 1.9"found here: http://akrabat.com/zend-framework-tutorial/
When I get to the point of testing Zend_Tool ("zf show version") I get  
severalthousand lines of warnings about failed includes followed by the  
version. For >instance:




I had the exact same problem on my Ubuntu system, and I think I solved it  
more by luck than judgement. So after a lot of trial and error, I can't  
remember *exactly* what the final answer was. However, this one was  
certainly important:

-
1. The PHP include path must point to a directory called  
"ZendFramework/library", (and possibly also the one called "pear") which  
could be almost anywhere, depending on how you downloaded the framework. I  
eventually used synaptic to load the Zend Server Community edition, which  
seemed to give me a nice clean installation. On my system this put in the  
following line (or maybe I added it myself, I don't remember) into the  
php.ini file:


include_path =  
".:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear"


The include_path is found in the php.ini file, which on my system is:
"/usr/local/zend/etc/php.ini"
--
2. I recursively changed the group of the directory /usr/local/zend and  
all its sub-files and directories to be "www-data":


"chgrp -R www-data /usr/local/zend"

but I don't know if this actually made a difference. I also changed their  
access permissions to 775, and put my own user into the www-data group, so  
I wouldn't have to become root or sudo to access things there.


"chmod -R 775 /usr/local/zend",
"useradd -G www-data my_user_name". (please check the commands, I'm  
working from memory here...)


This may have helped, because I was trying to create the project in my  
home directory, using my own username, not sudo or root.)

---
3. I put zf.sh and zf.php into "/usr/local/zend/bin", and changed .bashrc  
to put this directory into my $PATH - perhaps the files were already  
there, but putting them in the PATH probably helped. Also I created an  
alias of "zf='zf.sh'" in my profile.

---
Hope this helps, it's by no means an authoratitive answer, just some  
haphazard things that eventually worked for me.


-- Simon


Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-10-12 Thread Thomas Weidner

There was no further response because it's no issue with the actual release.
There is already a workaround for this PHP bug integrated within ZF.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - 
From: "Ryan Lange" 

To: 
Sent: Monday, October 12, 2009 3:43 PM
Subject: Re: [fw-general] User uploads file bigger than what's allowed in 
php.ini, can it be caught?




This is an old thread, but I noticed that no one actually hit upon the
*real* problem.

On Mon, Feb 16, 2009 at 7:28 AM, bytte  wrote:



Bug in my code or bug in Zend Framework?



Neither. It's an unfortunate short-coming of PHP itself.

http://us3.php.net/manual/en/ini.core.php#ini.post-max-size : "If the size
of post data is greater than post_max_size, the $_POST and $_FILES
superglobals are empty."

Files are uploaded as post data. If the file being uploaded pushes the 
post

data beyond the size allowed in php.ini, you get empty $_POST and $_FILES
superglobals, which is why ZF complains about not being able to find your
file field.





Re: [fw-general] Getting Started - Issues on CentOS

2009-10-12 Thread Jeremy Postlethwaite

If you are running SE Linux, certain paths and directories will be invisible
to the system.

Be sure to examine the logs for audit and messages:

tail -f /var/log/audit/audit.log

tail -f /var/log/messages

You may see messages such as:

Sep 24 08:43:48 server2001 setroubleshoot: SELinux is preventing access to
files with the default label, default_t. For complete SELinux messages. run
sealert -l dee71e13-efb6-461e-b086-a0bb10d718

In this case type this at the command line (the alert id in the log is
specific to the incedent):

sealert -l dee71e13-efb6-461e-b086-a0bb10d718

- Jeremy Postlethwaite


Ralph Schindler-2 wrote:
> 
> It looks like those directories are not executable by your user and they 
> are .  This is a known issue and will be fixed in 1.10.  Basically, 
> Zend_Tool attempts to use an auto-detection mechanism to find its
> providers.
> 
> In the coming days, I will produce a alpha version of 1.10 that you can 
> start using as it will not try to auto-detect out the box.
> 
> -ralph
> 
> Jeremy Clifton wrote:
>> Hi folks,
>> 
>> I'm trying to get started with Zend Framework and running into some 
>> issues. I'm working on a virtual machine with CentOS 5.3. It's running 
>> PHP 5.3.0.
>> 
>> I've been following the instructions in the "Getting Started with Zend 
>> Framework 1.9" found here: http://akrabat.com/zend-framework-tutorial/
>> 
>> When I get to the point of testing Zend_Tool ("zf show version") I get 
>> several thousand lines of warnings about failed includes followed by the 
>> version. For instance:
>> 
>>> [jclif...@localhost ~]# zf show version
>>> PHP Warning:  include_once(/usr/share/pear/.registry): failed to open 
>>> stream: No such file or directory in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>>
>>> Warning: include_once(/usr/share/pear/.registry): failed to open 
>>> stream: No such file or directory in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>> PHP Warning:  include_once(): Failed opening 
>>> '/usr/share/pear/.registry' for inclusion 
>>> (include_path='.:/usr/share/pear:/usr/share/php') in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>>
>>> Warning: include_once(): Failed opening '/usr/share/pear/.registry' 
>>> for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>> PHP Warning:  
>>> include_once(/usr/share/pear/.registry/.channel.pecl.php.net): failed 
>>> to open stream: No such file or directory in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>> 
>> [snipped]
>> 
>>> Warning: include_once(): Failed opening '/usr/share/pear/PEAR/REST' 
>>> for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>> PHP Warning:  include_once(/usr/share/pear/Net): failed to open 
>>> stream: No such file or directory in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>>
>>> Warning: include_once(/usr/share/pear/Net): failed to open stream: No 
>>> such file or directory in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>> PHP Warning:  include_once(): Failed opening '/usr/share/pear/Net' for 
>>> inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>>
>>> Warning: include_once(): Failed opening '/usr/share/pear/Net' for 
>>> inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
>>> /usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
>>> Zend Framework Version: 1.9.3PL1
>> 
>> It appears to me that it's trying to include things that aren't PHP 
>> library files and failing.
>> 
>> FWIW I can follow the same instructions on OS X and I have no issues at 
>> all. The problem is that the virtual server I'm using is a clone of the 
>> machine that I'll eventually be deploying on ... so I'd like to have it 
>> working there.
>> 
>> Am I doing something stupid, or is this a bug that should be reported?
>> 
>> Best,
>> Jeremy
>> 
>> ---
>> Jeremy Clifton 
>> 4-8-4 Software Works
>> (423) 240-4512
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Getting-Started---Issues-on-CentOS-tp25856866p25859266.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Getting Started - Issues on CentOS

2009-10-12 Thread Ralph Schindler
It looks like those directories are not executable by your user and they 
are .  This is a known issue and will be fixed in 1.10.  Basically, 
Zend_Tool attempts to use an auto-detection mechanism to find its providers.


In the coming days, I will produce a alpha version of 1.10 that you can 
start using as it will not try to auto-detect out the box.


-ralph

Jeremy Clifton wrote:

Hi folks,

I'm trying to get started with Zend Framework and running into some 
issues. I'm working on a virtual machine with CentOS 5.3. It's running 
PHP 5.3.0.


I've been following the instructions in the "Getting Started with Zend 
Framework 1.9" found here: http://akrabat.com/zend-framework-tutorial/


When I get to the point of testing Zend_Tool ("zf show version") I get 
several thousand lines of warnings about failed includes followed by the 
version. For instance:



[jclif...@localhost ~]# zf show version
PHP Warning:  include_once(/usr/share/pear/.registry): failed to open 
stream: No such file or directory in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90


Warning: include_once(/usr/share/pear/.registry): failed to open 
stream: No such file or directory in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
PHP Warning:  include_once(): Failed opening 
'/usr/share/pear/.registry' for inclusion 
(include_path='.:/usr/share/pear:/usr/share/php') in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90


Warning: include_once(): Failed opening '/usr/share/pear/.registry' 
for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
PHP Warning:  
include_once(/usr/share/pear/.registry/.channel.pecl.php.net): failed 
to open stream: No such file or directory in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90


[snipped]

Warning: include_once(): Failed opening '/usr/share/pear/PEAR/REST' 
for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
PHP Warning:  include_once(/usr/share/pear/Net): failed to open 
stream: No such file or directory in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90


Warning: include_once(/usr/share/pear/Net): failed to open stream: No 
such file or directory in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
PHP Warning:  include_once(): Failed opening '/usr/share/pear/Net' for 
inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90


Warning: include_once(): Failed opening '/usr/share/pear/Net' for 
inclusion (include_path='.:/usr/share/pear:/usr/share/php') in 
/usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90

Zend Framework Version: 1.9.3PL1


It appears to me that it's trying to include things that aren't PHP 
library files and failing.


FWIW I can follow the same instructions on OS X and I have no issues at 
all. The problem is that the virtual server I'm using is a clone of the 
machine that I'll eventually be deploying on ... so I'd like to have it 
working there.


Am I doing something stupid, or is this a bug that should be reported?

Best,
Jeremy

---
Jeremy Clifton 
4-8-4 Software Works
(423) 240-4512




[fw-general] Getting Started - Issues on CentOS

2009-10-12 Thread Jeremy Clifton

Hi folks,

I'm trying to get started with Zend Framework and running into some  
issues. I'm working on a virtual machine with CentOS 5.3. It's running  
PHP 5.3.0.


I've been following the instructions in the "Getting Started with Zend  
Framework 1.9" found here: http://akrabat.com/zend-framework-tutorial/


When I get to the point of testing Zend_Tool ("zf show version") I get  
several thousand lines of warnings about failed includes followed by  
the version. For instance:



[jclif...@localhost ~]# zf show version
PHP Warning:  include_once(/usr/share/pear/.registry): failed to  
open stream: No such file or directory in /usr/share/pear/Zend/Tool/ 
Framework/Loader/Abstract.php on line 90


Warning: include_once(/usr/share/pear/.registry): failed to open  
stream: No such file or directory in /usr/share/pear/Zend/Tool/ 
Framework/Loader/Abstract.php on line 90
PHP Warning:  include_once(): Failed opening '/usr/share/ 
pear/.registry' for inclusion (include_path='.:/usr/share/pear:/usr/ 
share/php') in /usr/share/pear/Zend/Tool/Framework/Loader/ 
Abstract.php on line 90


Warning: include_once(): Failed opening '/usr/share/pear/.registry'  
for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in / 
usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
PHP Warning:  include_once(/usr/share/ 
pear/.registry/.channel.pecl.php.net): failed to open stream: No  
such file or directory in /usr/share/pear/Zend/Tool/Framework/Loader/ 
Abstract.php on line 90


[snipped]

Warning: include_once(): Failed opening '/usr/share/pear/PEAR/REST'  
for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in / 
usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90
PHP Warning:  include_once(/usr/share/pear/Net): failed to open  
stream: No such file or directory in /usr/share/pear/Zend/Tool/ 
Framework/Loader/Abstract.php on line 90


Warning: include_once(/usr/share/pear/Net): failed to open stream:  
No such file or directory in /usr/share/pear/Zend/Tool/Framework/ 
Loader/Abstract.php on line 90
PHP Warning:  include_once(): Failed opening '/usr/share/pear/Net'  
for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in / 
usr/share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90


Warning: include_once(): Failed opening '/usr/share/pear/Net' for  
inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /usr/ 
share/pear/Zend/Tool/Framework/Loader/Abstract.php on line 90

Zend Framework Version: 1.9.3PL1


It appears to me that it's trying to include things that aren't PHP  
library files and failing.


FWIW I can follow the same instructions on OS X and I have no issues  
at all. The problem is that the virtual server I'm using is a clone of  
the machine that I'll eventually be deploying on ... so I'd like to  
have it working there.


Am I doing something stupid, or is this a bug that should be reported?

Best,
Jeremy

---
Jeremy Clifton 
4-8-4 Software Works
(423) 240-4512



Re: [fw-general] Sending iCal using Zend_Mail

2009-10-12 Thread Sebastian Keßler
*Content-Transfer-Encoding: multipart/alternative *
makes no sense, please dont´t use the 3rd parameter
in the setBodyText-function, so it will use the standard
"quoted-printable" decoding.

i guess the problem could be the line-delimiters. depending
on your editor-settings this could be linux/win/mac.
try to quote them directly, typing the ical-content in separate lines:

ical .= "foobar\n";
ical .= "foobar\n";
ical .= "foobar\n";

the headers and the general solution should do it, as i´m
using the same approach and it works for me.

if outlook denys the ical-format it definitively is the generation
of the ical you should look at.

here is my working ical-example:

$ical .= "BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
METHOD:PUBLISH
DTSTART:20100313T07Z
DTEND:20100314T073000Z
SEQUENCE:0
UID:$uid
DTSTAMP:$tstamp
SUMMARY:test\ntest\n\n
PRIORITY:5
X-MICROSOFT-CDO-IMPORTANCE:1
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR";

kind regards,
sebastian keßler


2009/10/12 Tridem GmbH, tech...@tridem.de 

>  Unfortunately that wasn’t the problem. The different headers still seem
> to cause the ‚unsupported internet calendar messaging‘.
>
> I can open the calendar, though outlook is warning me that i does not
> include any appointments.
>
>
>
> Here are the 2 headers. The first one was produced by the well working php
> function I mentioned in the beginning.
>
> The second one ist the header we have so far by now.
>
>
>
> I think it has something to do with the ‚ multipart/mixed‘ header created
> by the setBodyText() method…
>
>
>
> 1) WORKING
>
> …
>
> From: My Name 
>
> Reply-To: My Name 
>
> MIME-Version: 1.0
>
> Content-Type: multipart/alternative;
>
> boundary="Meeting
> Booking20d7ae1209e3fded1c4074d99e66cd5f"
>
> Content-Class: urn:content-classes:calendarmessage
>
> Status:
>
>
>
> 2) CURRENTLY NOT WORKING
>
> …
>
> From: My Name 
>
> Reply-To: My Name 
>
> Content-Class: urn:content-classes:calendarmessage
>
> Date: Mon, 12 Oct 2009 15:13:52 +0200
>
> Content-Type: multipart/mixed; charset="utf-8";
>
> boundary="=_bcf3e757c5ac5be0b440efd17331641a"
>
> Content-Transfer-Encoding: multipart/alternative
>
> Content-Disposition: inline
>
> MIME-Version: 1.0
>
> Status:
>
>
>
>
>
> *Von:* Sebastian Keßler [mailto:inventingwhe...@googlemail.com]
>
>  hi michael,
>
> the uid seems to be too long for outlook, try
> using the date-function to create the uid like in the example:
>
> $uid = date('Ymd').'T'.date('His')."-".rand()."@foo.com";
>
> regards
> sebastian keßler
>


Re: [fw-general] session problem in zend framework

2009-10-12 Thread Elia C.

I have the same problem.

Do you solve it?



alexk400 wrote:
> 
> hi,
> 
> I use zend_session to manage session. I have this strange problem  that i
> want to understand why it is happening.
> 
> I have one browser window1 where i login with my url. Now i open another
> window2 using navigation links and it resets session. 
> 
> In Window1 , i try to refresh , it keeps showing same screen , it should
> have reset the session globally. It almost seems like it is coming from
> some form of cache. But my browser do not have cache enabled. Is there
> anyplace zendframework enable the cache when same request comes
> successively?.
> 
> Because even in the first window1 i go to another url and come back to old
> url by pasting it address bar , it reset the session.
> 
> I have problem only when i try to get the same request successively , it
> does n't understand the session is reset. It almost seems like it never
> reaches the code.
> 
> Anyone care to explain?.
> 
> Thanks
> alexk
> 

-- 
View this message in context: 
http://www.nabble.com/session-problem-in-zend-framework-tp14580013p25856136.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] User uploads file bigger than what's allowed in php.ini, can it be caught?

2009-10-12 Thread Ryan Lange
This is an old thread, but I noticed that no one actually hit upon the
*real* problem.

On Mon, Feb 16, 2009 at 7:28 AM, bytte  wrote:

>
> Bug in my code or bug in Zend Framework?
>

Neither. It's an unfortunate short-coming of PHP itself.

http://us3.php.net/manual/en/ini.core.php#ini.post-max-size : "If the size
of post data is greater than post_max_size, the $_POST and $_FILES
superglobals are empty."

Files are uploaded as post data. If the file being uploaded pushes the post
data beyond the size allowed in php.ini, you get empty $_POST and $_FILES
superglobals, which is why ZF complains about not being able to find your
file field.


Re: [fw-general] Sending iCal using Zend_Mail

2009-10-12 Thread Sebastian Keßler
you could do it by creating a mime-part
and add it as attachement.

$ical .= "BEGIN:VCALENDAR\n";
...

$at = new Zend_Mime_Part($ical);
$at->type = 'text/calendar"';
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_8BIT;
$at->filename = 'termin.ics';

$mail->addAttachment($at);

if disposition is set to inline, it will open directly
as calendar-request.

outlook (2003, 2007) always shows the "accept" and "deny"
buttons, the "method=publish" has no effect in
disposition-inline. i could not get any information
about the internal outlook implementation of iCalendar.

regards,
sebastian keßler


2009/10/9 Tridem 

>
> I found this function which perfectely sends meeting requests for outlook
> in
> icalendar format:
> [URL="http://swik.net/PHP/PHP+Code+Snippets/PHP+iCal+Email/c1jfi";]
> http://swik.net/PHP/PHP+Code+Snippets/PHP+iCal+Email/c1jfi[/URL]
>
> The only problem is that I can't get it working with Zend_Mail.
>
> The difficulty is setting the correct headers since the main methods
> setBodyText() and setBodyHtml() set their own.
>
> Using attachments wasn't successful either.
>
> Any idea to achieve the correct headers?
>
> [CODE]Subject: Meeting Booking
> From: My Name 
> Reply-To: My Name 
> MIME-Version: 1.0
> Content-Type: multipart/alternative;
>boundary="Meeting Bookingd3667a9b1f6cda067ce244c8102529b7"
> Content-Class: urn:content-classes:calendarmessage[/CODE]
>
> --
> View this message in context:
> http://www.nabble.com/Sending-iCal-using-Zend_Mail-tp25818865p25818865.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] Sending iCal using Zend_Mail

2009-10-12 Thread Sebastian Keßler
hi michael,

the uid seems to be too long for outlook, try
using the date-function to create the uid like in the example:

$uid = date('Ymd').'T'.date('His')."-".rand()."@foo.com";

regards
sebastian keßler


2009/10/12 Tridem GmbH, tech...@tridem.de 

>  Hi Sebastian, thanks for the answer.
>
> According to your change I have the following script. Still Outlook 2007
> tells me the icalendar is unsupporten:/
>
>
>
> Any ideas?!
>
>
>
> $mail = new Zend_Mail('utf-8');
>
> $mail->setFrom('f...@bar.com', 'Technik');
>
> $mail->addTo('f...@bar.com');
>
> $mail->setSubject('My Calendar Message Subject');
>
> #$mail->addHeader('content-class', 'urn:content-classes:calendarmessage');
>
> #$mail->addHeader('content-description', 'My Calendar Message
> Filename.ics');
>
> $mail->setBodyText('My Calendar Message Body Text', 'utf-8',
> Zend_Mime::DISPOSITION_INLINE);
>
>
>
> $ical = "BEGIN:VCALENDAR\n";
>
> $ical .= "PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
>
> VERSION:2.0
>
> METHOD:PUBLISH
>
> BEGIN:VEVENT
>
> ORGANIZER:MAILTO:f...@bar.com
>
> DTSTART:20060306T05Z
>
> DTEND:20060306T053000Z
>
> LOCATION:location
>
> TRANSP:OPAQUE
>
> SEQUENCE:0
>
>
> UID:04008200E00074C5B7101A82E00820DC2A139243C601000
>
>  0DEF81CB498E1594B90378312C3D6551D
>
> DTSTAMP:20060309T045649Z
>
> DESCRIPTION:FreeFormText.\nMore FreeFormText.\n\n
>
> SUMMARY:subject
>
> PRIORITY:5
>
> X-MICROSOFT-CDO-IMPORTANCE:1
>
> CLASS:PUBLIC
>
> END:VEVENT
>
> END:VCALENDAR
>
> ";
>
>
>
> $at = new Zend_Mime_Part($ical);
>
> $at->type = 'text/calendar';
>
> #$at->type = 'text/calendar; method=REQUEST; name=\"subject.ics\"';
>
> $at->disposition = Zend_Mime::DISPOSITION_INLINE;
>
> $at->encoding = Zend_Mime::ENCODING_8BIT;
>
> $at->filename = 'My Calendar Message Filename.ics';
>
>
>
>
>
> $mail->addAttachment($at);
>
>
>
> $mail->send();
>
>
>
> Zend_Debug::dump($mail);
>
>
>
> Regards
>
> Michael Borchers
>
>
>
> *Von:* Sebastian Keßler [mailto:inventingwhe...@googlemail.com]
> *Gesendet:* Montag, 12. Oktober 2009 08:32
> *An:* Tridem GmbH, tech...@tridem.de
> *Cc:* fw-general@lists.zend.com
> *Betreff:* Re: [fw-general] Sending iCal using Zend_Mail
>
>
>
> you could do it by creating a mime-part
> and add it as attachement.
>
> $ical .= "BEGIN:VCALENDAR\n";
> ...
>
> $at = new Zend_Mime_Part($ical);
> $at->type = 'text/calendar"';
> $at->disposition = Zend_Mime::DISPOSITION_INLINE;
> $at->encoding = Zend_Mime::ENCODING_8BIT;
> $at->filename = 'termin.ics';
>
> $mail->addAttachment($at);
>
> if disposition is set to inline, it will open directly
> as calendar-request.
>
> outlook (2003, 2007) always shows the "accept" and "deny"
> buttons, the "method=publish" has no effect in
> disposition-inline. i could not get any information
> about the internal outlook implementation of iCalendar.
>
> regards,
> sebastian keßler
>
>  2009/10/9 Tridem 
>
>
> I found this function which perfectely sends meeting requests for outlook
> in
> icalendar format:
> [URL="http://swik.net/PHP/PHP+Code+Snippets/PHP+iCal+Email/c1jfi";]
> http://swik.net/PHP/PHP+Code+Snippets/PHP+iCal+Email/c1jfi[/URL]
>
> The only problem is that I can't get it working with Zend_Mail.
>
> The difficulty is setting the correct headers since the main methods
> setBodyText() and setBodyHtml() set their own.
>
> Using attachments wasn't successful either.
>
> Any idea to achieve the correct headers?
>
> [CODE]Subject: Meeting Booking
> From: My Name 
> Reply-To: My Name 
> MIME-Version: 1.0
> Content-Type: multipart/alternative;
>boundary="Meeting Bookingd3667a9b1f6cda067ce244c8102529b7"
> Content-Class: urn:content-classes:calendarmessage[/CODE]
>
> --
> View this message in context:
> http://www.nabble.com/Sending-iCal-using-Zend_Mail-tp25818865p25818865.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>
>


[fw-general] Zend_Translate Usage

2009-10-12 Thread Nick Pack

Hi All,

Apologies for the 'newbie' question here, this is my first use case of 
Zend_Translate so just want to check that I am invoking it correctly, in 
my bootstrap class I have this (a combination of some manual examples):


protected function _initLanguages()
{
$locale = new Zend_Locale();
Zend_Registry::set('Zend_Locale', $locale);

$defaultlanguage = 'en';

$translate = new Zend_Translate('csv', 
APPLICATION_PATH.'/languages');
if (!$translate->isAvailable($locale->getLanguage())) {
$translate->setLocale($defaultlanguage);
}

Zend_Registry::set('Zend_Translate',$translate);
}

Bascially I have a directory /languages under /application which 
contains en.csv, fr.csv


All of the labels displayed on the site forms (All extended Zend_Form 
objects) are simply 'Form1_FieldName' and there is an appropriate entry 
in the csv file to tie this up with the language of the user (and should 
fall back to english if there is not a translation matching the users 
own language)


Is this the correct approach, any pointers/tips would be greatly 
appreciated.


Thanks,

Nick


Re: [fw-general] The best way to store dates

2009-10-12 Thread Vladas Diržys
Hi,
Are you using MySQL and TIMESTAMP for date columns definition?
If yes, you don't need to do much with Zend Date. You just must ensure that
all users are dealing with their local date/time, and  correct MySQL
@@session.time_zone variable.

More infos under:
http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html

--
Regards,
Vladas Diržys


On Fri, Oct 9, 2009 at 13:22, MarkW508  wrote:

>
> Hello everyone,
>
> I've never used the Zend Framework before, and starting a new application I
> have a particular concern surrounding the best way to store dates. I really
> want to make sure that what I'm thinking is the best way to go about it,
> since it could be difficult to change later on.
>
> I'm expecting in my application users from different timezones, and it's
> important that the users see the correct timezone.
> For example, if "Joe" posts a message at noon in Australia, other users in
> Australia should see "Posted by Joe at 12pm" - but users in England should
> of course see "Posted by Joe at 2am" (or whatever).
>
> I was thinking the best way to go about this would be to first of all ask
> users when they register what timezone they're in by allowing them to
> choose
> from the list PHP provides. Then in the bootstrap, using
> date_default_timezone_set to set this.
> We'll represent all dates with an object of Zend_Date.
> When we save a date in the database we will use
> Zend_Date::setTimezone('UTC') - so all the timestamp will be in UTC - and
> then Zend_Date::get() to get the timestamp to save. So all timestamps in
> the
> database will be in UTC.
> Then when we retrieve a date from the database, we'll use $date = new
> Zend_Date($timestamp, 'UTC') - from the tests I've done, it looks like this
> will return a time in the timezone based off the current timezone which we
> can then display to the user.
>
> Now my question is firstly: will that work? Can anyone see any problems
> with
> doing that? But also: is this the best way to do it? Are there any other
> ways anyone can recommend? Like I say, I really want to start with the best
> practice to save headaches later - any advise would be greatly appreciated.
>
> Thanks :)
> --
> View this message in context:
> http://www.nabble.com/The-best-way-to-store-dates-tp25818798p25818798.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


Re: [fw-general] How to return XML in an Zend Framework Application

2009-10-12 Thread Karol Grecki

You really only need this one line

$this->getResponse()->setheader('Content-Type', 'text/xml');

It should work fine.

Cheers


Jayawi wrote:
> 
> I've also tried the following:
> 
>  class ProjectsController extends Gid_Controller_Action
> {
>  public function xmlAction ()
>  {
>   $content = "bar";
>   $this->getResponse()->clearHeaders();
>   $this->getResponse()->setheader('Content-Type', 'text/xml');
>   $this->getResponse()->setBody($content);
>   $this->getResponse()->sendResponse();
>  }
> }
> ?>
> 
> Could someone point me in the right direction as to how I go about
> achieving this?
> Thank you very much.
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-return-XML-in-an-Zend-Framework-Application-tp25818727p25852125.html
Sent from the Zend Framework mailing list archive at Nabble.com.