[fw-general] When will Zend_OpenId support Google OpenId?

2009-01-17 Thread Nguyen Kha

I found that Zend_OpenId dosen't work with Google Identifier
https://www.google.com/accounts/o8/id and a hack (modify Consumer class) to
work but it's not official T_T
-- 
View this message in context: 
http://www.nabble.com/When-will-Zend_OpenId-support-Google-OpenId--tp21524288p21524288.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Writing a validator for limit the number of selectable elements

2009-01-17 Thread fab2008


Chris Weldon wrote:
> 
> How do you have the Multicheckbox element setup? How are you going
> about checking that the form is valid? A bit more code samples would
> prove useful...
> 

I've done a simple setup, this is, more or less, my setup:

Base class (in which I add common decorator and filters for all forms in
order to obtain consistent look and feel and behaviour for my app)

abstract class Form_Base extends Zend_Form {
/**
 * Form title
 * @var string
 */
protected $_title;

public function init() {
// set class for this form
$this->setAttrib('class', 'form');
// add forms css
$view = $this->getView();
$view->headLink()->appendStylesheet(
$view->baseUrl() . '/styles/form.css', 'all');
// set the form to be post
$this->setMethod('post');
// set translator
$this->setTranslator(

Zend_Registry::get('Zend_Translate')->getAdapter());
// call abstract method that init form elements
$this->initComponents();
// trim all values provided in form
foreach ($this->getElements() as $elt) {
$elt->addFilter('StringTrim');
}
$this->setDecorators(
array (
'FormElements', 
array (
'Description', 
array (

'tag' => 'dd', 

'escape' => false, 

'placement' => Zend_Form_Decorator_Abstract::PREPEND)), 
array (
'HtmlTag', 
array (

'tag' => 'dl', 

'class' => 'zend_form')), 
'Form'));
// custom render of the form
$titleTag = new Form_Decorator_Title();
$this->addDecorator($titleTag);
$this->addDecorator(array ('SurroundTag' => 'HtmlTag'), 
array ('tag' => 'div', 'class' => 'formdiv'));
}

protected function addSubmitButton($label = 'Send') {
$submit = new Zend_Form_Element_Submit('submitBtn', $label);
$this->addElement($submit);
$this->addDisplayGroup(array ('submitBtn'), 'buttons', 
array ('legend' => 'Send Form'));
}

// subclass will create form elements in this method
abstract protected function initComponents();
}


and this is the class in which I use the multicheckbox element:

class Form_Checkout extends Form_Base { 
protected function initComponents() {
// title
$this->setTitle('FORM_CHECKOUT_TITLE');

$selected = new Zend_Form_Element_MultiCheckbox('orders', 
array (
'separator' => '', 
'required' => true, 
'class' => 'checkbox'));

$this->addElement($selected);

$this->addSubmitButton('FORM_CHECKOUT_BUTTON');
}

public function addOrder(Request $request) {
$this->orders->addMultiOption($request->idorder,
$request->getDescription());
}   
}

In my controller I call addOrder method once for every order that could be
payed, but in a special case, I don't want that more than x orders could be
selected in the form as explained in my first message.

Thank you.


-- 
View this message in context: 
http://www.nabble.com/Writing-a-validator-for-limit-the-number-of-selectable-elements-tp21511756p21523746.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Validate_EmailAddress, MX lookup not support on Windows?

2009-01-17 Thread Jason Webster

I submitted my CLA as a digitally filled out signed copy of the PDF they 
provide.
That should work, provided you have Acrobat proper.

On 17/01/2009 12:51 PM, Isaak Malik wrote:

That's because I'm not allowed (scanner-less, fax-less & most of the
time printer-less) ;-)

Also, the E-mail validation class could need some improvement because
validating against MX records only is a bad practice, instead it should
have support for an A record (to check if the hostname actually exists)
lookup which complies with the RFC 2821 (if no MX record is found by the
mail server, the A record will be used) or if for some reason (e.g. to
be more strict) one wants to allow only E-mail addresses with hostnames
that have an MX DNS record the class should also support checking for an
MX record alone.

Adding support for Windows environments requires little effort so I was
surprised to see that this hasn't been included thus far.

On Sat, Jan 17, 2009 at 9:16 PM, Matthew Ratzloff
mailto:m...@builtfromsource.com>> wrote:

