Unhandled Error!

File_put_contents(/home/tenacre/public_html/cache/nav_YTo2OntpOjA7czoxNDoiY291bnRyeTpmcmFuY2UiO2k6MTtzOjMwOiJncmFwZS12YXJpZXR5OnN5cmFoKyU3QytzaGlyYXoiO2k6MjtzOjI2OiJwcm9kdWNlcjpjaGFybGVzK3BlbGxldGllciI7aTozO3M6MTU6InJlZ2lvbjpidXJndW5keSI7aTo0O3M6OToic2l6ZTo3NWNsIjtpOjU7czoxNToic3R5bGU6c3BhcmtsaW5nIjt9.cache): failed to open stream: File name too long

Document /chameleon/chameleon_helper.php
Document type PHP document
Line 492
Exception class Phpr_PhpException

Code Highlight

}
 
if( ! function_exists('cs_save_cache_data') )
{
	function cs_save_cache_data( $cache_filename='', $data=array() )
	{
		file_put_contents($cache_filename, base64_encode(serialize($data)));
 
		return true;
	}
}
 
if( ! function_exists('cs_curl_it') )
# Call Stack Code Document Line
17 file_put_contents('/home/tenacre/public_html/cache/nav_YTo2OntpOjA7czoxNDoiY291bnRyeTpmcmFuY2UiO2k6MTtzOjMwOiJncmFwZS12YXJpZXR5OnN5cmFoKyU3QytzaGlyYXoiO2k6MjtzOjI2OiJwcm9kdWNlcjpjaGFybGVzK3BlbGxldGllciI7aTozO3M6MTU6InJlZ2lvbjpidXJndW5keSI7aTo0O3M6OToic2l6ZTo3NWNsIjtpOjU7czoxNToic3R5bGU6c3BhcmtsaW5nIjt9.cache', 'YTo3OntzOjc6IkNvdW50cnkiO2E6MTp7aTowO3M6NjoiRnJhbmNlIjt9czo2OiJSZWdpb24iO2E6MTp7aTowO3M6ODoiQnVyZ3VuZHkiO31zOjU6IlN0eWxlIjthOjE6e2k6MDtzOjk6IlNwYXJrbGluZyI7fXM6NzoiVmludGFnZSI7YToxOntpOjA7czoyOiJOViI7fXM6ODoiUHJvZHVjZXIiO2E6MTp7aTowO3M6MTc6IkNoYXJsZXMgUGVsbGV0aWVyIjt9czo0OiJTaXplIjthOjE6e2k6MDtzOjQ6Ijc1Y2wiO31zOjEzOiJHcmFwZSBWYXJpZXR5IjthOjE6e2k6MDtzOjE0OiJTeXJhaCAvIFNoaXJheiI7fX0=') /chameleon/chameleon_helper.php 492
16 cs_save_cache_data('/home/tenacre/public_html/cache/nav_YTo2OntpOjA7czoxNDoiY291bnRyeTpmcmFuY2UiO2k6MTtzOjMwOiJncmFwZS12YXJpZXR5OnN5cmFoKyU3QytzaGlyYXoiO2k6MjtzOjI2OiJwcm9kdWNlcjpjaGFybGVzK3BlbGxldGllciI7aTozO3M6MTU6InJlZ2lvbjpidXJndW5keSI7aTo0O3M6OToic2l6ZTo3NWNsIjtpOjU7czoxNToic3R5bGU6c3BhcmtsaW5nIjt9.cache', array(7) [Country => array(1), Region => array(1), Style => array(1), Vintage => array(1), Producer => array(1), Size => array(1), Grape Variety => array(1)]) /chameleon/chameleon_helper.php 468
15 cs_get_product_properties(object(Db_DataCollection), '1', array(6) [0 => 'country:france', 1 => 'style:sparkling', 2 => 'producer:charles+pelletier', 3 => 'region:burgundy', 4 => 'grape-variety:syrah+%7C+shiraz', 5 => 'size:75cl']) /modules/cms/classes/cms_controller.php(383) : eval()'d code 93
14 eval(()) /modules/cms/classes/cms_controller.php 383
13 Cms_Controller->evalWithException('?><?php $categories = Shop_Category::create()->list_root_children(); ?> <h3 class="lg">Browse by &hellip;</h3> <?php require_once 'chameleon/chameleon_helper.php'; // Are we already in a product filter page? $segs = explode('/', $_SERVER['REQUEST_URI']); $url = (in_array('filter', $segs)) ? $_SERVER['REQUEST_URI'] : '/wines/filter'; $url = explode('/', $url); $numeric = FALSE; if (end($url) == '') array_pop($url); // If we're on a paginated page, remove the page number from the url base if (is_numeric($url[(count($url) - 1)])) { $numeric = TRUE; array_pop($url); } // remove sorting filter $url = preg_grep("/^sorting:./", $url, PREG_GREP_INVERT); // Rebuld url base and re-add the trailing slash $url = implode('/', $url) . '/'; // if ($numeric) $url .= '/'; $excludes = array(); $excluded_attributes = array(); $filter_active = FALSE; // Work out if we have a certain type of filter applied. If so, don't show it if (isset($segs[2]) && $segs[2] == 'filter' && isset($segs[3]) && $segs[3] != '' && !is_numeric($segs[3])) { // Set TRUE as a filter is active $filter_active = TRUE; $filters = array_splice($segs, 3, count($segs) - 4); foreach ($filters as $k => $v) { $kv = explode(':', $v); $excludes[] = $kv[0]; $excluded_attributes[] = ucwords(str_replace('-', ' ', $kv[0])); } } // If the reset url var is set, reset the categories if (isset($reset_url) && $reset_url === TRUE) { $url = root_url('/wines/filter/'); $filter_active = FALSE; } // Used to reset the sidebar on a search page if (isset($reset_products) && $reset_products === TRUE) { unset($products); } if (!isset($products)) { $category = Shop_Category::create()->find_by_code('all_products'); // $products = $category->list_products()->find_all(); $products = array(); } $matrix = array( 'Style' => array('Country', 'Region', 'Producer', 'Grape Variety', 'Size'), 'Country' => array('Style', 'Region', 'Producer', 'Grape Variety', 'Size'), 'Region' => array('Style', 'Country', 'Producer', 'Grape Variety', 'Size'), 'Producer' => array('Style', 'Country', 'Region', 'Grape Variety', 'Size'), 'Grape Variety' => array('Style', 'Country', 'Region', 'Producer', 'Size'), // 'Price' => array('Style', 'Country', 'Region', 'Producer', 'Grape Variety', 'Size'), 'Size' => array('Style', 'Country', 'Region', 'Producer', 'Grape Variety'), ); $extended_attributes = array(); foreach( $matrix as $attribute => $associations ) { if( in_array($attribute, $excluded_attributes) ) continue; $associations = array_diff($associations, $excluded_attributes); $associations = array_slice($associations, 0, 3, true); array_unshift($associations, $attribute); // echo '<pre>', $attribute, ': ', print_r($associations, true), '</pre>'; $extended_attributes[$attribute] = cs_get_product_properties_by_attributes($associations, $filter_active ? $filters : array()); $matrix[$attribute] = $associations; } $attributes = cs_get_product_properties($products, $filter_active, $filter_active ? $filters : array()); // echo '<pre>Attributes: ', print_r($attributes, true), '</pre>'; exit(0); // echo '<pre>Excluded: ', print_r($excludes, true), '</pre>'; exit(0); // echo '<pre>Filters: ', print_r($filters, true), '</pre>'; exit(0); // echo '<pre>Ext. Attributes: ', print_r($extended_attributes, true), '</pre>'; exit(0); ?> <script type="text/javascript"> var base_url = '<?php echo $url; ?>'; var matrix = <?php echo json_encode($matrix); ?>; var extended_attributes = <?php echo json_encode($extended_attributes); ?>; </script> <?php $filters_list = array('Style', 'Country', 'Region', 'Producer', 'Price', 'Size', 'Grape Variety'); $last_index = count($filters_list) - 1; $counter = 0; ?> <ul class="category-filters"> <?php foreach( $filters_list as $idx => $filter ) : ?> <?php if( $filter == 'Price' && !in_array('Price', $excludes) && (!isset($show_price) || $show_price) ) : ?> <li id="price_filter" data-id="price_filter"> <p class="title"><?php echo $filter; ?></p> <div class="filter-container"> <div class="column" data-level="0"> <h3><?php echo $filter; ?></h3> <ul class="filter-list" id="price_filter-list"> <li><a href="<?php echo $url; ?>price:0-15/">Under <?php echo format_currency('15'); ?></a></li> <li><a href="<?php echo $url; ?>price:16-25/"><?php echo format_currency('16'); ?> to <?php echo format_currency('25'); ?></a></li> <li><a href="<?php echo $url; ?>price:26-50/"><?php echo format_currency('26'); ?> to <?php echo format_currency('50'); ?></a></li> <li><a href="<?php echo $url; ?>price:50+/"><?php echo format_currency('50'); ?> +</a></li> </ul> </div> </div> </li> <!-- // closes #price_filter --> <?php elseif (isset($attributes[$filter]) && !in_array(strtolower(str_replace(' ', '-', $filter)), $excludes) && is_array($extended_attributes[$filter])) : ?> <li data-id="<?php echo strtolower(str_replace(' ', '_', $filter)); ?>"> <p class="title"><?php echo $filter; ?></p> <div class="filter-container scrollbar"<?php echo $counter == 0 ? ' style=""' : ''; ?>> <?php $columns_html = cs_get_columns_html( compact("url", "filter", "extended_attributes", "matrix") ); echo implode('', $columns_html); ?> </div> </li> <?php endif; ?> <?php $counter++; endforeach; ?> </ul> <?php /*<a href="/en_primeur#newsletter-signup" class="button">En Primuer Enquiry</a>*/ ?> ', 'CMS partial', 'categories', array(2) [products => object(Db_DataCollection), show_price => '']) /modules/cms/classes/cms_controller.php 1020
12 Cms_Controller->render_partial('categories', array(2) [products => object(Db_DataCollection), show_price => '']) /modules/cms/classes/cms_controller.php(383) : eval()'d code 152
11 eval(()) /modules/cms/classes/cms_controller.php 383
10 Cms_Controller->evalWithException('?><?php ini_set('memory_limit', '128M'); // Get the url segments $parts = explode('/', $_SERVER['REQUEST_URI']); foreach ($parts as $k => $v) { if ($v == '') unset($parts[$k]); } // We have removed a filter if (isset($_POST['remove'])) { // Items to remove from url $remove = array(); foreach ($_POST['remove'] as $k => $v) { $remove[] = strtolower(str_replace(' ', '+', urldecode($k))); } foreach ($parts as $k => $v) { if ($v != '' && $v != 'wines' && $v != 'filter' && !is_numeric($v)) { $seg_arr = explode(':', $v); if( in_array($seg_arr[0], $remove) || in_array($seg_arr[1], $remove) ) { unset($parts[$k]); } } if (is_numeric($v)) { unset($parts[$k]); } } $url = '/' . implode('/', $parts); header('location:' . $url); } $pagination_num = 10; $pagination = new Phpr_Pagination($pagination_num); $unlimited_pagination = new Phpr_Pagination(100000); // This needs to be safely higher than the number of products in the store $current_page = (count($parts) > 2 && is_numeric($parts[count($parts)])) ? $parts[count($parts)] : ''; $base_url = ''; $curPageIndex = (is_numeric(end($parts))) ? (end($parts) - 1) : 0; // Start filtering $filters = array(); $new_filters = array(); $show_price = TRUE; $min_price = ''; $max_price = ''; $sorting = 'price asc'; //'relevance'; // Does this page show filtered results if (isset($parts[2]) && $parts[2] == 'filter' && isset($parts[3]) && $parts[3] != '') { if (is_numeric(end($parts))) { $filters = array_splice($parts, 2, count($parts) - 3); } else { $filters = array_splice($parts, 2, count($parts) - 2); } } foreach ($filters as $k => $v) { // Check if this is paginated page. Used to correctly rebuild URLs later $pop = (strpos(end($filters), ':')) ? 2 : 1; // Split filter segments into key/value pairs $kv = explode(':', $v); if (count($kv) < 2 || is_numeric($kv[0])) { continue; } if ($kv[0] == 'price') { // Split price-range into min and max $prices = explode('-', $kv[1]); $show_price = FALSE; $min_price = (strpos($prices[0], '+')) ? substr($prices[0], 0, -1) : $prices[0]; $max_price = (isset($prices[1])) ? $prices[1] : ''; if( $min_price != '' ) { $sorting = 'price asc'; } } else if ($kv[0] == 'sorting') { $sorting = str_replace('|', '/', urldecode($kv[1])); } else { // Returns key/values back to original format. $filter_k = str_replace('-', ' ', $kv[0]); $filter_v = str_replace('|', '/', urldecode($kv[1])); // Set the correct en primeur filter if ($kv[0] == 'en-primeur') $filter_v = 'Yes'; $new_filters[$filter_k] = urldecode($filter_v); } $base_url .= $v . '/'; } $apply_filters = array( 'attributes' => $new_filters, 'min_price' => $min_price, 'max_price' => $max_price, 'sorting' => $sorting ); $category = Shop_Category::create()->find_by_code('all_products'); // This gets all the products that match the applied filters (not limited by the pagination) $products = $category->list_products()->find_products('', $unlimited_pagination, $current_page, $apply_filters); // This gets all the products that match the applied filters (limited by the pagination) $list_products = $category->list_products()->find_products('', $pagination, $current_page, $apply_filters); // Remove the price filter as there is less than one page of results if (count($products) <= $pagination_num) $show_price = FALSE; ?> <?php $this->render_partial('headmeta'); ?> <?php $this->render_partial('header'); ?> <?php $this->render_partial('nav_main'); ?> <div id="content" class="search filter clearfix"> <div id="filters" class="left"> <?php if ((count($new_filters) || $min_price != '') && count($products) > 0) { $this->render_partial('categories', array( 'products' => $products, 'show_price' => $show_price )); } else { $this->render_partial('categories', array( 'reset_url' => TRUE )); } ?> </div> <!-- // #filters --> <div class="right"> <form method="post" action=""> <?php if (count($new_filters) || $min_price != '') : ?> <div id="applied_filters" class="clearfix"> <p>Your filters:</p> <ul> <?php if (count($new_filters)) : ?> <?php foreach ($new_filters as $filter) : ?> <?php $filter = ($filter == 'Yes') ? 'En Primeur' : $filter; ?> <li><input type="checkbox" name="remove[<?php echo $filter; ?>]" id="<?php echo $filter; ?>" /><label for="<?php echo $filter; ?>"><?php echo ucwords($filter); ?></label></li> <?php endforeach; ?> <?php endif; ?> <?php if ($min_price != '') : ?> <?php $filter = 'test'; ?> <li><input type="checkbox" name="remove[price]" id="price" /><label for="price"><?php echo format_currency($min_price); ?><?php echo ($max_price != '') ? ' - ' . format_currency($max_price) : '+'; ?></label></li> <?php endif; ?> </ul> <noscript> <button type="submit">Refresh list</button> </noscript> </div> <!-- // closes #applied_filters --> <?php endif; ?> <?php if (in_array('en primeur', array_keys($new_filters))): ?> <div class="ep-blurb"> The wines listed below and available to buy En Primeur directly through the website are just a taster from the full range of the exclusive and exciting wines we are able to offer from our hand-chosen domaines. To view the complete offers please download our <a href="/downloads">En Primeur offers</a> or <a href="mailto:sales@ten-acre.com">contact us directly</a>. </div> <?php endif ?> <?php if (count($products) > 0) { $this->render_partial('search_list', array( 'products' => $list_products, 'paginate'=> FALSE )); $addslash = ((count($new_filters) || $min_price != '') && ($base_url == '' || substr($base_url, 0, 1) != '/')) ? '/' : ''; $this->render_partial('list_pagination', array( 'pagination' => $pagination, 'base_url' => '/wines/filter' . $addslash . $base_url, 'suffix' => '', 'curPageIndex' => $curPageIndex )); } else { ?> <p class="no_results">There are no products matching this request. If you have filters set, try removing some</p> <?php } // End if ?> </form> </div> <!-- // .right --> </div> <!-- // #content --> <div class="push"></div> <?php $this->render_partial('footer'); ?>', 'CMS template', 'Filter results') /modules/cms/classes/cms_controller.php 211
9 Cms_Controller->open(object(Cms_Page), array(6) [0 => 'country:france', 1 => 'style:sparkling', 2 => 'producer:charles pelletier', 3 => 'region:burgundy', 4 => 'grape-variety:syrah | shiraz', 5 => 'size:75cl']) /controllers/application.php 72
8 Application->On404(())
7 call_user_func_array(array(2) [0 => object(Application), 1 => 'On404'], array(0)) /phproad/modules/phpr/classes/phpr_controller.php 170
6 Phpr_Controller->executeAction('On404', array(0)) /phproad/modules/phpr/classes/phpr_controller.php 84
5 Phpr_Controller->_run('On404', array(0)) /phproad/modules/phpr/classes/phpr_response.php 64
4 Phpr_Response->open404(()) /phproad/modules/phpr/classes/phpr_response.php 37
3 Phpr_Response->open('/wines/filter/country:france/style:sparkling/producer:charles pelletier/region:burgundy/grape-variety:syrah | shiraz/size:75cl') /phproad/system/phproad.php 31
2 include('/home/tenacre/public_html/phproad/system/phproad.php') /boot.php 114
1 require_once('/home/tenacre/public_html/boot.php') /index.php 3