~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to ext/cppconn/driver/class_stats.php

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
   Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 
4
 
 
5
  The MySQL Connector/C++ is licensed under the terms of the GPLv2
 
6
  <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
 
7
  MySQL Connectors. There are special exceptions to the terms and
 
8
  conditions of the GPLv2 as it is applied to this software, see the
 
9
  FLOSS License Exception
 
10
  <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
 
11
 
 
12
  This program is free software; you can redistribute it and/or modify
 
13
  it under the terms of the GNU General Public License as published
 
14
  by the Free Software Foundation; version 2 of the License.
 
15
 
 
16
  This program is distributed in the hope that it will be useful, but
 
17
  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
18
  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 
19
  for more details.
 
20
 
 
21
  You should have received a copy of the GNU General Public License along
 
22
  with this program; if not, write to the Free Software Foundation, Inc.,
 
23
  51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
24
*/
 
25
 
 
26
$prev_method = "";
 
27
$impl=$not_impl = 0;
 
28
foreach(file("php://stdin") as $v) {
 
29
        if (!preg_match("#(.*?cpp):/\* +{{{ (.*?)::(.*?) +\-(I|U)\-#", $v, $matches)) {
 
30
                continue;
 
31
        }
 
32
        $class = $matches[2];
 
33
        $method = $matches[3];
 
34
        $implemented = ($matches[4] == "I");
 
35
        if ($prev_method != $method) {
 
36
                $method_inc = 1;
 
37
                $prev_method = $method;
 
38
        } else {
 
39
                $method_inc++;
 
40
        }
 
41
        if (!isset($stats[$class][$method])) {
 
42
                $stats[$class][$method] = $implemented;
 
43
        } else {
 
44
                $stats[$class][$method."_".$method_inc] = $implemented;
 
45
        }
 
46
}
 
47
ksort($stats);
 
48
foreach ($stats as $class => $methods) {
 
49
        printf("-----------\n");
 
50
        ksort($methods);
 
51
        $local_impl=$local_notimpl=0;
 
52
        foreach ($methods as $method => $status) {
 
53
                if (1) {
 
54
                        printf(" %s::%-55s %-30s\n", $class,$method, $status? "Implemented":"Not implemented");
 
55
                }
 
56
                if ($status) {
 
57
                        $impl++;
 
58
                        $local_impl++;
 
59
                } else {
 
60
                        $not_impl++;
 
61
                        $local_notimpl++;
 
62
                }
 
63
        }
 
64
        printf("-----------\n%-30s Total=%-3d  Implemented=%-3d  Not Implemented=%-3d Impl=%-3d%%\n",
 
65
                        $class,$local_impl+$local_notimpl, $local_impl, $local_notimpl, 100*$local_impl/($local_impl+$local_notimpl));
 
66
}
 
67
 
 
68
printf("Total=%3d  Implemented=%3d  Not implemented=%3d\n", $not_impl+$impl, $impl, $not_impl);
 
69
?>