PHP code example of as-cornell / as_webhook_update

1. Go to this page and download the library: Download as-cornell/as_webhook_update 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/ */

    

as-cornell / as_webhook_update example snippets

bash
   # Get the old token value
   drush cget as_webhook_update.settings token

   # Set it via the new form at /admin/config/services/webhook-update
   # Or via drush:
   drush php-eval "
   \$key = \Drupal\key\Entity\Key::create([
     'id' => 'as_webhook_update_token',
     'label' => 'Webhook Update Authorization Token',
     'key_type' => 'authentication',
     'key_provider' => 'config',
     'key_provider_settings' => ['key_value' => 'YOUR_TOKEN_HERE'],
   ]);
   \$key->save();
   "
   
bash
   drush php-eval "\$key = \Drupal::service('key.repository')->getKey('as_webhook_update_token'); echo \$key ? 'Token configured' : 'Token NOT configured';"
   
bash
   drush php-eval "echo get_class(\Drupal::service('as_webhook_update.dispatcher'));"