本文整理汇总了PHP中Asset::source_file方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::source_file方法的具体用法?PHP Asset::source_file怎么用?PHP Asset::source_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::source_file方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Process asset content
*
* @param string $content
* @param Asset $asset
*
* @return string
*/
public static function process($content, Asset $asset)
{
// Set Less
$lc = new lessc();
$lc->importDir = dirname($asset->source_file()) . DIRECTORY_SEPARATOR;
return $lc->parse($content);
}
示例2: test_process
public function test_process()
{
$asset = new Asset(Assets::STYLESHEET, 'test-sass.css.sass');
$sass = file_get_contents($asset->source_file());
$css = file_get_contents($asset->destination_file());
$converted = Asset_Engine_Sass::process($sass, $asset);
$this->assertEquals($css, $converted);
}
示例3: test_process
public function test_process()
{
$asset = new Asset(Assets::JAVASCRIPT, 'test-coffee.js.coffee');
$coffee = file_get_contents($asset->source_file());
$js = file_get_contents($asset->destination_file());
$converted = Asset_Engine_Coffee::process($coffee, $asset);
$this->assertEquals($js, $converted);
}
示例4: process
/**
* Process asset content
*
* @param string $content
* @param Asset $asset
*
* @return string
*/
public static function process($content, Asset $asset)
{
// Set error reporting
$old = error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT));
// Set content
CoffeeScript\Init::load();
$options = array('filename' => Debug::path($asset->source_file()), 'header' => FALSE);
$content = CoffeeScript\Compiler::compile($content, $options);
// Set error reporting
error_reporting($old);
return $content;
}
示例5: process
/**
* Process asset content
*
* @param string $content
* @param Asset $asset
* @return string
*/
public static function process($content, Asset $asset)
{
// Set error reporting
$old = error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED | E_STRICT));
// Include the engine
include_once Kohana::find_file('vendor/coffeescript/CoffeeScript', 'Init');
// Set content
CoffeeScript\Init::load();
$options = array('filename' => Debug::path($asset->source_file()), 'header' => TRUE);
$content = CoffeeScript\Compiler::compile($content, $options);
// Set error reporting
error_reporting($old);
return $content;
}
示例6: test_construct
public function test_construct()
{
$asset = new Asset(Assets::JAVASCRIPT, 'test.js');
$this->assertEquals(self::data_dir() . 'js' . DIRECTORY_SEPARATOR . 'test.js', $asset->source_file());
$this->assertEquals(self::data_dir() . 'assets' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'test.js', $asset->destination_file());
$this->assertEquals('assets/js/test.js', $asset->destination_web());
$this->assertEquals(array(), $asset->engines());
$this->assertEquals(Assets::JAVASCRIPT, $asset->type());
$asset = new Asset(Assets::JAVASCRIPT, 'test.js.coffee.php');
$this->assertEquals(array('php', 'coffee'), $asset->engines());
$asset = new Asset(Assets::JAVASCRIPT, 'test.js', array('condition' => 'IF ie', 'processor' => 'jsmin'));
$this->assertEquals($asset->condition(), 'IF ie');
$this->assertEquals($asset->processor(), 'jsmin');
}