19 private const CONSTRUCTOR_OPTIONS = [
23 private $newLinks = [];
24 private $existingLinks;
26 private $migrationStage;
29 $options =
new ServiceOptions( self::CONSTRUCTOR_OPTIONS, $config );
30 $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
40 return 'externallinks';
57 private function getExistingLinks() {
58 if ( $this->existingLinks ===
null ) {
59 $this->existingLinks = [];
61 $this->existingLinks[$row->el_to] =
true;
64 return $this->existingLinks;
68 foreach ( $this->newLinks as $link => $unused ) {
74 foreach ( $this->getExistingLinks() as $link => $unused ) {
80 return \array_key_exists( $linkId, $this->getExistingLinks() );
84 return \array_key_exists( $linkId, $this->newLinks );
88 foreach ( LinkFilter::makeIndexes( $linkId ) as $index ) {
89 $params = [
'el_to' => $linkId ];
91 $params[
'el_index'] = implode(
'', $index );
92 $params[
'el_index_60'] = substr( implode(
'', $index ), 0, 60 );
95 $params[
'el_to_domain_index'] = substr( $index[0], 0, 255 );
96 $params[
'el_to_path'] = $index[1];
103 $this->
deleteRow( [
'el_to' => $linkId ] );
114 if ( is_array( $ids ) ) {
117 return iterator_to_array( $ids );
const SCHEMA_COMPAT_WRITE_OLD
const SCHEMA_COMPAT_WRITE_NEW
A class containing constants representing the names of configuration variables.
const ExternalLinksSchemaMigrationStage
Name constant for the ExternalLinksSchemaMigrationStage setting, for use with Config::get()
Interface for configuration instances.