Skip to content

Commit

Permalink
Merge pull request #10 from websharks/feature/cleanup
Browse files Browse the repository at this point in the history
Adding Composer and general cleanup.
  • Loading branch information
jaswsinc committed Apr 20, 2016
2 parents 1a59ba4 + 9ba53bb commit 4537aa2
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 53 deletions.
29 changes: 18 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,21 @@
*.so binary

# Archive ignores.
assets/ export-ignore
tests/ export-ignore
.git* export-ignore
.tags export-ignore
.post-receive export-ignore
.apigen.neon export-ignore
.travis.yml export-ignore
.coveralls.yml export-ignore
.scrutinizer.yml export-ignore
.build.properties export-ignore
.build.xml export-ignore
/assets/ export-ignore
/phings/ export-ignore
/tests/ export-ignore
/.git* export-ignore
/.tags export-ignore
/post-receive export-ignore
/.drone.yml export-ignore
/.drone.sec export-ignore
/.travis.yml export-ignore
/.coveralls.yml export-ignore
/.scrutinizer.yml export-ignore
/.build.props export-ignore
/build.xml export-ignore

# LFS storage locations.
/assets/** filter=lfs diff=lfs merge=lfs -text

# Custom code reinserted here via [custom] marker. Add your <custom></custom> comment markers here please.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ Icon?
# This list is for IntelliJ IDEA / PhpStorm `File Types` configuration. Some files we actually WANT to work with as part of a project.
# .sass-cache;.idea;*.ipr;*.iws;*.sublime-workspace;*.sublime-project;.git;CVS;.svn;_svn;.bzr;.hg;SCCS;RCS;$RECYCLE.BIN;Desktop.ini;Thumbs.db;ehthumbs.db;.Spotlight-V100;.AppleDouble;.LSOverride;.DS_Store;.Trashes;._*;.vagrant

# We also need to update the WebSharks™ Core `dirs_files::ignore()` method if this changes.
# Custom code reinserted here via [custom] marker. Add your <custom></custom> comment markers here please.
2 changes: 1 addition & 1 deletion src/.htaccess → .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
deny from all
</IfModule>

<FilesMatch "\.(js|css|gif|jpg|png|svg|eot|woff|ttf|html|txt|md)$">
<FilesMatch "\.(js|css|map|gif|jpg|png|svg|eot|woff|ttf|html|txt|md)$">
<IfModule authz_core_module>
Require all granted
</IfModule>
Expand Down
67 changes: 40 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
{
"name": "websharks/wp-php-rv",
"homepage": "https://github.com/websharks/wp-php-rv",
"description": "Stub for WordPress themes/plugins that require PHP vX.x+.",
"keywords": [
"websharks",
"wordpress",
"php"
],
"type": "library",
"license": "GPL-3.0+",
"authors": [{
"name": "websharks",
"homepage": "http://websharks-inc.com/",
"role": "company"
}, {
"name": "jaswsinc",
"homepage": "http://jaswsinc.com/",
"role": "developer"
}, {
"name": "raamdev",
"homepage": "http://raam.org/",
"role": "developer"
}],
"support": {
"source": "https://github.com/websharks/wp-php-rv",
"issues": "https://github.com/websharks/wp-php-rv/issues"
}
"name": "websharks/wp-php-rv",
"homepage": "https://github.com/websharks/wp-php-rv",
"description": "Stub for WordPress themes/plugins that require PHP vX.x+.",
"keywords": ["websharks", "wordpress", "php"],

"type": "library",
"license": "GPL-3.0+",

"authors": [{
"name": "websharks",
"homepage": "http://websharks-inc.com/",
"role": "company"
}, {
"name": "jaswsinc",
"homepage": "http://jaswsinc.com/",
"role": "developer"
}, {
"name": "raamdev",
"homepage": "http://raam.org/",
"role": "developer"
}],

"support": {
"source": "https://github.com/websharks/wp-php-rv",
"issues": "https://github.com/websharks/wp-php-rv/issues"
},

"require": {},
"require-dev": {},
"minimum-stability": "dev",
"prefer-stable": true,

"autoload": {},

"config": {
"vendor-dir": "src/vendor",
"preferred-install": "dist"
},

"repositories": []
}
5 changes: 3 additions & 2 deletions src/includes/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* PHP vX.x Handlers.
*
* @since 141004 First documented version.
* @copyright WebSharks, Inc. <http://www.websharks-inc.com>
*
* @copyright WebSharks, Inc. <http://websharks-inc.com>
* @license GNU General Public License, version 3
*/
if (!defined('WPINC')) {
Expand All @@ -13,4 +14,4 @@
require_once dirname(__FILE__).'/functions/wp.php';
}
___wp_php_rv_initialize(); // Run initilization routines.
return wp_php_rv(); // `TRUE` if running PHP vX.x+ w/ required extensions.
return wp_php_rv(); // True if running PHP vX.x+ w/ required extensions.
17 changes: 6 additions & 11 deletions src/includes/functions/wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @since 141004 First documented version.
*
* @copyright WebSharks, Inc. <http://www.websharks-inc.com>
* @copyright WebSharks, Inc. <http://websharks-inc.com>
* @license GNU General Public License, version 3
*/

