1: <?php
2: /*************************************************************************************/
3: /* */
4: /* Thelia */
5: /* */
6: /* Copyright (c) OpenStudio */
7: /* email : info@thelia.net */
8: /* web : http://www.thelia.net */
9: /* */
10: /* This program is free software; you can redistribute it and/or modify */
11: /* it under the terms of the GNU General Public License as published by */
12: /* the Free Software Foundation; either version 3 of the License */
13: /* */
14: /* This program is distributed in the hope that it will be useful, */
15: /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
16: /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
17: /* GNU General Public License for more details. */
18: /* */
19: /* You should have received a copy of the GNU General Public License */
20: /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
21: /* */
22: /*************************************************************************************/
23: namespace Thelia\Core\Template;
24:
25: use Symfony\Component\HttpFoundation\Response;
26: use Thelia\Core\Template\ParserInterface;
27: use Symfony\Component\DependencyInjection\ContainerInterface;
28:
29: /**
30: *
31: * Master class of Thelia's parser. The loop mechanism depends of this parser
32: *
33: * From this class all the parser is lunch
34: *
35: *
36: * @author Manuel Raynaud <mraynaud@openstudio.fr>
37: */
38:
39:
40: class Parser implements ParserInterface
41: {
42: const PREFIXE = 'prx';
43:
44: const SHOW_TIME = true;
45: const ALLOW_DEBUG = true;
46: const USE_CACHE = true;
47:
48: /**
49: *
50: * @var Symfony\Component\DependencyInjection\ContainerInterface
51: */
52: protected $container;
53:
54: protected $content;
55: protected $status = 200;
56:
57: /**
58: *
59: * @param type $container
60: *
61: * public function __construct(ContainerBuilder $container)
62: */
63: public function __construct(ContainerInterface $container)
64: {
65: $this->container = $container;
66: }
67:
68: /**
69: *
70: * This method must return a Symfony\Component\HttpFoudation\Response instance or the content of the response
71: *
72: */
73: public function getContent()
74: {
75: $this->loadParser();
76:
77: echo \Thelia\Model\ConfigQuery::read("alfred", "dupont");
78: \Thelia\Log\Tlog::getInstance()->debug("tutu");
79:
80: return $this->content;
81: }
82:
83: /**
84: *
85: * set $content with the body of the response or the Response object directly
86: *
87: * @param string|Symfony\Component\HttpFoundation\Response $content
88: */
89: public function setContent($content)
90: {
91: $this->content = $content;
92: }
93:
94: /**
95: *
96: * @return type the status of the response
97: */
98: public function getStatus()
99: {
100: return $this->status;
101: }
102:
103: /**
104: *
105: * status HTTP of the response
106: *
107: * @param int $status
108: */
109: public function setStatus($status)
110: {
111: $this->status = $status;
112: }
113:
114: public function loadParser()
115: {
116: }
117:
118: }
119: