├── .gitignore ├── bin └── v1.0.zip ├── .gitmodules ├── README.md ├── plugin.info.txt └── action.php /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/v1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gamma/dokuwiki-plugin-lessphp/master/bin/v1.0.zip -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "inc"] 2 | path = inc 3 | url = https://github.com/oyejorge/less.php 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LessPHP 2 | ======================= 3 | 4 | Drop-in replacement for the bundled less.inc.php using http://lessphp.gpeasy.com 5 | 6 | It will use a different less engine - still written in php - when rendering CSS and LESS files. 7 | -------------------------------------------------------------------------------- /plugin.info.txt: -------------------------------------------------------------------------------- 1 | # General Plugin Info do not edit 2 | 3 | base lessphp 4 | author i-net software 5 | email tools@inetsoftware.de 6 | date 2014-19-09 7 | name LessPHP 8 | desc Drop-in replacement for the bundled less.inc.php using http://lessphp.gpeasy.com 9 | url https://www.dokuwiki.org/plugin:lessphp 10 | -------------------------------------------------------------------------------- /action.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Gerry Weissbach 8 | */ 9 | 10 | // must be run within Dokuwiki 11 | if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 12 | if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 13 | require_once(DOKU_PLUGIN.'action.php'); 14 | 15 | class action_plugin_lessphp extends DokuWiki_Action_Plugin { 16 | 17 | /** 18 | * Register Plugin in DW 19 | **/ 20 | public function register(Doku_Event_Handler $controller) { 21 | $controller->register_hook('INIT_LANG_LOAD', 'BEFORE', $this, 'lessphp_load'); 22 | } 23 | 24 | /** 25 | * Check for Template changes 26 | **/ 27 | function lessphp_load(&$event) 28 | { 29 | global $conf, $INFO; 30 | if ( ! strrpos( $_SERVER['SCRIPT_FILENAME'], 'css.php', -7 ) ) { 31 | return; 32 | } 33 | 34 | $lessInc = dirname(__FILE__) . '/inc/lessc.inc.php'; 35 | if ( !file_exists($lessInc) ) { 36 | system("git submodule init " . dirname(__FILE__) ); 37 | system("git submodule update " . dirname(__FILE__) ); 38 | } 39 | 40 | // If this is a call for css.php include the other library 41 | if ( file_exists($lessInc) ) { 42 | require_once( $lessInc ); 43 | } 44 | } 45 | } 46 | --------------------------------------------------------------------------------