PHPackages                             inthraonsap/carabiner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. inthraonsap/carabiner

ActiveLibrary

inthraonsap/carabiner
=====================

To use minify js and css files (Extra Feature: you can put the php code in Javascript file.)

329PHP

Since Oct 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/inthra-onsap/InthraOnsap-Carabiner)[ Packagist](https://packagist.org/packages/inthraonsap/carabiner)[ RSS](/packages/inthraonsap-carabiner/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel4-Carabiner with Blade Compiler
--------------------------------------

[](#laravel4-carabiner-with-blade-compiler)

Carabiner is a js/css minify package. I changed some code to get it work with Laravel4 and add a few functionalities to make it compile php code. It's a good package when you work with two languages website or you need to send some php data to javascript file and so on.

Installation
------------

[](#installation)

Add "inthraonsap/carabiner": "dev-master" to composer.json file.

```
{
  "require": {
    "inthraonsap/carabiner": "dev-master"
  }
}
```

Run composer update CLI.

```
$ composer update
```

Open the app.php file in app/config/. and follow these steps.

```
'providers' => array(
  ...,
  'Inthraonsap\Carabiner\CarabinerServiceProvider',
  ...
),
'aliases' => array(
  ...,
  'Carabiner'   => 'Inthraonsap\Carabiner\Facades\Carabiner',
  ...
)
```

Publish a config file by using artisan CLI.

```
$ php artisan config:publish inthraonsap/carabiner
```

Usage
-----

[](#usage)

- [Configuration](#configuration)
- [Methods](#methods)

### Configuration

[](#configuration)

Configuration file of this package.

```
return array(
    /*
    |--------------------------------------------------------------------------
    | Script Directory
    |--------------------------------------------------------------------------
    |
    | Path to the script directory.
    | Relative to the public-Folder
    |
    */
    'scriptDir' => '/',
/*
|--------------------------------------------------------------------------
| Style Directory
|--------------------------------------------------------------------------
|
| Path to the style directory.
| Relative to the public-Folder
|
*/
'styleDir' => '/',
/*
|--------------------------------------------------------------------------
| Cache Directory
|--------------------------------------------------------------------------
|
| Path to the cache directory. Must be writable.
| Relative to the public-Folder
|
*/
'cacheDir' => 'cache/',

/*
 * Base url for file location.
 */
'base_uri' => URL::to('/').'/',

/*
|--------------------------------------------------------------------------
| Combine
|--------------------------------------------------------------------------
|
| Flags whether files should be combined. Defaults to TRUE.
|
*/
'combine' => TRUE,

/*
|--------------------------------------------------------------------------
| Development Flag
|--------------------------------------------------------------------------
|
|  Flags whether your in a development environment or not. Defaults to FALSE.
|
*/
'dev' => FALSE,

/*
|--------------------------------------------------------------------------
| Minify Javascript
|--------------------------------------------------------------------------
|
| Global flag for whether JS should be minified. Defaults to TRUE.
|
*/
'minify_js' => TRUE,

/*
|--------------------------------------------------------------------------
| Minify CSS
|--------------------------------------------------------------------------
|
| Global flag for whether CSS should be minified. Defaults to TRUE.
|
*/

'minify_css' => TRUE,

/*
|--------------------------------------------------------------------------
| Force cURL
|--------------------------------------------------------------------------
|
| Global flag for whether to force the use of cURL instead of file_get_contents()
| Defaults to FALSE.
|
*/

'force_curl' => FALSE,

/*
|--------------------------------------------------------------------------
| Predifined Asset Groups
|--------------------------------------------------------------------------
|
| Any groups defined here will automatically be included.  Of course, they
| won't be displayed unless you explicity display them ( like this: Carabiner::display('jquery') )
| See docs for more.
|
*/
'groups' =>  array(),

/**
 * character encoding for javascript tag.
 * Default: UTF-8
 */
'charset' => 'UTF-8',

/**
 * Choose a compiler for javascript file.(It works once you use Carabiner::compileJs())
 * Options: php | blade
 * ex. php
 *      alert("&lt;?php echo 'print some text'; ?&gt;");
 * ex. blade
 *      alert("{{{ print some text }}}");
 * Default: php
 */
'compiler' => 'php'

);

```

### Methods

[](#methods)

Working with assets

```
/**
* Add JS file to queue
* @param	String of the path to development version of the JS file.  Could also be an array, or array of arrays. (ex. "assets/js/jquery.js")
* @param	String of the path to production version of the JS file. NOT REQUIRED
* @param	Boolean flag whether the file is to be combined. NOT REQUIRED
* @param	String of the group name with which the asset is to be associated. NOT REQUIRED
* @return   Void
*/
Carabiner::js($dev_file, $prod_file = '', $combine = TRUE, $minify = TRUE, $group = 'main');
/**
```

- Add CSS file to queue
- @param String of the path to development version of the CSS file. Could also be an array, or array of arrays. (ex. "assets/css/layout.css")
- @param String of the media type, usually one of (screen, print, handheld) for css. Defaults to screen.
- @param String of the path to production version of the CSS file. NOT REQUIRED
- @param Boolean flag whether the file is to be combined. NOT REQUIRED
- @param Boolean flag whether the file is to be minified. NOT REQUIRED
- @param String of the group name with which the asset is to be associated. NOT REQUIRED
- @return Void \*/ Carabiner::css($dev\_file, $media = 'screen', $prod\_file = '', $combine = TRUE, $minify = TRUE, $group = 'main')

/\*\*

- Adding js file to queue with blade or php compiler.
- @param string $dev\_file is String of the path to development version of the JS file. Could also be an array, or array of arrays. (ex. "assets/js/jquery.js")
- @param type $args is Array of variable that you want to send to js view. (ex. array("name"=&gt;"Inthra Onsap")).
- @param string $prod\_file is String of the path to production version of the JS file. NOT REQUIRED
- @param type $combine is Boolean flag whether the file is to be combined. NOT REQUIRED
- @param type $minify is Boolean flag whether the file is to be minified. NOT REQUIRED
- @param type $group is String of the group name with which the asset is to be associated. NOT REQUIRED
- @return Void \*/ Carabiner::compileJs($dev\_file, $args = array(), $prod\_file = '', $combine = TRUE, $minify = TRUE, $group = 'main'){

// Display css Carabiner::display('css');

//display js Carabiner::display('js');

// display both Carabiner::display(); // OR Carabiner::display('both');

// display group Carabiner::display('jquery'); // group name defined as jquery

// display filterd group Carabiner::display('main', 'js'); // group name defined as main, only display JS

// return string of asset references $string = Carabiner::display\_string('main');

// clear css cache Carabiner::empty\_cache('css');

//clear js cache Carabiner::empty\_cache('js');

// clear both Carabiner::empty\_cache(); // OR Carabiner::empty\_cache('both');

// clear before a certain date Carabiner::empty\_cache('both', 'now'); // String denoting a time before which cache // files will be removed. Any string that // strtotime() can take is acceptable. // Defaults to 'now'.

Credits
-------

[](#credits)

All Credits to original developers.  and

Support or Contact
------------------

[](#support-or-contact)

If you find any issue, Please contact me by

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2da3f76b4bbf521130858468288bfca59e92addecf085af899df827b8a215077?d=identicon)[inthra.onsap](/maintainers/inthra.onsap)

---

Top Contributors

[![inthra-onsap](https://avatars.githubusercontent.com/u/5329079?v=4)](https://github.com/inthra-onsap "inthra-onsap (20 commits)")

### Embed Badge

![Health badge](/badges/inthraonsap-carabiner/health.svg)

```
[![Health](https://phpackages.com/badges/inthraonsap-carabiner/health.svg)](https://phpackages.com/packages/inthraonsap-carabiner)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