Expand All @@ -25,8 +25,7 @@ function wp_php_rv()
if ($_extension && is_string($_extension) && !extension_loaded($_extension)) {
return false; // Missing extension!
}
}
unset($_extension); // Housekeeping.
} // unset($_extension); // Housekeeping.

return true; // Good-to-go!
}
Expand All @@ -42,8 +41,7 @@ function wp_php_rv_missing()
if (isset($GLOBALS['wp_php_rv'])) {
___wp_php_rv_initialize();
}
$missing_rv = // Missing required PHP version?
!version_compare(PHP_VERSION, $GLOBALS['___wp_php_rv']['rv'], '>=');
$missing_rv = !version_compare(PHP_VERSION, $GLOBALS['___wp_php_rv']['rv'], '>=');
$missing_rv = $missing_rv ? $GLOBALS['___wp_php_rv']['rv'] : '';

$missing_re = array(); // Missing extensions.
Expand All @@ -53,15 +51,13 @@ function wp_php_rv_missing()
if ($_extension && is_string($_extension) && !extension_loaded($_extension)) {
$missing_re[] = $_extension; // Missing extension!
}
}
unset($_extension); // Housekeeping.
} // unset($_extension); // Housekeeping.

if ($missing_re) {
foreach ($missing_re as $_re) {
$missing_re_list .= '<code><a href="http://php.net/manual/en/book.'.urlencode($_re).'.php" target="_blank">'.esc_html($_re).'</a></code>, ';
}
} // unset($_re); // Housekeeping.
$missing_re_list = trim($missing_re_list, ', ');
unset($_re); // Housekeeping.
}
if ($missing_rv || $missing_re) {
return array('rv' => $missing_rv, 're' => $missing_re, 're_list' => $missing_re_list);
Expand Down Expand Up @@ -105,8 +101,7 @@ function wp_php_rv_notice($software_name = '', $software_text_domain = '', $noti
if (($_calling_file_basedir = strtolower(basename(dirname($_debug_backtrace[1]['file']))))) {
$software_name = ucwords(trim(preg_replace('/[^a-z0-9]+/i', ' ', $_calling_file_basedir)));
}
}
unset($_debug_backtrace, $_calling_file_basedir); // Housekeeping.
} // unset($_debug_backtrace, $_calling_file_basedir); // Housekeeping.
}
if (!$software_text_domain) {
$software_text_domain = trim(preg_replace('/[^a-z0-9\-]/i', '-', strtolower($software_name)), '-');
Expand Down
Empty file removed tests/placeholder.txt
Empty file.

0 comments on commit 4537aa2

Please sign in to comment.