Skip to content

Commit

Permalink
Change names in plates
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Nov 29, 2024
1 parent 525b93e commit 0e2dbe8
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ function run($command)

$app = __DIR__ . '/app';
$src = __DIR__ . '/src';
$space = str_repeat(' ', 8);

// Replace namespace in "index.php" --------
$index = $app . '/public/index.php';
Expand All @@ -298,6 +299,17 @@ function run($command)
replace_in_file($index, $texts);
// -----------------------------------------

// Replace names in "blades" and "plates" folder ------------
$texts = array('Basilisk' => $name);
$text = 'A skeleton application for the Slytherin framework';
$texts[$text] = $desc;
$texts['Muggle'] = $author;

replace_in_file($app . '/plates/index.php', $texts);

replace_in_file($app . '/blades/index.blade.php', $texts);
// ----------------------------------------------------------

if (! $useAssets)
{
remove_dir($app . '/assets');
Expand All @@ -324,8 +336,6 @@ function run($command)

$render = "'Rougin\Slytherin\Template\RendererIntegration'";

$space = str_repeat(' ', 8);

$texts = array();

$texts[$space . $render] = $space . '// ' . $render;
Expand All @@ -336,6 +346,15 @@ function run($command)
remove_dir($app . '/plates');

run('composer require illuminate/view');

// Always use "cache" folder ---
$useCache = true;
// -----------------------------
}

if (! $useCache)
{
remove_dir($app . '/cache');
}

if ($useEloquent)
Expand All @@ -347,8 +366,6 @@ function run($command)
{
$text = "'Rougin\Weasley\Packages\Laravel\Eloquent'";

$space = str_repeat(' ', 8);

$texts = array($space . $text => $space . '// ' . $text);

replace_in_file($config . '/app.php', $texts);
Expand Down

0 comments on commit 0e2dbe8

Please sign in to comment.