From 4153e2389e7216e95fca33e01eaf2415c2dd6eb4 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Tue, 20 Jun 2017 08:48:09 -0500 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20=E2=9D=84=EF=B8=8F=20?= =?UTF-8?q?=F0=9F=92=A1=20=E2=AC=86=EF=B8=8F=20Update=20to=20Homestead=20^?= =?UTF-8?q?5=20and=20use=20per=20project=20&=20make=20command=20for=20conf?= =?UTF-8?q?ig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This utilizes the Homestead features where you can specify a default `Homestead.yaml.example` file that is used to build the actual `Homestead.yaml` file when a user runs `./vendor/bin/homestead make`. This is essentially a dist type file. Also adds `aliases` and `after.sh` files from Homestead to further customize and add some handy aliases into the VM. --- Homestead.yaml.example | 15 +++ after.sh | 5 + aliases | 208 +++++++++++++++++++++++++++++++++++++++++ composer.json | 2 +- composer.lock | 179 ++++++++++++++++++----------------- readme.md | 34 ++----- 6 files changed, 327 insertions(+), 116 deletions(-) create mode 100644 Homestead.yaml.example create mode 100644 after.sh create mode 100644 aliases diff --git a/Homestead.yaml.example b/Homestead.yaml.example new file mode 100644 index 0000000..6708e9f --- /dev/null +++ b/Homestead.yaml.example @@ -0,0 +1,15 @@ +ip: 192.168.10.30 +memory: 2048 +cpus: 1 +provider: virtualbox +authorize: ~/.ssh/id_rsa.pub +keys: + - ~/.ssh/id_rsa +folders: + - { map: ~/PhpstormProjects/pastebin, to: /home/vagrant/pastebin } +sites: + - { map: pastebin.app, to: /home/vagrant/pastebin/public } +databases: + - homestead +name: pastebin +hostname: pastebin \ No newline at end of file diff --git a/after.sh b/after.sh new file mode 100644 index 0000000..85402e8 --- /dev/null +++ b/after.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# If you would like to do some extra provisioning you may +# add any commands you wish to this file and they will +# be run after the Homestead machine is provisioned. diff --git a/aliases b/aliases new file mode 100644 index 0000000..7bc879e --- /dev/null +++ b/aliases @@ -0,0 +1,208 @@ +alias ..="cd .." +alias ...="cd ../.." + +alias h='cd ~' +alias c='clear' +alias art=artisan + +alias phpspec='vendor/bin/phpspec' +alias phpunit='vendor/bin/phpunit' +alias serve=serve-laravel + +alias xoff='sudo phpdismod -s cli xdebug' +alias xon='sudo phpenmod -s cli xdebug' + +function artisan() { + php artisan "$@" +} + +function dusk() { + pids=$(pidof /usr/bin/Xvfb) + + if [ ! -n "$pids" ]; then + Xvfb :0 -screen 0 1280x960x24 & + fi + + php artisan dusk "$@" +} + +function serve-apache() { + if [[ "$1" && "$2" ]] + then + sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-apache.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-apache.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve-apache domain path" + fi +} + +function serve-laravel() { + if [[ "$1" && "$2" ]] + then + sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-laravel.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-laravel.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve domain path" + fi +} + +function serve-proxy() { + if [[ "$1" && "$2" ]] + then + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-proxy.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-proxy.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve-proxy domain port" + fi +} + +function serve-silverstripe() { + if [[ "$1" && "$2" ]] + then + sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-silverstripe.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-silverstripe.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve-silverstripe domain path" + fi +} + +function serve-spa() { + if [[ "$1" && "$2" ]] + then + sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-spa.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-spa.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve-spa domain path" + fi +} + +function serve-statamic() { + if [[ "$1" && "$2" ]] + then + sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-statamic.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-statamic.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve-statamic domain path" + fi +} + +function serve-symfony2() { + if [[ "$1" && "$2" ]] + then + sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" + sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-symfony2.sh + sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-symfony2.sh "$1" "$2" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " serve-symfony2 domain path" + fi +} + +function share() { + if [[ "$1" ]] + then + ngrok http ${@:2} -host-header="$1" 80 + else + echo "Error: missing required parameters." + echo "Usage: " + echo " share domain" + echo "Invocation with extra params passed directly to ngrok" + echo " share domain -region=eu -subdomain=test1234" + fi +} + +function flip() { + sudo bash /vagrant/vendor/laravel/homestead/scripts/flip-webserver.sh +} + +function __has_pv() { + $(hash pv 2>/dev/null); + + return $? +} + +function __pv_install_message() { + if ! __has_pv; then + echo $1 + echo "Install pv with \`sudo apt-get install -y pv\` then run this command again." + echo "" + fi +} + +function dbexport() { + FILE=${1:-/vagrant/mysqldump.sql.gz} + + # This gives an estimate of the size of the SQL file + # It appears that 80% is a good approximation of + # the ratio of estimated size to actual size + SIZE_QUERY="select ceil(sum(data_length) * 0.8) as size from information_schema.TABLES" + + __pv_install_message "Want to see export progress?" + + echo "Exporting databases to '$FILE'" + + if __has_pv; then + ADJUSTED_SIZE=$(mysql --vertical -uhomestead -psecret -e "$SIZE_QUERY" 2>/dev/null | grep 'size' | awk '{print $2}') + HUMAN_READABLE_SIZE=$(numfmt --to=iec-i --suffix=B --format="%.3f" $ADJUSTED_SIZE) + + echo "Estimated uncompressed size: $HUMAN_READABLE_SIZE" + mysqldump -uhomestead -psecret --all-databases --skip-lock-tables 2>/dev/null | pv --size=$ADJUSTED_SIZE | gzip > "$FILE" + else + mysqldump -uhomestead -psecret --all-databases --skip-lock-tables 2>/dev/null | gzip > "$FILE" + fi + + echo "Done." +} + +function dbimport() { + FILE=${1:-/vagrant/mysqldump.sql.gz} + + __pv_install_message "Want to see import progress?" + + echo "Importing databases from '$FILE'" + + if __has_pv; then + pv "$FILE" --progress --eta | zcat | mysql -uhomestead -psecret 2>/dev/null + else + cat "$FILE" | zcat | mysql -uhomestead -psecret 2>/dev/null + fi + + echo "Done." +} + +function xphp() { + (php -m | grep -q xdebug) + if [[ $? -eq 0 ]] + then + XDEBUG_ENABLED=true + else + XDEBUG_ENABLED=false + fi + + if ! $XDEBUG_ENABLED; then xon; fi + + php \ + -dxdebug.remote_host=192.168.10.1 \ + -dxdebug.remote_autostart=1 \ + "$@" + + if ! $XDEBUG_ENABLED; then xoff; fi +} diff --git a/composer.json b/composer.json index a71b40c..fd8b0a4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require-dev": { "codeclimate/php-test-reporter": "^0.4.4", "fzaninotto/faker": "^1.6", - "laravel/homestead": "^5.0", + "laravel/homestead": "^5", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~5.7" }, diff --git a/composer.lock b/composer.lock index 82ee5e7..ab384be 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "6cecf0ad3c30db753062555a93f874a3", - "content-hash": "b786fd4ee314898d84fb5deb7320ebd5", + "content-hash": "9c9ac49b268a6cff516e87433cdfc683", "packages": [ { "name": "bugsnag/bugsnag", @@ -62,7 +61,7 @@ "logging", "tracking" ], - "time": "2016-09-05 15:23:22" + "time": "2016-09-05T15:23:22+00:00" }, { "name": "bugsnag/bugsnag-laravel", @@ -121,7 +120,7 @@ "logging", "tracking" ], - "time": "2016-09-08 08:33:45" + "time": "2016-09-08T08:33:45+00:00" }, { "name": "bugsnag/bugsnag-psr-logger", @@ -179,7 +178,7 @@ "psr", "tracking" ], - "time": "2016-08-09 08:02:38" + "time": "2016-08-09T08:02:38+00:00" }, { "name": "composer/ca-bundle", @@ -237,7 +236,7 @@ "ssl", "tls" ], - "time": "2016-11-02 18:11:27" + "time": "2016-11-02T18:11:27+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -270,7 +269,7 @@ "MIT" ], "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24 07:27:01" + "time": "2014-10-24T07:27:01+00:00" }, { "name": "doctrine/inflector", @@ -337,7 +336,7 @@ "singularize", "string" ], - "time": "2015-11-06 14:35:42" + "time": "2015-11-06T14:35:42+00:00" }, { "name": "erusev/parsedown", @@ -379,7 +378,7 @@ "markdown", "parser" ], - "time": "2016-11-02 15:56:58" + "time": "2016-11-02T15:56:58+00:00" }, { "name": "guzzlehttp/guzzle", @@ -441,7 +440,7 @@ "rest", "web service" ], - "time": "2016-10-08 15:01:37" + "time": "2016-10-08T15:01:37+00:00" }, { "name": "guzzlehttp/promises", @@ -492,7 +491,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20 10:07:11" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", @@ -550,7 +549,7 @@ "stream", "uri" ], - "time": "2016-06-24 23:00:38" + "time": "2016-06-24T23:00:38+00:00" }, { "name": "hashids/hashids", @@ -613,7 +612,7 @@ "obfuscate", "youtube" ], - "time": "2017-01-01 13:33:33" + "time": "2017-01-01T13:33:33+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -656,7 +655,7 @@ "homepage": "http://www.acci.cz" } ], - "time": "2014-04-08 15:00:19" + "time": "2014-04-08T15:00:19+00:00" }, { "name": "jakub-onderka/php-console-highlighter", @@ -700,7 +699,7 @@ "homepage": "http://www.acci.cz/" } ], - "time": "2015-04-20 18:58:01" + "time": "2015-04-20T18:58:01+00:00" }, { "name": "laravel/framework", @@ -829,7 +828,7 @@ "framework", "laravel" ], - "time": "2017-02-03 19:47:35" + "time": "2017-02-03T19:47:35+00:00" }, { "name": "laravel/tinker", @@ -887,7 +886,7 @@ "laravel", "psysh" ], - "time": "2016-12-30 18:13:17" + "time": "2016-12-30T18:13:17+00:00" }, { "name": "laravelcollective/html", @@ -941,7 +940,7 @@ ], "description": "HTML and Form Builders for the Laravel Framework", "homepage": "http://laravelcollective.com", - "time": "2017-01-26 19:27:05" + "time": "2017-01-26T19:27:05+00:00" }, { "name": "league/flysystem", @@ -1024,7 +1023,7 @@ "sftp", "storage" ], - "time": "2017-01-30 17:41:17" + "time": "2017-01-30T17:41:17+00:00" }, { "name": "monolog/monolog", @@ -1102,7 +1101,7 @@ "logging", "psr-3" ], - "time": "2016-11-26 00:15:39" + "time": "2016-11-26T00:15:39+00:00" }, { "name": "mtdowling/cron-expression", @@ -1146,7 +1145,7 @@ "cron", "schedule" ], - "time": "2017-01-23 04:29:33" + "time": "2017-01-23T04:29:33+00:00" }, { "name": "nesbot/carbon", @@ -1199,7 +1198,7 @@ "datetime", "time" ], - "time": "2017-01-16 07:55:07" + "time": "2017-01-16T07:55:07+00:00" }, { "name": "nikic/php-parser", @@ -1250,7 +1249,7 @@ "parser", "php" ], - "time": "2017-02-03 21:57:31" + "time": "2017-02-03T21:57:31+00:00" }, { "name": "paragonie/random_compat", @@ -1298,7 +1297,7 @@ "pseudorandom", "random" ], - "time": "2016-11-07 23:38:38" + "time": "2016-11-07T23:38:38+00:00" }, { "name": "psr/http-message", @@ -1348,7 +1347,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -1395,7 +1394,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "psy/psysh", @@ -1468,7 +1467,7 @@ "interactive", "shell" ], - "time": "2017-01-15 17:54:13" + "time": "2017-01-15T17:54:13+00:00" }, { "name": "ramsey/uuid", @@ -1550,7 +1549,7 @@ "identifier", "uuid" ], - "time": "2016-11-22 19:21:44" + "time": "2016-11-22T19:21:44+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -1604,7 +1603,7 @@ "mail", "mailer" ], - "time": "2016-12-29 10:02:40" + "time": "2016-12-29T10:02:40+00:00" }, { "name": "symfony/console", @@ -1667,7 +1666,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-01-08 20:47:33" + "time": "2017-01-08T20:47:33+00:00" }, { "name": "symfony/css-selector", @@ -1720,7 +1719,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/debug", @@ -1777,7 +1776,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/event-dispatcher", @@ -1837,7 +1836,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/finder", @@ -1886,7 +1885,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/http-foundation", @@ -1939,7 +1938,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-01-08 20:47:33" + "time": "2017-01-08T20:47:33+00:00" }, { "name": "symfony/http-kernel", @@ -2021,7 +2020,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-01-12 21:36:33" + "time": "2017-01-12T21:36:33+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2080,7 +2079,7 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2016-11-14T01:06:16+00:00" }, { "name": "symfony/process", @@ -2129,7 +2128,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/routing", @@ -2204,7 +2203,7 @@ "uri", "url" ], - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/translation", @@ -2268,7 +2267,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/var-dumper", @@ -2331,7 +2330,7 @@ "debug", "dump" ], - "time": "2017-01-03 08:53:57" + "time": "2017-01-03T08:53:57+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -2378,7 +2377,7 @@ ], "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", - "time": "2016-09-20 12:50:39" + "time": "2016-09-20T12:50:39+00:00" }, { "name": "vlucas/phpdotenv", @@ -2428,7 +2427,7 @@ "env", "environment" ], - "time": "2016-09-01 10:05:43" + "time": "2016-09-01T10:05:43+00:00" } ], "packages-dev": [ @@ -2489,7 +2488,7 @@ "codeclimate", "coverage" ], - "time": "2017-02-15 22:25:47" + "time": "2017-02-15T22:25:47+00:00" }, { "name": "doctrine/instantiator", @@ -2543,7 +2542,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "fzaninotto/faker", @@ -2591,7 +2590,7 @@ "faker", "fixtures" ], - "time": "2016-04-29 12:21:54" + "time": "2016-04-29T12:21:54+00:00" }, { "name": "guzzle/guzzle", @@ -2684,7 +2683,7 @@ "web service" ], "abandoned": "guzzlehttp/guzzle", - "time": "2014-01-28 22:29:15" + "time": "2014-01-28T22:29:15+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -2729,20 +2728,20 @@ "keywords": [ "test" ], - "time": "2015-05-11 14:41:42" + "time": "2015-05-11T14:41:42+00:00" }, { "name": "laravel/homestead", - "version": "v5.0.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/laravel/homestead.git", - "reference": "af6ba5202e8c3e1f377fd748cbe7a7d8c1ba4d22" + "reference": "f54a9f0b6a0de85c96d5e82fd94a563d979f8288" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/homestead/zipball/af6ba5202e8c3e1f377fd748cbe7a7d8c1ba4d22", - "reference": "af6ba5202e8c3e1f377fd748cbe7a7d8c1ba4d22", + "url": "https://api.github.com/repos/laravel/homestead/zipball/f54a9f0b6a0de85c96d5e82fd94a563d979f8288", + "reference": "f54a9f0b6a0de85c96d5e82fd94a563d979f8288", "shasum": "" }, "require": { @@ -2779,19 +2778,19 @@ } ], "description": "A virtual machine for web artisans.", - "time": "2017-02-28 13:26:35" + "time": "2017-06-09T13:53:37+00:00" }, { "name": "mockery/mockery", "version": "0.9.7", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", + "url": "https://github.com/mockery/mockery.git", "reference": "4de7969f4664da3cef1ccd83866c9f59378c3371" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4de7969f4664da3cef1ccd83866c9f59378c3371", + "url": "https://api.github.com/repos/mockery/mockery/zipball/4de7969f4664da3cef1ccd83866c9f59378c3371", "reference": "4de7969f4664da3cef1ccd83866c9f59378c3371", "shasum": "" }, @@ -2844,7 +2843,7 @@ "test double", "testing" ], - "time": "2016-12-19 14:50:55" + "time": "2016-12-19T14:50:55+00:00" }, { "name": "myclabs/deep-copy", @@ -2886,19 +2885,19 @@ "object", "object graph" ], - "time": "2017-01-26 22:05:40" + "time": "2017-01-26T22:05:40+00:00" }, { "name": "padraic/humbug_get_contents", "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/padraic/file_get_contents.git", + "url": "https://github.com/humbug/file_get_contents.git", "reference": "66797199019d0cb4529cb8d29c6f0b4c5085b53a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/file_get_contents/zipball/66797199019d0cb4529cb8d29c6f0b4c5085b53a", + "url": "https://api.github.com/repos/humbug/file_get_contents/zipball/66797199019d0cb4529cb8d29c6f0b4c5085b53a", "reference": "66797199019d0cb4529cb8d29c6f0b4c5085b53a", "shasum": "" }, @@ -2943,19 +2942,19 @@ "ssl", "tls" ], - "time": "2015-04-22 18:45:00" + "time": "2015-04-22T18:45:00+00:00" }, { "name": "padraic/phar-updater", "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/padraic/phar-updater.git", + "url": "https://github.com/humbug/phar-updater.git", "reference": "c17eeb3887dc4269d1b4837dc875d39e9f8149a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/phar-updater/zipball/c17eeb3887dc4269d1b4837dc875d39e9f8149a8", + "url": "https://api.github.com/repos/humbug/phar-updater/zipball/c17eeb3887dc4269d1b4837dc875d39e9f8149a8", "reference": "c17eeb3887dc4269d1b4837dc875d39e9f8149a8", "shasum": "" }, @@ -2995,7 +2994,7 @@ "self-update", "update" ], - "time": "2016-01-05 23:08:01" + "time": "2016-01-05T23:08:01+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -3049,7 +3048,7 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -3094,7 +3093,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30 07:12:33" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -3141,7 +3140,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25 06:54:22" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpspec/prophecy", @@ -3204,7 +3203,7 @@ "spy", "stub" ], - "time": "2016-11-21 14:58:47" + "time": "2016-11-21T14:58:47+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3267,7 +3266,7 @@ "testing", "xunit" ], - "time": "2017-01-20 15:06:43" + "time": "2017-01-20T15:06:43+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3314,7 +3313,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -3355,7 +3354,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -3399,7 +3398,7 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2016-05-12T18:03:57+00:00" }, { "name": "phpunit/php-token-stream", @@ -3448,7 +3447,7 @@ "keywords": [ "tokenizer" ], - "time": "2016-11-15 14:06:22" + "time": "2016-11-15T14:06:22+00:00" }, { "name": "phpunit/phpunit", @@ -3530,7 +3529,7 @@ "testing", "xunit" ], - "time": "2017-02-04 09:03:53" + "time": "2017-02-04T09:03:53+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -3589,7 +3588,7 @@ "mock", "xunit" ], - "time": "2016-12-08 20:27:08" + "time": "2016-12-08T20:27:08+00:00" }, { "name": "satooshi/php-coveralls", @@ -3647,7 +3646,7 @@ "github", "test" ], - "time": "2016-01-20 17:35:46" + "time": "2016-01-20T17:35:46+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -3692,7 +3691,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13 06:45:14" + "time": "2016-02-13T06:45:14+00:00" }, { "name": "sebastian/comparator", @@ -3756,7 +3755,7 @@ "compare", "equality" ], - "time": "2017-01-29 09:50:25" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -3808,7 +3807,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", @@ -3858,7 +3857,7 @@ "environment", "hhvm" ], - "time": "2016-11-26 07:53:53" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", @@ -3925,7 +3924,7 @@ "export", "exporter" ], - "time": "2016-11-19 08:54:04" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -3976,7 +3975,7 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -4022,7 +4021,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-11-19 07:35:10" + "time": "2016-11-19T07:35:10+00:00" }, { "name": "sebastian/recursion-context", @@ -4075,7 +4074,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19 07:33:16" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -4117,7 +4116,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -4160,7 +4159,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/config", @@ -4216,7 +4215,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-02-14 16:27:43" + "time": "2017-02-14T16:27:43+00:00" }, { "name": "symfony/filesystem", @@ -4265,7 +4264,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-01-08 20:47:33" + "time": "2017-01-08T20:47:33+00:00" }, { "name": "symfony/stopwatch", @@ -4314,7 +4313,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:32:22" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/yaml", @@ -4369,7 +4368,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-01-03 13:51:32" + "time": "2017-01-03T13:51:32+00:00" }, { "name": "webmozart/assert", @@ -4419,7 +4418,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], diff --git a/readme.md b/readme.md index 3d65d70..0cebc7e 100644 --- a/readme.md +++ b/readme.md @@ -28,35 +28,19 @@ Please make sure you install the following tools before starting with the instal ## Installation -> Note that you're free to adjust the `~/Sites/pastebin` location to any directory you want on your machine. +> Note that you're free to adjust the `~/Code/pastebin` location that will be in the `Homestead.yaml` to any directory you want on your machine. 1. Clone this repository: `git clone git@github.com:laravelio/pastebin.git pastebin` -2. Add the `Homestead.yaml` file from below to the root of your project +2. Run `./vendor/bin/homestead make` 3. Run `vagrant up` -4. SSH into your Vagrant box, go to `/home/vagrant/pastebin` and run the following commands: +4. SSH into your Vagrant box, go to `/home/vagrant/Code/pastebin` and run the following commands: 1. `composer install` - 2. `php artisan migrate` -5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file - -```yaml -ip: 192.168.10.30 -memory: 2048 -cpus: 1 -provider: virtualbox -authorize: ~/.ssh/id_rsa.pub -keys: - - ~/.ssh/id_rsa -folders: - - { map: ~/Sites/pastebin, to: /home/vagrant/pastebin } -sites: - - { map: pastebin.app, to: /home/vagrant/pastebin/public } -databases: - - homestead -name: pastebin -hostname: pastebin -``` - -You can now visit the app in your browser by visiting [http://pastebin.app/](http://pastebin.app). + 2. `cp .env.example .env` + 3. `php artisan key:generate` + 4. `php artisan migrate` +5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file. (optional) + +You can now visit the app in your browser by visiting [http://pastebin.app/](http://pastebin.app) or [http://localhost:8000/](http://localhost:8000) if you prefer to not edit your hosts file. ## Maintainers From 2888d8ae1c332905f300400678146754f3ec8ee6 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Mon, 26 Jun 2017 08:57:40 -0500 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9C=A8=20=E2=9D=84=EF=B8=8F=20?= =?UTF-8?q?=F0=9F=92=A1=20=F0=9F=93=9A=20Update=20install=20notes,=20rever?= =?UTF-8?q?t=20paths=20to=20Sites,=20Update=20composer=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Homestead.yaml.example | 2 +- composer.json | 8 ++------ readme.md | 10 ++++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Homestead.yaml.example b/Homestead.yaml.example index 6708e9f..1cd4e91 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -6,7 +6,7 @@ authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - - { map: ~/PhpstormProjects/pastebin, to: /home/vagrant/pastebin } + - { map: ~/Sites/pastebin, to: /home/vagrant/pastebin } sites: - { map: pastebin.app, to: /home/vagrant/pastebin/public } databases: diff --git a/composer.json b/composer.json index e66f151..565d00d 100644 --- a/composer.json +++ b/composer.json @@ -34,13 +34,9 @@ } }, "scripts": { - "post-root-package-install": [ - "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "php artisan key:generate" - ], "post-install-cmd": [ + "php -r \"file_exists('.env') || copy('.env.example', '.env');\"", + "php artisan key:generate", "Illuminate\\Foundation\\ComposerScripts::postInstall", "php artisan optimize" ], diff --git a/readme.md b/readme.md index 6df2a2c..4c80111 100644 --- a/readme.md +++ b/readme.md @@ -31,16 +31,14 @@ Please make sure you install the following tools before starting with the instal > Note that you're free to adjust the `~/Code/pastebin` location that will be in the `Homestead.yaml` to any directory you want on your machine. 1. Clone this repository: `git clone git@github.com:laravelio/pastebin.git pastebin` -2. Run `./vendor/bin/homestead make` +2. Run `./vendor/bin/homestead make --no-after` 3. Run `vagrant up` 4. SSH into your Vagrant box, go to `/home/vagrant/Code/pastebin` and run the following commands: 1. `composer install` - 2. `cp .env.example .env` - 3. `php artisan key:generate` - 4. `php artisan migrate` -5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file. (optional) + 3. `php artisan migrate` +5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file. -You can now visit the app in your browser by visiting [http://pastebin.app/](http://pastebin.app) or [http://localhost:8000/](http://localhost:8000) if you prefer to not edit your hosts file. +You can now visit the app in your browser by visiting [http://pastebin.app/](http://pastebin.app). ## Maintainers From 66a4123593f5b2adf7ed0860c8c83955780bcd43 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Sat, 1 Jul 2017 11:33:42 -0500 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9D=84=EF=B8=8F=20=F0=9F=8E=80=20Tweak?= =?UTF-8?q?=20readme=20based=20on=20feedback,=20ignore=20after.sh=20and=20?= =?UTF-8?q?aliases,=20add=20Code=20in=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + Homestead.yaml.example | 4 +- aliases | 208 ----------------------------------------- readme.md | 4 +- 4 files changed, 6 insertions(+), 212 deletions(-) delete mode 100644 aliases diff --git a/.gitignore b/.gitignore index b700e0e..8c15197 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ Homestead.json Homestead.yaml .env +/aliases +/after.sh diff --git a/Homestead.yaml.example b/Homestead.yaml.example index 1cd4e91..df436f5 100644 --- a/Homestead.yaml.example +++ b/Homestead.yaml.example @@ -6,9 +6,9 @@ authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - - { map: ~/Sites/pastebin, to: /home/vagrant/pastebin } + - { map: ~/Sites/pastebin, to: /home/vagrant/Code/pastebin } sites: - - { map: pastebin.app, to: /home/vagrant/pastebin/public } + - { map: pastebin.app, to: /home/vagrant/Code/pastebin/public } databases: - homestead name: pastebin diff --git a/aliases b/aliases deleted file mode 100644 index 7bc879e..0000000 --- a/aliases +++ /dev/null @@ -1,208 +0,0 @@ -alias ..="cd .." -alias ...="cd ../.." - -alias h='cd ~' -alias c='clear' -alias art=artisan - -alias phpspec='vendor/bin/phpspec' -alias phpunit='vendor/bin/phpunit' -alias serve=serve-laravel - -alias xoff='sudo phpdismod -s cli xdebug' -alias xon='sudo phpenmod -s cli xdebug' - -function artisan() { - php artisan "$@" -} - -function dusk() { - pids=$(pidof /usr/bin/Xvfb) - - if [ ! -n "$pids" ]; then - Xvfb :0 -screen 0 1280x960x24 & - fi - - php artisan dusk "$@" -} - -function serve-apache() { - if [[ "$1" && "$2" ]] - then - sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-apache.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-apache.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve-apache domain path" - fi -} - -function serve-laravel() { - if [[ "$1" && "$2" ]] - then - sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-laravel.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-laravel.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve domain path" - fi -} - -function serve-proxy() { - if [[ "$1" && "$2" ]] - then - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-proxy.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-proxy.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve-proxy domain port" - fi -} - -function serve-silverstripe() { - if [[ "$1" && "$2" ]] - then - sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-silverstripe.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-silverstripe.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve-silverstripe domain path" - fi -} - -function serve-spa() { - if [[ "$1" && "$2" ]] - then - sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-spa.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-spa.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve-spa domain path" - fi -} - -function serve-statamic() { - if [[ "$1" && "$2" ]] - then - sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-statamic.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-statamic.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve-statamic domain path" - fi -} - -function serve-symfony2() { - if [[ "$1" && "$2" ]] - then - sudo bash /vagrant/vendor/laravel/homestead/scripts/create-certificate.sh "$1" - sudo dos2unix /vagrant/vendor/laravel/homestead/scripts/serve-symfony2.sh - sudo bash /vagrant/vendor/laravel/homestead/scripts/serve-symfony2.sh "$1" "$2" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " serve-symfony2 domain path" - fi -} - -function share() { - if [[ "$1" ]] - then - ngrok http ${@:2} -host-header="$1" 80 - else - echo "Error: missing required parameters." - echo "Usage: " - echo " share domain" - echo "Invocation with extra params passed directly to ngrok" - echo " share domain -region=eu -subdomain=test1234" - fi -} - -function flip() { - sudo bash /vagrant/vendor/laravel/homestead/scripts/flip-webserver.sh -} - -function __has_pv() { - $(hash pv 2>/dev/null); - - return $? -} - -function __pv_install_message() { - if ! __has_pv; then - echo $1 - echo "Install pv with \`sudo apt-get install -y pv\` then run this command again." - echo "" - fi -} - -function dbexport() { - FILE=${1:-/vagrant/mysqldump.sql.gz} - - # This gives an estimate of the size of the SQL file - # It appears that 80% is a good approximation of - # the ratio of estimated size to actual size - SIZE_QUERY="select ceil(sum(data_length) * 0.8) as size from information_schema.TABLES" - - __pv_install_message "Want to see export progress?" - - echo "Exporting databases to '$FILE'" - - if __has_pv; then - ADJUSTED_SIZE=$(mysql --vertical -uhomestead -psecret -e "$SIZE_QUERY" 2>/dev/null | grep 'size' | awk '{print $2}') - HUMAN_READABLE_SIZE=$(numfmt --to=iec-i --suffix=B --format="%.3f" $ADJUSTED_SIZE) - - echo "Estimated uncompressed size: $HUMAN_READABLE_SIZE" - mysqldump -uhomestead -psecret --all-databases --skip-lock-tables 2>/dev/null | pv --size=$ADJUSTED_SIZE | gzip > "$FILE" - else - mysqldump -uhomestead -psecret --all-databases --skip-lock-tables 2>/dev/null | gzip > "$FILE" - fi - - echo "Done." -} - -function dbimport() { - FILE=${1:-/vagrant/mysqldump.sql.gz} - - __pv_install_message "Want to see import progress?" - - echo "Importing databases from '$FILE'" - - if __has_pv; then - pv "$FILE" --progress --eta | zcat | mysql -uhomestead -psecret 2>/dev/null - else - cat "$FILE" | zcat | mysql -uhomestead -psecret 2>/dev/null - fi - - echo "Done." -} - -function xphp() { - (php -m | grep -q xdebug) - if [[ $? -eq 0 ]] - then - XDEBUG_ENABLED=true - else - XDEBUG_ENABLED=false - fi - - if ! $XDEBUG_ENABLED; then xon; fi - - php \ - -dxdebug.remote_host=192.168.10.1 \ - -dxdebug.remote_autostart=1 \ - "$@" - - if ! $XDEBUG_ENABLED; then xoff; fi -} diff --git a/readme.md b/readme.md index 4c80111..c396c1c 100644 --- a/readme.md +++ b/readme.md @@ -35,8 +35,8 @@ Please make sure you install the following tools before starting with the instal 3. Run `vagrant up` 4. SSH into your Vagrant box, go to `/home/vagrant/Code/pastebin` and run the following commands: 1. `composer install` - 3. `php artisan migrate` -5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file. + 2. `php artisan migrate` +5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file You can now visit the app in your browser by visiting [http://pastebin.app/](http://pastebin.app). From d76a9735a45ef1f7499c96b08020a4a491d7d173 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Sat, 1 Jul 2017 11:36:03 -0500 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9D=84=EF=B8=8F=20=F0=9F=8E=80=20Remove?= =?UTF-8?q?=20key:generate=20from=20post=20install=20script,=20update=20ke?= =?UTF-8?q?y:generate=20in=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 1 - readme.md | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 565d00d..27618a2 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,6 @@ "scripts": { "post-install-cmd": [ "php -r \"file_exists('.env') || copy('.env.example', '.env');\"", - "php artisan key:generate", "Illuminate\\Foundation\\ComposerScripts::postInstall", "php artisan optimize" ], diff --git a/readme.md b/readme.md index c396c1c..d8051a2 100644 --- a/readme.md +++ b/readme.md @@ -35,7 +35,8 @@ Please make sure you install the following tools before starting with the instal 3. Run `vagrant up` 4. SSH into your Vagrant box, go to `/home/vagrant/Code/pastebin` and run the following commands: 1. `composer install` - 2. `php artisan migrate` + 2. `php artisan key:generate` + 3. `php artisan migrate` 5. Add `192.168.10.30 pastebin.app` to your computer's `/etc/hosts` file You can now visit the app in your browser by visiting [http://pastebin.app/](http://pastebin.app).