Skip to content
Browse files

Merge branch 'release/1.5'

* release/1.5:
  Bump version to v1.5
  Change documentation for add_group function.
  Clarify usage of namespaces and the config file.
  Change add_group so it just adds the group, and use add_asset to load assets from config.
  Remove 'test' namespace from config.
  • Loading branch information...
2 parents 990ccc4 + 4551a1d commit 5e1cb6fc37dcbc62cd867d0d93ff1bf025e380d5 @canton7 committed Jun 15, 2011
Showing with 18 additions and 17 deletions.
  1. +1 −1 bootstrap.php
  2. +10 −11 classes/casset.php
  3. +1 −1 classes/casset/csscompressor.php
  4. +1 −1 classes/casset/cssurirewriter.php
  5. +1 −1 classes/casset/jsmin.php
  6. +1 −2 config/casset.php
  7. +3 −0 readme.md
View
2 bootstrap.php
@@ -4,7 +4,7 @@
* Casset: Convenient asset library for FuelPHP.
*
* @package Casset
- * @version v1.4
+ * @version v1.5
* @author Antony Male
* @license MIT License
* @copyright 2011 Antony Male
View
21 classes/casset.php
@@ -4,7 +4,7 @@
* Casset: Convenient asset library for FuelPHP.
*
* @package Casset
- * @version v1.4
+ * @version v1.5
* @author Antony Male
* @license MIT License
* @copyright 2011 Antony Male
@@ -120,7 +120,13 @@ public static function _init()
{
foreach ($groups as $group_name => $group)
{
- static::add_group($group_type, $group_name, $group['files'], $group['enabled']);
+ static::add_group($group_type, $group_name, $group['enabled']);
+ foreach ($group['files'] as $files)
+ {
+ if (!is_array($files))
+ $files = array($files, false);
+ static::add_asset($group_type, $files[0], $files[1], $group_name);
+ }
}
}
@@ -160,20 +166,13 @@ public static function set_path($path_key = 'core')
*
* @param string $group_type 'js' or 'css'
* @param string $group_name The name of the group
- * @param array $files The files to add to the group. Takes the form
- * array('file1', array('file2', 'file2.min'))
* @param bool $enabled Whether the group is enabled. Enabled groups will be
* rendered with render_js / render_css
*/
- public static function add_group($group_type, $group_name, $files, $enabled = true)
+ public static function add_group($group_type, $group_name, $enabled = true)
{
- foreach ($files as &$file)
- {
- if (!is_array($file))
- $file = array($file, false);
- }
static::$groups[$group_type][$group_name] = array(
- 'files' => $files,
+ 'files' => array(),
'enabled' => $enabled,
);
}
View
2 classes/casset/csscompressor.php
@@ -17,7 +17,7 @@
* This library is used as part of Casset.
*
* @package Casset
- * @version v1.4
+ * @version v1.5
* @author Antony Male
* @license MIT License
* @link http://github.com/canton7/fuelphp-casset
View
2 classes/casset/cssurirewriter.php
@@ -10,7 +10,7 @@
* This library is used as part of Casset.
*
* @package Casset
- * @version v1.4
+ * @version v1.5
* @author Antony Male
* @license MIT License
* @link http://github.com/canton7/fuelphp-casset
View
2 classes/casset/jsmin.php
@@ -52,7 +52,7 @@
/**
* This library is used as part of Casset.
* @package Casset
- * @version v1.4
+ * @version v1.5
* @author Antony Male
* @license MIT License
* @link http://github.com/canton7/fuelphp-casset
View
3 config/casset.php
@@ -4,7 +4,7 @@
* Casset: Convenient asset library for FuelPHP.
*
* @package Casset
- * @version v1.4
+ * @version v1.5
* @author Antony Male
* @license MIT License
* @copyright 2011 Antony Male
@@ -27,7 +27,6 @@
*/
'paths' => array(
'core' => 'assets/',
- 'test' => 'assets/test/'
),
/**
View
3 readme.md
@@ -304,6 +304,9 @@ Casset::js('index.js');
The "core" path can be restored by calling `Casset::set_path()` with no arguments.
+You can also namespace the files listed in the config file's 'groups' section, in the same manner.
+Note that these are loaded before the namespace is changed from 'core', so any files not in the core namespace will have to by explicitely prepended with the namespace name.
+
Clearing the cache
------------------
Since cache files are not automatically removed (Casset has no way of knowing whether a cache file might be needed again), a few method have been provided to remove cache files.

0 comments on commit 5e1cb6f

Please sign in to comment.
Something went wrong with that request. Please try again.