diff --git a/concat-utils.php b/concat-utils.php index 1626331..ecb55ba 100644 --- a/concat-utils.php +++ b/concat-utils.php @@ -1,6 +1,12 @@ = WPCOM_Concat_Utils::get_concat_max() ) { + $stylesheet_group_index++; + } $this->done[] = $handle; } else { $stylesheet_group_index++; diff --git a/jsconcat.php b/jsconcat.php index ab6d5b1..4c35562 100644 --- a/jsconcat.php +++ b/jsconcat.php @@ -129,6 +129,10 @@ function do_items( $handles = false, $group = false ) { $javascripts[$level]['paths'][] = $js_url_parsed['path']; $javascripts[$level]['handles'][] = $handle; + if ( count( $javascripts[$level]['paths'] ) >= WPCOM_Concat_Utils::get_concat_max() ) { + $level++; + } + } else { $level++; $javascripts[$level]['type'] = 'do_item'; diff --git a/ngx-http-concat.php b/ngx-http-concat.php index 31198bb..9443702 100644 --- a/ngx-http-concat.php +++ b/ngx-http-concat.php @@ -16,7 +16,7 @@ require_once( __DIR__ . '/concat-utils.php' ); /* Config */ -$concat_max_files = 150; +// Maximum group size is set in WPCOM_Concat_Utils::$concat_max, anything over than that will be spit into multiple groups $concat_unique = true; $concat_types = array( 'css' => 'text/css', @@ -114,7 +114,7 @@ function concat_get_path( $uri ) { concat_http_status_exit( 400 ); // array( '/foo/bar.css', '/foo1/bar/baz.css' ) -if ( 0 == count( $args ) || count( $args ) > $concat_max_files ) +if ( 0 == count( $args ) || count( $args ) > WPCOM_Concat_Utils::get_concat_max() ) concat_http_status_exit( 400 ); // If we're in a subdirectory context, use that as the root.