PHP code example of placetopay / app-version

1. Go to this page and download the library: Download placetopay/app-version 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/ */

    

placetopay / app-version example snippets


return [
    'sentry' => [
        /*
        * The sentry auth token used to authenticate with Sentry Api
        * Create tokens here at account level https://sentry.io/settings/account/api/auth-tokens/
        * Or here at organization level https://sentry.io/settings/your-organization/developer-settings/
        */
        'auth_token' => env('APP_VERSION_SENTRY_AUTH'),
        
        /*
        * The organization name this project belongs to, you can find out the
        * organization at https://sentry.io/settings/
        */
        'organization' => env('APP_VERSION_SENTRY_ORGANIZATION', 'placetopay'),
        
        /*
        * The repository name of this project. Repositories are added in sentry as integrations.
        * You must add your (Github|Bitbucket) integration at https://sentry.io/settings/your-organization/integrations/
        * and then add the repositories you want to track commits
        */
        'repository' => env('APP_VERSION_SENTRY_REPOSITORY'),
        
        /*
        * The name of this project in Sentry Dashboard
        * You can find out the project name at https://sentry.io/settings/your-organization/projects/
        */
        'project' => env('APP_VERSION_SENTRY_PROJECT'),
    ],
    'newrelic' => [
        /*
        * The NewRelic Rest API Key, you can found it on the following URL when you are logged in
        * https://rpm.newrelic.com/api/explore/application_deployments/create
        */
        'api_key' => env('APP_VERSION_NEWRELIC_API_KEY'),
        
        /*
        * The NewRelic application id, you can get it from the URL in the APM
        */
        'application_id' => env('APP_VERSION_NEWRELIC_APPLICATION_ID'),
    ],
    
    /*
    * The current deployed version, will be read from version file
    * generated by `php artisan app-version:create ...` command
    */
    'version' => \PlacetoPay\AppVersion\VersionFile::readSha(),
    
    /*
     * The value of query param token to be able showed the deployed version.
     */
    'token' => env('APP_VERSION_TOKEN', 'delivery'),
];

return [
    'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),

    // capture release as git sha
    'release' => \PlacetoPay\AppVersion\VersionFile::readSha(),

    'breadcrumbs' => [
        // Capture Laravel logs in breadcrumbs
        'logs' => true,

        // Capture SQL queries in breadcrumbs
        'sql_queries' => true,

        // Capture bindings on SQL queries logged in breadcrumbs
        'sql_bindings' => true,

        // Capture queue job information in breadcrumbs
        'queue_info' => true,
    ],

];
 
config('app-version.version.sha'); 
 
PlacetoPay\AppVersion\VersionFile::readSha()
bash
 php artisan vendor:publish --provider="PlacetoPay\AppVersion\VersionServiceProvider"
 
shell
cd {{ release }}
php artisan app-version:create --sha={{ sha }} --time={{ time }} --project={{ project }} --branch={{ branch }}
shell
cd {{ release }}
php artisan app-version:create-release
php artisan app-version:create-deploy