-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '8.x' into rename-catalog-info-20240923
- Loading branch information
Showing
18 changed files
with
527 additions
and
229 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
.idea | ||
.DS_Store | ||
docs/Badge.confluence | ||
|
||
.envrc |
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
namespace Drupal\search_api_pantheon\Commands; | ||
|
||
use Drupal\Core\Logger\LoggerChannelFactoryInterface; | ||
use Drupal\Core\Logger\LoggerChannelTrait; | ||
use Drupal\search_api_pantheon\Services\PantheonGuzzle; | ||
use Drupal\search_api_pantheon\Services\SchemaPoster; | ||
use Drush\Commands\DrushCommands; | ||
|
||
/** | ||
* Drush Search Api Pantheon Schema Commands. | ||
*/ | ||
class Reload extends DrushCommands { | ||
use LoggerChannelTrait; | ||
|
||
/** | ||
* Configured pantheon-solr-specific guzzle client. | ||
* | ||
* @var \Drupal\search_api_pantheon\Services\PantheonGuzzle | ||
*/ | ||
private PantheonGuzzle $pantheonGuzzle; | ||
|
||
/** | ||
* Configured pantheon-solr-specific schema poster class. | ||
* | ||
* @var \Drupal\search_api_pantheon\Services\SchemaPoster | ||
*/ | ||
private SchemaPoster $schemaPoster; | ||
|
||
/** | ||
* Class constructor. | ||
* | ||
* @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $loggerChannelFactory | ||
* Injected by container. | ||
* @param \Drupal\search_api_pantheon\Services\PantheonGuzzle $pantheonGuzzle | ||
* Injected by container. | ||
* @param \Drupal\search_api_pantheon\Services\SchemaPoster $schemaPoster | ||
* Injected by Container. | ||
*/ | ||
public function __construct( | ||
LoggerChannelFactoryInterface $loggerChannelFactory, | ||
PantheonGuzzle $pantheonGuzzle, | ||
SchemaPoster $schemaPoster | ||
) { | ||
$this->logger = $loggerChannelFactory->get('SearchAPIPantheon Drush'); | ||
$this->pantheonGuzzle = $pantheonGuzzle; | ||
$this->schemaPoster = $schemaPoster; | ||
} | ||
|
||
/** | ||
* Search_api_pantheon:reloadSchema. | ||
* | ||
* @usage search-api-pantheon:reloadSchema | ||
* Reload the latest schema | ||
* | ||
* @command search-api-pantheon:reloadSchema | ||
*/ | ||
public function reloadSchema() { | ||
try { | ||
$this->schemaPoster->reloadServer(); | ||
} | ||
catch (\Exception $e) { | ||
$this->logger->error((string) $e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.