-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
188 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WP Starter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the wpstarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -28,9 +26,9 @@ final class Loader extends DotenvLoader | |
*/ | ||
public function setEnvironmentVariable($name, $value = null) | ||
{ | ||
list($name, $value) = $this->normaliseEnvironmentVariable($name, $value); | ||
list($normalised_name, $value) = $this->normaliseEnvironmentVariable($name, $value); | ||
|
||
in_array($name, $this->allVars, true) or $this->allVars[] = $name; | ||
in_array($normalised_name, $this->allVars, true) or $this->allVars[] = $normalised_name; | ||
|
||
if (!$this->immutable || is_null($this->getEnvironmentVariable($name))) { | ||
parent::setEnvironmentVariable($name, $value); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WP Starter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
@@ -77,7 +75,11 @@ public static function addHook($hook, $callable, $priority = 10, $argsNum = 1) | |
return; | ||
} | ||
|
||
if (defined(ABSPATH) && is_file(ABSPATH.'wp-includes/plugin.php')) { | ||
if ( | ||
defined(ABSPATH) | ||
&& is_file(ABSPATH.'wp-includes/class-wp-hook.php') | ||
&& is_file(ABSPATH.'wp-includes/plugin.php') | ||
) { | ||
require_once ABSPATH.'wp-includes/plugin.php'; | ||
if (class_exists('WP_Hook')) { | ||
add_filter($hook, $callable, $priority, $argsNum); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WP Starter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
@@ -108,7 +106,10 @@ private function loading($refresh, $transient) | |
*/ | ||
private function loadPlugin($key, $file, $refresh, $transient) | ||
{ | ||
if (is_readable($file) && strtolower(pathinfo($file, PATHINFO_EXTENSION)) === 'php') { | ||
if ( | ||
is_readable($file) | ||
&& strtolower( (string) pathinfo($file, PATHINFO_EXTENSION)) === 'php' | ||
) { | ||
wp_register_plugin_realpath($file); | ||
if (in_array($file, $this->regular, true)) { | ||
$this->regularLoaded[] = $file; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -25,6 +23,7 @@ | |
use WCM\WPStarter\Setup\Steps\GitignoreStep; | ||
use WCM\WPStarter\Setup\Steps\IndexStep; | ||
use WCM\WPStarter\Setup\Steps\MoveContentStep; | ||
use WCM\WPStarter\Setup\Steps\WPCliStep; | ||
use WCM\WPStarter\Setup\Steps\WPConfigStep; | ||
|
||
/** | ||
|
@@ -102,6 +101,7 @@ private function install(Composer $composer, Config $config, IO $io, array $extr | |
->addStep(new EnvExampleStep($io, $builder)) | ||
->addStep(new DropinsStep($io, $overwrite)) | ||
->addStep(new GitignoreStep($io, $builder)) | ||
->addStep(new WPCliStep($builder)) | ||
->addStep(new MoveContentStep($io)) | ||
->run($paths); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -185,7 +183,7 @@ private function validateBoolOrAskOrUrl($value) | |
private function validateBoolOrAsk($value) | ||
{ | ||
$asks = array('ask', 'prompt', 'query', 'interrogate', 'demand'); | ||
if (in_array(trim(strtolower($value)), $asks, true)) { | ||
if (is_string($value) && in_array(trim(strtolower($value)), $asks, true)) { | ||
return 'ask'; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -147,7 +145,7 @@ private function validName($name) | |
if ($this->config['unknown-dropins'] === true || in_array($name, self::$dropins, true)) { | ||
return true; | ||
} | ||
$ext = pathinfo($name, PATHINFO_EXTENSION); | ||
$ext = (string) pathinfo($name, PATHINFO_EXTENSION); | ||
if (strtolower($ext) !== 'php') { | ||
return $this->config['unknown-dropins'] === 'ask' && $this->ask($name, 0); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace WCM\WPStarter\Setup\Steps; | ||
|
||
use WCM\WPStarter\Setup\IO; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace WCM\WPStarter\Setup\Steps; | ||
|
||
use WCM\WPStarter\Setup\Config; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php declare( strict_types = 1 ); # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?php | ||
<?php # -*- coding: utf-8 -*- | ||
/* | ||
* This file is part of the WPStarter package. | ||
* | ||
* (c) Giuseppe Mazzapica <[email protected]> | ||
* This file is part of the WP Starter package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
Oops, something went wrong.