Completed
Pull Request — master (#7)
by Markus
07:32
created

Default_Error404SuccessView   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2
1
    <?php
2
3
// +---------------------------------------------------------------------------+
4
// | This file is part of the Agavi package.                                   |
5
// | Copyright (c) 2005-2011 the Agavi Project.                                |
6
// |                                                                           |
7
// | For the full copyright and license information, please view the LICENSE   |
8
// | file that was distributed with this source code. You can also view the    |
9
// | LICENSE file online at http://www.agavi.org/LICENSE.txt                   |
10
// |   vi: set noexpandtab:                                                    |
11
// |   Local Variables:                                                        |
12
// |   indent-tabs-mode: t                                                     |
13
// |   End:                                                                    |
14
// +---------------------------------------------------------------------------+
15
use Agavi\Request\RequestDataHolder;
16
class Default_Error404SuccessView extends SampleAppDefaultBaseView
17
{
18
19
	public function executeHtml(RequestDataHolder $rd)
20
	{
21
		$this->setupHtml($rd);
22
23
		// set the title
24
		$this->setAttribute('_title', $this->tm->_('404 Not Found', 'default.ErrorControllers'));
25
26
		$this->container->getResponse()->setHttpStatusCode('404');
27
	}
28
29
	public function executeXmlrpc(RequestDataHolder $rd)
30
	{
31
		return array(
32
			'faultCode' => -32601, // as per http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
33
			'faultString' => 'requested method not found',
34
		);
35
	}
36
	
37
	public function executeText(RequestDataHolder $rd)
38
	{
39
		return
40
			'Usage: console.php <command> [OPTION]...' . PHP_EOL .
41
			PHP_EOL .
42
			'Commands:' . PHP_EOL .
43
			'  viewproduct <id>' . PHP_EOL .
44
			'    Retrieves product details given a product ID.' . PHP_EOL .
45
			'  listproducts' . PHP_EOL .
46
			'    Lists all products in the application.' . PHP_EOL;
47
	}
48
}
49
50
?>