Skip to content

Commit

Permalink
Issue #15 - first pass routines to analyse current situation
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Mar 10, 2018
1 parent f7a5bac commit 1f74de1
Show file tree
Hide file tree
Showing 10 changed files with 3,002 additions and 0 deletions.
1 change: 1 addition & 0 deletions converter/.~lock.estimate.ods#
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Herb Miller,QW/Herb,qw,09.03.2018 14:28,file:///C:/Users/Herb/AppData/Roaming/OpenOffice/4;
40 changes: 40 additions & 0 deletions converter/class-component-counter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* @copyright (C) Bobbing Wide 2018
* @package oik-block
*/

class component_counter {


public $components;

public function __construct() {
$this->components = array();
$this->components['plugins'] = array();
$this->components['themes'] = array();
}

public function add( $component, $type ) {
if ( !isset( $this->components[ $type ][ $component ] ) ) {
$this->components[ $type ][ $component ] = 0;
}
$this->components[ $type ][ $component ] += 1;
}

public function report() {
//print_r( $this->components );
echo "Type,Component,Count" . PHP_EOL;
$components = 0;
foreach ( $this->components as $type => $data ) {
foreach ( $data as $component => $count ) {
echo "$type,$component,$count" . PHP_EOL;
$total += $count;
$components++;
}
}
echo "Totals,$components,$total" . PHP_EOL;
}

}

0 comments on commit 1f74de1

Please sign in to comment.