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
2013-10-02 11:14:53 -05:00

27 lines
501 B
PHP
Executable File

<?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();
}
}