本文整理汇总了PHP中lessc::ccompile方法的典型用法代码示例。如果您正苦于以下问题:PHP lessc::ccompile方法的具体用法?PHP lessc::ccompile怎么用?PHP lessc::ccompile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lessc
的用法示例。
在下文中一共展示了lessc::ccompile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseOnce
function parseOnce($path, $force = 'false')
{
if ($force == 'true') {
JFile::delete($path . DS . 'css' . DS . 'template.css');
JFile::delete($path . DS . 'css' . DS . 'override.css');
JFile::delete($path . DS . 'css' . DS . 'error.css');
JFile::delete($path . DS . 'css' . DS . 'print.css');
JFile::delete($path . DS . 'css' . DS . 'mail.css');
// generate new Template CSS files
try {
// normal Template code
lessc::ccompile($path . DS . 'less' . DS . 'main.less', $path . DS . 'css' . DS . 'template.css');
lessc::ccompile($path . DS . 'less' . DS . 'print.less', $path . DS . 'css' . DS . 'print.css');
lessc::ccompile($path . DS . 'less' . DS . 'mail.less', $path . DS . 'css' . DS . 'mail.css');
// additional Template code
lessc::ccompile($path . DS . 'less' . DS . 'error.less', $path . DS . 'css' . DS . 'error.css');
lessc::ccompile($path . DS . 'less' . DS . 'offline.less', $path . DS . 'css' . DS . 'offline.css');
lessc::ccompile($path . DS . 'less' . DS . 'override.less', $path . DS . 'css' . DS . 'override.css');
$result = true;
} catch (exception $ex) {
$result = $ex->getMessage();
return $result;
}
return $result;
}
}
示例2: __construct
function __construct($parent)
{
if ($parent->API->get('recompile_css', 0) == 1) {
// remove old Template CSS files
jimport('joomla.filesystem.file');
JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'template.css');
JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'override.css');
JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'error.css');
JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'print.css');
JFile::delete($parent->API->URLtemplatepath() . DS . 'css' . DS . 'mail.css');
// generate new Template CSS files
try {
// normal Template code
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'main.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'template.css');
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'print.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'print.css');
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'mail.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'mail.css');
// additional Template code
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'error.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'error.css');
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'offline.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'offline.css');
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'less' . DS . 'override.less', $parent->API->URLtemplatepath() . DS . 'css' . DS . 'override.css');
} catch (exception $ex) {
exit('LESS Parser fatal error:<br />' . $ex->getMessage());
}
}
}
示例3: compile
public static function compile($source, $destination)
{
try {
lessc::ccompile($source, $destination);
} catch (\Exception $ex) {
\Log::error($ex->getMessage());
}
}
示例4: compile
/**
* Compiles the $uncompiledFile into CSS
*/
public function compile()
{
if (MetaLanguages::within_modification_tolerance($this->uncompiledFile, $this->getCompiledPath())) {
return;
}
$path = $this->getCompiledPath();
if (file_exists($path) && !is_writable($this->getCompiledPath())) {
user_error("SCSS compiling error: {$path} is not writable.", E_USER_ERROR);
} elseif (!is_writable(dirname($path))) {
user_error("SCSS compiling error: {$path} is not writable.", E_USER_ERROR);
}
lessc::ccompile(BASE_PATH . "/" . $this->uncompiledFile, BASE_PATH . "/" . $path);
}
示例5: beforeRender
public function beforeRender()
{
// only compile it on development mode
if (Configure::read('debug') > 0) {
// import the file to application
App::import('Vendor', 'lessc');
// set the LESS file location
$less = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'less' . DS . 'main.less';
// set the CSS file to be written
$css = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'main.css';
// compile the file
lessc::ccompile($less, $css);
}
parent::beforeRender();
}
示例6: createCss
function createCss()
{
$inputFile = "views/backend/less/";
$outFile = "views/backend/css/";
$less_cats = array("main.less" => "main.css");
//ХњСПБрвы
for (reset($less_cats); $index = key($less_cats); next($less_cats)) {
try {
lessc::ccompile($inputFile . $index, $outFile . $less_cats[$index]);
echo '<span>Брвы' . $inputFile . $index . 'ЕН' . $outFile . $less_cats[$index] . 'ГЩЙІ!</br></span>';
} catch (exception $ex) {
echo '<span>БрвыДэЮѓаХЯЂ:' . $ex->getMessage() . '</span>';
}
}
}
示例7: __construct
function __construct($parent, $force = 'false')
{
if ($parent->API->get('recompile_css', 0) == 1) {
$tpl_path = $parent->API->URLtemplatepath();
$override_suffix = '';
if ($parent->API->get('custom_override', '-1') != '-1') {
$override_suffix = '.' . $parent->API->get('custom_override', '-1');
}
$style_suffix = '';
if ($parent->API->get('template_style', 'main.less') != 'main.less') {
$style_suffix = '.' . str_replace('.main.less', '', $parent->API->get('template_style', 'main.less'));
}
$style_dir = str_replace('.', '', $style_suffix);
if ($style_dir != '') {
$style_dir .= DS;
}
$files = array('main' => array('css' => 'template' . $style_suffix . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $parent->API->get('template_style', 'main.less')), 'small.desktop' => array('css' => 'small.desktop' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'small.desktop.less'), 'tablet' => array('css' => 'tablet' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'tablet.less'), 'small.tablet' => array('css' => 'small.tablet' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'small.tablet.less'), 'mobile' => array('css' => 'mobile' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'mobile.less'), 'print' => array('css' => 'print' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . 'print.less'), 'mailto' => array('css' => 'mailto' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . 'mailto.less'), 'offline' => array('css' => 'offline' . $style_suffix . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . $style_dir . 'offline.less'), 'override' => array('css' => 'override' . $override_suffix, 'less' => $tpl_path . DS . 'less' . DS . 'override.less'));
if ($parent->API->get('custom_override', '-1') !== '-1') {
$override_path = JPATH_SITE . DS . 'templates' . DS . 'gk_overrides' . DS . $parent->API->get('custom_override', '-1') . DS . 'less' . DS;
foreach ($files as $file_name => $file_data) {
if (JFile::exists($override_path . $file_name . '.less')) {
$files[$file_name]['less'] = $override_path . $file_name . '.less';
}
}
}
// remove old Template CSS files
foreach ($files as $file) {
JFile::delete($tpl_path . DS . 'css' . DS . $file['css'] . '.css');
}
// generate new Template CSS files
try {
// normal Template code
lessc::ccompile($files['main']['less'], $tpl_path . DS . 'css' . DS . $files['main']['css'] . '.css');
lessc::ccompile($files['small.desktop']['less'], $tpl_path . DS . 'css' . DS . $files['small.desktop']['css'] . '.css');
lessc::ccompile($files['tablet']['less'], $tpl_path . DS . 'css' . DS . $files['tablet']['css'] . '.css');
lessc::ccompile($files['small.tablet']['less'], $tpl_path . DS . 'css' . DS . $files['small.tablet']['css'] . '.css');
lessc::ccompile($files['mobile']['less'], $tpl_path . DS . 'css' . DS . $files['mobile']['css'] . '.css');
lessc::ccompile($files['print']['less'], $tpl_path . DS . 'css' . DS . $files['print']['css'] . '.css');
lessc::ccompile($files['mailto']['less'], $tpl_path . DS . 'css' . DS . $files['mailto']['css'] . '.css');
// additional Template code
lessc::ccompile($files['offline']['less'], $tpl_path . DS . 'css' . DS . $files['offline']['css'] . '.css');
lessc::ccompile($files['override']['less'], $tpl_path . DS . 'css' . DS . $files['override']['css'] . '.css');
return true;
} catch (exception $ex) {
exit('LESS Parser fatal error:<br />' . $ex->getMessage());
}
}
}
示例8: __construct
function __construct($parent)
{
if ($parent->API->get('recompile_bootstrap', 0) == 1) {
// remove old Bootstrap CSS files
jimport('joomla.filesystem.file');
JFile::delete($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap.css');
JFile::delete($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap-responsive.css');
// generate new Bootstrap CSS files
try {
// normal Bootstrap code
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'less' . DS . 'bootstrap.less', $parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap.css');
// responsive Bootstrap code
lessc::ccompile($parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'less' . DS . 'responsive.less', $parent->API->URLtemplatepath() . DS . 'bootstrap' . DS . 'output' . DS . 'bootstrap-responsive.css');
} catch (exception $ex) {
exit('LESS Parser fatal error:<br />' . $ex->getMessage());
}
}
}
示例9: beforeRender
public function beforeRender()
{
// Error layout 変更
if ($this->name == 'CakeError') {
$this->layout = 'messages';
}
// only compile it on development mode
if (Configure::read('debug') > 0) {
// import the file to application
App::import('Vendor', 'lessc');
// set the LESS file location
$less = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'style.less';
// set the CSS file to be written
$css = ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'css' . DS . 'style.css';
// compile the file
lessc::ccompile($less, $css);
}
parent::beforeRender();
}
示例10: catch
<?php
require 'include/lessc.php';
try {
lessc::ccompile('less/index.less', 'css/index.css');
} catch (exception $ex) {
exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/ProjetMysqli.php';
$projetMysqli = new ProjetMysqli();
$projets = $projetMysqli->selectLast6();
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cifa3com</title>
<meta name="description" content="">
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/index.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
示例11: define
<?php
define('LESSPHP_LIB_PATH', 'sites/all/modules/contrib/less/lessphp');
define('LESSPHP_LIB_INCLUDE_FILE', 'lessc.inc.php');
$include = realpath(dirname(__FILE__) . '/../') . DIRECTORY_SEPARATOR . LESSPHP_LIB_PATH . DIRECTORY_SEPARATOR . LESSPHP_LIB_INCLUDE_FILE;
if( !file_exists($include) ) die('less library not found. ensure the module is installed and at the correct path: ' . $include);
$in = $argv[1];
$out = $argv[2];
if( file_exists($in) && file_exists(dirname($out)) ) {
require $include;
try {
lessc::ccompile($argv[1], $argv[2]);
}
catch (exception $ex) {
die($ex->getMessage());
}
}
else {
die("\ncompilation failed. check input and output files\n");
}
echo "Complete\n";
?>
示例12: bootstrap_admin_phpless
function bootstrap_admin_phpless()
{
require_once WP_PLUGIN_DIR . '/bootstrap-admin/includes/lessc.inc.php';
lessc::ccompile(WP_PLUGIN_DIR . '/bootstrap-admin/assets/css/global.less', WP_PLUGIN_DIR . '/bootstrap-admin/assets/css/compiled-style.css');
}
示例13: daylimotion_id_by_url
<?php
require 'include/lessc.php';
try {
lessc::ccompile('less/video.less', 'css/video.css');
} catch (exception $ex) {
exit('lessc fatal error:' . $ex->getMessage());
}
require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/EtudiantMysqli.php';
require 'include/ProjetMysqli.php';
$etudiantMysqli = new EtudiantMysqli();
$projetMysqli = new ProjetMysqli();
if (isset($_GET['id']) && !empty($_GET['id']) && ctype_digit($_GET['id'])) {
$id = (int) $_GET['id'];
$projet = $projetMysqli->selectAllById($id);
if ($projet['filiere'] == 1) {
$projets = $projetMysqli->selectLast3Mt();
} else {
$projets = $projetMysqli->selectLast3Rea();
}
} else {
header('Location: index.php');
exit;
}
$crochet = array("[", "]");
function daylimotion_id_by_url($url)
{
$media_url = "";
示例14: catch
<?php
require 'include/lessc.php';
try {
lessc::ccompile('less/equipe-pedagogique.less', 'css/equipe-pedagogique.css');
} catch (exception $ex) {
exit('lessc fatal error:' . $ex->getMessage());
}
/*require 'include/Config.php';
require 'include/MysqliRessource.php';
require 'include/ModelMysqli.php';
require 'include/ProjetMysqli.php';
$projetMysqli = new ProjetMysqli();
$projets = $projetMysqli->selectLast6();*/
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Equipe pédagogique - Cifa3com</title>
<meta name="description" content="">
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/equipe-pedagogique.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
示例15: isset
<?php
$file = isset($_REQUEST['file']) ? $_REQUEST['file'] : '';
if ($file && file_exists(TYPEF_DIR . $file) && is_file(TYPEF_DIR . $file)) {
header('Content-type: text/css');
$dir = dirname($file);
$md5 = md5($file) . '.css';
$dst = TYPEF_DIR . '/files/cache/lessphp/' . $md5;
lessc::ccompile(TYPEF_DIR . $file, $dst);
$css = SimpleCss::LoadFile($dst, TYPEF_WEB_DIR . $dir);
$code = $css->toString();
preg_match_all('/url\\(\\"([\\w\\W\\s\\S]*?)"\\)/', $code, $matches);
if (isset($matches[1])) {
foreach ($matches[1] as $url) {
$url = Typeframe_Attribute_Url::ConvertShortUrlToExpression($url);
$url = Typeframe::Pagemill()->data()->parseVariables($url);
$code = str_replace($matches[1], $url, $code);
}
}
echo $code;
exit;
} else {
http_response_code(404);
Typeframe::SetPageTemplate('/404.html');
Typeframe::CurrentPage()->stop();
}