Version Description
- Fixed 301 redirects for pagination (thanks @xavivars)
- Added new escaping filter options for
|e('wp_kses_post')
and|e('esc_url')
(thanks @matgargano) - Fixed pagination warning (thanks @nikola3244)
- More test coverage
- Fixed issue with archive limits (@jarednova)
Download this release
Release Info
Developer | jarednova |
Plugin | Timber |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- README.md +12 -8
- lib/Admin.php +2 -2
- lib/Archives.php +4 -6
- lib/Helper.php +11 -6
- lib/Image.php +3 -8
- lib/Image/Operation/Letterbox.php +1 -2
- lib/Image/Operation/Retina.php +3 -4
- lib/Loader.php +1 -0
- lib/Post.php +7 -12
- lib/PostPreview.php +1 -1
- lib/Timber.php +6 -9
- lib/Twig.php +24 -4
- lib/User.php +1 -1
- readme.txt +8 -1
- timber.php +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +3 -3
- vendor/composer/installed.json +14 -12
- vendor/composer/installers/README.md +5 -1
- vendor/composer/installers/composer.json +2 -0
- vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +9 -6
- vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +10 -0
- vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +29 -0
- vendor/composer/installers/src/Composer/Installers/Installer.php +5 -0
- vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +11 -0
- vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +24 -0
- vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +21 -0
- vendor/upstatement/routes/README.md +6 -2
- vendor/upstatement/routes/Routes.php +7 -3
- vendor/upstatement/routes/bin/install-wp-tests.sh +86 -50
- vendor/upstatement/routes/readme.txt +37 -0
README.md
CHANGED
@@ -5,7 +5,7 @@ By Jared Novack (<a href="https://twitter.com/jarednova">@JaredNova</a>) and <a
|
|
5 |
</div>
|
6 |
|
7 |
[![Build Status](https://img.shields.io/travis/timber/timber/master.svg?style=flat-square)](https://travis-ci.org/timber/timber)
|
8 |
-
[![Coverage Status](https://img.shields.io/
|
9 |
[![Dependency Status](https://www.versioneye.com/user/projects/574e40e6e298f30048059b9f/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/574e40e6e298f30048059b9f)
|
10 |
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/timber/timber.svg?style=flat-square)](https://scrutinizer-ci.com/g/timber/timber/?branch=master)
|
11 |
[![Latest Stable Version](https://img.shields.io/packagist/v/timber/timber.svg?style=flat-square)](https://packagist.org/packages/timber/timber)
|
@@ -98,20 +98,24 @@ Timber is great for any WordPress developer who cares about writing good, mainta
|
|
98 |
Please post on [StackOverflow under the "Timber" tag](http://stackoverflow.com/questions/tagged/timber). Please use GitHub issues only for specific bugs, feature requests and other types of issues.
|
99 |
|
100 |
#### Should I use it?
|
101 |
-
It's MIT-licensed, so please use in personal or commercial work. Just don't re-sell it.
|
102 |
|
103 |
#### Contributing
|
104 |
Read the [contributor guidelines](https://github.com/timber/timber/wiki#contributing) in the wiki.
|
105 |
|
106 |
|
|
|
107 |
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
-
#### Generate documentation
|
111 |
-
```bash
|
112 |
-
$ cd /srv/www/timber
|
113 |
-
$ ./bin/generate-docs.sh
|
114 |
-
```
|
115 |
|
116 |
|
117 |
|
5 |
</div>
|
6 |
|
7 |
[![Build Status](https://img.shields.io/travis/timber/timber/master.svg?style=flat-square)](https://travis-ci.org/timber/timber)
|
8 |
+
[![Coverage Status](https://img.shields.io/codecov/c/github/timber/timber.svg?style=flat-square)](hhttps://codecov.io/gh/timber/timber)
|
9 |
[![Dependency Status](https://www.versioneye.com/user/projects/574e40e6e298f30048059b9f/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/574e40e6e298f30048059b9f)
|
10 |
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/timber/timber.svg?style=flat-square)](https://scrutinizer-ci.com/g/timber/timber/?branch=master)
|
11 |
[![Latest Stable Version](https://img.shields.io/packagist/v/timber/timber.svg?style=flat-square)](https://packagist.org/packages/timber/timber)
|
98 |
Please post on [StackOverflow under the "Timber" tag](http://stackoverflow.com/questions/tagged/timber). Please use GitHub issues only for specific bugs, feature requests and other types of issues.
|
99 |
|
100 |
#### Should I use it?
|
101 |
+
It's MIT-licensed, so please use in personal or commercial work. Just don't re-sell it. Timber is used on [hundreds of sites](http://timber.github.io/timber/#showcase) (and tons more we don't know about)
|
102 |
|
103 |
#### Contributing
|
104 |
Read the [contributor guidelines](https://github.com/timber/timber/wiki#contributing) in the wiki.
|
105 |
|
106 |
|
107 |
+
## [Documentation](http://timber.github.io/timber/)
|
108 |
|
109 |
+
Documentation for Timber classes and functions is [auto generated](https://github.com/jarednova/PHP-Markdown-Documentation-Generator), so any changes to the object reference docs should be made by editing the function's DocBlock. To make a change to one of the guides, edit the relevant file in the `docs` directory.
|
110 |
+
|
111 |
+
To publish docs:
|
112 |
+
1. `composer install` if not already run
|
113 |
+
2. Clone the [timber/slate](https://github.com/timber/slate) repo at the same directory level as Timber
|
114 |
+
3. From the root of the slate directory
|
115 |
+
- `gem install bundler`
|
116 |
+
- `bundle install` (you'll need at least Ruby 2.0 or newer)
|
117 |
+
- `sh publish-docs.sh`
|
118 |
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
|
121 |
|
lib/Admin.php
CHANGED
@@ -32,10 +32,10 @@ class Admin {
|
|
32 |
}
|
33 |
|
34 |
/**
|
35 |
-
* in_plugin_update_message
|
36 |
-
*
|
37 |
* Displays an update message for plugin list screens.
|
38 |
* Shows only the version updates from the current until the newest version
|
|
|
|
|
39 |
*
|
40 |
* @type function
|
41 |
* @date 4/22/16
|
32 |
}
|
33 |
|
34 |
/**
|
|
|
|
|
35 |
* Displays an update message for plugin list screens.
|
36 |
* Shows only the version updates from the current until the newest version
|
37 |
+
*
|
38 |
+
* @codeCoverageIgnore
|
39 |
*
|
40 |
* @type function
|
41 |
* @date 4/22/16
|
lib/Archives.php
CHANGED
@@ -127,11 +127,11 @@ class Archives extends Core {
|
|
127 |
* @param string $join
|
128 |
* @param string $where
|
129 |
* @param string $order
|
130 |
-
* @param
|
131 |
* @param bool $nested
|
132 |
* @return array
|
133 |
*/
|
134 |
-
protected function get_items_monthly( $args, $last_changed, $join, $where, $order, $limit =
|
135 |
global $wpdb, $wp_locale;
|
136 |
$output = array();
|
137 |
$defaults = array(
|
@@ -207,10 +207,9 @@ class Archives extends Core {
|
|
207 |
}
|
208 |
|
209 |
if ( !empty($args['limit']) ) {
|
210 |
-
$limit = absint($limit);
|
211 |
$limit = ' LIMIT '.$limit;
|
212 |
}
|
213 |
-
|
214 |
$order = strtoupper($order);
|
215 |
if ( $order !== 'ASC' ) {
|
216 |
$order = 'DESC';
|
@@ -307,11 +306,10 @@ class Archives extends Core {
|
|
307 |
foreach ( (array) $results as $result ) {
|
308 |
if ( $result->post_date != '0000-00-00 00:00:00' ) {
|
309 |
$url = get_permalink($result);
|
|
|
310 |
if ( $result->post_title ) {
|
311 |
/** This filter is documented in wp-includes/post-template.php */
|
312 |
$text = strip_tags(apply_filters('the_title', $result->post_title, $result->ID));
|
313 |
-
} else {
|
314 |
-
$text = $result->ID;
|
315 |
}
|
316 |
$output[] = $this->get_archives_link($url, $text);
|
317 |
}
|
127 |
* @param string $join
|
128 |
* @param string $where
|
129 |
* @param string $order
|
130 |
+
* @param string $limit
|
131 |
* @param bool $nested
|
132 |
* @return array
|
133 |
*/
|
134 |
+
protected function get_items_monthly( $args, $last_changed, $join, $where, $order, $limit = '', $nested = true ) {
|
135 |
global $wpdb, $wp_locale;
|
136 |
$output = array();
|
137 |
$defaults = array(
|
207 |
}
|
208 |
|
209 |
if ( !empty($args['limit']) ) {
|
210 |
+
$limit = absint($args['limit']);
|
211 |
$limit = ' LIMIT '.$limit;
|
212 |
}
|
|
|
213 |
$order = strtoupper($order);
|
214 |
if ( $order !== 'ASC' ) {
|
215 |
$order = 'DESC';
|
306 |
foreach ( (array) $results as $result ) {
|
307 |
if ( $result->post_date != '0000-00-00 00:00:00' ) {
|
308 |
$url = get_permalink($result);
|
309 |
+
$text = $result->ID;
|
310 |
if ( $result->post_title ) {
|
311 |
/** This filter is documented in wp-includes/post-template.php */
|
312 |
$text = strip_tags(apply_filters('the_title', $result->post_title, $result->ID));
|
|
|
|
|
313 |
}
|
314 |
$output[] = $this->get_archives_link($url, $text);
|
315 |
}
|
lib/Helper.php
CHANGED
@@ -187,14 +187,15 @@ class Helper {
|
|
187 |
* @param mixed $arg that you want to error_log
|
188 |
* @return void
|
189 |
*/
|
190 |
-
public static function error_log( $
|
191 |
-
|
|
|
192 |
return;
|
193 |
}
|
194 |
-
if ( is_object($
|
195 |
-
$
|
196 |
}
|
197 |
-
return error_log($
|
198 |
}
|
199 |
|
200 |
/**
|
@@ -513,9 +514,12 @@ class Helper {
|
|
513 |
}
|
514 |
$link = str_replace(' ', '+', $link);
|
515 |
$link = untrailingslashit($link);
|
|
|
|
|
|
|
516 |
$page_links[] = array(
|
517 |
'class' => 'page-number page-numbers',
|
518 |
-
'link' =>
|
519 |
'title' => $n_display,
|
520 |
'name' => $n_display,
|
521 |
'current' => $args['current'] == $n
|
@@ -530,6 +534,7 @@ class Helper {
|
|
530 |
}
|
531 |
}
|
532 |
}
|
|
|
533 |
return $page_links;
|
534 |
}
|
535 |
|
187 |
* @param mixed $arg that you want to error_log
|
188 |
* @return void
|
189 |
*/
|
190 |
+
public static function error_log( $error ) {
|
191 |
+
global $timber_disable_error_log;
|
192 |
+
if ( !WP_DEBUG || $timber_disable_error_log ) {
|
193 |
return;
|
194 |
}
|
195 |
+
if ( is_object($error) || is_array($error) ) {
|
196 |
+
$error = print_r($error, true);
|
197 |
}
|
198 |
+
return error_log($error);
|
199 |
}
|
200 |
|
201 |
/**
|
514 |
}
|
515 |
$link = str_replace(' ', '+', $link);
|
516 |
$link = untrailingslashit($link);
|
517 |
+
$link = esc_url(apply_filters('paginate_links', $link));
|
518 |
+
$link = user_trailingslashit($link);
|
519 |
+
|
520 |
$page_links[] = array(
|
521 |
'class' => 'page-number page-numbers',
|
522 |
+
'link' => $link,
|
523 |
'title' => $n_display,
|
524 |
'name' => $n_display,
|
525 |
'current' => $args['current'] == $n
|
534 |
}
|
535 |
}
|
536 |
}
|
537 |
+
|
538 |
return $page_links;
|
539 |
}
|
540 |
|
lib/Image.php
CHANGED
@@ -123,7 +123,7 @@ class Image extends Post implements CoreInterface {
|
|
123 |
* @param string $dim
|
124 |
* @return array|int
|
125 |
*/
|
126 |
-
protected function get_dimensions( $dim
|
127 |
if ( isset($this->_dimensions) ) {
|
128 |
return $this->get_dimensions_loaded($dim);
|
129 |
}
|
@@ -142,16 +142,11 @@ class Image extends Post implements CoreInterface {
|
|
142 |
* @return array|int
|
143 |
*/
|
144 |
protected function get_dimensions_loaded( $dim ) {
|
145 |
-
|
146 |
-
return $this->_dimensions;
|
147 |
-
}
|
148 |
-
if ( $dim == 'w' || $dim == 'width' ) {
|
149 |
-
return $this->_dimensions[0];
|
150 |
-
}
|
151 |
if ( $dim == 'h' || $dim == 'height' ) {
|
152 |
return $this->_dimensions[1];
|
153 |
}
|
154 |
-
return
|
155 |
}
|
156 |
|
157 |
/**
|
123 |
* @param string $dim
|
124 |
* @return array|int
|
125 |
*/
|
126 |
+
protected function get_dimensions( $dim ) {
|
127 |
if ( isset($this->_dimensions) ) {
|
128 |
return $this->get_dimensions_loaded($dim);
|
129 |
}
|
142 |
* @return array|int
|
143 |
*/
|
144 |
protected function get_dimensions_loaded( $dim ) {
|
145 |
+
$dim = strtolower($dim);
|
|
|
|
|
|
|
|
|
|
|
146 |
if ( $dim == 'h' || $dim == 'height' ) {
|
147 |
return $this->_dimensions[1];
|
148 |
}
|
149 |
+
return $this->_dimensions[0];
|
150 |
}
|
151 |
|
152 |
/**
|
lib/Image/Operation/Letterbox.php
CHANGED
@@ -105,9 +105,8 @@ class Letterbox extends ImageOperation {
|
|
105 |
return $save_func($bg, $save_filename);
|
106 |
}
|
107 |
return $save_func($bg, $save_filename, $quality);
|
108 |
-
} else {
|
109 |
-
Helper::error_log($image);
|
110 |
}
|
|
|
111 |
return false;
|
112 |
}
|
113 |
}
|
105 |
return $save_func($bg, $save_filename);
|
106 |
}
|
107 |
return $save_func($bg, $save_filename, $quality);
|
|
|
|
|
108 |
}
|
109 |
+
Helper::error_log($image);
|
110 |
return false;
|
111 |
}
|
112 |
}
|
lib/Image/Operation/Retina.php
CHANGED
@@ -67,14 +67,13 @@ class Retina extends ImageOperation {
|
|
67 |
Helper::error_log($result);
|
68 |
return false;
|
69 |
// @codeCoverageIgnoreEnd
|
70 |
-
} else {
|
71 |
-
return true;
|
72 |
}
|
|
|
73 |
} else if ( isset($image->error_data['error_loading_image']) ) {
|
74 |
Helper::error_log('Error loading '.$image->error_data['error_loading_image']);
|
75 |
-
|
76 |
-
Helper::error_log($image);
|
77 |
}
|
|
|
78 |
return false;
|
79 |
}
|
80 |
}
|
67 |
Helper::error_log($result);
|
68 |
return false;
|
69 |
// @codeCoverageIgnoreEnd
|
|
|
|
|
70 |
}
|
71 |
+
return true;
|
72 |
} else if ( isset($image->error_data['error_loading_image']) ) {
|
73 |
Helper::error_log('Error loading '.$image->error_data['error_loading_image']);
|
74 |
+
return false;
|
|
|
75 |
}
|
76 |
+
Helper::error_log($image);
|
77 |
return false;
|
78 |
}
|
79 |
}
|
lib/Loader.php
CHANGED
@@ -246,6 +246,7 @@ class Loader {
|
|
246 |
|
247 |
$twig = apply_filters('twig_apply_filters', $twig);
|
248 |
$twig = apply_filters('timber/twig/filters', $twig);
|
|
|
249 |
$twig = apply_filters('timber/loader/twig', $twig);
|
250 |
return $twig;
|
251 |
}
|
246 |
|
247 |
$twig = apply_filters('twig_apply_filters', $twig);
|
248 |
$twig = apply_filters('timber/twig/filters', $twig);
|
249 |
+
$twig = apply_filters('timber/twig/escapers', $twig);
|
250 |
$twig = apply_filters('timber/loader/twig', $twig);
|
251 |
return $twig;
|
252 |
}
|
lib/Post.php
CHANGED
@@ -450,12 +450,9 @@ class Post extends Core implements CoreInterface {
|
|
450 |
/**
|
451 |
* gets the post custom and attaches it to the current object
|
452 |
* @internal
|
453 |
-
* @param
|
454 |
*/
|
455 |
-
public function import_custom( $pid
|
456 |
-
if ( !$pid ) {
|
457 |
-
$pid = $this->ID;
|
458 |
-
}
|
459 |
$customs = $this->get_post_custom($pid);
|
460 |
$this->import($customs);
|
461 |
}
|
@@ -1261,13 +1258,11 @@ class Post extends Core implements CoreInterface {
|
|
1261 |
* @return TimberImage|null of your thumbnail
|
1262 |
*/
|
1263 |
public function thumbnail() {
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
}
|
1270 |
-
}
|
1271 |
}
|
1272 |
|
1273 |
|
450 |
/**
|
451 |
* gets the post custom and attaches it to the current object
|
452 |
* @internal
|
453 |
+
* @param integer $pid a post ID number
|
454 |
*/
|
455 |
+
public function import_custom( $pid ) {
|
|
|
|
|
|
|
456 |
$customs = $this->get_post_custom($pid);
|
457 |
$this->import($customs);
|
458 |
}
|
1258 |
* @return TimberImage|null of your thumbnail
|
1259 |
*/
|
1260 |
public function thumbnail() {
|
1261 |
+
$tid = get_post_thumbnail_id($this->ID);
|
1262 |
+
if ( $tid ) {
|
1263 |
+
//return new Image($tid);
|
1264 |
+
return new $this->ImageClass($tid);
|
1265 |
+
}
|
|
|
|
|
1266 |
}
|
1267 |
|
1268 |
|
lib/PostPreview.php
CHANGED
@@ -94,7 +94,7 @@ class PostPreview {
|
|
94 |
} elseif ( $this->readmore ) {
|
95 |
$text .= ' <a href="'.$this->post->link().'" class="'.$read_more_class.'">'.trim($this->readmore).'</a>';
|
96 |
}
|
97 |
-
if ( !$this->strip && $last_p_tag && (strpos($text, '<p>') || strpos($text, '<p ')) ) {
|
98 |
$text .= '</p>';
|
99 |
}
|
100 |
return trim($text);
|
94 |
} elseif ( $this->readmore ) {
|
95 |
$text .= ' <a href="'.$this->post->link().'" class="'.$read_more_class.'">'.trim($this->readmore).'</a>';
|
96 |
}
|
97 |
+
if ( !$this->strip && $last_p_tag && (strpos($text, '<p>') > -1 || strpos($text, '<p ')) ) {
|
98 |
$text .= '</p>';
|
99 |
}
|
100 |
return trim($text);
|
lib/Timber.php
CHANGED
@@ -355,10 +355,7 @@ class Timber {
|
|
355 |
* @param array $data
|
356 |
* @return bool|string
|
357 |
*/
|
358 |
-
public static function get_sidebar( $sidebar = '', $data = array() ) {
|
359 |
-
if ( $sidebar == '' ) {
|
360 |
-
$sidebar = 'sidebar.php';
|
361 |
-
}
|
362 |
if ( strstr(strtolower($sidebar), '.php') ) {
|
363 |
return self::get_sidebar_from_php($sidebar, $data);
|
364 |
}
|
@@ -461,11 +458,11 @@ class Timber {
|
|
461 |
}
|
462 |
|
463 |
// set next and prev using pages array generated by paginate links
|
464 |
-
if ( isset($data['pages'][$current + 1]) ) {
|
465 |
-
$data['next'] = array('link' =>
|
466 |
-
}
|
467 |
-
if ( isset($data['pages'][$current - 1]) ) {
|
468 |
-
$data['prev'] = array('link' =>
|
469 |
}
|
470 |
if ( $paged < 2 ) {
|
471 |
$data['prev'] = '';
|
355 |
* @param array $data
|
356 |
* @return bool|string
|
357 |
*/
|
358 |
+
public static function get_sidebar( $sidebar = 'sidebar.php', $data = array() ) {
|
|
|
|
|
|
|
359 |
if ( strstr(strtolower($sidebar), '.php') ) {
|
360 |
return self::get_sidebar_from_php($sidebar, $data);
|
361 |
}
|
458 |
}
|
459 |
|
460 |
// set next and prev using pages array generated by paginate links
|
461 |
+
if ( isset($current) && isset($data['pages'][$current + 1]) ) {
|
462 |
+
$data['next'] = array('link' => user_trailingslashit($data['pages'][$current + 1]['link']), 'class' => 'page-numbers next');
|
463 |
+
}
|
464 |
+
if ( isset($current) && isset($data['pages'][$current - 1]) ) {
|
465 |
+
$data['prev'] = array('link' => user_trailingslashit($data['pages'][$current - 1]['link']), 'class' => 'page-numbers prev');
|
466 |
}
|
467 |
if ( $paged < 2 ) {
|
468 |
$data['prev'] = '';
|
lib/Twig.php
CHANGED
@@ -26,6 +26,7 @@ class Twig {
|
|
26 |
*/
|
27 |
public function __construct() {
|
28 |
add_action('timber/twig/filters', array($this, 'add_timber_filters'));
|
|
|
29 |
}
|
30 |
|
31 |
/**
|
@@ -36,10 +37,10 @@ class Twig {
|
|
36 |
*/
|
37 |
public function add_timber_filters( $twig ) {
|
38 |
/* image filters */
|
39 |
-
$twig->addFilter(new \Twig_SimpleFilter('resize', array('
|
40 |
-
$twig->addFilter(new \Twig_SimpleFilter('retina', array('
|
41 |
-
$twig->addFilter(new \Twig_SimpleFilter('letterbox', array('
|
42 |
-
$twig->addFilter(new \Twig_SimpleFilter('tojpg', array('
|
43 |
|
44 |
/* debugging filters */
|
45 |
$twig->addFilter(new \Twig_SimpleFilter('get_class', 'get_class'));
|
@@ -208,6 +209,25 @@ class Twig {
|
|
208 |
return $twig;
|
209 |
}
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
/**
|
212 |
*
|
213 |
*
|
26 |
*/
|
27 |
public function __construct() {
|
28 |
add_action('timber/twig/filters', array($this, 'add_timber_filters'));
|
29 |
+
add_action('timber/twig/escapers', array($this, 'add_timber_escapers'));
|
30 |
}
|
31 |
|
32 |
/**
|
37 |
*/
|
38 |
public function add_timber_filters( $twig ) {
|
39 |
/* image filters */
|
40 |
+
$twig->addFilter(new \Twig_SimpleFilter('resize', array('Timber\ImageHelper', 'resize')));
|
41 |
+
$twig->addFilter(new \Twig_SimpleFilter('retina', array('Timber\ImageHelper', 'retina_resize')));
|
42 |
+
$twig->addFilter(new \Twig_SimpleFilter('letterbox', array('Timber\ImageHelper', 'letterbox')));
|
43 |
+
$twig->addFilter(new \Twig_SimpleFilter('tojpg', array('Timber\ImageHelper', 'img_to_jpg')));
|
44 |
|
45 |
/* debugging filters */
|
46 |
$twig->addFilter(new \Twig_SimpleFilter('get_class', 'get_class'));
|
209 |
return $twig;
|
210 |
}
|
211 |
|
212 |
+
/**
|
213 |
+
*
|
214 |
+
*
|
215 |
+
* @param Twig_Environment $twig
|
216 |
+
* @return Twig_Environment
|
217 |
+
*/
|
218 |
+
public function add_timber_escapers( $twig ) {
|
219 |
+
|
220 |
+
$twig->getExtension( 'core' )->setEscaper( 'esc_url', function( \Twig_Environment $env, $string ) {
|
221 |
+
return esc_url( $string );
|
222 |
+
} );
|
223 |
+
$twig->getExtension( 'core' )->setEscaper( 'wp_kses_post', function( \Twig_Environment $env, $string ) {
|
224 |
+
return wp_kses_post( $string );
|
225 |
+
} );
|
226 |
+
|
227 |
+
return $twig;
|
228 |
+
|
229 |
+
}
|
230 |
+
|
231 |
/**
|
232 |
*
|
233 |
*
|
lib/User.php
CHANGED
@@ -193,7 +193,7 @@ class User extends Core implements CoreInterface {
|
|
193 |
*/
|
194 |
public function link() {
|
195 |
if ( !$this->_link ) {
|
196 |
-
$this->_link =
|
197 |
}
|
198 |
return $this->_link;
|
199 |
}
|
193 |
*/
|
194 |
public function link() {
|
195 |
if ( !$this->_link ) {
|
196 |
+
$this->_link = user_trailingslashit(get_author_posts_url($this->ID));
|
197 |
}
|
198 |
return $this->_link;
|
199 |
}
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: jarednova, connorjburton, lggorman
|
3 |
Tags: template engine, templates, twig
|
4 |
Requires at least: 3.7
|
5 |
-
Stable tag: 1.1.
|
6 |
Tested up to: 4.5.1
|
7 |
PHP version: 5.3.0 or greater
|
8 |
License: GPLv2 or later
|
@@ -41,6 +41,13 @@ Timber is great for any WordPress developer who cares about writing good, mainta
|
|
41 |
|
42 |
== Changelog ==
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
= 1.1.0 =
|
45 |
* Fixed how Timber loads with Composer (thanks @connorjburton and @mrgrain)
|
46 |
* Updated docs! (thanks @lggorman and @kateboudreau)
|
2 |
Contributors: jarednova, connorjburton, lggorman
|
3 |
Tags: template engine, templates, twig
|
4 |
Requires at least: 3.7
|
5 |
+
Stable tag: 1.1.1
|
6 |
Tested up to: 4.5.1
|
7 |
PHP version: 5.3.0 or greater
|
8 |
License: GPLv2 or later
|
41 |
|
42 |
== Changelog ==
|
43 |
|
44 |
+
= 1.1.1 =
|
45 |
+
* Fixed 301 redirects for pagination (thanks @xavivars)
|
46 |
+
* Added new escaping filter options for `|e('wp_kses_post')` and `|e('esc_url')`(thanks @matgargano)
|
47 |
+
* Fixed pagination warning (thanks @nikola3244)
|
48 |
+
* More test coverage
|
49 |
+
* Fixed issue with archive limits (@jarednova)
|
50 |
+
|
51 |
= 1.1.0 =
|
52 |
* Fixed how Timber loads with Composer (thanks @connorjburton and @mrgrain)
|
53 |
* Updated docs! (thanks @lggorman and @kateboudreau)
|
timber.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Timber
|
|
4 |
Description: The WordPress Timber Library allows you to write themes using the power Twig templates.
|
5 |
Plugin URI: http://timber.upstatement.com
|
6 |
Author: Jared Novack + Upstatement
|
7 |
-
Version: 1.1.
|
8 |
Author URI: http://upstatement.com/
|
9 |
*/
|
10 |
// we look for Composer files first in the plugins dir.
|
4 |
Description: The WordPress Timber Library allows you to write themes using the power Twig templates.
|
5 |
Plugin URI: http://timber.upstatement.com
|
6 |
Author: Jared Novack + Upstatement
|
7 |
+
Version: 1.1.1
|
8 |
Author URI: http://upstatement.com/
|
9 |
*/
|
10 |
// we look for Composer files first in the plugins dir.
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit6db8cd96031eb5111a748582779e5b56::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInita33a0f094141597796f7eb9432c529a9
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit6db8cd96031eb5111a748582779e5b56
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit6db8cd96031eb5111a748582779e5b56', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit6db8cd96031eb5111a748582779e5b56', 'loadClassLoader'));
|
25 |
|
26 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
27 |
foreach ($map as $namespace => $path) {
|
vendor/composer/installed.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
[
|
2 |
{
|
3 |
"name": "composer/installers",
|
4 |
-
"version": "v1.0
|
5 |
-
"version_normalized": "1.0.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/composer/installers.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/composer/installers/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
@@ -25,7 +25,7 @@
|
|
25 |
"composer/composer": "1.0.*@dev",
|
26 |
"phpunit/phpunit": "4.1.*"
|
27 |
},
|
28 |
-
"time": "2016-
|
29 |
"type": "composer-plugin",
|
30 |
"extra": {
|
31 |
"class": "Composer\\Installers\\Plugin",
|
@@ -60,6 +60,7 @@
|
|
60 |
"MODX Evo",
|
61 |
"Mautic",
|
62 |
"OXID",
|
|
|
63 |
"SMF",
|
64 |
"Thelia",
|
65 |
"WolfCMS",
|
@@ -75,6 +76,7 @@
|
|
75 |
"dokuwiki",
|
76 |
"drupal",
|
77 |
"elgg",
|
|
|
78 |
"fuelphp",
|
79 |
"grav",
|
80 |
"installer",
|
@@ -272,17 +274,17 @@
|
|
272 |
},
|
273 |
{
|
274 |
"name": "upstatement/routes",
|
275 |
-
"version": "0.
|
276 |
-
"version_normalized": "0.
|
277 |
"source": {
|
278 |
"type": "git",
|
279 |
"url": "https://github.com/Upstatement/routes.git",
|
280 |
-
"reference": "
|
281 |
},
|
282 |
"dist": {
|
283 |
"type": "zip",
|
284 |
-
"url": "https://api.github.com/repos/Upstatement/routes/zipball/
|
285 |
-
"reference": "
|
286 |
"shasum": ""
|
287 |
},
|
288 |
"require": {
|
@@ -295,7 +297,7 @@
|
|
295 |
"satooshi/php-coveralls": "dev-master",
|
296 |
"wp-cli/wp-cli": "*"
|
297 |
},
|
298 |
-
"time": "
|
299 |
"type": "library",
|
300 |
"installation-source": "dist",
|
301 |
"autoload": {
|
1 |
[
|
2 |
{
|
3 |
"name": "composer/installers",
|
4 |
+
"version": "v1.1.0",
|
5 |
+
"version_normalized": "1.1.0.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/composer/installers.git",
|
9 |
+
"reference": "a3595c5272a6f247228abb20076ed27321e4aae9"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/composer/installers/zipball/a3595c5272a6f247228abb20076ed27321e4aae9",
|
14 |
+
"reference": "a3595c5272a6f247228abb20076ed27321e4aae9",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
25 |
"composer/composer": "1.0.*@dev",
|
26 |
"phpunit/phpunit": "4.1.*"
|
27 |
},
|
28 |
+
"time": "2016-07-05 06:18:20",
|
29 |
"type": "composer-plugin",
|
30 |
"extra": {
|
31 |
"class": "Composer\\Installers\\Plugin",
|
60 |
"MODX Evo",
|
61 |
"Mautic",
|
62 |
"OXID",
|
63 |
+
"RadPHP",
|
64 |
"SMF",
|
65 |
"Thelia",
|
66 |
"WolfCMS",
|
76 |
"dokuwiki",
|
77 |
"drupal",
|
78 |
"elgg",
|
79 |
+
"expressionengine",
|
80 |
"fuelphp",
|
81 |
"grav",
|
82 |
"installer",
|
274 |
},
|
275 |
{
|
276 |
"name": "upstatement/routes",
|
277 |
+
"version": "0.4",
|
278 |
+
"version_normalized": "0.4.0.0",
|
279 |
"source": {
|
280 |
"type": "git",
|
281 |
"url": "https://github.com/Upstatement/routes.git",
|
282 |
+
"reference": "fae7d46f56e8b5775f072774941a5f0a25cb86f3"
|
283 |
},
|
284 |
"dist": {
|
285 |
"type": "zip",
|
286 |
+
"url": "https://api.github.com/repos/Upstatement/routes/zipball/fae7d46f56e8b5775f072774941a5f0a25cb86f3",
|
287 |
+
"reference": "fae7d46f56e8b5775f072774941a5f0a25cb86f3",
|
288 |
"shasum": ""
|
289 |
},
|
290 |
"require": {
|
297 |
"satooshi/php-coveralls": "dev-master",
|
298 |
"wp-cli/wp-cli": "*"
|
299 |
},
|
300 |
+
"time": "2016-07-06 12:53:24",
|
301 |
"type": "library",
|
302 |
"installation-source": "dist",
|
303 |
"autoload": {
|
vendor/composer/installers/README.md
CHANGED
@@ -38,7 +38,7 @@ is not needed to install packages with these frameworks:
|
|
38 |
| AGL | `agl-module`
|
39 |
| Bonefish | `bonefish-package`
|
40 |
| AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
|
41 |
-
| Bitrix | `bitrix-module
|
42 |
| CakePHP 2+ | **`cakephp-plugin`**
|
43 |
| Chef | `chef-cookbook`<br>`chef-role`
|
44 |
| CCFramework | `ccframework-ship`<br>`ccframework-theme`
|
@@ -46,10 +46,12 @@ is not needed to install packages with these frameworks:
|
|
46 |
| concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
|
47 |
| Craft | `craft-plugin`
|
48 |
| Croogo | `croogo-plugin`<br>`croogo-theme`
|
|
|
49 |
| DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
|
50 |
| Dolibarr | `dolibarr-module`
|
51 |
| Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
|
52 |
| Elgg | `elgg-plugin`
|
|
|
53 |
| FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
|
54 |
| FuelPHP v2.x | `fuelphp-component`
|
55 |
| Grav | `grav-plugin`<br>`grav-theme`
|
@@ -75,6 +77,7 @@ is not needed to install packages with these frameworks:
|
|
75 |
| Pimcore | `pimcore-plugin`
|
76 |
| PPI | **`ppi-module`**
|
77 |
| Puppet | `puppet-module`
|
|
|
78 |
| REDAXO | `redaxo-addon`
|
79 |
| Roundcube | `roundcube-plugin`
|
80 |
| shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`
|
@@ -89,6 +92,7 @@ is not needed to install packages with these frameworks:
|
|
89 |
| Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
|
90 |
| Zikula | `zikula-module`<br>`zikula-theme`
|
91 |
| Prestashop | `prestashop-module`<br>`prestashop-theme`
|
|
|
92 |
|
93 |
## Example `composer.json` File
|
94 |
|
38 |
| AGL | `agl-module`
|
39 |
| Bonefish | `bonefish-package`
|
40 |
| AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
|
41 |
+
| Bitrix | `bitrix-module` (deprecated) <br>`bitrix-component` (deprecated) <br>`bitrix-theme` (deprecated) <br><br> `bitrix-d7-module` <br> `bitrix-d7-component` <br> `bitrix-d7-template`
|
42 |
| CakePHP 2+ | **`cakephp-plugin`**
|
43 |
| Chef | `chef-cookbook`<br>`chef-role`
|
44 |
| CCFramework | `ccframework-ship`<br>`ccframework-theme`
|
46 |
| concrete5 | `concrete5-block`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-update`
|
47 |
| Craft | `craft-plugin`
|
48 |
| Croogo | `croogo-plugin`<br>`croogo-theme`
|
49 |
+
| Decibel | `decibel-app`
|
50 |
| DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
|
51 |
| Dolibarr | `dolibarr-module`
|
52 |
| Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
|
53 |
| Elgg | `elgg-plugin`
|
54 |
+
| ExpressionEngine 3 | `ee3-addon`<br>`ee3-theme`
|
55 |
| FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
|
56 |
| FuelPHP v2.x | `fuelphp-component`
|
57 |
| Grav | `grav-plugin`<br>`grav-theme`
|
77 |
| Pimcore | `pimcore-plugin`
|
78 |
| PPI | **`ppi-module`**
|
79 |
| Puppet | `puppet-module`
|
80 |
+
| RadPHP | `radphp-bundle`
|
81 |
| REDAXO | `redaxo-addon`
|
82 |
| Roundcube | `roundcube-plugin`
|
83 |
| shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`
|
92 |
| Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
|
93 |
| Zikula | `zikula-module`<br>`zikula-theme`
|
94 |
| Prestashop | `prestashop-module`<br>`prestashop-theme`
|
95 |
+
| Phifty | `phifty-bundle`<br>`phifty-framework`<br>`phifty-library`
|
96 |
|
97 |
## Example `composer.json` File
|
98 |
|
vendor/composer/installers/composer.json
CHANGED
@@ -19,6 +19,7 @@
|
|
19 |
"Dolibarr",
|
20 |
"Drupal",
|
21 |
"Elgg",
|
|
|
22 |
"FuelPHP",
|
23 |
"Grav",
|
24 |
"Hurad",
|
@@ -39,6 +40,7 @@
|
|
39 |
"phpBB",
|
40 |
"PPI",
|
41 |
"Puppet",
|
|
|
42 |
"Roundcube",
|
43 |
"shopware",
|
44 |
"SilverStripe",
|
19 |
"Dolibarr",
|
20 |
"Drupal",
|
21 |
"Elgg",
|
22 |
+
"ExpressionEngine",
|
23 |
"FuelPHP",
|
24 |
"Grav",
|
25 |
"Hurad",
|
40 |
"phpBB",
|
41 |
"PPI",
|
42 |
"Puppet",
|
43 |
+
"RadPHP",
|
44 |
"Roundcube",
|
45 |
"shopware",
|
46 |
"SilverStripe",
|
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php
CHANGED
@@ -6,9 +6,9 @@ use Composer\Util\Filesystem;
|
|
6 |
|
7 |
/**
|
8 |
* Installer for Bitrix Framework. Supported types of extensions:
|
9 |
-
* - `bitrix-module` — copy the module to directory `bitrix/modules
|
10 |
-
* - `bitrix-component` — copy the component to directory `bitrix/components
|
11 |
-
* - `bitrix-template` — copy the template to directory `bitrix/templates
|
12 |
*
|
13 |
* You can set custom path to directory with Bitrix kernel in `composer.json`:
|
14 |
*
|
@@ -26,9 +26,12 @@ use Composer\Util\Filesystem;
|
|
26 |
class BitrixInstaller extends BaseInstaller
|
27 |
{
|
28 |
protected $locations = array(
|
29 |
-
'module' => '{$bitrix_dir}/modules/{$name}/',
|
30 |
-
'component' => '{$bitrix_dir}/components/{$name}/',
|
31 |
-
'theme' => '{$bitrix_dir}/templates/{$name}/',
|
|
|
|
|
|
|
32 |
);
|
33 |
|
34 |
/**
|
6 |
|
7 |
/**
|
8 |
* Installer for Bitrix Framework. Supported types of extensions:
|
9 |
+
* - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
|
10 |
+
* - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
|
11 |
+
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
|
12 |
*
|
13 |
* You can set custom path to directory with Bitrix kernel in `composer.json`:
|
14 |
*
|
26 |
class BitrixInstaller extends BaseInstaller
|
27 |
{
|
28 |
protected $locations = array(
|
29 |
+
'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
30 |
+
'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
31 |
+
'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
|
32 |
+
'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
|
33 |
+
'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
|
34 |
+
'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
|
35 |
);
|
36 |
|
37 |
/**
|
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class DecibelInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
/** @var array */
|
7 |
+
protected $locations = array(
|
8 |
+
'app' => 'app/{$name}/',
|
9 |
+
);
|
10 |
+
}
|
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
use Composer\Package\PackageInterface;
|
5 |
+
|
6 |
+
class ExpressionEngineInstaller extends BaseInstaller
|
7 |
+
{
|
8 |
+
|
9 |
+
protected $locations = array();
|
10 |
+
|
11 |
+
private $ee2Locations = array(
|
12 |
+
'addon' => 'system/expressionengine/third-party/{$name}/',
|
13 |
+
'theme' => 'themes/third-party/{$name}/',
|
14 |
+
);
|
15 |
+
|
16 |
+
private $ee3Locations = array(
|
17 |
+
'addon' => 'system/user/addons/{$name}/',
|
18 |
+
'theme' => 'themes/user/{$name}/',
|
19 |
+
);
|
20 |
+
|
21 |
+
public function getInstallPath(PackageInterface $package, $frameworkType = '')
|
22 |
+
{
|
23 |
+
|
24 |
+
$version = "{$frameworkType}Locations";
|
25 |
+
$this->locations = $this->$version;
|
26 |
+
|
27 |
+
return parent::getInstallPath($package, $frameworkType);
|
28 |
+
}
|
29 |
+
}
|
vendor/composer/installers/src/Composer/Installers/Installer.php
CHANGED
@@ -29,8 +29,11 @@ class Installer extends LibraryInstaller
|
|
29 |
'croogo' => 'CroogoInstaller',
|
30 |
'dokuwiki' => 'DokuWikiInstaller',
|
31 |
'dolibarr' => 'DolibarrInstaller',
|
|
|
32 |
'drupal' => 'DrupalInstaller',
|
33 |
'elgg' => 'ElggInstaller',
|
|
|
|
|
34 |
'fuel' => 'FuelInstaller',
|
35 |
'fuelphp' => 'FuelphpInstaller',
|
36 |
'grav' => 'GravInstaller',
|
@@ -57,6 +60,8 @@ class Installer extends LibraryInstaller
|
|
57 |
'piwik' => 'PiwikInstaller',
|
58 |
'ppi' => 'PPIInstaller',
|
59 |
'puppet' => 'PuppetInstaller',
|
|
|
|
|
60 |
'redaxo' => 'RedaxoInstaller',
|
61 |
'roundcube' => 'RoundcubeInstaller',
|
62 |
'shopware' => 'ShopwareInstaller',
|
29 |
'croogo' => 'CroogoInstaller',
|
30 |
'dokuwiki' => 'DokuWikiInstaller',
|
31 |
'dolibarr' => 'DolibarrInstaller',
|
32 |
+
'decibel' => 'DecibelInstaller',
|
33 |
'drupal' => 'DrupalInstaller',
|
34 |
'elgg' => 'ElggInstaller',
|
35 |
+
'ee3' => 'ExpressionEngineInstaller',
|
36 |
+
'ee2' => 'ExpressionEngineInstaller',
|
37 |
'fuel' => 'FuelInstaller',
|
38 |
'fuelphp' => 'FuelphpInstaller',
|
39 |
'grav' => 'GravInstaller',
|
60 |
'piwik' => 'PiwikInstaller',
|
61 |
'ppi' => 'PPIInstaller',
|
62 |
'puppet' => 'PuppetInstaller',
|
63 |
+
'radphp' => 'RadPHPInstaller',
|
64 |
+
'phifty' => 'PhiftyInstaller',
|
65 |
'redaxo' => 'RedaxoInstaller',
|
66 |
'roundcube' => 'RoundcubeInstaller',
|
67 |
'shopware' => 'ShopwareInstaller',
|
vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class PhiftyInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'bundle' => 'bundles/{$name}/',
|
8 |
+
'library' => 'libraries/{$name}/',
|
9 |
+
'framework' => 'frameworks/{$name}/',
|
10 |
+
);
|
11 |
+
}
|
vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Composer\Installers;
|
3 |
+
|
4 |
+
class RadPHPInstaller extends BaseInstaller
|
5 |
+
{
|
6 |
+
protected $locations = array(
|
7 |
+
'bundle' => 'src/{$name}/'
|
8 |
+
);
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Format package name to CamelCase
|
12 |
+
*/
|
13 |
+
public function inflectPackageVars($vars)
|
14 |
+
{
|
15 |
+
$nameParts = explode('/', $vars['name']);
|
16 |
+
foreach ($nameParts as &$value) {
|
17 |
+
$value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
|
18 |
+
$value = str_replace(array('-', '_'), ' ', $value);
|
19 |
+
$value = str_replace(' ', '', ucwords($value));
|
20 |
+
}
|
21 |
+
$vars['name'] = implode('/', $nameParts);
|
22 |
+
return $vars;
|
23 |
+
}
|
24 |
+
}
|
vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php
CHANGED
@@ -110,10 +110,15 @@ class InstallerTest extends TestCase
|
|
110 |
array('craft-plugin', true),
|
111 |
array('croogo-plugin', true),
|
112 |
array('croogo-theme', true),
|
|
|
113 |
array('dokuwiki-plugin', true),
|
114 |
array('dokuwiki-template', true),
|
115 |
array('drupal-module', true),
|
116 |
array('dolibarr-module', true),
|
|
|
|
|
|
|
|
|
117 |
array('elgg-plugin', true),
|
118 |
array('fuel-module', true),
|
119 |
array('fuel-package', true),
|
@@ -150,6 +155,7 @@ class InstallerTest extends TestCase
|
|
150 |
array('prestashop-module', true),
|
151 |
array('prestashop-theme', true),
|
152 |
array('puppet-module', true),
|
|
|
153 |
array('redaxo-addon', true),
|
154 |
array('redaxo-bestyle-plugin', true),
|
155 |
array('roundcube-plugin', true),
|
@@ -179,6 +185,9 @@ class InstallerTest extends TestCase
|
|
179 |
array('zikula-theme', true),
|
180 |
array('kodicms-plugin', true),
|
181 |
array('kodicms-media', true),
|
|
|
|
|
|
|
182 |
);
|
183 |
}
|
184 |
|
@@ -211,6 +220,9 @@ class InstallerTest extends TestCase
|
|
211 |
array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
|
212 |
array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
|
213 |
array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
|
|
|
|
|
|
|
214 |
array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
|
215 |
array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
|
216 |
array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
|
@@ -224,6 +236,7 @@ class InstallerTest extends TestCase
|
|
224 |
array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
|
225 |
array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
|
226 |
array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
|
|
|
227 |
array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
|
228 |
array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
|
229 |
array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
|
@@ -232,6 +245,10 @@ class InstallerTest extends TestCase
|
|
232 |
array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
|
233 |
array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
|
234 |
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
|
|
|
|
|
|
|
|
|
235 |
array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
|
236 |
array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
|
237 |
array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
|
@@ -274,6 +291,7 @@ class InstallerTest extends TestCase
|
|
274 |
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
|
275 |
array('ppi-module', 'modules/foo/', 'test/foo'),
|
276 |
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
|
|
|
277 |
array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
|
278 |
array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
|
279 |
array('roundcube-plugin', 'plugins/base/', 'test/base'),
|
@@ -309,6 +327,9 @@ class InstallerTest extends TestCase
|
|
309 |
array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
|
310 |
array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
|
311 |
array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
|
|
|
|
|
|
|
312 |
);
|
313 |
}
|
314 |
|
110 |
array('craft-plugin', true),
|
111 |
array('croogo-plugin', true),
|
112 |
array('croogo-theme', true),
|
113 |
+
array('decibel-app', true),
|
114 |
array('dokuwiki-plugin', true),
|
115 |
array('dokuwiki-template', true),
|
116 |
array('drupal-module', true),
|
117 |
array('dolibarr-module', true),
|
118 |
+
array('ee3-theme', true),
|
119 |
+
array('ee3-addon', true),
|
120 |
+
array('ee2-theme', true),
|
121 |
+
array('ee2-addon', true),
|
122 |
array('elgg-plugin', true),
|
123 |
array('fuel-module', true),
|
124 |
array('fuel-package', true),
|
155 |
array('prestashop-module', true),
|
156 |
array('prestashop-theme', true),
|
157 |
array('puppet-module', true),
|
158 |
+
array('radphp-bundle', true),
|
159 |
array('redaxo-addon', true),
|
160 |
array('redaxo-bestyle-plugin', true),
|
161 |
array('roundcube-plugin', true),
|
185 |
array('zikula-theme', true),
|
186 |
array('kodicms-plugin', true),
|
187 |
array('kodicms-media', true),
|
188 |
+
array('phifty-bundle', true),
|
189 |
+
array('phifty-library', true),
|
190 |
+
array('phifty-framework', true),
|
191 |
);
|
192 |
}
|
193 |
|
220 |
array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
|
221 |
array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
|
222 |
array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
|
223 |
+
array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),
|
224 |
+
array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),
|
225 |
+
array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),
|
226 |
array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
|
227 |
array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
|
228 |
array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
|
236 |
array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
|
237 |
array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
|
238 |
array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
|
239 |
+
array('decibel-app', 'app/someapp/', 'author/someapp'),
|
240 |
array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
|
241 |
array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
|
242 |
array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
|
245 |
array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
|
246 |
array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
|
247 |
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
|
248 |
+
array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
|
249 |
+
array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
|
250 |
+
array('ee2-addon', 'system/expressionengine/third-party/ee_theme/', 'author/ee_theme'),
|
251 |
+
array('ee2-theme', 'themes/third-party/ee_package/', 'author/ee_package'),
|
252 |
array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
|
253 |
array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
|
254 |
array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
|
291 |
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
|
292 |
array('ppi-module', 'modules/foo/', 'test/foo'),
|
293 |
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
|
294 |
+
array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
|
295 |
array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
|
296 |
array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
|
297 |
array('roundcube-plugin', 'plugins/base/', 'test/base'),
|
327 |
array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
|
328 |
array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
|
329 |
array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
|
330 |
+
array('phifty-bundle', 'bundles/core/', 'shama/core'),
|
331 |
+
array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
|
332 |
+
array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
|
333 |
);
|
334 |
}
|
335 |
|
vendor/upstatement/routes/README.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
# Routes
|
2 |
Simple routing for WordPress.
|
3 |
|
4 |
-
[![Build Status](https://
|
|
|
|
|
|
|
5 |
|
6 |
### Usage
|
7 |
```php
|
@@ -10,6 +13,7 @@ Routes::map('myfoo/bar', 'my_callback_function');
|
|
10 |
Routes::map('my-events/:event', function($params) {
|
11 |
$event_slug = $params['event'];
|
12 |
$event = new ECP_Event($event_slug);
|
13 |
-
|
|
|
14 |
});
|
15 |
```
|
1 |
# Routes
|
2 |
Simple routing for WordPress.
|
3 |
|
4 |
+
[![Build Status](https://img.shields.io/travis/Upstatement/routes/master.svg?style=flat-square)](https://travis-ci.org/Upstatement/routes)
|
5 |
+
[![Coverage Status](https://img.shields.io/coveralls/Upstatement/routes.svg?style=flat-square)](https://coveralls.io/r/Upstatement/routes?branch=master)
|
6 |
+
[![Packagist Downloads](https://img.shields.io/packagist/dt/Upstatement/routes.svg?style=flat-square)]()
|
7 |
+
|
8 |
|
9 |
### Usage
|
10 |
```php
|
13 |
Routes::map('my-events/:event', function($params) {
|
14 |
$event_slug = $params['event'];
|
15 |
$event = new ECP_Event($event_slug);
|
16 |
+
$query = new WPQuery(); //if you want to send a custom query to the page's main loop
|
17 |
+
Routes::load('single.php', array('event' => $event), $query, 200);
|
18 |
});
|
19 |
```
|
vendor/upstatement/routes/Routes.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Routes
|
|
4 |
Plugin URI: http://routes.upstatement.com
|
5 |
Description: The WordPress Timber Library allows you to write themes using the power Twig templates
|
6 |
Author: Jared Novack + Upstatement
|
7 |
-
Version: 0.1
|
8 |
Author URI: http://upstatement.com/
|
9 |
|
10 |
Usage:
|
@@ -21,12 +21,16 @@ class Routes {
|
|
21 |
|
22 |
function __construct(){
|
23 |
add_action('init', array($this, 'match_current_request') );
|
|
|
24 |
}
|
25 |
|
26 |
static function match_current_request() {
|
27 |
global $upstatement_routes;
|
28 |
if (isset($upstatement_routes->router)) {
|
29 |
$route = $upstatement_routes->router->match();
|
|
|
|
|
|
|
30 |
if ($route && isset($route['target'])) {
|
31 |
if ( isset($route['params']) ) {
|
32 |
call_user_func($route['target'], $route['params']);
|
@@ -62,8 +66,8 @@ class Routes {
|
|
62 |
$upstatement_routes->router->setBasePath($base_path);
|
63 |
}
|
64 |
$route = self::convert_route($route);
|
65 |
-
$upstatement_routes->router->map('GET|POST', trailingslashit($route), $callback, $args);
|
66 |
-
$upstatement_routes->router->map('GET|POST', untrailingslashit($route), $callback, $args);
|
67 |
}
|
68 |
|
69 |
/**
|
4 |
Plugin URI: http://routes.upstatement.com
|
5 |
Description: The WordPress Timber Library allows you to write themes using the power Twig templates
|
6 |
Author: Jared Novack + Upstatement
|
7 |
+
Version: 0.3.1
|
8 |
Author URI: http://upstatement.com/
|
9 |
|
10 |
Usage:
|
21 |
|
22 |
function __construct(){
|
23 |
add_action('init', array($this, 'match_current_request') );
|
24 |
+
add_action('wp_loaded', array($this, 'match_current_request') );
|
25 |
}
|
26 |
|
27 |
static function match_current_request() {
|
28 |
global $upstatement_routes;
|
29 |
if (isset($upstatement_routes->router)) {
|
30 |
$route = $upstatement_routes->router->match();
|
31 |
+
|
32 |
+
unset($upstatement_routes->router);
|
33 |
+
|
34 |
if ($route && isset($route['target'])) {
|
35 |
if ( isset($route['params']) ) {
|
36 |
call_user_func($route['target'], $route['params']);
|
66 |
$upstatement_routes->router->setBasePath($base_path);
|
67 |
}
|
68 |
$route = self::convert_route($route);
|
69 |
+
$upstatement_routes->router->map('GET|POST|PUT|DELETE', trailingslashit($route), $callback, $args);
|
70 |
+
$upstatement_routes->router->map('GET|POST|PUT|DELETE', untrailingslashit($route), $callback, $args);
|
71 |
}
|
72 |
|
73 |
/**
|
vendor/upstatement/routes/bin/install-wp-tests.sh
CHANGED
@@ -1,78 +1,114 @@
|
|
1 |
#!/usr/bin/env bash
|
2 |
|
3 |
if [ $# -lt 3 ]; then
|
4 |
-
|
5 |
-
|
6 |
fi
|
7 |
|
8 |
DB_NAME=$1
|
9 |
DB_USER=$2
|
10 |
DB_PASS=$3
|
11 |
DB_HOST=${4-localhost}
|
12 |
-
WP_VERSION=${5-
|
13 |
|
14 |
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
|
15 |
-
WP_CORE_DIR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
set -ex
|
18 |
|
19 |
install_wp() {
|
20 |
-
mkdir -p $WP_CORE_DIR
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
|
31 |
-
|
32 |
}
|
33 |
|
34 |
install_test_suite() {
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
install_db() {
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
}
|
75 |
|
76 |
install_wp
|
77 |
install_test_suite
|
78 |
-
install_db
|
1 |
#!/usr/bin/env bash
|
2 |
|
3 |
if [ $# -lt 3 ]; then
|
4 |
+
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
|
5 |
+
exit 1
|
6 |
fi
|
7 |
|
8 |
DB_NAME=$1
|
9 |
DB_USER=$2
|
10 |
DB_PASS=$3
|
11 |
DB_HOST=${4-localhost}
|
12 |
+
WP_VERSION=${5-latest}
|
13 |
|
14 |
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
|
15 |
+
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/}
|
16 |
+
|
17 |
+
echo $WP_TESTS_DIR;
|
18 |
+
|
19 |
+
download() {
|
20 |
+
if [ `which curl` ]; then
|
21 |
+
curl -s "$1" > "$2";
|
22 |
+
elif [ `which wget` ]; then
|
23 |
+
wget -nv -O "$2" "$1"
|
24 |
+
fi
|
25 |
+
}
|
26 |
+
|
27 |
+
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
|
28 |
+
WP_TESTS_TAG="tags/$WP_VERSION"
|
29 |
+
else
|
30 |
+
# http serves a single offer, whereas https serves multiple. we only want one
|
31 |
+
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
|
32 |
+
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
|
33 |
+
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
|
34 |
+
if [[ -z "$LATEST_VERSION" ]]; then
|
35 |
+
echo "Latest WordPress version could not be found"
|
36 |
+
exit 1
|
37 |
+
fi
|
38 |
+
WP_TESTS_TAG="tags/$LATEST_VERSION"
|
39 |
+
fi
|
40 |
|
41 |
set -ex
|
42 |
|
43 |
install_wp() {
|
|
|
44 |
|
45 |
+
if [ -d $WP_CORE_DIR ]; then
|
46 |
+
return;
|
47 |
+
fi
|
48 |
+
|
49 |
+
mkdir -p $WP_CORE_DIR
|
50 |
+
|
51 |
+
if [ $WP_VERSION == 'latest' ]; then
|
52 |
+
local ARCHIVE_NAME='latest'
|
53 |
+
else
|
54 |
+
local ARCHIVE_NAME="wordpress-$WP_VERSION"
|
55 |
+
fi
|
56 |
|
57 |
+
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
|
58 |
+
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
|
59 |
|
60 |
+
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
|
61 |
}
|
62 |
|
63 |
install_test_suite() {
|
64 |
+
# portable in-place argument for both GNU sed and Mac OSX sed
|
65 |
+
if [[ $(uname -s) == 'Darwin' ]]; then
|
66 |
+
local ioption='-i .bak'
|
67 |
+
else
|
68 |
+
local ioption='-i'
|
69 |
+
fi
|
70 |
+
|
71 |
+
# set up testing suite if it doesn't yet exist
|
72 |
+
if [ ! -d $WP_TESTS_DIR ]; then
|
73 |
+
# set up testing suite
|
74 |
+
mkdir -p $WP_TESTS_DIR
|
75 |
+
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
|
76 |
+
fi
|
77 |
+
|
78 |
+
cd $WP_TESTS_DIR
|
79 |
+
|
80 |
+
if [ ! -f wp-tests-config.php ]; then
|
81 |
+
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
|
82 |
+
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php
|
83 |
+
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
|
84 |
+
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
|
85 |
+
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
|
86 |
+
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
|
87 |
+
fi
|
88 |
+
|
89 |
}
|
90 |
|
91 |
install_db() {
|
92 |
+
# parse DB_HOST for port or socket references
|
93 |
+
local PARTS=(${DB_HOST//\:/ })
|
94 |
+
local DB_HOSTNAME=${PARTS[0]};
|
95 |
+
local DB_SOCK_OR_PORT=${PARTS[1]};
|
96 |
+
local EXTRA=""
|
97 |
+
|
98 |
+
if ! [ -z $DB_HOSTNAME ] ; then
|
99 |
+
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then
|
100 |
+
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
|
101 |
+
elif ! [ -z $DB_SOCK_OR_PORT ] ; then
|
102 |
+
EXTRA=" --socket=$DB_SOCK_OR_PORT"
|
103 |
+
elif ! [ -z $DB_HOSTNAME ] ; then
|
104 |
+
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
|
105 |
+
fi
|
106 |
+
fi
|
107 |
+
|
108 |
+
# create database
|
109 |
+
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
|
110 |
}
|
111 |
|
112 |
install_wp
|
113 |
install_test_suite
|
114 |
+
install_db
|
vendor/upstatement/routes/readme.txt
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Routes ===
|
2 |
+
Contributors: jarednova
|
3 |
+
Tags: admin, configuration
|
4 |
+
Requires at least: 4.0
|
5 |
+
Stable tag: 0.3.1
|
6 |
+
Tested up to: 4.5
|
7 |
+
PHP version: 5.3.0 or greater
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Simple ways to add HTTP routes to your WordPress Theme
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
Simple ways to make admin customizations for WordPress. You know all that brain space you saved for rewrite regex? Now you can simply...
|
15 |
+
|
16 |
+
* On [GitHub](https://github.com/upstatement/routes)
|
17 |
+
|
18 |
+
### Usage
|
19 |
+
<code><pre>
|
20 |
+
/* functions.php */
|
21 |
+
Routes::map('myfoo/bar', 'my_callback_function');
|
22 |
+
Routes::map('my-events/:event', function($params) {
|
23 |
+
$event_slug = $params['event'];
|
24 |
+
$event = new ECP_Event($event_slug);
|
25 |
+
Routes::load('single.php', array('event' => $event));
|
26 |
+
});
|
27 |
+
</code></pre>
|
28 |
+
|
29 |
+
|
30 |
+
== Installation ==
|
31 |
+
|
32 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
33 |
+
2. Add custom routes in a theme file like functions.php
|
34 |
+
|
35 |
+
== Support ==
|
36 |
+
|
37 |
+
Please use the [GitHub repo](https://github.com/upstatement/routes/issues?state=open) to file bugs or questions.
|