Skip to content

Commit

Permalink
1.1.0-pl Release (requires MODX 2.1+)
Browse files Browse the repository at this point in the history
Merge branch 'develop'

* develop:
  Bump version for 1.1.0-pl release
  Fix ability to override cache_key, cache_handler, and cache_expires
  Add cache properties to Snippet defaults
  Add changelog to transport package build script
  Change default cache_key property to use 'resource' (for MODX 2.1+)
  • Loading branch information
opengeek committed Mar 27, 2011
2 parents a67bd4b + f5111ac commit e25114c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
5 changes: 3 additions & 2 deletions _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package getpage
* @subpackage build
* @version 1.0.0-pl
* @version 1.1.0-pl
* @author Jason Coward <[email protected]>
*/
$mtime = microtime();
Expand All @@ -25,7 +25,7 @@

/* package defines */
define('PKG_NAME','getPage');
define('PKG_VERSION','1.0.0');
define('PKG_VERSION','1.1.0');
define('PKG_RELEASE','pl');
define('PKG_LNAME',strtolower(PKG_NAME));

Expand Down Expand Up @@ -73,6 +73,7 @@
$builder->setPackageAttributes(array(
'license' => file_get_contents($sources['source_core'] . '/docs/license.txt'),
'readme' => file_get_contents($sources['source_core'] . '/docs/readme.txt'),
'changelog' => file_get_contents($sources['source_core'] . '/docs/changelog.txt'),
));

/* zip up the package */
Expand Down
28 changes: 28 additions & 0 deletions _build/properties/properties.getpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,34 @@
'options' => '',
'value' => '<li class="control"><a[[+classes]][[+title]] href="[[+href]]">&gt;&gt;</a></li>',
)
,array(
'name' => 'cache',
'desc' => 'If true, unique page requests will be cached according to addition cache properties.',
'type' => 'combo-boolean',
'options' => '',
'value' => false,
)
,array(
'name' => 'cache_key',
'desc' => 'The key of the cache provider to use; leave empty to use the cache_resource_key cache partition (default is "resource").',
'type' => 'textfield',
'options' => '',
'value' => false,
)
,array(
'name' => 'cache_handler',
'desc' => 'The cache provider implementation to use; leave empty unless you are caching to a custom cache_key.',
'type' => 'textfield',
'options' => '',
'value' => false,
)
,array(
'name' => 'cache_expires',
'desc' => 'The number of seconds before the cached pages expire and must be regenerated; leave empty to use the cache provider option for cache_expires.',
'type' => 'textfield',
'options' => '',
'value' => false,
)
);

return $properties;
4 changes: 4 additions & 0 deletions core/components/getpage/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog for getPage.

getPage 1.1.0-pl (March 27, 2011)
====================================
- Change default cacheKey property to use 'resource' (for MODX 2.1+)

getPage 1.0.0-pl (August 18, 2010)
====================================
- Add support for snippets that send output toPlaceholder
Expand Down
4 changes: 2 additions & 2 deletions core/components/getpage/docs/readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--------------------
Snippet: getPage
--------------------
Version: 1.0.0-pl
Version: 1.1.0-pl
Since: March 19, 2010
Author: Jason Coward <[email protected]>

A generic wrapper snippet for returning paged results and navigation from snippets that return limitable collections.
A generic wrapper snippet for returning paged results and navigation from snippets that return limitable collections. This release requires MODX Revolution 2.1+.

Official Documentation:
http://rtfm.modx.com/display/ADDON/getPage
8 changes: 4 additions & 4 deletions core/components/getpage/snippet.getpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
$properties['pagePrevTpl'] = empty($pagePrevTpl) ? "<li class=\"control\"><a[[+title]] href=\"[[+href]]\">&lt;&lt;</a></li>" : $pagePrevTpl;
$properties['pageNextTpl'] = empty($pageNextTpl) ? "<li class=\"control\"><a[[+title]] href=\"[[+href]]\">&gt;&gt;</a></li>" : $pageNextTpl;
$properties['toPlaceholder'] = !empty($toPlaceholder) ? $toPlaceholder : '';
$properties['cache'] = isset($cache) ? (boolean) $cache : (boolean) $modx->getOption('cache_resource', $properties, false);
$properties[xPDO::OPT_CACHE_KEY] = $modx->getOption('cache_resource_key', $properties, 'default');
$properties[xPDO::OPT_CACHE_HANDLER] = $modx->getOption('cache_resource_handler', $properties, 'xPDOFileCache');
$properties[xPDO::OPT_CACHE_EXPIRES] = (integer) $modx->getOption(xPDO::OPT_CACHE_EXPIRES, $properties, 0);
$properties['cache'] = isset($cache) ? (boolean) $cache : (boolean) $modx->getOption('cache_resource', null, false);
if (empty($cache_key)) $properties[xPDO::OPT_CACHE_KEY] = $modx->getOption('cache_resource_key', null, 'resource');
if (empty($cache_handler)) $properties[xPDO::OPT_CACHE_HANDLER] = $modx->getOption('cache_resource_handler', null, 'xPDOFileCache');
if (empty($cache_expires)) $properties[xPDO::OPT_CACHE_EXPIRES] = (integer) $modx->getOption('cache_resource_expires', null, 0);

if ($properties['cache']) {
$properties['cachePageKey'] = $modx->resource->getCacheKey() . '/' . $properties['page'] . '/' . md5(implode('', $modx->request->getParameters()));
Expand Down

0 comments on commit e25114c

Please sign in to comment.