Skip to content

Instantly share code, notes, and snippets.

@scoumbourdis
Created December 5, 2023 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scoumbourdis/4e0e3d00d1d6721f6e8db1a01dca98c3 to your computer and use it in GitHub Desktop.
Save scoumbourdis/4e0e3d00d1d6721f6e8db1a01dca98c3 to your computer and use it in GitHub Desktop.
<?php
namespace App\Publishers;
use CodeIgniter\Publisher\Publisher;
class GroceryCrudPublisher extends Publisher
{
/**
* Tell Publisher where to get the files.
* Since we will use Composer to download
* them we point to the "vendor" directory.
*
* @var string
*/
protected $source = FCPATH . '/../vendor/grocery-crud/enterprise/public/';
/**
* FCPATH is always the default destination,
* but just to be explicit, we'll set it here.
*
* @var string
*/
protected $destination = FCPATH;
/**
* Use the "publish" method to indicate that this
* class is ready to be discovered and automated.
*/
public function publish(): bool
{
return $this
// Add all the files relative to $source
->addPath('./')
->removePattern('#\.gitkeep#')
->removePattern('#\.txt#')
// Merge-and-replace to retain the original directory structure
->merge(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment