wzq 5 年之前
父节点
当前提交
04036464a4
共有 5 个文件被更改,包括 86 次插入0 次删除
  1. 26 0
      bin/fswatch
  2. 11 0
      bin/laravels
  3. 21 0
      public/.htaccess
  4. 28 0
      public/index.php
  5. 0 0
      resources/views/.gitkeep

+ 26 - 0
bin/fswatch

@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+WORK_DIR=$1
+if [ ! -n "${WORK_DIR}" ] ;then
+    WORK_DIR="."
+fi
+
+echo "Restarting LaravelS..."
+./bin/laravels restart -d -i
+
+echo "Starting fswatch..."
+LOCKING=0
+fswatch -e ".*" -i "\\.php$" -m poll_monitor -r ${WORK_DIR} | while read file
+do
+    if [[ ! ${file} =~ .php$ ]] ;then
+        continue
+    fi
+    if [ ${LOCKING} -eq 1 ] ;then
+        echo "Reloading, skipped."
+        continue
+    fi
+    echo "File ${file} has been modified."
+    LOCKING=1
+    ./bin/laravels reload
+    LOCKING=0
+done
+exit 0

+ 11 - 0
bin/laravels

@@ -0,0 +1,11 @@
+#!/usr/bin/env php
+<?php
+$basePath = realpath(__DIR__ . '/../');
+include $basePath . '/vendor/autoload.php';
+
+$command = new Hhxsv5\LaravelS\Console\Portal($basePath);
+$input = new Symfony\Component\Console\Input\ArgvInput();
+$output = new Symfony\Component\Console\Output\ConsoleOutput();
+
+$code = $command->run($input, $output);
+exit($code);

+ 21 - 0
public/.htaccess

@@ -0,0 +1,21 @@
+<IfModule mod_rewrite.c>
+    <IfModule mod_negotiation.c>
+        Options -MultiViews -Indexes
+    </IfModule>
+
+    RewriteEngine On
+
+    # Handle Authorization Header
+    RewriteCond %{HTTP:Authorization} .
+    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+
+    # Redirect Trailing Slashes If Not A Folder...
+    RewriteCond %{REQUEST_FILENAME} !-d
+    RewriteCond %{REQUEST_URI} (.+)/$
+    RewriteRule ^ %1 [L,R=301]
+
+    # Handle Front Controller...
+    RewriteCond %{REQUEST_FILENAME} !-d
+    RewriteCond %{REQUEST_FILENAME} !-f
+    RewriteRule ^ index.php [L]
+</IfModule>

+ 28 - 0
public/index.php

@@ -0,0 +1,28 @@
+<?php
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| First we need to get an application instance. This creates an instance
+| of the application / container and bootstraps the application so it
+| is ready to receive HTTP / Console requests from the environment.
+|
+*/
+
+$app = require __DIR__.'/../bootstrap/app.php';
+
+/*
+|--------------------------------------------------------------------------
+| Run The Application
+|--------------------------------------------------------------------------
+|
+| Once we have the application, we can handle the incoming request
+| through the kernel, and send the associated response back to
+| the client's browser allowing them to enjoy the creative
+| and wonderful application we have prepared for them.
+|
+*/
+
+$app->run();

+ 0 - 0
resources/views/.gitkeep