-
Notifications
You must be signed in to change notification settings - Fork 1
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
12 changed files
with
314 additions
and
228 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
app/Console/Commands/WordpressInstall/Tasks/PageBuilder.php
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands\WordpressInstall\Tasks; | ||
|
||
use App\Console\Task; | ||
|
||
class PageBuilder extends Task | ||
{ | ||
public $name = 'Installing Page Builder'; | ||
|
||
public function localRequirements() | ||
{ | ||
return $this->options->pageBuilder !== 'None'; | ||
} | ||
|
||
public function handle() | ||
{ | ||
switch ($this->options->pageBuilder) { | ||
case 'Elementor': | ||
$this->shell->exec("cd {$this->bindings->installationDir} && wp plugin install elementor --activate"); | ||
break; | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Helper; | ||
|
||
class Initials | ||
{ | ||
/** | ||
* Generate initials from a name. | ||
* | ||
* @param string $name | ||
* | ||
* @return string | ||
*/ | ||
public function generate(string $name) : string | ||
{ | ||
$words = explode(' ', $name); | ||
if (count($words) >= 2) { | ||
return strtoupper(substr($words[0], 0, 1) . substr(end($words), 0, 1)); | ||
} | ||
|
||
return $this->makeInitialsFromSingleWord($name); | ||
} | ||
|
||
/** | ||
* Make initials from a word with no spaces. | ||
* | ||
* @param string $name | ||
* | ||
* @return string | ||
*/ | ||
protected function makeInitialsFromSingleWord(string $name) : string | ||
{ | ||
preg_match_all('#([A-Z]+)#', $name, $capitals); | ||
if (count($capitals[1]) >= 2) { | ||
return substr(implode('', $capitals[1]), 0, 2); | ||
} | ||
|
||
return strtoupper(substr($name, 0, 2)); | ||
} | ||
} |
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
Oops, something went wrong.