Deprecated: Phalcon\Http\Cookie::setDomain(): Passing null to parameter #1 ($domain) of type string is deprecated in /var/www/html/discounts-n-coupons.com/src/app/Lib/Helper/Language.php on line 46
ParseError: syntax error, unexpected string content "view"
Phalcon Framework 5.8.0

ParseError: syntax error, unexpected string content "view"

/var/www/html/discounts-n-coupons.com/cache/volt/Tmpl_System_Comment_Comment.volt.php (120)
#0Phalcon\Mvc\View\Engine\Volt->render
#1Phalcon\Mvc\View->engineRender
#2Phalcon\Mvc\View->partial
#3Phalcon\Mvc\View\Engine\AbstractEngine->partial
/var/www/html/discounts-n-coupons.com/cache/volt/Tmpl_Site_PhalCMS_Post_Show.volt.php (114)
  1. <div class="uk-container" itemscope itemtype="http://schema.org/Brand">
  2. <article class="uk-article">
  3. <div class="uk-text-left">
  4. <?= $this->partial('Breadcrumb/Breadcrumb') ?>
  5. </div>
  6. <h1 class="uk-article-title" itemprop="name">
  7. <?= html_entity_decode($post->t('title')) ?>
  8. </h1>
  9. <p class="uk-article-meta">
  10. <?= CLSystems\PhalCMS\Lib\Helper\Text::_('posted-in') . ' ' ?>
  11. <a href="<?= $post->category->link ?>">
  12. <?= $post->category->t('title') ?>
  13. </a>
  14. <?= ' | ' . CLSystems\PhalCMS\Lib\Helper\IconSvg::render('eye') . ' ' . CLSystems\PhalCMS\Lib\Helper\Text::plural('hits',$post->hits,['hits' => $post->hits]) ?>
  15. </p>
  16.  
  17. <?php $vouchers = $post->vouchers(); ?>
  18. <?php if (!empty($vouchers)) { ?>
  19. <h2><?= CLSystems\PhalCMS\Lib\Helper\Text::_('discounts-at') ?> <?= $this->escaper->attributes(html_entity_decode($post->t('title'))) ?></h2>
  20. <?= $this->partial('UcmItem/VouchersSlider') ?>
  21. <?php } ?>
  22.  
  23. <?php if ($post->parentId == 118) { ?>
  24. <h2><?= CLSystems\PhalCMS\Lib\Helper\Text::_('info-about') ?> <?= lcfirst(html_entity_decode(html_entity_decode($post->t('title')))) ?></h2>
  25. <?php } else { ?>
  26. <h2><?= CLSystems\PhalCMS\Lib\Helper\Text::_('info-about') ?> <?= html_entity_decode(html_entity_decode($post->t('title'))) ?></h2>
  27. <?php } ?>
  28. <?php $images = CLSystems\PhalCMS\Lib\Helper\Image::loadImage($post->t('image'),false); ?>
  29. <?php $rating = $post->rating(); ?>
  30. <?php if (!empty($rating)) { ?>
  31. <script type="application/ld+json">
  32. {
  33. "@context": "https://schema.org/",
  34. "@type": "Organization",
  35. "brand": {
  36. "@type": "Brand",
  37. "name": "<?= $this->escaper->attributes($rating->merchantName) ?>"
  38. },
  39. "description": "<?= strip_tags(html_entity_decode($post->t('summary'))) ?>",
  40. "image": "<?= $images[0]->getUri() ?>",
  41. "name": "<?= $this->escaper->attributes($post->t('title')) ?>",
  42. "aggregateRating": {
  43. "@type": "AggregateRating",
  44. "ratingValue": "<?= $rating->ratingValue ?>",
  45. "bestRating": "100",
  46. "ratingCount": "<?= $rating->ratingCount ?>"
  47. }
  48. }
  49. </script>
  50. <div class="post-rating uk-text-muted uk-margin"><?= $rating->ratingCount ?> <?= CLSystems\PhalCMS\Lib\Helper\Text::_('reviews') ?><br/>
  51. <?= CLSystems\PhalCMS\Lib\Helper\Text::_('score') ?>: <a href="<?= $rating->externalRatingUrl ?>" target="_blank" rel="noreferrer noopener">
  52. <?= $rating->ratingValue ?> <?= CLSystems\PhalCMS\Lib\Helper\Text::_('out-of') ?> 100
  53. </a>
  54. </div>
  55. <?php } ?>
  56.  
  57. <?php $summary = trim($post->t('summary')); ?>
  58. <?php if (!empty($summary)) { ?>
  59. <div class="post-summary uk-text-lead uk-margin">
  60. <?= strip_tags(html_entity_decode($summary)) ?>
  61. </div>
  62. <?php } ?>
  63.  
  64. <?php if ($this->length($images) > 0) { ?>
  65. <?php if ($this->length($images) > 1) { ?>
  66. <div class="post-images">
  67. <div class="uk-position-relative" uk-slideshow>
  68. <ul class="uk-slideshow-items" uk-lightbox>
  69. <?php $thumbNav = ''; ?>
  70. <?php foreach ($images as $i => $image) { ?>
  71. <?php $ratio = $image->getRatio(); ?>
  72. <li>
  73. <a href="<?= $image->getUri() ?>">
  74. <div style="--aspect-ratio: <?= $ratio ?>/1">
  75. <img data-src="<?= $image->getUri() ?>" alt="<?= $this->escaper->attributes($post->t('title')) ?>" uk-img />
  76. </div>
  77. </a>
  78. </li>
  79. <?php $thumbNav = $thumbNav . '<li uk-slideshow-item="' . $i . '"><a href="#"><img src="' . $image->getResize(100) . '" width="100" alt=""></a></li>'; ?>
  80. <?php } ?>
  81. </ul>
  82. <div class="uk-position-bottom-center uk-position-small">
  83. <ul class="uk-thumbnav">
  84. <?= $thumbNav ?>
  85. </ul>
  86. </div>
  87. </div>
  88. </div>
  89. <?php } else { ?>
  90. <?php $ratio = $images[0]->getRatio(); ?>
  91. <div class="post-image" uk-lightbox>
  92. <div style="--aspect-ratio: <?= $ratio ?>; --size: 100%; width: var(--size); height: calc(var(--size) / var(--aspect-ratio));">
  93. <a href="<?= $images[0]->getUri() ?>">
  94. <img itemprop="logo" data-src="<?= $images[0]->getUri() ?>" alt="<?= $this->escaper->attributes($post->t('title')) ?>" uk-img
  95. /> <!-- style="--aspect-ratio: <?= $ratio ?>; --size: 100%; width: var(--size); height: calc(var(--size) / var(--aspect-ratio));" -->
  96. </a>
  97. </div>
  98. </div>
  99. <?php } ?>
  100. <?php } ?>
  101.  
  102. <span itemprop="description"><?= $this->partial('UcmItem/Description') ?></span>
  103.  
  104. <?php if ($post->parentId == 118) { ?>
  105. <?php if (!empty($brandlink)) { ?>
  106. <a href="<?= $brandlink ?>"><?= CLSystems\PhalCMS\Lib\Helper\Text::_('click-here-for-brand') ?></a>
  107. <?php } ?>
  108. <?php } ?>
  109.  
  110. </article>
  111.  
  112. <?= $this->partial('Comment/Comment') ?>
  113. </div>
