-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a less compiler to the build folder.
- Loading branch information
1 parent
b7a025e
commit 619af17
Showing
5 changed files
with
4,157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Build | ||
* | ||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
// Set flag that this is a parent file. | ||
const _JEXEC = 1; | ||
|
||
// Load system defines | ||
if (file_exists(dirname(__DIR__) . '/defines.php')) | ||
{ | ||
require_once dirname(__DIR__) . '/defines.php'; | ||
} | ||
|
||
if (!defined('_JDEFINES')) | ||
{ | ||
define('JPATH_BASE', dirname(__DIR__)); | ||
require_once JPATH_BASE . '/includes/defines.php'; | ||
} | ||
|
||
require_once JPATH_LIBRARIES . '/import.php'; | ||
|
||
JLoader::registerPrefix('J', __DIR__ . '/libraries'); | ||
|
||
require_once JPATH_LIBRARIES . '/cms.php'; | ||
|
||
// Load the configuration | ||
require_once JPATH_CONFIGURATION . '/configuration.php'; | ||
|
||
/** | ||
* This script will fetch the update information for all extensions and store | ||
* them in the database, speeding up your administrator. | ||
* | ||
* @package Joomla.Build | ||
* @since 3.0 | ||
*/ | ||
class GenerateCss extends JApplicationCli | ||
{ | ||
/** | ||
* Entry point for the script | ||
* | ||
* @return void | ||
* | ||
* @since 3.0 | ||
*/ | ||
public function doExecute() | ||
{ | ||
$templates = array( | ||
JPATH_ADMINISTRATOR . '/templates/isis/less/template.less' => JPATH_ADMINISTRATOR . '/templates/isis/css/template.css', | ||
JPATH_ADMINISTRATOR . '/templates/hathor/less/template.less' => JPATH_ADMINISTRATOR . '/templates/hathor/css/template.css', | ||
JPATH_ADMINISTRATOR . '/templates/hathor/less/colour_blue.less' => JPATH_ADMINISTRATOR . '/templates/hathor/css/colour_blue.css', | ||
JPATH_ADMINISTRATOR . '/templates/hathor/less/colour_standard.less' => JPATH_ADMINISTRATOR . '/templates/hathor/css/colour_standard.css', | ||
JPATH_SITE . '/templates/protostar/less/template.less' => JPATH_SITE . '/templates/protostar/css/template.css' | ||
); | ||
$less = new JLess; | ||
|
||
foreach ($templates as $source => $output) | ||
{ | ||
try | ||
{ | ||
$less->compileFile($source, $output); | ||
} | ||
catch (Exception $e) | ||
{ | ||
echo $e->getMessage(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
JApplicationCli::getInstance('GenerateCss')->execute(); |
Oops, something went wrong.