First, clone the repository of the project :
mkdir /tmp/project-name
git clone ...
Create a packages.json file in the root, containing the following :
| <?php | |
| namespace CoiSA\Facade; | |
| abstract class AbstractFacade implements FacadeInterface | |
| { | |
| use FacadeTrait; | |
| } |
| <?php | |
| trait Singleton | |
| { | |
| private static $instance; | |
| public static function getInstance(...$args): static | |
| { | |
| if (null === self::$instance) { | |
| self::$instance = new static(...$args); |
| <?php | |
| // Save referrer url in cookie | |
| function set_referrer_cookie() { | |
| $cookie_value = $_SERVER['HTTP_REFERER'] ?? null; // Get URL the user came to your site for | |
| if ( !is_admin() && !isset($_COOKIE['origin'])) { // If not an admin or if cookie doesn't exist already | |
| setcookie( 'origin', $cookie_value, time()+3600*24*30, COOKIEPATH, COOKIE_DOMAIN, false); // Set cookie for 30 days | |
| } | |
| } |
First, clone the repository of the project :
mkdir /tmp/project-name
git clone ...
Create a packages.json file in the root, containing the following :