当前位置: 首页>>代码示例>>PHP>>正文


PHP Asset::source_file方法代码示例

本文整理汇总了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);
 }
开发者ID:alle,项目名称:assets-merger,代码行数:15,代码来源:Less.php

示例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);
 }
开发者ID:boomcms,项目名称:asset-merger,代码行数:8,代码来源:sassTest.php

示例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);
 }
开发者ID:boomcms,项目名称:asset-merger,代码行数:8,代码来源:coffeeTest.php

示例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;
 }
开发者ID:alle,项目名称:assets-merger,代码行数:20,代码来源:Coffee.php

示例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;
 }
开发者ID:boomcms,项目名称:asset-merger,代码行数:21,代码来源:Coffee.php

示例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');
 }
开发者ID:alle,项目名称:assets-merger,代码行数:14,代码来源:TestAsset.php


注:本文中的Asset::source_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。