This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
<?php | |
namespace Drupal\rl_migrates\Plugin\migrate\source; | |
use Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity; | |
/** | |
* ContentEntity migration source that accepts multiple bundles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\rl_migrates\Plugin\migrate\source; | |
use Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity; | |
/** | |
* ContentEntity migration source that accepts multiple bundles. | |
* | |
* This is a stop gap measure for: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\xxx\Authentication\Provider; | |
use Drupal\Core\Authentication\AuthenticationProviderInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Drupal\Core\Session\AccountProxyInterface; | |
/** | |
* Allow all authentication provider. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\rl_migrates\Plugin\migrate\process; | |
use Drupal\migrate\MigrateExecutableInterface; | |
use Drupal\migrate\ProcessPluginBase; | |
use Drupal\migrate\Row; | |
use Drupal\migrate\MigrateSkipRowException; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Description: | |
* | |
* Draft process of gaining stuctured address components (street,street2,city,state,zipcode,building) from a unstructured address string. | |
* | |
* Legend: | |
* | |
* Address String - unstructured address string. eg. "123 Main St, Chicago, IL, 60140", "123 Main Street Chicago Illinois 60640-1242", etc.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Utility function either updates/inserts an entity field values; useful for bulk update situations to avoid node-save. | |
* | |
* @param string $entity_type eg. node, taxonomy_term, etc.. | |
* @param string $bundle eg. asset, etc.. | |
* @param string $entity_id | |
* @param string $field field name | |
* @param array $field_values indexed by delta, then an array of components. [0 => ['value' => 'County Name']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Utility get all field values | |
* @param string $entity_type Entity Type eg. (node,taxonomy) | |
* @param string $bundle Bundle (asset) | |
* @param string $field_name Field Name machine_name (field_asset_address) | |
* @param string $column_key $records keyed by column eg. (entity_id) | |
* @param array $columns Field columns eg. (value,uri,address_line1,locality) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$m = \Drupal::service('plugin.manager.migration'); | |
$mi = $m->createInstance('migration_id'); | |
$source = $mi->getSourceConfiguration(); | |
$source['urls'][0] = 'temporary://file.json' | |
$source['data_fetcher_plugin'] = 'file'; | |
$mi->set('source', $source); | |
$exe = new \Drupal\migrate\MigrateExecutable($mi); | |
$mi->setStatus(\Drupal\migrate\Plugin\MigrationInterface::STATUS_IDLE); | |
$result = $exe->import(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$targetMiners = array_values(array_filter(get_declared_classes(), function ($className) { | |
return in_array('App\Contracts\MinerInterface', class_implements($className)); | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import swagger_client as looker | |
# replace with your custom Looker API Host domain and port, if applicable. | |
base_url = 'https://your.looker.instance:19999/api/3.0/' | |
client_id = 'your-API3-client-id' | |
client_secret = 'your-API3-client-secret' | |
unauthenticated_client = looker.ApiClient(configuration=None) | |
unauthenticated_authApi = looker.ApiAuthApi(unauthenticated_client) | |
token = unauthenticated_authApi.login(client_id=client_id, client_secret=client_secret) | |
client = looker.ApiClient(base_url, 'Authorization', 'token ' + token.access_token) |
NewerOlder