You can use the .phar for PHPCS, but it's easier to pull the repo down from git to then choose what version to use.
cd ~
mkdir -p code
cd code
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs| <?php | |
| // Copy everything below this line in to your functions.php file. | |
| /** | |
| * Remove microdata attributes from Genesis 2.6.0. | |
| * | |
| * May need adapting for other versions of Genesis. | |
| * | |
| * @author Gary Jones, Gamajo. |
| <?php | |
| add_filter( 'genesis_footer_widget_areas', 'gmj_add_footer_widgets_classes', 10, 2 ); | |
| /** | |
| * Add classes to footer widget areas container, depending on the configured number of footer widget areas. | |
| * | |
| * @param string $output Existing footer widget areas container markup. | |
| * @param int $footer_widgets Number of configured footer widget areas. | |
| * @return string Possibly amended markup for footer widget areas container. | |
| */ |
| <IfModule mod_headers.c> | |
| # HSTS - force redirect to HTTPS at the browser level. | |
| # Submit for Chrome preload list at https://hstspreload.appspot.com/ | |
| # Header always set Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload" env=HTTPS | |
| # X-Xss-Protection | |
| Header always set X-XSS-Protection "1; mode=block" | |
| # Stop clickjacking by only allowing us to frame our own site | |
| Header always set X-Frame-Options "SAMEORIGIN" |
| <?php | |
| // Untested, but should give you an idea. | |
| add_filter( 'gettext', 'claire_rename_color_to_colour' ); | |
| /** | |
| * Rename the exact WP string "Color" to "Colour". | |
| * | |
| * Doesn't affect non-exact strings. | |
| * |
| #, fuzzy | |
| msgid "" | |
| msgstr "" | |
| "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | |
| "Project-Id-Version: Title Capitalization For WordPress\n" | |
| "POT-Creation-Date: 2016-08-20 09:39-0700\n" | |
| "PO-Revision-Date: 2016-08-20 18:30+0100\n" | |
| "Last-Translator: Gary Jones\n" | |
| "Language-Team: British English\n" | |
| "MIME-Version: 1.0\n" |
| <?php | |
| /* | |
| * = Instructions = | |
| * Save locally as xml-bom.php | |
| * Then in terminal, `cd` to the correct folder, and run: | |
| * php xml-bom.php | |
| */ | |
| $xml = file_get_contents('http://www.usda.gov/oce/commodity/wasde/latest.xml'); | |
| define('BOM', "\xEF\xBB\xBF"); |
| <?php | |
| namespace GAA\CorpManager; | |
| use WP_UnitTestCase; | |
| class PluginTest extends WP_UnitTestCase { | |
| private $domain; | |
| private $mofile; |
These are my instructions for compiling a new version of PHP via Phpbrew on Mac High Sierra, with the latest versions of cURL and OpenSSL that Composer seems to need.
/usr/local/bin must come before /usr/bin in the PATH when using Homebrew.
export PATH=/usr/local/bin:$PATH
| <?php | |
| $dates = array("Sunday", | |
| "Monday", | |
| "Tuesday", | |
| "Wednesday", | |
| "Thursday", | |
| "Friday", | |
| "Saturday" | |
| ); |