It's because you haven't added it yet, of course. ;-)

-Matt


On Sat, Jan 17, 2009 at 11:29 AM, Isaak Malik mailto:iso...@gmail.com>> wrote:

How come there is no support for MX lookups on a Windows
environment? I'm aware that checkdnsrr() is not supported by
Windows but why is there no alternative included? If it's
because a lack of knowledge there are some good alternatives at
http://php.net/checkdnsrr

--
Isaak Malik
Web Developer




--
Isaak Malik
Web Developer




[fw-general] New proposal for Translateable Exceptions

2009-01-17 Thread Thomas Weidner

Hy all,

I am pleased to announce that a "Translateable Exceptions" proposal is ready 
for review.

http://framework.zend.com/wiki/display/ZFPROP/Translateable+Exceptions+for+ZF+-+Thomas+Weidner

It is an additional feature into ZF which adds a possibility to translate 
the message of thrown exceptions eighter

with your own language or with languages whihc are provided by us.

There is no change necessary for existing code, as a simple static setting 
will activate this behaviour.

Review and comments are appreciated.

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



Re: [fw-general] Writing a validator for limit the number of selectable elements

2009-01-17 Thread Chris Weldon
How do you have the Multicheckbox element setup? How are you going
about checking that the form is valid? A bit more code samples would
prove useful...
--
Chris Weldon

On Sat, Jan 17, 2009 at 2:36 PM, fab2008  wrote:
>
> Nobody who can helps me?
>
>
> fab2008 wrote:
>>
>> Hi all,
>>
>> I've the following situation: In a form i put a multicheckbox element with
>> a certain number of elements say n. I'want the user select a number of
>> elements between x and y with 0 <= x < y <= n
>>
>> For this i've just tried to write my custom validator extending the
>> Zend_Validate_Between class, overriding its isValid method with something
>> similar to this:
>>
>> public function isValid($value) {
>>   return parent::isValid(count($value));
>> }
>>
>> because I tought that $value is an array, but it's not the case, my
>> validator will be called once per selected checkbox with scalar values. So
>> I've tried a different approach:
>>
>> protected $count = 0;
>>
>> public function isValid($value) {
>>   if (++$this->count > $this->_max) {
>> return false;
>>   }
>>   return true;
>> }
>>
>> I'm unsure about correctness, it breaks if the same validator instance
>> will be attached to more than one multi element, and clearly it works only
>> for the max, but not for the min.
>>
>> Any suggestion?
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Writing-a-validator-for-limit-the-number-of-selectable-elements-tp21511756p21520370.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>



-- 
Christopher Weldon
http://chrisweldon.net
ch...@chrisweldon.net


Re: [fw-general] Zend_Validate_EmailAddress, MX lookup not support on Windows?

2009-01-17 Thread Isaak Malik
That's because I'm not allowed (scanner-less, fax-less & most of the time
printer-less) ;-)

Also, the E-mail validation class could need some improvement because
validating against MX records only is a bad practice, instead it should have
support for an A record (to check if the hostname actually exists) lookup
which complies with the RFC 2821 (if no MX record is found by the mail
server, the A record will be used) or if for some reason (e.g. to be more
strict) one wants to allow only E-mail addresses with hostnames that have an
MX DNS record the class should also support checking for an MX record alone.

Adding support for Windows environments requires little effort so I was
surprised to see that this hasn't been included thus far.

On Sat, Jan 17, 2009 at 9:16 PM, Matthew Ratzloff
wrote:

> It's because you haven't added it yet, of course.  ;-)
> -Matt
>
>
> On Sat, Jan 17, 2009 at 11:29 AM, Isaak Malik  wrote:
>
>> How come there is no support for MX lookups on a Windows environment? I'm
>> aware that checkdnsrr() is not supported by Windows but why is there no
>> alternative included? If it's because a lack of knowledge there are some
>> good alternatives at http://php.net/checkdnsrr
>>
>> --
>> Isaak Malik
>> Web Developer
>
>


-- 
Isaak Malik
Web Developer


Re: [fw-general] Writing a validator for limit the number of selectable elements

2009-01-17 Thread fab2008

Nobody who can helps me?


