diff --git a/.gitignore b/.gitignore
index fcd8c07..8941c05 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
.env
-config.php
composer.phar
/vendor/
diff --git a/README.md b/README.md
index ae43191..8b51218 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,10 @@ cp .env.example .env
Open `.env` in your favorite text editor and configure the following values.
+On production, to avoid showing errors, you should set the variable `DISPLAY_ERRORS` to
+`0`. For development, it can be set to `1` on development. For more information, read
+[this](https://phpdelusions.net/articles/error_reporting)
+
### Configure account information
Every sample in the demo requires some basic credentials from your Twilio account. Configure these first.
@@ -89,13 +93,12 @@ Check your config values, and follow the links to the demo applications!
## Warning: You may need to update the phpdotenv dependency
-The phpdotenv dependency (for loading configuration information) was recently updated, so you may need to run composer update on your directory if you have downloaded this project in the past. For new installations, this step won't be necessary. The error you will get is:
+The phpdotenv dependency (for loading configuration information) was recently updated, so you may need to run `composer update` on your project if you have downloaded this project in the past. For new installations, this step won't be necessary. The error you will get is:
```
/config-check.php - Uncaught Error: Call to undefined method Dotenv\Dotenv::create()
```
-
## Running the SDK Starter Kit with ngrok
If you are going to connect to this SDK Starter Kit with a mobile app (and you should try it out!), your phone won't be able to access localhost directly. You'll need to create a publicly accessible URL using a tool like [ngrok](https://ngrok.com/) to send HTTP/HTTPS traffic to a server running on your localhost. Use HTTPS to make web connections that retrieve a Twilio access token.
diff --git a/composer.json b/composer.json
index 54baad4..5eb43fb 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
"require": {
- "twilio/sdk": "5.22.0",
- "vlucas/phpdotenv": "dev-master"
+ "twilio/sdk": "6.13.0",
+ "vlucas/phpdotenv": "5.2.0"
}
}
diff --git a/composer.lock b/composer.lock
index 50714d2..3950598 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,36 +1,417 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "0cc1742d0846f4fd1089fd678bf269ef",
+ "content-hash": "966f401005b2b3203497276ae7a8e93c",
"packages": [
+ {
+ "name": "graham-campbell/result-type",
+ "version": "v1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/GrahamCampbell/Result-Type.git",
+ "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb",
+ "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0|^8.0",
+ "phpoption/phpoption": "^1.7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GrahamCampbell\\ResultType\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "graham@alt-three.com"
+ }
+ ],
+ "description": "An Implementation Of The Result Type",
+ "keywords": [
+ "Graham Campbell",
+ "GrahamCampbell",
+ "Result Type",
+ "Result-Type",
+ "result"
+ ],
+ "support": {
+ "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
+ "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-04-13T13:17:36+00:00"
+ },
+ {
+ "name": "phpoption/phpoption",
+ "version": "1.7.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/schmittjoh/php-option.git",
+ "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/994ecccd8f3283ecf5ac33254543eb0ac946d525",
+ "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpOption\\": "src/PhpOption/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Johannes M. Schmitt",
+ "email": "schmittjoh@gmail.com"
+ },
+ {
+ "name": "Graham Campbell",
+ "email": "graham@alt-three.com"
+ }
+ ],
+ "description": "Option Type for PHP",
+ "keywords": [
+ "language",
+ "option",
+ "php",
+ "type"
+ ],
+ "support": {
+ "issues": "https://github.com/schmittjoh/php-option/issues",
+ "source": "https://github.com/schmittjoh/php-option/tree/1.7.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-07-20T17:29:33+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.20.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+ "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.20-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com/",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-10-23T14:02:19+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.20.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
+ "reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.20-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com/",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-10-23T14:02:19+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.20.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
+ "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.20-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com/",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-10-23T14:02:19+00:00"
+ },
{
"name": "twilio/sdk",
- "version": "5.22.0",
+ "version": "6.13.0",
"source": {
"type": "git",
"url": "https://github.com/twilio/twilio-php.git",
- "reference": "9984743a96015258a7fec3a382cd789001278710"
+ "reference": "df14c92ae0c6604ffe88c9880ad78851c42f7b21"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twilio/twilio-php/zipball/9984743a96015258a7fec3a382cd789001278710",
- "reference": "9984743a96015258a7fec3a382cd789001278710",
+ "url": "https://api.github.com/repos/twilio/twilio-php/zipball/df14c92ae0c6604ffe88c9880ad78851c42f7b21",
+ "reference": "df14c92ae0c6604ffe88c9880ad78851c42f7b21",
"shasum": ""
},
"require": {
- "php": ">=5.5.0"
+ "php": ">=7.1.0"
},
"require-dev": {
- "apigen/apigen": "^4.1",
- "phpunit/phpunit": "4.5.*"
+ "guzzlehttp/guzzle": "^6.3 || ^7.0",
+ "phpunit/phpunit": ">=4.5",
+ "theseer/phpdox": "^0.12.0"
+ },
+ "suggest": {
+ "guzzlehttp/guzzle": "An HTTP client to execute the API requests"
},
"type": "library",
"autoload": {
"psr-4": {
- "Twilio\\": "Twilio/"
+ "Twilio\\": "src/Twilio/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -50,32 +431,47 @@
"sms",
"twilio"
],
- "time": "2018-09-21T21:35:30+00:00"
+ "support": {
+ "issues": "https://github.com/twilio/twilio-php/issues",
+ "source": "https://github.com/twilio/twilio-php/tree/6.13.0"
+ },
+ "time": "2020-11-19T00:40:06+00:00"
},
{
"name": "vlucas/phpdotenv",
- "version": "dev-master",
+ "version": "v5.2.0",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
- "reference": "54d599d414f8cf3f6129e287acaf44b610486aa1"
+ "reference": "fba64139db67123c7a57072e5f8d3db10d160b66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/54d599d414f8cf3f6129e287acaf44b610486aa1",
- "reference": "54d599d414f8cf3f6129e287acaf44b610486aa1",
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/fba64139db67123c7a57072e5f8d3db10d160b66",
+ "reference": "fba64139db67123c7a57072e5f8d3db10d160b66",
"shasum": ""
},
"require": {
- "php": ">=5.3.9"
+ "ext-pcre": "*",
+ "graham-campbell/result-type": "^1.0.1",
+ "php": "^7.1.3 || ^8.0",
+ "phpoption/phpoption": "^1.7.4",
+ "symfony/polyfill-ctype": "^1.17",
+ "symfony/polyfill-mbstring": "^1.17",
+ "symfony/polyfill-php80": "^1.17"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.0"
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "ext-filter": "*",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.2 || ^9.0"
+ },
+ "suggest": {
+ "ext-filter": "Required to use the boolean validator."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.5-dev"
+ "dev-master": "5.2-dev"
}
},
"autoload": {
@@ -88,10 +484,15 @@
"BSD-3-Clause"
],
"authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "graham@alt-three.com",
+ "homepage": "https://gjcampbell.co.uk/"
+ },
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
- "homepage": "http://www.vancelucas.com/"
+ "homepage": "https://vancelucas.com/"
}
],
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
@@ -100,17 +501,30 @@
"env",
"environment"
],
- "time": "2018-08-22 19:34:05"
+ "support": {
+ "issues": "https://github.com/vlucas/phpdotenv/issues",
+ "source": "https://github.com/vlucas/phpdotenv/tree/v5.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-09-14T15:57:31+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": {
- "vlucas/phpdotenv": 20
- },
+ "stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
- "platform-dev": []
+ "platform-dev": [],
+ "plugin-api-version": "2.0.0"
}
diff --git a/webroot/.env.example b/webroot/.env.example
index 61512b1..a4ee486 100644
--- a/webroot/.env.example
+++ b/webroot/.env.example
@@ -1,3 +1,6 @@
+# Set it to 0 when running on production. See the README for further explanation
+DISPLAY_ERRORS=0
+
# Required for all uses
TWILIO_ACCOUNT_SID=ACXXXXXXXXXXXXXXXXX
TWILIO_API_KEY=SKXXXXXXXXXXXXXXXXX
diff --git a/webroot/chat/index.html b/webroot/chat/index.html
index 9acc7ba..e03ec33 100755
--- a/webroot/chat/index.html
+++ b/webroot/chat/index.html
@@ -19,8 +19,7 @@
-
-
+