mirror of
https://github.com/bdnugget/php-wasm.git
synced 2026-11-07 09:07:28 +00:00
Cleaning up build process
This commit is contained in:
1 parent
34449cd3c1
commit
8befe9b60c
21 files changed
+2061027
-49
No files matched your search
@@ -2,65 +2,103 @@ SHELL=/bin/bash -euxo pipefail
|
||||
|
||||
-include .env
|
||||
|
||||
PHP_BRANCH ?=PHP-7.4
|
||||
VRZNO_BRANCH ?=DomAccess
|
||||
ENVIRONMENT ?=web
|
||||
TOTAL_MEMORY ?=256MB
|
||||
PRELOAD_ASSETS ?=Zend/bench.php
|
||||
RELEASE_SUFFUX ?=
|
||||
|
||||
.PHONY: build hooks build-js clean e
|
||||
PHP_BRANCH ?=PHP-7.4
|
||||
VRZNO_BRANCH ?=DomAccess
|
||||
ICU_TAG ?=release-67-1
|
||||
LIBXML2_TAG ?=v2.9.10
|
||||
|
||||
DOCKER_RUN=docker-compose run --rm \
|
||||
-e PRELOAD_ASSETS=${PRELOAD_ASSETS} \
|
||||
-e TOTAL_MEMORY=${TOTAL_MEMORY} \
|
||||
-e ENVIRONMENT=web
|
||||
|
||||
DOCKER_RUN_IN_PHP =${DOCKER_RUN} -w third_party/php7.4-src/ emscripten-builder
|
||||
DOCKER_RUN_IN_ICU4C=${DOCKER_RUN} -w /src/third_party/libicu-src/icu4c/source/ emscripten-builder
|
||||
|
||||
.PHONY: build hooks build-js clean
|
||||
|
||||
build: build-js php-web.js php-webview.js php-node.js php-shell.js php-worker.js
|
||||
@ echo "Done!"
|
||||
|
||||
########### Build the objects. ###########
|
||||
|
||||
build/pib_eval.o: configured build-objects.sh
|
||||
lib/pib_eval.o: lib/libphp7.a build-objects.sh
|
||||
@ docker-compose run --rm -e ENVIRONMENT=web -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash build-objects.sh | pv
|
||||
|
||||
configured: php7.4-src sqlite3.33-src php7.4-src/ext/vrzno
|
||||
lib/libphp7.a: third_party/php7.4-src/patched third_party/php7.4-src/ext/vrzno/README.md
|
||||
@ docker-compose run --rm -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash configure.sh
|
||||
@ date > configured
|
||||
@cp third_party/php7.4-src/.libs/* lib/
|
||||
|
||||
lib/something:
|
||||
${DOCKER_RUN_IN_ICU4C} make clean
|
||||
${DOCKER_RUN_IN_ICU4C} emconfigure ./configure --prefix=/src/lib/
|
||||
${DOCKER_RUN_IN_ICU4C} emmake make
|
||||
${DOCKER_RUN_IN_ICU4C} emmake make install
|
||||
|
||||
# @ ${DOCKER_BASH} cd third_party/libicu-src/icu4c/source/ && ls -al .
|
||||
# @ ${DOCKER_BASH} cd third_party/libicu-src/icu4c/source/ \
|
||||
# && make clean \
|
||||
# && \
|
||||
# &&
|
||||
|
||||
########### Collect & patch the source code. ###########
|
||||
|
||||
php7.4-src:
|
||||
@ git clone https://github.com/php/php-src.git php7.4-src \
|
||||
third_party/php7.4-src/patched:
|
||||
@ git clone https://github.com/php/php-src.git third_party/php7.4-src \
|
||||
--branch ${PHP_BRANCH} \
|
||||
--single-branch \
|
||||
--depth 1;
|
||||
@ git apply --no-index php-sqlite-static.patch
|
||||
@ git apply --no-index php-pdo-sqlite-static.patch
|
||||
@ touch third_party/php7.4-src/patched
|
||||
|
||||
sqlite3.33-src:
|
||||
third_party/sqlite3.33-src/sqlite3.c:
|
||||
@ wget https://sqlite.org/2020/sqlite-amalgamation-3330000.zip
|
||||
@ unzip sqlite-amalgamation-3330000.zip
|
||||
@ mv sqlite-amalgamation-3330000 sqlite3.33-src
|
||||
@ mv sqlite-amalgamation-3330000 third_party/sqlite3.33-src
|
||||
@ rm sqlite-amalgamation-3330000.zip*
|
||||
@ git apply --no-index sqlite3-wasm.patch
|
||||
@ cp ./sqlite3.33-src/sqlite3.* ./php7.4-src/
|
||||
@ cp third_party/sqlite3.33-src/sqlite3.* third_party/php7.4-src/
|
||||
|
||||
php7.4-src/ext/vrzno:
|
||||
@ cd php7.4-src/ext \
|
||||
&& git clone https://github.com/seanmorris/vrzno.git \
|
||||
third_party/php7.4-src/ext/vrzno/README.md:
|
||||
git clone https://github.com/seanmorris/vrzno.git third_party/php7.4-src/ext/vrzno \
|
||||
--branch ${VRZNO_BRANCH} \
|
||||
--single-branch \
|
||||
--depth 1;
|
||||
|
||||
third_party/libicu-src:
|
||||
@ git clone https://github.com/unicode-org/icu.git third_party/libicu-src \
|
||||
--branch ${ICU_TAG} \
|
||||
--single-branch \
|
||||
--depth 1;
|
||||
|
||||
third_party/libxml2:
|
||||
@ git clone https://gitlab.gnome.org/GNOME/libxml2.git third_party/libxml2 \
|
||||
--branch ${LIBXML2_TAG} \
|
||||
--single-branch \
|
||||
--depth 1;
|
||||
|
||||
|
||||
########### Build the final files. ###########
|
||||
|
||||
php-web.js: configured build/pib_eval.o build.sh source/*.js source/*.c
|
||||
php-web.js: lib/libphp7.a build/pib_eval.o build.sh source/*.js source/*.c
|
||||
@ docker-compose run --rm -e ENVIRONMENT=web -e PRELOAD_ASSETS=${PRELOAD_ASSETS} -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash build.sh | pv
|
||||
|
||||
php-webview.js: configured build/pib_eval.o build.sh source/*.js source/*.c
|
||||
php-webview.js: lib/libphp7.a build/pib_eval.o build.sh source/*.js source/*.c
|
||||
@ docker-compose run --rm -e ENVIRONMENT=webview -e PRELOAD_ASSETS=${PRELOAD_ASSETS} -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash build.sh | pv
|
||||
|
||||
php-node.js: configured build/pib_eval.o build.sh source/*.js source/*.c
|
||||
php-node.js: lib/libphp7.a build/pib_eval.o build.sh source/*.js source/*.c
|
||||
@ docker-compose run --rm -e ENVIRONMENT=node -e PRELOAD_ASSETS=${PRELOAD_ASSETS} -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash build.sh | pv
|
||||
|
||||
php-shell.js: configured build/pib_eval.o build.sh source/*.js source/*.c
|
||||
php-shell.js: lib/libphp7.a build/pib_eval.o build.sh source/*.js source/*.c
|
||||
@ docker-compose run --rm -e ENVIRONMENT=shell -e PRELOAD_ASSETS=${PRELOAD_ASSETS} -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash build.sh | pv
|
||||
|
||||
php-worker.js: configured build/pib_eval.o build.sh source/*.js source/*.c
|
||||
php-worker.js: lib/libphp7.a build/pib_eval.o build.sh source/*.js source/*.c
|
||||
@ docker-compose run --rm -e ENVIRONMENT=worker -e PRELOAD_ASSETS=${PRELOAD_ASSETS} -e TOTAL_MEMORY=${TOTAL_MEMORY} emscripten-builder bash build.sh | pv
|
||||
|
||||
########### Clerical stuff. ###########
|
||||
|
||||
+5
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
set -euxo pipefail;
|
||||
|
||||
pushd php7.4-src/
|
||||
pushd third_party/php7.4-src/
|
||||
|
||||
emmake make -j8
|
||||
|
||||
@@ -11,5 +11,7 @@ EMCC_CORES=8 emcc -O1 \
|
||||
-I Zend \
|
||||
-I main \
|
||||
-I TSRM/ \
|
||||
../source/pib_eval.c \
|
||||
-o ../build/pib_eval.o
|
||||
../../source/pib_eval.c \
|
||||
-o ../../lib/pib_eval.o
|
||||
|
||||
popd
|
||||
@@ -2,23 +2,23 @@
|
||||
|
||||
set -euxo pipefail;
|
||||
|
||||
pushd php7.4-src
|
||||
pushd third_party/php7.4-src/
|
||||
|
||||
EMCC_CORES=8 emcc -O1 \
|
||||
-o ../../build/php-${ENVIRONMENT:-web}.js \
|
||||
--llvm-lto 2 \
|
||||
-s ENVIRONMENT=${ENVIRONMENT:-web} \
|
||||
--preload-file ${PRELOAD_ASSETS} \
|
||||
-s EXPORTED_FUNCTIONS='["_pib_init", "_pib_destroy", "_pib_eval" "_pib_refresh", "_main", "_php_embed_init", "_php_embed_shutdown", "_php_embed_shutdown", "_zend_eval_string", "_exec_callback", "_del_callback"]' \
|
||||
-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "UTF8ToString", "lengthBytesUTF8"]' \
|
||||
-s MODULARIZE=1 \
|
||||
-s EXPORT_NAME="'PHP'" \
|
||||
-s ENVIRONMENT=${ENVIRONMENT:-web} \
|
||||
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
|
||||
-s TOTAL_MEMORY=${TOTAL_MEMORY} \
|
||||
-s EXPORT_NAME="'PHP'" \
|
||||
-s MODULARIZE=1 \
|
||||
-s ASSERTIONS=0 \
|
||||
-s INVOKE_RUN=0 \
|
||||
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
|
||||
--preload-file ${PRELOAD_ASSETS} \
|
||||
-o ../build/php-${ENVIRONMENT:-web}.js \
|
||||
libs/libphp7.a ../build/pib_eval.o
|
||||
../../lib/libphp7.a ../../lib/pib_eval.o
|
||||
|
||||
popd
|
||||
|
||||
cp -v ./build/php-${ENVIRONMENT:-web}.* ./
|
||||
cp -v ./build/php-${ENVIRONMENT:-web}${RELEASE_SUFFUX:-}.* ./
|
||||
+5
-4
@@ -2,17 +2,18 @@
|
||||
|
||||
set -euxo pipefail;
|
||||
|
||||
pushd php7.4-src
|
||||
pushd third_party/php7.4-src/
|
||||
|
||||
rm configure || true
|
||||
|
||||
./buildconf --force
|
||||
|
||||
emconfigure ./configure \
|
||||
--enable-static=yes \
|
||||
--enable-shared=no \
|
||||
--with-sqlite3 \
|
||||
--disable-all \
|
||||
--prefix=`pwd`/../../lib/ \
|
||||
--with-sqlite3 \
|
||||
--without-pdo-sqlite \
|
||||
--without-pdo \
|
||||
--disable-cgi \
|
||||
--disable-cli \
|
||||
--disable-rpath \
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Numerous always-ignore extensions
|
||||
*.diff
|
||||
*.err
|
||||
*.orig
|
||||
*.log
|
||||
*.rej
|
||||
*.swo
|
||||
*.swp
|
||||
*.vi
|
||||
*~
|
||||
*.sass-cache
|
||||
|
||||
# OS or Editor folders
|
||||
.DS_Store
|
||||
.cache
|
||||
.project
|
||||
.settings
|
||||
.tmproj
|
||||
nbproject
|
||||
Thumbs.db
|
||||
|
||||
# NPM packages folder.
|
||||
node_modules/
|
||||
|
||||
# Brunch folder for temporary files.
|
||||
tmp/
|
||||
|
||||
# Brunch output folder.
|
||||
public/
|
||||
@@ -0,0 +1,132 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.PhpBase = void 0;
|
||||
|
||||
var _UniqueIndex = require("./UniqueIndex");
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
||||
|
||||
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
var PhpBase = /*#__PURE__*/function (_EventTarget) {
|
||||
_inherits(PhpBase, _EventTarget);
|
||||
|
||||
var _super = _createSuper(PhpBase);
|
||||
|
||||
function PhpBase(PhpBinary) {
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, PhpBase);
|
||||
|
||||
_this = _super.call(this);
|
||||
var FLAGS = {};
|
||||
_this.returnValue = -1;
|
||||
|
||||
_this.onerror = function () {};
|
||||
|
||||
_this.onoutput = function () {};
|
||||
|
||||
_this.onready = function () {};
|
||||
|
||||
var callbacks = new _UniqueIndex.UniqueIndex();
|
||||
var targets = new _UniqueIndex.UniqueIndex();
|
||||
_this.binary = new PhpBinary({
|
||||
callbacks: callbacks,
|
||||
targets: targets,
|
||||
postRun: function postRun() {
|
||||
var event = new CustomEvent('ready');
|
||||
|
||||
_this.dispatchEvent(event);
|
||||
|
||||
_this.onready(event);
|
||||
},
|
||||
print: function print() {
|
||||
for (var _len = arguments.length, chunks = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
chunks[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var event = new CustomEvent('output', {
|
||||
detail: chunks.map(function (c) {
|
||||
return c + "\n";
|
||||
})
|
||||
});
|
||||
|
||||
_this.dispatchEvent(event);
|
||||
|
||||
_this.onoutput(event);
|
||||
},
|
||||
printErr: function printErr() {
|
||||
for (var _len2 = arguments.length, chunks = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
chunks[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
var event = new CustomEvent('error', {
|
||||
detail: chunks.map(function (c) {
|
||||
return c + "\n";
|
||||
})
|
||||
});
|
||||
|
||||
_this.onerror(event);
|
||||
|
||||
_this.dispatchEvent(event);
|
||||
}
|
||||
}).then(function (php) {
|
||||
var retVal = php.ccall('pib_init', 'number', ["string"], []);
|
||||
return php;
|
||||
})["catch"](function (error) {
|
||||
return console.log(error);
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(PhpBase, [{
|
||||
key: "run",
|
||||
value: function run(phpCode) {
|
||||
return this.binary.then(function (php) {
|
||||
var retVal = php.ccall('pib_eval', 'number', ["string"], ["?>".concat(phpCode)]);
|
||||
php.ccall('pib_eval', 'number', ["string"], ["fwrite(fopen('php://stdout', 'w'), PHP_EOL);"]);
|
||||
return retVal;
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "refresh",
|
||||
value: function refresh() {
|
||||
return this.binary.then(function (php) {
|
||||
return php.ccall('pib_refresh', 'number', [], []);
|
||||
})["catch"](function (error) {
|
||||
return console.log(error);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return PhpBase;
|
||||
}( /*#__PURE__*/_wrapNativeSuper(EventTarget));
|
||||
|
||||
exports.PhpBase = PhpBase;
|
||||
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.PhpWorker = void 0;
|
||||
|
||||
var _PhpBase2 = require("./PhpBase");
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
var PhpBinary = require('./php-worker');
|
||||
|
||||
var PhpWorker = /*#__PURE__*/function (_PhpBase) {
|
||||
_inherits(PhpWorker, _PhpBase);
|
||||
|
||||
var _super = _createSuper(PhpWorker);
|
||||
|
||||
function PhpWorker() {
|
||||
_classCallCheck(this, PhpWorker);
|
||||
|
||||
return _super.call(this, PhpBinary);
|
||||
}
|
||||
|
||||
return PhpWorker;
|
||||
}(_PhpBase2.PhpBase);
|
||||
|
||||
exports.PhpWorker = PhpWorker;
|
||||
@@ -0,0 +1,16 @@
|
||||
# Brunch app
|
||||
|
||||
This is a HTML5 application, built with [Brunch](http://brunch.io).
|
||||
|
||||
## Getting started
|
||||
* Install (if you don't have them):
|
||||
* [Node.js](http://nodejs.org): `brew install node` on OS X
|
||||
* [Brunch](http://brunch.io): `npm install -g brunch`
|
||||
* Brunch plugins and app dependencies: `npm install`
|
||||
* Run:
|
||||
* `npm start` — watches the project with continuous rebuild. This will also launch HTTP server with [pushState](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history).
|
||||
* `npm run build` — builds minified project for production
|
||||
* Learn:
|
||||
* `public/` dir is fully auto-generated and served by HTTP server. Write your code in `app/` dir.
|
||||
* Place static files you want to be copied from `app/assets/` to `public/`.
|
||||
* [Brunch site](http://brunch.io), [Getting started guide](https://github.com/brunch/brunch-guide#readme)
|
||||
@@ -7,7 +7,9 @@
|
||||
<script src="//ajaxorg.github.io/ace-builds/src-min/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Allow the page to be served from any direcotry...
|
||||
navigator.serviceWorker.register('/worker.js').then(reg => {
|
||||
reg.update();
|
||||
});
|
||||
|
||||
const path = location.pathname.replace(/index.html$/, '');
|
||||
|
||||
|
||||
Generated
+2058
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "brunch-app",
|
||||
"description": "Brunch.io application",
|
||||
"private": true,
|
||||
"author": "Brunch",
|
||||
"version": "0.0.1",
|
||||
"repository": "",
|
||||
"scripts": {
|
||||
"start": "brunch watch --server",
|
||||
"build": "brunch build --production"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"auto-reload-brunch": "^2",
|
||||
"brunch": "^3",
|
||||
"clean-css-brunch": "^3",
|
||||
"terser-brunch": "^4"
|
||||
}
|
||||
}
|
||||
+2044407
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
// self.importScripts('./php-worker.js', './PhpBase.js', './PhpWorker.js');
|
||||
|
||||
// const PhpWorker = require('./PhpWorker').PhpWorker;
|
||||
// const php = new PhpWorker;
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
console.log('SW installed',event);
|
||||
console.dir(event);
|
||||
// event.waitUntil(php);
|
||||
});
|
||||
|
||||
self.addEventListener('activate', event => {
|
||||
console.log('SW activated',event);
|
||||
console.dir(event);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', event => {
|
||||
console.log('SW fetched!',event);
|
||||
console.dir(event);
|
||||
});
|
||||
@@ -12,23 +12,23 @@ RUN set -euxo pipefail;\
|
||||
build-essential \
|
||||
libargon2-0-dev \
|
||||
libreadline-dev \
|
||||
libsqlite3-dev \
|
||||
libsqlite3-dev \
|
||||
automake-1.15 \
|
||||
libsodium-dev \
|
||||
libonig-dev \
|
||||
libyaml-dev \
|
||||
libxml2-dev \
|
||||
libxml2-dev \
|
||||
libssl-dev \
|
||||
libgmp-dev \
|
||||
autoconf \
|
||||
valgrind \
|
||||
libtool \
|
||||
php-dev \
|
||||
pkgconf \
|
||||
valgrind \
|
||||
libtool \
|
||||
php-dev \
|
||||
pkgconf \
|
||||
bison \
|
||||
flex \
|
||||
make \
|
||||
make \
|
||||
re2c \
|
||||
gdb \
|
||||
git \
|
||||
pv
|
||||
git \
|
||||
pv
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,28 @@
|
||||
--- a/third_party/php7.4-src/ext/pdo_sqlite/config.m4
|
||||
+++ b/third_party/php7.4-src/ext/pdo_sqlite/config.m4
|
||||
@@ -10,25 +10,5 @@ if test "$PHP_PDO_SQLITE" != "no"; then
|
||||
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
|
||||
fi
|
||||
|
||||
- PHP_CHECK_PDO_INCLUDES
|
||||
-
|
||||
- PKG_CHECK_MODULES([SQLITE], [sqlite3 > 3.7.4])
|
||||
-
|
||||
- PHP_EVAL_INCLINE($SQLITE_CFLAGS)
|
||||
- PHP_EVAL_LIBLINE($SQLITE_LIBS, PDO_SQLITE_SHARED_LIBADD)
|
||||
- AC_DEFINE(HAVE_PDO_SQLITELIB, 1, [Define to 1 if you have the pdo_sqlite extension enabled.])
|
||||
-
|
||||
- PHP_CHECK_LIBRARY(sqlite3, sqlite3_close_v2, [
|
||||
- AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])
|
||||
- ], [], [$PDO_SQLITE_SHARED_LIBADD])
|
||||
-
|
||||
- PHP_CHECK_LIBRARY(sqlite3, sqlite3_column_table_name, [
|
||||
- AC_DEFINE(HAVE_SQLITE3_COLUMN_TABLE_NAME, 1, [have sqlite3_column_table_name])
|
||||
- ], [], [$PDO_SQLITE_SHARED_LIBADD])
|
||||
-
|
||||
- PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
|
||||
- PHP_NEW_EXTENSION(pdo_sqlite, pdo_sqlite.c sqlite_driver.c sqlite_statement.c,
|
||||
- $ext_shared,,-I$pdo_cv_inc_path)
|
||||
-
|
||||
PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
|
||||
fi
|
||||
@@ -1,5 +1,5 @@
|
||||
--- a/php7.4-src/ext/sqlite3/config0.m4
|
||||
+++ b/php7.4-src/ext/sqlite3/config0.m4
|
||||
--- a/third_party/php7.4-src/ext/sqlite3/config0.m4
|
||||
+++ b/third_party/php7.4-src/ext/sqlite3/config0.m4
|
||||
@@ -5,26 +5,6 @@ PHP_ARG_WITH([sqlite3],
|
||||
[yes])
|
||||
|
||||
@@ -27,3 +27,4 @@
|
||||
PHP_NEW_EXTENSION(sqlite3, sqlite3.c, $ext_shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
||||
PHP_SUBST(SQLITE3_SHARED_LIBADD)
|
||||
fi
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
--- a/sqlite3.33-src/sqlite3.h
|
||||
+++ b/sqlite3.33-src/sqlite3.h
|
||||
--- a/third_party/sqlite3.33-src/sqlite3.h
|
||||
+++ b/third_party/sqlite3.33-src/sqlite3.h
|
||||
@@ -159,7 +159,7 @@ extern "C" {
|
||||
**
|
||||
** See also: [sqlite_version()] and [sqlite_source_id()].
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
|
||||
Reference in new issue
Block a user