1: <?php
2: /**
3: * The Ingo_Script_Procmail_Variable:: class represents a Procmail variable.
4: *
5: * Copyright 2003-2012 Horde LLC (http://www.horde.org/)
6: *
7: * See the enclosed file LICENSE for license information (ASL). If you
8: * did not receive this file, see http://www.horde.org/licenses/apache.
9: *
10: * @author Michael Slusarz <slusarz@horde.org>
11: * @package Ingo
12: */
13: class Ingo_Script_Procmail_Variable
14: {
15: /**
16: */
17: protected $_name;
18:
19: /**
20: */
21: protected $_value;
22:
23: /**
24: * Constructs a new procmail variable.
25: *
26: * @param array $params Array of parameters. Expected fields are 'name'
27: * and 'value'.
28: */
29: public function __construct($params = array())
30: {
31: $this->_name = $params['name'];
32: $this->_value = $params['value'];
33: }
34:
35: /**
36: * Generates procmail code to represent the variable.
37: *
38: * @return string Procmail code to represent the variable.
39: */
40: public function generate()
41: {
42: return $this->_name . '=' . $this->_value . "\n";
43: }
44:
45: }
46: