Tweaks
* Added basic http facade * Updated build rules
This commit is contained in:
parent
63aae2a504
commit
7c4ca953f6
@ -19,6 +19,8 @@ if [ ! -z "$FLAVOR" ]; then
|
||||
fi
|
||||
|
||||
PATH="$PWD/tools:$PATH"
|
||||
PLUGINS="plugins/com.noccy.apiclient plugins/com.noccy.pdo plugins/com.noccy.todo plugins/com.noccy.pdo.shell plugins/com.noccy.watcher"
|
||||
|
||||
|
||||
if [ -z $DESTINATION ]; then
|
||||
DESTINATION="release/$VERSION"
|
||||
@ -34,15 +36,15 @@ cp README.md $DESTINATION/README.md
|
||||
cp VERSIONS.md $DESTINATION/VERSIONS.md
|
||||
|
||||
echo "* Building dist and source archives"
|
||||
7z a -tzip "$DESTINATION/spark-$VERSION-dist.zip" spark.phar plugins README.md VERSIONS.md >/dev/null
|
||||
tar cfz "$DESTINATION/spark-$VERSION-dist.tgz" spark.phar plugins README.md VERSIONS.md
|
||||
7z a -tzip "$DESTINATION/spark-$VERSION-src.zip" bin src runtime plugins composer.json README.md VERSIONS.md >/dev/null
|
||||
tar cfz "$DESTINATION/spark-$VERSION-src.tgz" bin src runtime plugins composer.json README.md VERSIONS.md
|
||||
7z a -tzip "$DESTINATION/spark-$VERSION-dist.zip" spark.phar $PLUGINS README.md VERSIONS.md >/dev/null
|
||||
tar cfz "$DESTINATION/spark-$VERSION-dist.tgz" spark.phar $PLUGINS README.md VERSIONS.md
|
||||
7z a -tzip "$DESTINATION/spark-$VERSION-src.zip" bin src runtime $PLUGINS composer.json README.md VERSIONS.md >/dev/null
|
||||
tar cfz "$DESTINATION/spark-$VERSION-src.tgz" bin src runtime $PLUGINS composer.json README.md VERSIONS.md
|
||||
|
||||
echo "* Creating makeself installer"
|
||||
test -d release/tmp && rm -rf release/tmp
|
||||
mkdir release/tmp
|
||||
cp -R spark.phar plugins README.md VERSIONS.md release/tmp/
|
||||
cp -R spark.phar $PLUGINS README.md VERSIONS.md release/tmp/
|
||||
pushd release/tmp &>/dev/null
|
||||
makeself . ../../$DESTINATION/spark-$VERSION-dist.run "Spark $VERSION" ./spark.phar install &>/dev/null
|
||||
popd &>/dev/null
|
||||
|
@ -11,5 +11,8 @@
|
||||
- Rewritten script runner with proper variable substitution.
|
||||
- Added utility libraries for HTTP requests (Guzzle), templating (Twig) and dotenv
|
||||
support (symfony/dotenv, activates with environment).
|
||||
- PHP REPL; execute PHP code interactively.
|
||||
- Development mode; script the startup and shutdown of your projects development
|
||||
environment, and have it start and stop with the dedicated project shell.
|
||||
- Plugins in beta: com.noccy.pdo, com.noccy.pdo.shell, com.noccy.watcher.
|
||||
- Plugins in alpha: com.noccy.apiclient.
|
||||
- Plugins in alpha: com.noccy.apiclient, com.noccy.todo.
|
||||
|
@ -122,4 +122,6 @@ function get_filter(string $name, array $args=[]): null|FilterInterface|callable
|
||||
$filter->setArguments($args);
|
||||
}
|
||||
return $filter;
|
||||
}
|
||||
}
|
||||
|
||||
require_once __DIR__."/http.php";
|
||||
|
17
runtime/http.php
Normal file
17
runtime/http.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
|
||||
function fetch(string $url, array $options=[], bool $returnResponse=false) {
|
||||
|
||||
$client = new GuzzleHttp\Client();
|
||||
|
||||
$method = $options['method'] ?? 'GET';
|
||||
|
||||
$response = $client->request($method, $url, $options);
|
||||
|
||||
if ($returnResponse) {
|
||||
return $response;
|
||||
}
|
||||
return (string)$response->getBody();
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user