Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
66.67% covered (warning)
66.67%
2 / 3
0.00% covered (danger)
0.00%
0 / 1
CRAP
n/a
0 / 0
Ably\ably_autoloader
66.67% covered (warning)
66.67%
2 / 3
0.00% covered (danger)
0.00%
0 / 1
2.15
1<?php
2/**
3 * This is an autoloader for Ably classes for cases when you do not wish to use composer
4 */
5
6namespace Ably;
7
8function ably_autoloader( $class ) {
9    if ( strpos( $class, 'Ably\\' ) !== 0 ) { // attempt auto-loading only classes from the Ably namespace
10        return;
11    }
12    require_once ( __DIR__ . '/src/' . str_replace( '\\', '/', substr( $class, 5 ) ) . '.php' );
13}
14
15spl_autoload_register( '\Ably\ably_autoloader', true, true );