#4Phalcon\Mvc\View\Engine\Volt->render
#5Phalcon\Mvc\View->engineRender
#6Phalcon\Mvc\View->processRender
#7Phalcon\Mvc\View->render
#8Phalcon\Mvc\Application->handle
/var/www/html/discounts-n-coupons.com/src/app/Lib/CmsApplication.php (117)
  1. <?php
  2.  
  3. namespace CLSystems\PhalCMS\Lib;
  4.  
  5. use Phalcon\Autoload\Loader;
  6. use Phalcon\Http\Response;
  7. use Phalcon\Events\Event;
  8. use Phalcon\Mvc\Application;
  9. use Phalcon\Mvc\Dispatcher;
  10. use Phalcon\Mvc\View;
  11. use CLSystems\PhalCMS\Lib\Helper\Asset;
  12. use CLSystems\PhalCMS\Lib\Helper\Config;
  13. use CLSystems\PhalCMS\Lib\Helper\Uri;
  14. use CLSystems\PhalCMS\Lib\Helper\State;
  15. use CLSystems\PhalCMS\Lib\Helper\User;
  16. use CLSystems\PhalCMS\Lib\Helper\Event as EventHelper;
  17. use CLSystems\PhalCMS\Lib\Mvc\View\ViewBase;
  18. use CLSystems\Php\Registry;
  19. use MatthiasMullie\Minify;
  20. use Exception;
  21.  
  22. class CmsApplication extends Application
  23. {
  24. public function execute()
  25. {
  26. try {
  27. $eventsManager = $this->di->getShared('eventsManager');
  28. $eventsManager->attach('application:beforeSendResponse', $this);
  29. $plugins = EventHelper::getPlugins();
  30. $systemEvents = [
  31. 'application:beforeSendResponse',
  32. 'dispatch:beforeExecuteRoute',
  33. 'dispatch:beforeException',
  34. 'dispatch:beforeDispatch',
  35. 'dispatch:afterDispatch',
  36. 'dispatch:afterInitialize',
  37. ];
  38.  
  39. foreach ($plugins['System'] as $className => $config) {
  40. $handler = EventHelper::getHandler($className, $config);
  41.  
  42. foreach ($systemEvents as $systemEvent) {
  43. $eventsManager->attach($systemEvent, $handler);
  44. }
  45. }
  46.  
  47. // Update view dirs
  48. define('TPL_SITE_PATH', APP_PATH . '/Tmpl/Site/' . Config::get('siteTemplate', 'PhalCMS'));
  49. define('TPL_ADMINISTRATOR_PATH', APP_PATH . '/Tmpl/Administrator');
  50. define('TPL_SYSTEM_PATH', APP_PATH . '/Tmpl/System');
  51.  
  52. if (Uri::isClient('site')) {
  53. $viewDirs = [
  54. TPL_SITE_PATH . '/Tmpl/',
  55. TPL_SITE_PATH . '/',
  56. ];
  57. } else {
  58. $viewDirs = [
  59. TPL_ADMINISTRATOR_PATH . '/',
  60. ];
  61. }
  62.  
  63. foreach (['System', 'Cms'] as $plgGroup) {
  64. if (isset($plugins[$plgGroup])) {
  65. /**
  66. * @var string $pluginClass
  67. * @var Registry $pluginConfig
  68. */
  69.  
  70.  
  71. foreach ($plugins[$plgGroup] as $pluginClass => $pluginConfig) {
  72. $pluginName = $pluginConfig->get('manifest.name');
  73. $pluginPath = PLUGIN_PATH . '/' . $plgGroup . '/' . $pluginName;
  74. $psrPaths = [];
  75.  
  76. if (is_dir($pluginPath . '/Tmpl')) {
  77. $viewDirs[] = $pluginPath . '/Tmpl/';
  78. }
  79.  
  80. if (is_dir($pluginPath . '/Lib')) {
  81. $psrPaths['CLSystems\\PhalCMS\\Lib'] = $pluginPath . '/Lib';
  82. }
  83.  
  84. if (is_dir($pluginPath . '/Widget')) {
  85. $psrPaths['CLSystems\\PhalCMS\\Widget'] = $pluginPath . '/Widget';
  86. }
  87.  
  88. if ($psrPaths) {
  89. (new Loader)
  90. ->setNamespaces($psrPaths, true)
  91. ->register();
  92. }
  93. }
  94. }
  95. }
  96.  
  97. $viewDirs[] = TPL_SYSTEM_PATH . '/';
  98.  
  99. /** @var ViewBase $view */
  100. $view = $this->di->getShared('view');
  101. $requestUri = $_SERVER['REQUEST_URI'];
  102.  
  103. if (Config::get('siteOffline') === 'Y'
  104. && !User::getInstance()->access('super')
  105. ) {
  106. $this->view->setMainView('Offline/Index');
  107.  
  108. if (strpos($requestUri, '/user/') !== 0) {
  109. $requestUri = '';
  110. }
  111. } else {
  112. $view->setMainView('Index');
  113. }
  114.  
  115. $view->setViewsDir($viewDirs);
  116. $this->setEventsManager($eventsManager);
  117. $this->handle($requestUri)->send();
  118. } catch (Exception $e) {
  119. if (true === DEVELOPMENT_MODE) {
  120. // Let Phalcon Debug catch this
  121. throw $e;
  122. }
  123.  
  124. try {
  125. if (User::getInstance()->access('super')) {
  126. State::setMark('exception', $e);
  127. }
  128.  
  129. /**
  130. * @var Dispatcher $dispatcher
  131. * @var View $view
  132. */
  133. $dispatcher = $this->getDI()->getShared('dispatcher');
  134. $dispatcher->setControllerName(Uri::isClient('administrator') ? 'admin_error' : 'error');
  135. $dispatcher->setActionName('show');
  136. $dispatcher->setParams(
  137. [
  138. 'code' => $e->getCode(),
  139. 'message' => $e->getMessage(),
  140. ]
  141. );
  142.  
  143. $view = $this->getDI()->getShared('view');
  144. $view->start();
  145. $dispatcher->dispatch();
  146. $view->render(
  147. $dispatcher->getControllerName(),
  148. $dispatcher->getActionName(),
  149. $dispatcher->getParams()
  150. );
  151. $view->finish();
  152. echo $view->getContent();
  153. } catch (Exception $e2) {
  154. debugVar($e2->getMessage());
  155. }
  156. }
  157. }
  158.  
  159. protected function getCompressor($type)
  160. {
  161. if ('css' === $type) {
  162. $compressor = new Minify\CSS;
  163. $compressor->setImportExtensions(
  164. [
  165. 'gif' => 'data:image/gif',
  166. 'png' => 'data:image/png',
  167. 'svg' => 'data:image/svg+xml',
  168. ]
  169. );
  170. } else {
  171. $compressor = new Minify\JS;
  172. }
  173.  
  174. return $compressor;
  175. }
  176.  
  177. protected function compressAssets()
  178. {
  179. $basePath = PUBLIC_PATH . '/assets';
  180. $assets = Factory::getService('assets');
  181.  
  182. foreach (Asset::getFiles() as $type => $files) {
  183. $fileName = md5(implode(':', $files)) . '.' . $type;
  184. $filePath = $basePath . '/compressed/' . $fileName;
  185. $fileUri = DOMAIN . '/assets/compressed/' . $fileName . (DEVELOPMENT_MODE ? '?' . time() : '');
  186. $hasAsset = is_file($filePath);
  187. $ucType = ucfirst($type);
  188. $addFunc = 'add' . $ucType;
  189.  
  190. if ($hasAsset && !DEVELOPMENT_MODE) {
  191. call_user_func_array([$assets, $addFunc], [$fileUri, false]);
  192. continue;
  193. }
  194.  
  195. $compressor = self::getCompressor($type);
  196.  
  197. foreach ($files as $file) {
  198. $compressor->add($file);
  199. }
  200.  
  201. if (!is_dir($basePath . '/compressed/')) {
  202. mkdir($basePath . '/compressed/', 0777, true);
  203. }
  204.  
  205. if ($compressor->minify($filePath)) {
  206. // echo $filePath;
  207. $chmodFile = chmod($filePath, 0777);
  208. if (false === $chmodFile)
  209. {
  210. touch($filePath);
  211. chmod($filePath, 0777);
  212. }
  213. call_user_func_array([$assets, $addFunc], [$fileUri, false]);
  214. }
  215.  
  216. unset($compressor);
  217. }
  218. }
  219.  
  220. public function beforeSendResponse(Event $event, CmsApplication $app, Response $response)
  221. {
  222. $request = $this->di->getShared('request');
  223.  
  224. if ($request->isAjax()) {
  225. return;
  226. }
  227.  
  228. /** @var Asset $assets */
  229. $this->compressAssets();
  230. $assets = $this->di->getShared('assets');
  231.  
  232. // Compress CSS
  233. ob_start();
  234. $assets->outputCss();
  235. $assets->outputInlineCss();
  236. $content = str_replace('</head>', ob_get_clean() . '</head>', $response->getContent());
  237.  
  238. // Compress JS
  239. ob_start();
  240. $assets->outputJs();
  241. $assets->outputInlineJs();
  242. $code = Asset::getCode() . ob_get_clean();
  243.  
  244. // Extra code (in the footer)
  245. $content = str_replace('</body>', $code . '</body>', $content);
  246. $response->setContent($content);
  247. }
  248. }
#9CLSystems\PhalCMS\Lib\CmsApplication->execute
/var/www/html/discounts-n-coupons.com/public/index.php (14)
  1. <?php
  2. declare(strict_types=1);
  3.  
  4. error_reporting(E_ALL);
  5. ini_set('display_errors', true);
  6.  
  7. use CLSystems\PhalCMS\Lib\Factory;
  8.  
  9. define('BASE_PATH', dirname(__DIR__));
  10.  
  11. require_once BASE_PATH . '/src/app/Lib/Factory.php';
  12.  
  13. // Execute application
  14. Factory::getApplication()->execute();