fab2008 wrote:
> 
> Hi all, 
> 
> I've the following situation: In a form i put a multicheckbox element with
> a certain number of elements say n. I'want the user select a number of
> elements between x and y with 0 <= x < y <= n
> 
> For this i've just tried to write my custom validator extending the
> Zend_Validate_Between class, overriding its isValid method with something
> similar to this:
> 
> public function isValid($value) {
>   return parent::isValid(count($value));
> }
> 
> because I tought that $value is an array, but it's not the case, my
> validator will be called once per selected checkbox with scalar values. So
> I've tried a different approach:
> 
> protected $count = 0;
> 
> public function isValid($value) {
>   if (++$this->count > $this->_max) {
> return false;
>   }
>   return true;
> }
> 
> I'm unsure about correctness, it breaks if the same validator instance
> will be attached to more than one multi element, and clearly it works only
> for the max, but not for the min.
> 
> Any suggestion?
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Writing-a-validator-for-limit-the-number-of-selectable-elements-tp21511756p21520370.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Validate_EmailAddress, MX lookup not support on Windows?

2009-01-17 Thread Matthew Ratzloff
It's because you haven't added it yet, of course.  ;-)
-Matt

On Sat, Jan 17, 2009 at 11:29 AM, Isaak Malik  wrote:

> How come there is no support for MX lookups on a Windows environment? I'm
> aware that checkdnsrr() is not supported by Windows but why is there no
> alternative included? If it's because a lack of knowledge there are some
> good alternatives at http://php.net/checkdnsrr
>
> --
> Isaak Malik
> Web Developer


Re: [fw-general] Is Cal Evan's Globals.php a recommended approach

2009-01-17 Thread Matthew Ratzloff
Since configuration is such a fundamental aspect of most components, perhaps
this can be added to the coding standards, along with whatever suggested
implementations the community agrees upon?

-Matt

On Sat, Jan 17, 2009 at 6:55 AM, Matthew Weier O'Phinney
wrote:

> -- Matthew Ratzloff  wrote
> (on Friday, 16 January 2009, 09:42 AM -0800):
> > This is more or less how you see the setOptions() implementation in a
> few
> >
> > classes currently.  The idea that you proxy the key to a mutator
> (setter)
> >
> > setSomething($value) method.
> >
> >
> > Yep, except it's in one place instead of several with tiny variations.
>  And it
> > works with static setters.
>
> But your solution would introduce a hard dependency on another class.
> One principle we have espoused from the beginning is that we would not
> have a "base" class used by all other classes, in an effort to reduce
> dependencies.
>
> There's also good reasons to implement setOptions functionality on a
> class-by-class basis. One is to allow for class-specific behavior; for
> instance, one class might discard unknown keys, another might set them
> as class metadata. Another implementation might proxy to protected
> methods. Another implementation might make setOptions protected so that
> the class can be used within a service.
>
> In other words, the variations in _behavior_ have their purpose. But the
> constructors would still have the same public API -- leaving a
> consistent _use case_ that can be messaged.
>
>
> > On Fri, Jan 16, 2009 at 9:12 AM, Ralph Schindler <
> ralph.schind...@zend.com>
> > wrote:
> >
> >
> > > The primary problem with configuration in Zend Framework is that
> > configuration
> > > is left up to each class and so each class handles it differently.
>  The
> > > primary problem with PHP is lack of mixins, which would elegantly
> solve
> > the
> > > first problem.  I solved the issue at my job like this:
> >
> >
> > The initial problem is that each class solves the configuration
> without any
> > regard to how other components solve the configuration issue (the
> common
> > convention).  This thus creates a somewhat ambiguous API.  I think
> one of
> > the stories I'd like to see told with ZF2 is more one of API
> consistency,
> > fewer statics, and those statics that are used are part of an
> acceptable
> > list of static usages... All for the purpose of keeping things
> consistent.
> >
> >
> > > public static function setConfig($caller, $config, $section =
> null)
> > > {
> > > $config = self::getOptionsFromConfig($config, $section);
> > >
> > > foreach ($config as $option => $value) {
> > > $method = 'set' . ucfirst($option);
> > >
> > > if (method_exists($caller, $method)) {
> > > if ($value instanceof Zend_Config) {
> > > $value = $value->toArray();
> > > }
> > >
> > > if (is_object($caller)) {
> > > $caller->$method($value);
> > > } else {
> > > call_user_func(array($caller, $method),
> $value);
> > > }
> > > }
> > > }
> > >
> > > return $config;
> > > }
> >
> >
> > This is more or less how you see the setOptions() implementation in a
> few
> > classes currently.  The idea that you proxy the key to a mutator
> (setter)
> > setSomething($value) method.
> >
> >
> > > This is a pretty flexible approach that allows instance or static
> method
> > calls
> > > on the caller and does not distinguish between Zend_Config objects
> and
> > arrays.
> > > In my experience there is no practical benefit, and some drawbacks,
> to
> > > distinguishing between separate setConfig() and setOptions()
> methods.  If
> > you
> > > must store the configuration in the object, for example to allow a
> > generic
> > > getOption($optionName) method, the logic is still off-loaded to the
> other
> > > class.
> > >
> >
> >
> > The major difference I think Matthew W.O. Was trying to demonstrate
> is that
> > those methods have different signatures:
> >
> > Public function setConfig(Zend_Config $config);
> > Public function setOptions(Array $options);
> >
> > This creates a very loose coupling on Zend_Config for instances where
> one
> > would like to use Zend_Config. In other cases, an associative array
> is just
> > fine.
> >
> > -ralph
> >
> > --
> > Ralph Schindler
> > Software Engineer | ralph.schind...@zend.com
> > Zend Framework| http://framework.zend.com/
> >
> >
>
> --
> Matthew Weier O'Phinney
> Software Architect   | matt...@zend.com
> Zend Framework   | http://framework.zend.com/
>


[fw-general] Zend_Validate_EmailAddress, MX lookup not support on Windows?

2009-01-17 Thread Isaak Malik
How come there is no support for MX lookups on a Windows environment? I'm
aware that checkdnsrr() is not supported by Windows but why is there no
alternative included? If it's because a lack of knowledge there are some
good alternatives at http://php.net/checkdnsrr

-- 
Isaak Malik
Web Developer


Re: [fw-general] Zend_Form_SubForm based wizard with conditional subForms

2009-01-17 Thread MPoje

I ended up approaching it by defining a public function w/in the
My_Custom_Form class that takes a subForm name as its argument. In the
My_Custom_Form's init() I only set the first subForm. 

In the controller, I called those functions conditionally to build the
appropriate version of the form based on if
($subForm->getValue('some_param') == 'yes') { 
$form->addSub('yes_SubForm_part2'); etc ...  after validating the $subForm
but before trying to validate the entire $form.

I am open to any other feedback on a more eloquent/proper way to handle it,
as it felt a little hacked/clumsy in places. From a best practices
standpoint, the conditional machinations are probably better contained in a
function w/in  My_Custom_Form instead of spilling into my (almost skinny)
Controller?




joostvanveen wrote:
> 
> Anybody? I would be interested to know this, too.
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form_SubForm-based-wizard-with-conditional-subForms-tp20994488p21518766.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Zend_Form_SubForm based wizard with conditional subForms

2009-01-17 Thread joostvanveen

Anybody? I would be interested to know this, too.
-- 
View this message in context: 
http://www.nabble.com/Zend_Form_SubForm-based-wizard-with-conditional-subForms-tp20994488p21518200.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Is Cal Evan's Globals.php a recommended approach

2009-01-17 Thread Matthew Weier O'Phinney
-- Matthew Ratzloff  wrote
(on Friday, 16 January 2009, 09:42 AM -0800):
> This is more or less how you see the setOptions() implementation in a few
> 
> classes currently.  The idea that you proxy the key to a mutator (setter)
> 
> setSomething($value) method.
> 
> 
> Yep, except it's in one place instead of several with tiny variations.  And it
> works with static setters.

But your solution would introduce a hard dependency on another class.
One principle we have espoused from the beginning is that we would not
have a "base" class used by all other classes, in an effort to reduce
dependencies.

There's also good reasons to implement setOptions functionality on a
class-by-class basis. One is to allow for class-specific behavior; for
instance, one class might discard unknown keys, another might set them
as class metadata. Another implementation might proxy to protected
methods. Another implementation might make setOptions protected so that
the class can be used within a service.

In other words, the variations in _behavior_ have their purpose. But the
constructors would still have the same public API -- leaving a
consistent _use case_ that can be messaged.


> On Fri, Jan 16, 2009 at 9:12 AM, Ralph Schindler 
> wrote:
> 
> 
> > The primary problem with configuration in Zend Framework is that
> configuration
> > is left up to each class and so each class handles it differently.  The
> > primary problem with PHP is lack of mixins, which would elegantly solve
> the
> > first problem.  I solved the issue at my job like this:
> 
> 
> The initial problem is that each class solves the configuration without 
> any
> regard to how other components solve the configuration issue (the common
> convention).  This thus creates a somewhat ambiguous API.  I think one of
> the stories I'd like to see told with ZF2 is more one of API consistency,
> fewer statics, and those statics that are used are part of an acceptable
> list of static usages... All for the purpose of keeping things consistent.
> 
> 
> > public static function setConfig($caller, $config, $section = null)
> > {
> > $config = self::getOptionsFromConfig($config, $section);
> >
> > foreach ($config as $option => $value) {
> > $method = 'set' . ucfirst($option);
> >
> > if (method_exists($caller, $method)) {
> > if ($value instanceof Zend_Config) {
> > $value = $value->toArray();
> > }
> >
> > if (is_object($caller)) {
> > $caller->$method($value);
> > } else {
> > call_user_func(array($caller, $method), $value);
> > }
> > }
> > }
> >
> > return $config;
> > }
> 
> 
> This is more or less how you see the setOptions() implementation in a few
> classes currently.  The idea that you proxy the key to a mutator (setter)
> setSomething($value) method.
> 
> 
> > This is a pretty flexible approach that allows instance or static method
> calls
> > on the caller and does not distinguish between Zend_Config objects and
> arrays.
> > In my experience there is no practical benefit, and some drawbacks, to
> > distinguishing between separate setConfig() and setOptions() methods.  
> If
> you
> > must store the configuration in the object, for example to allow a
> generic
> > getOption($optionName) method, the logic is still off-loaded to the 
> other
> > class.
> >
> 
> 
> The major difference I think Matthew W.O. Was trying to demonstrate is 
> that
> those methods have different signatures:
> 
> Public function setConfig(Zend_Config $config);
> Public function setOptions(Array $options);
> 
> This creates a very loose coupling on Zend_Config for instances where one
> would like to use Zend_Config. In other cases, an associative array is 
> just
> fine.
> 
> -ralph
> 
> --
> Ralph Schindler
> Software Engineer | ralph.schind...@zend.com
> Zend Framework| http://framework.zend.com/
> 
> 

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


Re: [fw-general] Zend_Feed::import link down

2009-01-17 Thread PHPScriptor

Thank you both. I took the Zend_Exception... just to make sure that I catch
all the exceptions :-))


