Added makefile, cleanup
This commit is contained in:
		
							
								
								
									
										22
									
								
								Makefile
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										22
									
								
								Makefile
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,22 @@
 | 
				
			|||||||
 | 
					.DEFAULT_GOAL := help
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					REPODIR="$(shell pwd)"
 | 
				
			||||||
 | 
					BUILDDIR="/tmp/mercureact.tmp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: help
 | 
				
			||||||
 | 
					help:
 | 
				
			||||||
 | 
						@echo "Available Targets:"; grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: phar
 | 
				
			||||||
 | 
					phar: ## Build .phar using pharlite
 | 
				
			||||||
 | 
						rm -rf $(BUILDDIR)
 | 
				
			||||||
 | 
						git clone $(REPODIR) $(BUILDDIR) && \
 | 
				
			||||||
 | 
							cd $(BUILDDIR) && \
 | 
				
			||||||
 | 
							composer install --no-dev && \
 | 
				
			||||||
 | 
							pharlite && \
 | 
				
			||||||
 | 
							mv $(BUILDDIR)/*.phar . && \
 | 
				
			||||||
 | 
							rm -rf $(BUILDDIR)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: phpstan
 | 
				
			||||||
 | 
					phpstan: ## Run static analysis
 | 
				
			||||||
 | 
						phpstan --no-progress
 | 
				
			||||||
@@ -7,6 +7,7 @@ use NoccyLabs\Mercureact\Daemon;
 | 
				
			|||||||
require_once __DIR__."/../vendor/autoload.php";
 | 
					require_once __DIR__."/../vendor/autoload.php";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$config = Configuration::createDefault()
 | 
					$config = Configuration::createDefault()
 | 
				
			||||||
 | 
					            ->setAllowAnonymousSubscribe(true)
 | 
				
			||||||
            ->setJwtSecret("!ChangeThisMercureHubJWTSecretKey!");
 | 
					            ->setJwtSecret("!ChangeThisMercureHubJWTSecretKey!");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$daemon = new Daemon($config);
 | 
					$daemon = new Daemon($config);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								make-phar.sh
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								make-phar.sh
									
									
									
									
									
								
							@@ -1,12 +0,0 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					 | 
				
			||||||
REPO=$PWD
 | 
					 | 
				
			||||||
DIR=mercureact
 | 
					 | 
				
			||||||
pushd /tmp
 | 
					 | 
				
			||||||
rm -rf /tmp/$DIR
 | 
					 | 
				
			||||||
git clone "$REPO"
 | 
					 | 
				
			||||||
cd $DIR
 | 
					 | 
				
			||||||
composer install --no-dev
 | 
					 | 
				
			||||||
pharlite
 | 
					 | 
				
			||||||
popd
 | 
					 | 
				
			||||||
mv /tmp/$DIR/*.phar .
 | 
					 | 
				
			||||||
rm -rf /tmp/$DIR
 | 
					 | 
				
			||||||
@@ -26,8 +26,6 @@ class Server
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private SplObjectStorage $webSocketClients;
 | 
					    private SplObjectStorage $webSocketClients;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private SplObjectStorage $eventClients;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private TopicManager $topicManager;
 | 
					    private TopicManager $topicManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private ResponseMiddleware $responseMiddleware;
 | 
					    private ResponseMiddleware $responseMiddleware;
 | 
				
			||||||
@@ -50,7 +48,6 @@ class Server
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $this->topicManager = new TopicManager();
 | 
					        $this->topicManager = new TopicManager();
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        $this->eventClients = new SplObjectStorage();
 | 
					 | 
				
			||||||
        $this->webSocketClients = new SplObjectStorage();
 | 
					        $this->webSocketClients = new SplObjectStorage();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->server = $this->createHttpServer();
 | 
					        $this->server = $this->createHttpServer();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user