Skip to content

Commit

Permalink
feat: add site module macro
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Jan 17, 2024
1 parent aa78554 commit 992862a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions macros/copySiteModule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace ProcessWire;

/**
* Install Site Module
*/

$wire = wire();
$rm = rockmigrations();

$file = $wire->config->paths->siteModules . "Site/Site.module.php";
if (is_file($file)) {
$wire->message("Site module file already exists!");
return;
}

$stub = __DIR__ . "/../stubs/SiteModule.php";
$wire->files->mkdir(dirname($file));
$wire->files->filePutContents($file, $wire->files->fileGetContents($stub));
$wire->message("Please do a modules refresh and install the site module.");

0 comments on commit 992862a

Please sign in to comment.