This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/lib/Rails/Assets/Parser/PHParser.php

27 lines
501 B
PHP
Raw Normal View History

2013-10-02 18:14:53 +02:00
<?php
namespace Rails\Assets\Parser;
use Rails\Assets\Traits\AssetPathTrait;
class PHParser
{
use AssetPathTrait;
static protected $instance;
static public function parseContents($contents)
{
if (!self::$instance) {
self::$instance = new static();
}
return self::$instance->parse($contents);
}
public function parse($contents)
{
ob_start();
eval('?>' . $contents);
return ob_get_clean();
}
}