Download the PHP package max-dreamsoft/yii2-asset-converter without Composer

On this page you can find all versions of the php package max-dreamsoft/yii2-asset-converter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-asset-converter

Only for YII2 with the new Asset Manager, convert Less and Sass files to CSS whithout external tools and executable. The sass and less files are converted with PHP libraries It replace the AssetConverter who use external tools. The Less and Sass file are converted with time source files dependency.

Requirements

YII 2.0

Usage

1) Install with Composer


"require": {
    "dreamsoft/yii2-asset-converter": "1.*",
},

php composer.phar update

2) Modify assetManager in your configuration file {app}/protected/config/main.php

    'assetManager' => [
        'bundles' => require(__DIR__ . '/assets.php'),
        'converter'=> [
            'class'=>'dreamsoft\assetConverter\Converter',
        ]
    ],

3) Create .gitignore in 4) Enjoy!

Example of assets config file /protected/config/assets.php


return [
    'app' => [
        'basePath' => '@webroot',
        'baseUrl' => '@web',
        'css' => [
            'css/bootstrap.min.css',
            'css/bootstrap-responsive.min.css',
            'css/site.css',
            'css/less_style.less',
            'css/sass_style.sass',
        ],
        'js' => [

        ],
        'depends' => [
            'yii',
        ],
    ],
];

Where is compiled files?

By default it present at @webroot/compiled But you can change it by destinationDir property from config

Full configuration


'components' => [
    'assetManager' => [
        'converter'=> [
            'class'=> 'dreamsoft\assetConverter\Converter',
            'force'=> false, // true : If you want convert your sass each time without time dependency
            'destinationDir' => 'compiled', // at which folder of @webroot put compiled files
            'destinationDirPerms' => 0755, // permissions to assign to destinationDir
            'recursiveRecompileCheck' => false, // check timestamps of all source siblings and children
            'parsers' => [
                'sass' => [ // file extension to parse
                    'class' => 'dreamsoft\assetConverter\Sass',
                    'output' => 'css', // parsed output file type
                    'options' => [
                        'cachePath' => '@app/runtime/cache/sass-parser' // optional options
                    ],
                ],
                'scss' => [ // file extension to parse
                    'class' => 'dreamsoft\assetConverter\Scss',
                    'output' => 'css', // parsed output file type
                    'options' => [] // optional options
                ],
                'less' => [ // file extension to parse
                    'class' => 'dreamsoft\assetConverter\Less',
                    'output' => 'css', // parsed output file type
                    'options' => [
                        'auto' => true, // optional options
                    ]
                ]
            ]
        ]
    ],
],

Also, for SCSS files you can use alternate configuration:

'components' => [
    'assetManager' => [
            'converter'=> [
                // ...
                'parsers' => [
                    // ...
                    'scss' => [ // file extension to parse
                        'class' => 'dreamsoft\assetConverter\Scss',
                        'output' => 'css', // parsed output file type
                        'options' => [ // optional options
                            'enableCompass' => true, // default is true
                            'importPaths' => [], // import paths, you may use path alias here, 
                                // e.g., `['@path/to/dir', '@path/to/dir1', ...]`
                            'lineComments' => false, // if true — compiler will place line numbers in your compiled output
                            'generateMap' => false, // if true — compiler will generate map **
                            'outputStyle' => 'nested', // May be `compressed`, `crunched`, `expanded` or `nested`,
                                // see more at http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style
                        ],
                    ],
                ],
            ],
        ],
    // ...

** possible values for generateMap are:


All versions of yii2-asset-converter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yiisoft/yii2 Version ^2.0.13
yiisoft/yii2-composer Version 2.*
oyejorge/less.php Version 1.7.0.*
richthegeek/phpsass Version 1.*
leafo/scssphp Version 0.7.*
yourilima/scssphp-compass Version 1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package max-dreamsoft/yii2-asset-converter contains the following files

Loading the files please wait ....