Simone Carletti wrote:
> 
> Or you can even decide to catch a Zend_Exception to be sure to rescue any
> Zend-related exception raised by Zend_Feed, including Zend_Http and
> Zend_Feed errors.
> 
> -- Simone
> 
> 
> On Sat, Jan 17, 2009 at 2:39 PM, Chris Weldon 
> wrote:
> 
>> On Sat, Jan 17, 2009 at 5:06 AM, PHPScriptor 
>> wrote:
>> > "Fatal error: Uncaught exception 'Zend_Http_Client_Exception' with
>> message
>>
>> Try catching Zend_Http_Client_Exception in addition to
>> Zend_Feed_Exception like you have below.
>>
>> >
>> > try {
>> >  $slashdotRss  =
>> Zend_Feed::import('http://www.test.eu/rss.php'
>> );
>> >  foreach ($slashdotRss as $item) {
>> >$channel1[] = array(
>> >'title' => $item->title(),
>> >'link'  => $item->link(),
>> >'description'   => $item->description());
>> >  }
>> >  $this->view->nieuwskan = $channel1;
>> > }
>> > catch (Zend_Feed_Exception $e) {
>> > }
>>
>> try {
>>  // try it
>> } catch (Zend_Http_Client_Exception $e) {
>>  // handle it
>> } catch (Zend_Feed_Exception $e) {
>>   // handle it
>> }
>>
>> --
>> Christopher Weldon
>> http://chrisweldon.net
>> ch...@chrisweldon.net
>>
> 
> 
> 
> -- 
> Simone Carletti
> 
> Site & Blog: www.simonecarletti.com
> Email: wep...@weppos.net
> LinkedIn: http://linkedin.com/in/weppos
> 
> 


