MediaWiki  master
ExtensionRegistry.php
Go to the documentation of this file.
1 <?php
2 
3 use Composer\Semver\Semver;
6 use Wikimedia\ScopedCallback;
7 
18 
22  public const MEDIAWIKI_CORE = 'MediaWiki';
23 
28  public const MANIFEST_VERSION = 2;
29 
34  public const MANIFEST_VERSION_MW_VERSION = '>= 1.29.0';
35 
39  public const OLDEST_MANIFEST_VERSION = 1;
40 
44  private const CACHE_VERSION = 7;
45 
46  private const CACHE_EXPIRY = 60 * 60 * 24;
47 
53  public const MERGE_STRATEGY = '_merge_strategy';
54 
58  private const LAZY_LOADED_ATTRIBUTES = [
59  'TrackingCategories',
60  'QUnitTestModules',
61  'SkinLessImportPaths',
62  ];
63 
75  private $loaded = [];
76 
82  protected $queued = [];
83 
89  private $finished = false;
90 
97  protected $attributes = [];
98 
104  protected $testAttributes = [];
105 
111  protected $lazyAttributes = [];
112 
118  protected $checkDev = false;
119 
125  protected $loadTestClassesAndNamespaces = false;
126 
130  private static $instance;
131 
136  public static function getInstance() {
137  if ( self::$instance === null ) {
138  self::$instance = new self();
139  }
140 
141  return self::$instance;
142  }
143 
148  public function setCheckDevRequires( $check ) {
149  $this->checkDev = $check;
150  }
151 
159  public function setLoadTestClassesAndNamespaces( $load ) {
160  $this->loadTestClassesAndNamespaces = $load;
161  }
162 
166  public function queue( $path ) {
167  global $wgExtensionInfoMTime;
168 
169  $mtime = $wgExtensionInfoMTime;
170  if ( $mtime === false ) {
171  // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
172  $mtime = @filemtime( $path );
173  // @codeCoverageIgnoreStart
174  if ( $mtime === false ) {
175  $err = error_get_last();
176  throw new Exception( "Unable to open file $path: {$err['message']}" );
177  // @codeCoverageIgnoreEnd
178  }
179  }
180  $this->queued[$path] = $mtime;
181  }
182 
183  private function getCache(): BagOStuff {
184  // Can't call MediaWikiServices here, as we must not cause services
185  // to be instantiated before extensions have loaded.
187  }
188 
189  private function makeCacheKey( BagOStuff $cache, $component, ...$extra ) {
190  // Everything we vary the cache on
191  $vary = [
192  'registration' => self::CACHE_VERSION,
193  'mediawiki' => MW_VERSION,
194  'abilities' => $this->getAbilities(),
195  'checkDev' => $this->checkDev,
196  'queue' => $this->queued,
197  ];
198 
199  // Allow reusing cached ExtensionRegistry metadata between wikis (T274648)
200  return $cache->makeGlobalKey(
201  "registration-$component",
202  // We vary the cache on the current queue (what will be or already was loaded)
203  // plus various versions of stuff for VersionChecker
204  md5( json_encode( $vary ) ),
205  ...$extra
206  );
207  }
208 
213  public function loadFromQueue() {
214  if ( !$this->queued ) {
215  return;
216  }
217 
218  if ( $this->finished ) {
219  throw new MWException(
220  "The following paths tried to load late: "
221  . implode( ', ', array_keys( $this->queued ) )
222  );
223  }
224 
225  $cache = $this->getCache();
226  // See if this queue is in APC
227  $key = $this->makeCacheKey( $cache, 'main' );
228  $data = $cache->get( $key );
229  if ( !$data ) {
230  $data = $this->readFromQueue( $this->queued );
231  $this->saveToCache( $cache, $data );
232  }
233  $this->exportExtractedData( $data );
234  }
235 
242  protected function saveToCache( BagOStuff $cache, array $data ) {
243  global $wgDevelopmentWarnings;
244  if ( $data['warnings'] && $wgDevelopmentWarnings ) {
245  // If warnings were shown, don't cache it
246  return;
247  }
248  $lazy = [];
249  // Cache lazy-loaded attributes separately
250  foreach ( self::LAZY_LOADED_ATTRIBUTES as $attrib ) {
251  if ( isset( $data['attributes'][$attrib] ) ) {
252  $lazy[$attrib] = $data['attributes'][$attrib];
253  unset( $data['attributes'][$attrib] );
254  }
255  }
256  $mainKey = $this->makeCacheKey( $cache, 'main' );
257  $cache->set( $mainKey, $data, self::CACHE_EXPIRY );
258  foreach ( $lazy as $attrib => $value ) {
259  $cache->set(
260  $this->makeCacheKey( $cache, 'lazy-attrib', $attrib ),
261  $value,
262  self::CACHE_EXPIRY
263  );
264  }
265  }
266 
273  public function getQueue() {
274  return $this->queued;
275  }
276 
281  public function clearQueue() {
282  $this->queued = [];
283  }
284 
290  public function finish() {
291  $this->finished = true;
292  }
293 
298  private function getAbilities() {
299  return [
300  'shell' => !Shell::isDisabled(),
301  ];
302  }
303 
309  private function buildVersionChecker() {
310  // array to optionally specify more verbose error messages for
311  // missing abilities
312  $abilityErrors = [
313  'shell' => ( new ShellDisabledError() )->getMessage(),
314  ];
315 
316  return new VersionChecker(
317  MW_VERSION,
318  PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION,
319  get_loaded_extensions(),
320  $this->getAbilities(),
321  $abilityErrors
322  );
323  }
324 
333  public function readFromQueue( array $queue ) {
334  $autoloadClasses = [];
335  $autoloadNamespaces = [];
336  $autoloaderPaths = [];
337  $processor = new ExtensionProcessor();
338  $versionChecker = $this->buildVersionChecker();
339  $extDependencies = [];
340  $warnings = false;
341  foreach ( $queue as $path => $mtime ) {
342  $json = file_get_contents( $path );
343  if ( $json === false ) {
344  throw new Exception( "Unable to read $path, does it exist?" );
345  }
346  $info = json_decode( $json, /* $assoc = */ true );
347  if ( !is_array( $info ) ) {
348  throw new Exception( "$path is not a valid JSON file." );
349  }
350 
351  if ( !isset( $info['manifest_version'] ) ) {
353  "{$info['name']}'s extension.json or skin.json does not have manifest_version, " .
354  'this is deprecated since MediaWiki 1.29',
355  '1.29', false, false
356  );
357  $warnings = true;
358  // For backwards-compatibility, assume a version of 1
359  $info['manifest_version'] = 1;
360  }
361  $version = $info['manifest_version'];
362  if ( $version < self::OLDEST_MANIFEST_VERSION || $version > self::MANIFEST_VERSION ) {
363  throw new Exception( "$path: unsupported manifest_version: {$version}" );
364  }
365 
366  $dir = dirname( $path );
368  $dir,
369  $info,
370  $autoloadClasses,
371  $autoloadNamespaces
372  );
373 
374  if ( $this->loadTestClassesAndNamespaces ) {
376  $dir,
377  $info,
378  $autoloadClasses,
379  $autoloadNamespaces
380  );
381  }
382 
383  // get all requirements/dependencies for this extension
384  $requires = $processor->getRequirements( $info, $this->checkDev );
385 
386  // validate the information needed and add the requirements
387  if ( is_array( $requires ) && $requires && isset( $info['name'] ) ) {
388  $extDependencies[$info['name']] = $requires;
389  }
390 
391  // Get extra paths for later inclusion
392  $autoloaderPaths = array_merge( $autoloaderPaths,
393  $processor->getExtraAutoloaderPaths( $dir, $info ) );
394  // Compatible, read and extract info
395  $processor->extractInfo( $path, $info, $version );
396  }
397  $data = $processor->getExtractedInfo();
398  $data['warnings'] = $warnings;
399 
400  // check for incompatible extensions
401  $incompatible = $versionChecker
402  ->setLoadedExtensionsAndSkins( $data['credits'] )
403  ->checkArray( $extDependencies );
404 
405  if ( $incompatible ) {
406  throw new ExtensionDependencyError( $incompatible );
407  }
408 
409  // FIXME: It was a design mistake to handle autoloading separately (T240535)
410  $data['globals']['wgAutoloadClasses'] = $autoloadClasses;
411  $data['autoloaderPaths'] = $autoloaderPaths;
412  $data['autoloaderNS'] = $autoloadNamespaces;
413  return $data;
414  }
415 
424  public static function exportAutoloadClassesAndNamespaces(
425  $dir, $info, &$autoloadClasses = [], &$autoloadNamespaces = []
426  ) {
427  if ( isset( $info['AutoloadClasses'] ) ) {
428  $autoload = self::processAutoLoader( $dir, $info['AutoloadClasses'] );
429  // @phan-suppress-next-line PhanUndeclaredVariableAssignOp
430  $GLOBALS['wgAutoloadClasses'] += $autoload;
431  $autoloadClasses += $autoload;
432  }
433  if ( isset( $info['AutoloadNamespaces'] ) ) {
434  $autoloadNamespaces += self::processAutoLoader( $dir, $info['AutoloadNamespaces'] );
435  AutoLoader::$psr4Namespaces += $autoloadNamespaces;
436  }
437  }
438 
449  $dir, $info, &$autoloadClasses = [], &$autoloadNamespaces = []
450  ) {
451  if ( isset( $info['TestAutoloadClasses'] ) ) {
452  $autoload = self::processAutoLoader( $dir, $info['TestAutoloadClasses'] );
453  $GLOBALS['wgAutoloadClasses'] += $autoload;
454  $autoloadClasses += $autoload;
455  }
456  if ( isset( $info['TestAutoloadNamespaces'] ) ) {
457  $autoloadNamespaces += self::processAutoLoader( $dir, $info['TestAutoloadNamespaces'] );
458  AutoLoader::$psr4Namespaces += $autoloadNamespaces;
459  }
460  }
461 
462  protected function exportExtractedData( array $info ) {
463  foreach ( $info['globals'] as $key => $val ) {
464  // If a merge strategy is set, read it and remove it from the value
465  // so it doesn't accidentally end up getting set.
466  if ( is_array( $val ) && isset( $val[self::MERGE_STRATEGY] ) ) {
467  $mergeStrategy = $val[self::MERGE_STRATEGY];
468  unset( $val[self::MERGE_STRATEGY] );
469  } else {
470  $mergeStrategy = 'array_merge';
471  }
472 
473  if ( $mergeStrategy === 'provide_default' ) {
474  if ( !array_key_exists( $key, $GLOBALS ) ) {
475  $GLOBALS[$key] = $val;
476  }
477  continue;
478  }
479 
480  // Optimistic: If the global is not set, or is an empty array, replace it entirely.
481  // Will be O(1) performance.
482  if ( !array_key_exists( $key, $GLOBALS ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
483  $GLOBALS[$key] = $val;
484  continue;
485  }
486 
487  if ( !is_array( $GLOBALS[$key] ) || !is_array( $val ) ) {
488  // config setting that has already been overridden, don't set it
489  continue;
490  }
491 
492  switch ( $mergeStrategy ) {
493  case 'array_merge_recursive':
494  $GLOBALS[$key] = array_merge_recursive( $GLOBALS[$key], $val );
495  break;
496  case 'array_replace_recursive':
497  $GLOBALS[$key] = array_replace_recursive( $val, $GLOBALS[$key] );
498  break;
499  case 'array_plus_2d':
500  $GLOBALS[$key] = wfArrayPlus2d( $GLOBALS[$key], $val );
501  break;
502  case 'array_plus':
503  $GLOBALS[$key] += $val;
504  break;
505  case 'array_merge':
506  $GLOBALS[$key] = array_merge( $val, $GLOBALS[$key] );
507  break;
508  default:
509  throw new UnexpectedValueException( "Unknown merge strategy '$mergeStrategy'" );
510  }
511  }
512 
513  if ( isset( $info['autoloaderNS'] ) ) {
514  AutoLoader::$psr4Namespaces += $info['autoloaderNS'];
515  }
516 
517  foreach ( $info['defines'] as $name => $val ) {
518  if ( !defined( $name ) ) {
519  define( $name, $val );
520  } elseif ( constant( $name ) !== $val ) {
521  throw new UnexpectedValueException(
522  "$name cannot be re-defined with $val it has already been set with " . constant( $name )
523  );
524  }
525  }
526 
527  foreach ( $info['autoloaderPaths'] as $path ) {
528  if ( file_exists( $path ) ) {
529  require_once $path;
530  }
531  }
532 
533  $this->loaded += $info['credits'];
534  if ( $info['attributes'] ) {
535  if ( !$this->attributes ) {
536  $this->attributes = $info['attributes'];
537  } else {
538  $this->attributes = array_merge_recursive( $this->attributes, $info['attributes'] );
539  }
540  }
541 
542  foreach ( $info['callbacks'] as $name => $cb ) {
543  if ( !is_callable( $cb ) ) {
544  if ( is_array( $cb ) ) {
545  $cb = '[ ' . implode( ', ', $cb ) . ' ]';
546  }
547  throw new UnexpectedValueException( "callback '$cb' is not callable" );
548  }
549  $cb( $info['credits'][$name] );
550  }
551  }
552 
561  public function isLoaded( $name, $constraint = '*' ) {
562  $isLoaded = isset( $this->loaded[$name] );
563  if ( $constraint === '*' || !$isLoaded ) {
564  return $isLoaded;
565  }
566  // if a specific constraint is requested, but no version is set, throw an exception
567  if ( !isset( $this->loaded[$name]['version'] ) ) {
568  $msg = "{$name} does not expose its version, but an extension or a skin"
569  . " requires: {$constraint}.";
570  throw new LogicException( $msg );
571  }
572 
573  return Semver::satisfies( $this->loaded[$name]['version'], $constraint );
574  }
575 
580  public function getAttribute( $name ) {
581  if ( isset( $this->testAttributes[$name] ) ) {
582  return $this->testAttributes[$name];
583  }
584 
585  if ( in_array( $name, self::LAZY_LOADED_ATTRIBUTES, true ) ) {
586  return $this->getLazyLoadedAttribute( $name );
587  }
588 
589  return $this->attributes[$name] ?? [];
590  }
591 
598  protected function getLazyLoadedAttribute( $name ) {
599  if ( isset( $this->testAttributes[$name] ) ) {
600  return $this->testAttributes[$name];
601  }
602 
603  // See if it's in the cache
604  $cache = $this->getCache();
605  $key = $this->makeCacheKey( $cache, 'lazy-attrib', $name );
606  $data = $cache->get( $key );
607  if ( $data !== false ) {
608  return $data;
609  }
610 
611  $paths = [];
612  foreach ( $this->loaded as $info ) {
613  // mtime (array value) doesn't matter here since
614  // we're skipping cache, so use a dummy time
615  $paths[$info['path']] = 1;
616  }
617 
618  $result = $this->readFromQueue( $paths );
619  $data = $result['attributes'][$name] ?? [];
620  $this->saveToCache( $cache, $result );
621 
622  return $data;
623  }
624 
633  public function setAttributeForTest( $name, array $value ) {
634  // @codeCoverageIgnoreStart
635  if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
636  throw new RuntimeException( __METHOD__ . ' can only be used in tests' );
637  }
638  // @codeCoverageIgnoreEnd
639  if ( isset( $this->testAttributes[$name] ) ) {
640  throw new Exception( "The attribute '$name' has already been overridden" );
641  }
642  $this->testAttributes[$name] = $value;
643  return new ScopedCallback( function () use ( $name ) {
644  unset( $this->testAttributes[$name] );
645  } );
646  }
647 
653  public function getAllThings() {
654  return $this->loaded;
655  }
656 
664  protected static function processAutoLoader( $dir, array $files ) {
665  // Make paths absolute, relative to the JSON file
666  foreach ( $files as &$file ) {
667  $file = "$dir/$file";
668  }
669  return $files;
670  }
671 }
ExtensionRegistry\isLoaded
isLoaded( $name, $constraint=' *')
Whether a thing has been loaded.
Definition: ExtensionRegistry.php:561
ExtensionRegistry\setLoadTestClassesAndNamespaces
setLoadTestClassesAndNamespaces( $load)
Controls if classes and namespaces defined under the keys TestAutoloadClasses and TestAutoloadNamespa...
Definition: ExtensionRegistry.php:159
MediaWiki\Shell\Shell
Executes shell commands.
Definition: Shell.php:45
ExtensionRegistry\getQueue
getQueue()
Get the current load queue.
Definition: ExtensionRegistry.php:273
ExtensionRegistry\$finished
bool $finished
Whether we are done loading things.
Definition: ExtensionRegistry.php:89
ExtensionRegistry\MANIFEST_VERSION
const MANIFEST_VERSION
Version of the highest supported manifest version Note: Update MANIFEST_VERSION_MW_VERSION when chang...
Definition: ExtensionRegistry.php:28
ExtensionRegistry\queue
queue( $path)
Definition: ExtensionRegistry.php:166
wfArrayPlus2d
wfArrayPlus2d(array $baseArray, array $newValues)
Merges two (possibly) 2 dimensional arrays into the target array ($baseArray).
Definition: GlobalFunctions.php:2651
ExtensionDependencyError
Copyright (C) 2018 Kunal Mehta legoktm@debian.org
Definition: ExtensionDependencyError.php:25
ExtensionRegistry\exportAutoloadClassesAndNamespaces
static exportAutoloadClassesAndNamespaces( $dir, $info, &$autoloadClasses=[], &$autoloadNamespaces=[])
Export autoload classes and namespaces for a given directory and parsed JSON info file.
Definition: ExtensionRegistry.php:424
ObjectCache\makeLocalServerCache
static makeLocalServerCache()
Create a new BagOStuff instance for local-server caching.
Definition: ObjectCache.php:299
ExtensionRegistry\exportExtractedData
exportExtractedData(array $info)
Definition: ExtensionRegistry.php:462
ExtensionRegistry\makeCacheKey
makeCacheKey(BagOStuff $cache, $component,... $extra)
Definition: ExtensionRegistry.php:189
ExtensionRegistry
ExtensionRegistry class.
Definition: ExtensionRegistry.php:17
MW_VERSION
const MW_VERSION
The running version of MediaWiki.
Definition: Defines.php:36
ExtensionRegistry\$loadTestClassesAndNamespaces
bool $loadTestClassesAndNamespaces
Whether test classes and namespaces should be added to the auto loader.
Definition: ExtensionRegistry.php:125
ExtensionRegistry\getLazyLoadedAttribute
getLazyLoadedAttribute( $name)
Get an attribute value that isn't cached by reading each extension.json file again.
Definition: ExtensionRegistry.php:598
ExtensionRegistry\getAllThings
getAllThings()
Get credits information about all installed extensions and skins.
Definition: ExtensionRegistry.php:653
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
BagOStuff
Class representing a cache/ephemeral data store.
Definition: BagOStuff.php:86
ExtensionRegistry\setCheckDevRequires
setCheckDevRequires( $check)
Definition: ExtensionRegistry.php:148
ExtensionRegistry\exportTestAutoloadClassesAndNamespaces
static exportTestAutoloadClassesAndNamespaces( $dir, $info, &$autoloadClasses=[], &$autoloadNamespaces=[])
Export test autoload classes and namespaces for a given directory and parsed JSON info file.
Definition: ExtensionRegistry.php:448
ExtensionRegistry\getCache
getCache()
Definition: ExtensionRegistry.php:183
ExtensionRegistry\getAbilities
getAbilities()
Get the list of abilities and their values.
Definition: ExtensionRegistry.php:298
ExtensionRegistry\setAttributeForTest
setAttributeForTest( $name, array $value)
Force override the value of an attribute during tests.
Definition: ExtensionRegistry.php:633
ExtensionRegistry\clearQueue
clearQueue()
Clear the current load queue.
Definition: ExtensionRegistry.php:281
ExtensionRegistry\MERGE_STRATEGY
const MERGE_STRATEGY
Special key that defines the merge strategy.
Definition: ExtensionRegistry.php:53
ExtensionRegistry\getInstance
static getInstance()
Definition: ExtensionRegistry.php:136
ExtensionProcessor
Definition: ExtensionProcessor.php:3
ExtensionRegistry\CACHE_VERSION
const CACHE_VERSION
Bump whenever the registration cache needs resetting.
Definition: ExtensionRegistry.php:44
wfDeprecatedMsg
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
Definition: GlobalFunctions.php:1028
MWException
MediaWiki exception.
Definition: MWException.php:29
ExtensionRegistry\$attributes
array $attributes
Items in the JSON file that aren't being set as globals.
Definition: ExtensionRegistry.php:97
ExtensionRegistry\processAutoLoader
static processAutoLoader( $dir, array $files)
Fully expand autoloader paths.
Definition: ExtensionRegistry.php:664
$queue
$queue
Definition: mergeMessageFileList.php:176
ExtensionRegistry\MANIFEST_VERSION_MW_VERSION
const MANIFEST_VERSION_MW_VERSION
MediaWiki version constraint representing what the current highest MANIFEST_VERSION is supported in.
Definition: ExtensionRegistry.php:34
AutoLoader\$psr4Namespaces
static string[] $psr4Namespaces
Definition: AutoLoader.php:39
ExtensionRegistry\finish
finish()
After this is called, no more extensions can be loaded.
Definition: ExtensionRegistry.php:290
ExtensionRegistry\loadFromQueue
loadFromQueue()
Definition: ExtensionRegistry.php:213
ExtensionRegistry\$queued
int[] $queued
List of paths that should be loaded.
Definition: ExtensionRegistry.php:82
ExtensionRegistry\OLDEST_MANIFEST_VERSION
const OLDEST_MANIFEST_VERSION
Version of the oldest supported manifest version.
Definition: ExtensionRegistry.php:39
ExtensionRegistry\MEDIAWIKI_CORE
const MEDIAWIKI_CORE
"requires" key that applies to MediaWiki core
Definition: ExtensionRegistry.php:22
ExtensionRegistry\readFromQueue
readFromQueue(array $queue)
Process a queue of extensions and return their extracted data.
Definition: ExtensionRegistry.php:333
ExtensionRegistry\LAZY_LOADED_ATTRIBUTES
const LAZY_LOADED_ATTRIBUTES
Attributes that should be lazy-loaded.
Definition: ExtensionRegistry.php:58
ExtensionRegistry\$testAttributes
array $testAttributes
Attributes for testing.
Definition: ExtensionRegistry.php:104
$wgDevelopmentWarnings
$wgDevelopmentWarnings
If set to true MediaWiki will throw notices for some possible error conditions and for deprecated fun...
Definition: DefaultSettings.php:7462
MediaWiki\ShellDisabledError
@newable
Definition: ShellDisabledError.php:29
ExtensionRegistry\$loaded
array[] $loaded
Array of loaded things, keyed by name, values are credits information.
Definition: ExtensionRegistry.php:75
VersionChecker
Provides functions to check a set of extensions with dependencies against a set of loaded extensions ...
Definition: VersionChecker.php:32
$cache
$cache
Definition: mcc.php:33
ExtensionRegistry\buildVersionChecker
buildVersionChecker()
Queries information about the software environment and constructs an appropiate version checker.
Definition: ExtensionRegistry.php:309
ExtensionRegistry\$lazyAttributes
array $lazyAttributes
Lazy-loaded attributes.
Definition: ExtensionRegistry.php:111
$path
$path
Definition: NoLocalSettings.php:25
$wgExtensionInfoMTime
int bool $wgExtensionInfoMTime
When loading extensions through the extension registration system, this can be used to invalidate the...
Definition: DefaultSettings.php:3192
ExtensionRegistry\CACHE_EXPIRY
const CACHE_EXPIRY
Definition: ExtensionRegistry.php:46
ExtensionRegistry\getAttribute
getAttribute( $name)
Definition: ExtensionRegistry.php:580
ExtensionRegistry\$checkDev
bool $checkDev
Whether to check dev-requires.
Definition: ExtensionRegistry.php:118
BagOStuff\makeGlobalKey
makeGlobalKey( $collection,... $components)
Make a cache key for the default keyspace and given components.
ExtensionRegistry\$instance
static ExtensionRegistry $instance
Definition: ExtensionRegistry.php:130
ExtensionRegistry\saveToCache
saveToCache(BagOStuff $cache, array $data)
Save data in the cache.
Definition: ExtensionRegistry.php:242