PHP code example of sarhanm / sms-survey

1. Go to this page and download the library: Download sarhanm/sms-survey library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sarhanm / sms-survey example snippets



if(!defined('SARHAN_SURVEY'))
    die("Improper use of file!");

return array(
    "test" => array(
        'driver' => 'pdo_sqlite',
        'memory' => true)
    ,
    "production" => array(
        'driver' => 'pdo_mysql',
        'dbname'=>'your_dbname',
        'user'=>'your_dbuser',
        'password'=>'you_dbpasswd',
        'host'=>'your_dbhost'
    )
);

    define('SURVEY_DB_CONFIG_PATH', 'path/to/db/config/survey-db-config.php');
    



//Order does matter. 
//Do the equire_once("survey-sms/src/request/TwilioRequestHandler.php");
session_start();

$twilioRequest = new \sarhan\survey\TwilioRequestHandler();

$twilioAccountAuthToken = "myTwilioAuthToken";

$response = $twilioRequest->handleRequest($twilioAccountAuthToken);

if(!is_null($response))
{
    header($response->getHeader());
    echo $response->getContent();
}
else
{
    echo "Invalid Twilio Request";
}
bash
php composer.phar install
bash    
php vendor/bin/phpunit tests/
bash
php vendor/bin/doctrine orm:schema-tool:create  --dump-sql
bash
php vendor/bin/doctrine orm:schema-tool:create