-
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Zend_Feed%3A%3Aimport--link-down-tp21515256p21517126.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Feed::import link down

2009-01-17 Thread Simone Carletti
Or you can even decide to catch a Zend_Exception to be sure to rescue any
Zend-related exception raised by Zend_Feed, including Zend_Http and
Zend_Feed errors.

-- Simone


On Sat, Jan 17, 2009 at 2:39 PM, Chris Weldon  wrote:

> On Sat, Jan 17, 2009 at 5:06 AM, PHPScriptor 
> wrote:
> > "Fatal error: Uncaught exception 'Zend_Http_Client_Exception' with
> message
>
> Try catching Zend_Http_Client_Exception in addition to
> Zend_Feed_Exception like you have below.
>
> >
> > try {
> >  $slashdotRss  = 
> > Zend_Feed::import('http://www.test.eu/rss.php'
> );
> >  foreach ($slashdotRss as $item) {
> >$channel1[] = array(
> >'title' => $item->title(),
> >'link'  => $item->link(),
> >'description'   => $item->description());
> >  }
> >  $this->view->nieuwskan = $channel1;
> > }
> > catch (Zend_Feed_Exception $e) {
> > }
>
> try {
>  // try it
> } catch (Zend_Http_Client_Exception $e) {
>  // handle it
> } catch (Zend_Feed_Exception $e) {
>   // handle it
> }
>
> --
> Christopher Weldon
> http://chrisweldon.net
> ch...@chrisweldon.net
>



-- 
Simone Carletti

Site & Blog: www.simonecarletti.com
Email: wep...@weppos.net
LinkedIn: http://linkedin.com/in/weppos


Re: [fw-general] Zend_Feed::import link down

2009-01-17 Thread Chris Weldon
On Sat, Jan 17, 2009 at 5:06 AM, PHPScriptor  wrote:
> "Fatal error: Uncaught exception 'Zend_Http_Client_Exception' with message

Try catching Zend_Http_Client_Exception in addition to
Zend_Feed_Exception like you have below.

>
> try {
>  $slashdotRss  = Zend_Feed::import('http://www.test.eu/rss.php');
>  foreach ($slashdotRss as $item) {
>$channel1[] = array(
>'title' => $item->title(),
>'link'  => $item->link(),
>'description'   => $item->description());
>  }
>  $this->view->nieuwskan = $channel1;
> }
> catch (Zend_Feed_Exception $e) {
> }

try {
  // try it
} catch (Zend_Http_Client_Exception $e) {
  // handle it
} catch (Zend_Feed_Exception $e) {
  // handle it
}

-- 
Christopher Weldon
http://chrisweldon.net
ch...@chrisweldon.net


Re: [fw-general] 301 Redirect

2009-01-17 Thread Simone Carletti

Toggle the order of the rules. The www redirect should be placed before the
Zend Framework rewrite rule. In fact, it should appear first before any
functional rewrite rule.


bits.abhinav wrote:
> 
> But will this work with the Rewrite rules for Zend Framework?
> 
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule .* index.php
> 
> I tried adding this code below the above code but it takes me to
> www.domain.com/index.php which then messes up with the relative URLs in
> the code.
> 
> 
> Simone Carletti wrote:
>> 
>> There is more than one solution for this problem.
>> Here's one.
>> 
>> RewriteEngine On
>> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
>> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
>> 
>> -- Simone
>> 
>> 
>> bits.abhinav wrote:
>>> 
>>> Hi all,
>>> I want to implement a 301 redirect on my portal so that domain.com
>>> redirects to www.domain.com. I don't have much knowledge about the
>>> mod_rewrite module of Apace. I found out the code for this online but it
>>> doesn't work properly. If anyone has done this before or knows how to do
>>> it please help me out.
>>> 
>>> Thanks
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21515265.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Feed::import link down

2009-01-17 Thread PHPScriptor

Hello,

I'm using a feed on my site for news. Now, when the feed site is down my
site crashes. Is there a way for not showing this 'fatal error'? And my
second question: it only crashes after e.g. 15 seconds, but I want to move
on faster. If the rss site is down it has to go further after e.g. 2
seconds...

