+ private function cacheKey( $src, $integrity ) {
+ $key = basename( $src ) . '_' . substr( $integrity, -12 );
+ $key = preg_replace( '/[.\/+?=_-]+/', '_', $key );
+ return rtrim( $key, '_' );
+ }
+
+ /** @return string|false */
+ private function cacheGet( $key ) {
+ return Wikimedia\quietCall( 'file_get_contents', "{$this->cacheDir}/$key.data" );
+ }
+
+ private function cacheSet( $key, $data ) {
+ wfMkdirParents( $this->cacheDir );
+ file_put_contents( "{$this->cacheDir}/$key.data", $data, LOCK_EX );
+ }
+