| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
namespace MediaWiki\ResourceLoader; |
| 22 |
|
| 23 |
use InvalidArgumentException; |
| 24 |
use MediaWiki\Config\Config; |
| 25 |
use MediaWiki\Html\Html; |
| 26 |
use MediaWiki\Html\HtmlJsCode; |
| 27 |
use MediaWiki\MainConfigNames; |
| 28 |
use MediaWiki\Registration\ExtensionRegistry; |
| 29 |
use RuntimeException; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
class CodexModule extends FileModule { |
| 41 |
protected const CODEX_DEFAULT_LIBRARY_DIR = 'resources/lib/codex'; |
| 42 |
private const CODEX_MODULE_DEPENDENCIES = [ 'vue' ]; |
| 43 |
|
| 44 |
|
| 45 |
private static ?array $themeMap = null; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
private static array $codexFilesCache = []; |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
private array $codexComponents = []; |
| 69 |
|
| 70 |
private bool $isStyleOnly = false; |
| 71 |
private bool $isScriptOnly = false; |
| 72 |
private bool $codexFullLibrary = false; |
| 73 |
private bool $setupComplete = false; |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
public function __construct( array $options = [], $localBasePath = null, $remoteBasePath = null ) { |
| 85 |
if ( isset( $options[ 'codexComponents' ] ) ) { |
| 86 |
if ( !is_array( $options[ 'codexComponents' ] ) || count( $options[ 'codexComponents' ] ) === 0 ) { |
| 87 |
throw new InvalidArgumentException( |
| 88 |
"All 'codexComponents' properties in your module definition file " . |
| 89 |
'must either be omitted or be an array with at least one component name' |
| 90 |
); |
| 91 |
} |
| 92 |
|
| 93 |
$this->codexComponents = $options[ 'codexComponents' ]; |
| 94 |
} |
| 95 |
|
| 96 |
if ( isset( $options['codexFullLibrary'] ) ) { |
| 97 |
if ( isset( $options[ 'codexComponents' ] ) ) { |
| 98 |
throw new InvalidArgumentException( |
| 99 |
'ResourceLoader modules using the CodexModule class cannot ' . |
| 100 |
"use both 'codexFullLibrary' and 'codexComponents' options. " . |
| 101 |
"Instead, use 'codexFullLibrary' to load the entire library" . |
| 102 |
"or 'codexComponents' to load a subset of components." |
| 103 |
); |
| 104 |
} |
| 105 |
|
| 106 |
$this->codexFullLibrary = $options[ 'codexFullLibrary' ]; |
| 107 |
} |
| 108 |
|
| 109 |
if ( isset( $options[ 'codexStyleOnly' ] ) ) { |
| 110 |
$this->isStyleOnly = $options[ 'codexStyleOnly' ]; |
| 111 |
} |
| 112 |
|
| 113 |
if ( isset( $options[ 'codexScriptOnly' ] ) ) { |
| 114 |
$this->isScriptOnly = $options[ 'codexScriptOnly' ]; |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
$options[ 'dependencies' ] = (array)( $options[ 'dependencies' ] ?? [] ); |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
if ( !$this->isStyleOnly && count( $this->codexComponents ) > 0 ) { |
| 125 |
$options[ 'dependencies' ] = array_unique( array_merge( |
| 126 |
$options[ 'dependencies' ], |
| 127 |
self::CODEX_MODULE_DEPENDENCIES |
| 128 |
) ); |
| 129 |
} |
| 130 |
|
| 131 |
if ( in_array( '@wikimedia/codex', $options[ 'dependencies' ] ) ) { |
| 132 |
throw new InvalidArgumentException( |
| 133 |
'ResourceLoader modules using the CodexModule class cannot ' . |
| 134 |
"list the '@wikimedia/codex' module as a dependency. " . |
| 135 |
"Instead, use 'codexComponents' to require a subset of components." |
| 136 |
); |
| 137 |
} |
| 138 |
|
| 139 |
parent::__construct( $options, $localBasePath, $remoteBasePath ); |
| 140 |
} |
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
public static function getIcons( Context $context, Config $config, array $iconNames = [] ): array { |
| 164 |
static $cachedIcons = null; |
| 165 |
static $cachedIconFilePath = null; |
| 166 |
|
| 167 |
$iconFile = self::getIconFilePath( $config ); |
| 168 |
if ( $cachedIcons === null || $cachedIconFilePath !== $iconFile ) { |
| 169 |
$cachedIcons = json_decode( file_get_contents( $iconFile ), true ); |
| 170 |
$cachedIconFilePath = $iconFile; |
| 171 |
} |
| 172 |
|
| 173 |
return array_intersect_key( $cachedIcons, array_flip( $iconNames ) ); |
| 174 |
} |
| 175 |
|
| 176 |
private static function getIconFilePath( Config $config ) { |
| 177 |
$devDir = $config->get( MainConfigNames::CodexDevelopmentDir ); |
| 178 |
$iconsDir = $devDir !== null ? |
| 179 |
"$devDir/packages/codex-icons/dist" : |
| 180 |
MW_INSTALL_PATH . '/resources/lib/codex-icons'; |
| 181 |
return "$iconsDir/codex-icons.json"; |
| 182 |
} |
| 183 |
|
| 184 |
public function getMessages() { |
| 185 |
$messages = parent::getMessages(); |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
if ( $this->codexFullLibrary || ( !$this->isStyleOnly && count( $this->codexComponents ) > 0 ) ) { |
| 190 |
$messageKeyFilePath = $this->makeFilePath( 'messageKeys.json' )->getLocalPath(); |
| 191 |
$messageKeys = json_decode( file_get_contents( $messageKeyFilePath ), true ); |
| 192 |
$messages = array_merge( $messages, $messageKeys ); |
| 193 |
} |
| 194 |
|
| 195 |
return $messages; |
| 196 |
} |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
public function getPackageFiles( Context $context ) { |
| 202 |
$this->setupCodex( $context ); |
| 203 |
return parent::getPackageFiles( $context ); |
| 204 |
} |
| 205 |
|
| 206 |
public function getStyleFiles( Context $context ) { |
| 207 |
$this->setupCodex( $context ); |
| 208 |
return parent::getStyleFiles( $context ); |
| 209 |
} |
| 210 |
|
| 211 |
protected function processStyle( $style, $styleLang, $path, Context $context ) { |
| 212 |
$pathAsString = $path instanceof FilePath ? $path->getLocalPath() : $path; |
| 213 |
if ( str_starts_with( $pathAsString, $this->getCodexDirectory() ) ) { |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
return $style; |
| 221 |
} |
| 222 |
|
| 223 |
return parent::processStyle( $style, $styleLang, $path, $context ); |
| 224 |
} |
| 225 |
|
| 226 |
public function getDefinitionSummary( Context $context ) { |
| 227 |
$this->setupCodex( $context ); |
| 228 |
return parent::getDefinitionSummary( $context ); |
| 229 |
} |
| 230 |
|
| 231 |
public function supportsURLLoading() { |
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
return false; |
| 238 |
} |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
private function getTheme( Context $context ): string { |
| 247 |
if ( self::$themeMap === null ) { |
| 248 |
|
| 249 |
$skinCodexThemes = ExtensionRegistry::getInstance()->getAttribute( 'SkinCodexThemes' ); |
| 250 |
self::$themeMap = [ 'default' => 'wikimedia-ui' ] + $skinCodexThemes; |
| 251 |
} |
| 252 |
|
| 253 |
return self::$themeMap[ $context->getSkin() ] ?? self::$themeMap[ 'default' ]; |
| 254 |
} |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
private function makeFilePath( string $file ): FilePath { |
| 265 |
$remoteBasePath = $this->getConfig()->get( MainConfigNames::ResourceBasePath ); |
| 266 |
$devDir = $this->getConfig()->get( MainConfigNames::CodexDevelopmentDir ); |
| 267 |
if ( $devDir === null ) { |
| 268 |
$filePath = new FilePath( |
| 269 |
static::CODEX_DEFAULT_LIBRARY_DIR . '/' . $file, |
| 270 |
MW_INSTALL_PATH, |
| 271 |
$remoteBasePath |
| 272 |
); |
| 273 |
if ( !file_exists( $filePath->getLocalPath() ) ) { |
| 274 |
throw new RuntimeException( "Could not find Codex file `{$filePath->getLocalPath()}`" ); |
| 275 |
} |
| 276 |
return $filePath; |
| 277 |
} |
| 278 |
|
| 279 |
$modulesDir = $devDir . '/packages/codex/dist/modules'; |
| 280 |
if ( !file_exists( $modulesDir ) ) { |
| 281 |
throw new RuntimeException( |
| 282 |
"Could not find Codex development build, `$modulesDir` does not exist. " . |
| 283 |
"You may need to run `npm run build-all` in the `$devDir` directory, " . |
| 284 |
"or disable Codex development mode by setting \$wgCodexDevelopmentDir = null;" |
| 285 |
); |
| 286 |
} |
| 287 |
$path = $devDir . '/packages/codex/dist/' . $file; |
| 288 |
if ( !file_exists( $path ) ) { |
| 289 |
throw new RuntimeException( |
| 290 |
"Could not find Codex file `$path`. " . |
| 291 |
"You may need to run `npm run build-all` in the `$devDir` directory, " . |
| 292 |
"or you may be using a version of Codex that is too old for this version of MediaWiki." |
| 293 |
); |
| 294 |
} |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
return new class ( $path, '' ) extends FilePath { |
| 300 |
public function getLocalPath(): string { |
| 301 |
return $this->getPath(); |
| 302 |
} |
| 303 |
}; |
| 304 |
} |
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
private function getCodexDirectory() { |
| 315 |
|
| 316 |
return $this->makeFilePath( '' )->getLocalPath(); |
| 317 |
} |
| 318 |
|
| 319 |
private function isDevelopmentMode() { |
| 320 |
return $this->getConfig()->get( MainConfigNames::CodexDevelopmentDir ) !== null; |
| 321 |
} |
| 322 |
|
| 323 |
private function getDevelopmentWarning() { |
| 324 |
return $this->isDevelopmentMode() ? |
| 325 |
Html::encodeJsCall( 'mw.log.warn', [ |
| 326 |
"You are using a local development version of Codex, which may not match the latest version. " . |
| 327 |
"To disable this, set \$wgCodexDevelopmentDir = null;" |
| 328 |
] ) : |
| 329 |
''; |
| 330 |
} |
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
private function getManifestFilePath( Context $context ): string { |
| 339 |
$themeManifestNames = [ |
| 340 |
'wikimedia-ui' => [ |
| 341 |
'ltr' => 'manifest.json', |
| 342 |
'rtl' => 'manifest-rtl.json', |
| 343 |
], |
| 344 |
'wikimedia-ui-legacy' => [ |
| 345 |
'ltr' => 'manifest.json', |
| 346 |
'rtl' => 'manifest-rtl.json', |
| 347 |
], |
| 348 |
'experimental' => [ |
| 349 |
'ltr' => 'manifest.json', |
| 350 |
'rtl' => 'manifest-rtl.json', |
| 351 |
] |
| 352 |
]; |
| 353 |
|
| 354 |
$theme = $this->getTheme( $context ); |
| 355 |
$direction = $context->getDirection(); |
| 356 |
if ( !isset( $themeManifestNames[ $theme ] ) ) { |
| 357 |
throw new InvalidArgumentException( "Unknown Codex theme $theme" ); |
| 358 |
} |
| 359 |
$manifestFile = $themeManifestNames[ $theme ][ $direction ]; |
| 360 |
$manifestFilePath = $this->makeFilePath( "modules/$manifestFile" ); |
| 361 |
return $manifestFilePath->getLocalPath(); |
| 362 |
} |
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
private function getCodexFiles( Context $context ): array { |
| 392 |
$manifestFilePath = $this->getManifestFilePath( $context ); |
| 393 |
|
| 394 |
if ( isset( self::$codexFilesCache[ $manifestFilePath ] ) ) { |
| 395 |
return self::$codexFilesCache[ $manifestFilePath ]; |
| 396 |
} |
| 397 |
|
| 398 |
$manifest = json_decode( file_get_contents( $manifestFilePath ), true ); |
| 399 |
$files = []; |
| 400 |
$components = []; |
| 401 |
foreach ( $manifest as $key => $val ) { |
| 402 |
$files[ $val[ 'file' ] ] = [ |
| 403 |
'styles' => $val[ 'css' ] ?? [], |
| 404 |
|
| 405 |
'dependencies' => array_map( static function ( $manifestKey ) use ( $manifest ) { |
| 406 |
|
| 407 |
return $manifest[ $manifestKey ][ 'file' ]; |
| 408 |
}, $val[ 'imports' ] ?? [] ) |
| 409 |
]; |
| 410 |
|
| 411 |
$isComponent = isset( $val[ 'isEntry' ] ) && $val[ 'isEntry' ]; |
| 412 |
if ( $isComponent ) { |
| 413 |
$fileInfo = pathinfo( $val[ 'file' ] ); |
| 414 |
|
| 415 |
|
| 416 |
$components[ $fileInfo[ 'filename' ] ] = $val[ 'file' ]; |
| 417 |
} |
| 418 |
} |
| 419 |
|
| 420 |
self::$codexFilesCache[ $manifestFilePath ] = [ 'files' => $files, 'components' => $components ]; |
| 421 |
return self::$codexFilesCache[ $manifestFilePath ]; |
| 422 |
} |
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
private function setupCodex( Context $context ) { |
| 446 |
if ( $this->setupComplete ) { |
| 447 |
return; |
| 448 |
} |
| 449 |
|
| 450 |
|
| 451 |
if ( count( $this->codexComponents ) > 0 ) { |
| 452 |
$this->addComponentFiles( $context ); |
| 453 |
} |
| 454 |
|
| 455 |
|
| 456 |
if ( $this->codexFullLibrary ) { |
| 457 |
$this->loadFullCodexLibrary( $context ); |
| 458 |
|
| 459 |
} |
| 460 |
|
| 461 |
$this->setupComplete = true; |
| 462 |
} |
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
private function resolveDependencies( array $requestedFiles, array $codexFiles ) { |
| 479 |
$scripts = []; |
| 480 |
$styles = []; |
| 481 |
|
| 482 |
$gatherDependencies = static function ( $file ) use ( &$scripts, &$styles, $codexFiles, &$gatherDependencies ) { |
| 483 |
foreach ( $codexFiles[ 'files' ][ $file ][ 'dependencies' ] as $dep ) { |
| 484 |
if ( !in_array( $dep, $scripts ) ) { |
| 485 |
$gatherDependencies( $dep ); |
| 486 |
} |
| 487 |
} |
| 488 |
$scripts[] = $file; |
| 489 |
$styles = array_merge( $styles, $codexFiles[ 'files' ][ $file ][ 'styles' ] ); |
| 490 |
}; |
| 491 |
|
| 492 |
foreach ( $requestedFiles as $requestedFile ) { |
| 493 |
$gatherDependencies( $requestedFile ); |
| 494 |
} |
| 495 |
|
| 496 |
return [ 'scripts' => $scripts, 'styles' => $styles ]; |
| 497 |
} |
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
private function addComponentFiles( Context $context ) { |
| 507 |
$codexFiles = $this->getCodexFiles( $context ); |
| 508 |
|
| 509 |
$requestedFiles = array_map( static function ( $component ) use ( $codexFiles ) { |
| 510 |
if ( !isset( $codexFiles[ 'components' ][ $component ] ) ) { |
| 511 |
throw new InvalidArgumentException( |
| 512 |
"\"$component\" is not an export of Codex and cannot be included in the \"codexComponents\" array." |
| 513 |
); |
| 514 |
} |
| 515 |
return $codexFiles[ 'components' ][ $component ]; |
| 516 |
}, $this->codexComponents ); |
| 517 |
|
| 518 |
[ 'scripts' => $scripts, 'styles' => $styles ] = $this->resolveDependencies( $requestedFiles, $codexFiles ); |
| 519 |
|
| 520 |
|
| 521 |
if ( !$this->isScriptOnly ) { |
| 522 |
foreach ( $styles as $fileName ) { |
| 523 |
$this->styles[] = $this->makeFilePath( "modules/$fileName" ); |
| 524 |
} |
| 525 |
} |
| 526 |
|
| 527 |
|
| 528 |
if ( !$this->isStyleOnly ) { |
| 529 |
|
| 530 |
$exports = []; |
| 531 |
foreach ( $this->codexComponents as $component ) { |
| 532 |
$componentFile = $codexFiles[ 'components' ][ $component ]; |
| 533 |
$exports[ $component ] = new HtmlJsCode( |
| 534 |
'require( ' . Html::encodeJsVar( "./_codex/$componentFile" ) . ' )' |
| 535 |
); |
| 536 |
} |
| 537 |
|
| 538 |
$syntheticExports = Html::encodeJsVar( HtmlJsCode::encodeObject( $exports ) ); |
| 539 |
|
| 540 |
|
| 541 |
$devWarning = $this->getDevelopmentWarning(); |
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
$proxiedSyntheticExports = <<<JAVASCRIPT |
| 546 |
module.exports = new Proxy( $syntheticExports, { |
| 547 |
get( target, prop ) { |
| 548 |
if ( !( prop in target ) ) { |
| 549 |
throw new Error( |
| 550 |
`Codex component "\${prop}" ` + |
| 551 |
'is not listed in the "codexComponents" array ' + |
| 552 |
'of the "{$this->getName()}" module in your module definition file' |
| 553 |
); |
| 554 |
} |
| 555 |
return target[ prop ]; |
| 556 |
} |
| 557 |
} ); |
| 558 |
$devWarning |
| 559 |
JAVASCRIPT; |
| 560 |
|
| 561 |
$this->packageFiles[] = [ |
| 562 |
'name' => 'codex.js', |
| 563 |
'content' => $proxiedSyntheticExports |
| 564 |
]; |
| 565 |
|
| 566 |
|
| 567 |
foreach ( $scripts as $fileName ) { |
| 568 |
$this->packageFiles[] = [ |
| 569 |
'name' => "_codex/$fileName", |
| 570 |
'file' => $this->makeFilePath( "modules/$fileName" ) |
| 571 |
]; |
| 572 |
} |
| 573 |
} |
| 574 |
} |
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
|
| 581 |
private function loadFullCodexLibrary( Context $context ) { |
| 582 |
|
| 583 |
if ( !$this->isStyleOnly ) { |
| 584 |
$jsFilePath = $this->makeFilePath( 'codex.umd.cjs' ); |
| 585 |
|
| 586 |
|
| 587 |
$devWarning = $this->getDevelopmentWarning(); |
| 588 |
if ( $devWarning ) { |
| 589 |
$this->packageFiles[] = [ |
| 590 |
'name' => 'codex.js', |
| 591 |
'callback' => static function () use ( $jsFilePath, $devWarning ) { |
| 592 |
return $devWarning . ';' . file_get_contents( $jsFilePath->getLocalPath() ); |
| 593 |
}, |
| 594 |
'versionCallback' => static function () use ( $jsFilePath ) { |
| 595 |
return $jsFilePath; |
| 596 |
} |
| 597 |
]; |
| 598 |
} else { |
| 599 |
$this->packageFiles[] = [ |
| 600 |
'name' => 'codex.js', |
| 601 |
'file' => $jsFilePath |
| 602 |
]; |
| 603 |
} |
| 604 |
} |
| 605 |
|
| 606 |
|
| 607 |
if ( !$this->isScriptOnly ) { |
| 608 |
|
| 609 |
$themeStyles = [ |
| 610 |
'wikimedia-ui' => [ |
| 611 |
'ltr' => 'codex.style.css', |
| 612 |
'rtl' => 'codex.style-rtl.css' |
| 613 |
], |
| 614 |
'wikimedia-ui-legacy' => [ |
| 615 |
'ltr' => 'codex.style.css', |
| 616 |
'rtl' => 'codex.style-rtl.css' |
| 617 |
], |
| 618 |
'experimental' => [ |
| 619 |
'ltr' => 'codex.style.css', |
| 620 |
'rtl' => 'codex.style-rtl.css' |
| 621 |
] |
| 622 |
]; |
| 623 |
|
| 624 |
$theme = $this->getTheme( $context ); |
| 625 |
$direction = $context->getDirection(); |
| 626 |
$styleFile = $themeStyles[ $theme ][ $direction ]; |
| 627 |
$this->styles[] = $this->makeFilePath( $styleFile ); |
| 628 |
} |
| 629 |
} |
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
public function getType(): string { |
| 635 |
return $this->isStyleOnly ? self::LOAD_STYLES : self::LOAD_GENERAL; |
| 636 |
} |
| 637 |
} |