diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
commit | 8fabf77b2a7720a357c63817c07035a9908818a0 (patch) | |
tree | d689fcac1403e2473010fe80bc337599a78c21a4 /Neutron-trunk/count-code.php | |
parent | 7b4af63a90a726b98a59b83e53f040a7a566a11d (diff) | |
download | electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.gz electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.bz2 electrode-8fabf77b2a7720a357c63817c07035a9908818a0.zip |
Update
Diffstat (limited to 'Neutron-trunk/count-code.php')
-rw-r--r-- | Neutron-trunk/count-code.php | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Neutron-trunk/count-code.php b/Neutron-trunk/count-code.php deleted file mode 100644 index 21a5c82..0000000 --- a/Neutron-trunk/count-code.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -$cwd = getcwd(); -$found = 0; -$size = 0; - -function crawl(string $dir) { - global $found; - global $size; - echo("(DIR) " . $dir . "\n"); - $files = scandir($dir); - foreach ($files as $file) { - if (is_dir($dir . "/" . $file)) { - if ($file == "." || $file == ".." || $file == ".git") {} else { - crawl($dir . "/" . $file); - } - } else { - if (is_link($dir . "/" . $file)) {} else { - echo("(DOC) " . $dir . "/" . $file . "\n"); - $size = $size + filesize($dir . "/" . $file); - $found = $found + count(file($dir . "/" . $file)); - } - } - } - return $found; -} - -if (PHP_SAPI === 'cli') -{ - echo("Couting lines..."); - crawl($cwd); - echo("\nDONE!\n\nTotal code is " . $found . " lines long."); - echo("({$size} bytes)"); -} |