It still throws this exception:

"Fatal error: Uncaught exception 'Zend_Http_Client_Exception' with message
'Unable to read response, or response is empty' in
C:\wamp\php\Zend\Http\Client.php:836 Stack trace: #0
C:\wamp\php\Zend\Feed.php(171): Zend_Http_Client->request('GET') #1
C:\wamp\www\kantersnet\app\modules\default\controllers\IndexController.php(22):
Zend_Feed::import('http://www.test...') #2
C:\wamp\php\Zend\Controller\Action.php(502): IndexController->indexAction()
#3 C:\wamp\php\Zend\Controller\Dispatcher\Standard.php(293):
Zend_Controller_Action->dispatch('indexAction') #4
C:\wamp\php\Zend\Controller\Front.php(946):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http)) #5
C:\wamp\www\kantersnet\application.php(180):
Zend_Controller_Front->dispatch() #6
C:\wamp\www\kantersnet\application.php(48):
ZfApplication->dispatch(Object(Zend_Controller_Front)) #7
C:\wamp\www\kantersnet\public_html\index.php(57): ZfApplication->bootstrap()
#8 {main} thrown in C:\wamp\php\Zend\Http\Client.php on line 836"

try {
  $slashdotRss  = Zend_Feed::import('http://www.test.eu/rss.php');
  foreach ($slashdotRss as $item) {
$channel1[] = array(
'title' => $item->title(),
'link'  => $item->link(),
'description'   => $item->description());
  }
  $this->view->nieuwskan = $channel1;
}
catch (Zend_Feed_Exception $e) {
}

-
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Zend_Feed%3A%3Aimport--link-down-tp21515256p21515256.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread bits.abhinav

But will this work with the Rewrite rules for Zend Framework?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

I tried adding this code below the above code but it takes me to
www.domain.com/index.php which then messes up with the relative URLs in the
code.


Simone Carletti wrote:
> 
> There is more than one solution for this problem.
> Here's one.
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
> 
> -- Simone
> 
> 
> bits.abhinav wrote:
>> 
>> Hi all,
>> I want to implement a 301 redirect on my portal so that domain.com
>> redirects to www.domain.com. I don't have much knowledge about the
>> mod_rewrite module of Apace. I found out the code for this online but it
>> doesn't work properly. If anyone has done this before or knows how to do
>> it please help me out.
>> 
>> Thanks
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21515215.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread bits.abhinav

But will this work with the Rewrite rules for Zend Framework?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

I tried adding this code below the above code but it takes me to
www.domain.com/index.php which then messes up with the relative URLs in the
code.


Simone Carletti wrote:
> 
> There is more than one solution for this problem.
> Here's one.
> 
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^domain\.com [NC]
> RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
> 
> -- Simone
> 
> 
> bits.abhinav wrote:
>> 
>> Hi all,
>> I want to implement a 301 redirect on my portal so that domain.com
>> redirects to www.domain.com. I don't have much knowledge about the
>> mod_rewrite module of Apace. I found out the code for this online but it
>> doesn't work properly. If anyone has done this before or knows how to do
>> it please help me out.
>> 
>> Thanks
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21515212.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] 301 Redirect

2009-01-17 Thread Simone Carletti

There is more than one solution for this problem.
Here's one.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]

-- Simone


bits.abhinav wrote:
> 
> Hi all,
> I want to implement a 301 redirect on my portal so that domain.com
> redirects to www.domain.com. I don't have much knowledge about the
> mod_rewrite module of Apace. I found out the code for this online but it
> doesn't work properly. If anyone has done this before or knows how to do
> it please help me out.
> 
> Thanks
> 

-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21514713.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] 301 Redirect

2009-01-17 Thread bits.abhinav

Hi all,
I want to implement a 301 redirect on my portal so that domain.com redirects
to www.domain.com. I don't have much knowledge about the mod_rewrite module
of Apace. I found out the code for this online but it doesn't work properly.
If anyone has done this before or knows how to do it please help me out.

Thanks
-- 
View this message in context: 
http://www.nabble.com/301-Redirect-tp21514435p21514435.html
Sent from the Zend Framework mailing list archive at Nabble.com.