Updated for coding style

This commit is contained in:
Andrey Savchenko committed 2013-12-05 23:40:42 +02:00
1 parent b7028e1f5a
commit 0ed37d4d92
2 files changed
+18 -9

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
DEALINGS IN THE SOFTWARE.
*/
if( file_exists( __DIR__ . '/vendor/autoload.php' ) )
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) )
require __DIR__ . '/vendor/autoload.php';
Rarst\Laps\Laps::on_load();
+17 -8
View File
@@ -90,10 +90,13 @@ class Laps {
$filter = current_filter();
$priority = key( $wp_filter[$filter] );
$event = wp_parse_args( self::$events[$filter][$priority], array(
$event = wp_parse_args(
self::$events[$filter][$priority],
array(
'action' => 'start',
'category' => null,
) );
)
);
self::$stopwatch->$event['action']( $event['event'], $event['category'] );
@@ -183,9 +186,11 @@ class Laps {
global $timestart, $wpdb;
$mustache = new \Mustache_Engine( array(
$mustache = new \Mustache_Engine(
array(
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
) );
)
);
$events = self::$stopwatch->getSectionEvents( '__root__' );
$start = $timestart * 1000;
@@ -262,15 +267,19 @@ class Laps {
)
);
$wp_admin_bar->add_node( array(
$wp_admin_bar->add_node(
array(
'id' => 'laps',
'title' => sprintf( 'Lap: %ss', round( $total / 1000, 3 ) ),
) );
)
);
$wp_admin_bar->add_node( array(
$wp_admin_bar->add_node(
array(
'id' => 'laps_output',
'parent' => 'laps',
'meta' => array( 'html' => $html ),
) );
)
);
}
}