Closed mmattel closed 5 years ago
Some of the orpans at /core/scripts/responses/
are covered by PR: https://github.com/owncloud/docs/pull/789
Update
I did an extension of the script to match which output from above was used in the old documentation. This means we know that those files were valid as they have been used and we know in which directory to look at in old docs. To reduce output of multiple occurrences I only print the directory. It is now relatively easy to identify valid old doc files for the particular script and see if it needs a change in this documention.
Note: I only check for a filename match, not restricted to a manual.
Extended code (appended to the code above)
$old_docs = "../old_doc";
$exclude_path_components = "[examples|\_old\_shared\_assets|\_shared\_assets|\.git]"; # regex
echo "\n";
echo "grep for found matches in: $old_docs" . "\n";
foreach($lost_link as $path) {
$to_print = "";
# get only the filename for grep
$file_name = \basename($path);
$cmd = "grep -rl " . "'" . "$file_name" . "' " . $old_docs ;
$subject = \trim(\shell_exec($cmd)); # string
if (!empty($subject)) {
$line = \explode("\n", $subject);
# there can be more than one match
foreach($line as $item) {
$path_parts = \pathinfo($item);
$path_found = $path_parts['dirname'];
# exclude specific paths
if(!\preg_match($exclude_path_components, $path_found)) {
$to_print = $to_print . "$path_found" . "\n";
}
}
}
# output only if there is a result found
if (!empty($to_print)) {
$to_print = "\n" . "$path" . "\n" . $to_print;
# remove double occurences
$double = \explode("\n", $to_print);
$double = \array_unique($double);
$to_print = \implode("\n", $double);
echo "$to_print" . "\n";
}
}
Result
grep for found matches in: ../old_doc
/app/storage-backend/OCA/MyStorageApp/Backend/MyStorageBackend.php
../old_doc/developer_manual/app/advanced
/app/storage-backend/OCA/MyStorageApp/Storage/MyStorage.php
../old_doc/developer_manual/app/advanced
/core/scripts/php/composer.json
../old_doc/developer_manual/app/tutorial
/core/scripts/php/vendor/autoload.php
../old_doc/developer_manual/core
/core/scripts/php/vendor/composer/LICENSE
../old_doc
../old_doc/admin_manual/appliance
/core/scripts/php/vendor/guzzlehttp/guzzle/CHANGELOG.md
../old_doc/admin_manual
/core/scripts/php/vendor/guzzlehttp/guzzle/LICENSE
../old_doc
../old_doc/admin_manual/appliance
/core/scripts/php/vendor/guzzlehttp/guzzle/README.md
../old_doc/developer_manual/app/fundamentals
/core/scripts/php/vendor/guzzlehttp/guzzle/composer.json
../old_doc/developer_manual/app/tutorial
/core/scripts/php/vendor/guzzlehttp/guzzle/src/functions.php
../old_doc/admin_manual
/core/scripts/php/vendor/guzzlehttp/promises/CHANGELOG.md
../old_doc/admin_manual
/core/scripts/php/vendor/guzzlehttp/promises/LICENSE
../old_doc
../old_doc/admin_manual/appliance
/core/scripts/php/vendor/guzzlehttp/promises/Makefile
../old_doc
../old_doc/admin_manual
../old_doc/developer_manual
../old_doc/user_manual
/core/scripts/php/vendor/guzzlehttp/promises/README.md
../old_doc/developer_manual/app/fundamentals
/core/scripts/php/vendor/guzzlehttp/promises/composer.json
../old_doc/developer_manual/app/tutorial
/core/scripts/php/vendor/guzzlehttp/promises/src/functions.php
../old_doc/admin_manual
/core/scripts/php/vendor/guzzlehttp/promises/tests/bootstrap.php
../old_doc/developer_manual/app/fundamentals
../old_doc/developer_manual/core
/core/scripts/php/vendor/guzzlehttp/psr7/CHANGELOG.md
../old_doc/admin_manual
/core/scripts/php/vendor/guzzlehttp/psr7/LICENSE
../old_doc
../old_doc/admin_manual/appliance
/core/scripts/php/vendor/guzzlehttp/psr7/Makefile
../old_doc
../old_doc/admin_manual
../old_doc/developer_manual
../old_doc/user_manual
/core/scripts/php/vendor/guzzlehttp/psr7/README.md
../old_doc/developer_manual/app/fundamentals
/core/scripts/php/vendor/guzzlehttp/psr7/composer.json
../old_doc/developer_manual/app/tutorial
/core/scripts/php/vendor/guzzlehttp/psr7/src/functions.php
../old_doc/admin_manual
/core/scripts/php/vendor/guzzlehttp/psr7/tests/bootstrap.php
../old_doc/developer_manual/app/fundamentals
../old_doc/developer_manual/core
/core/scripts/php/vendor/psr/http-message/CHANGELOG.md
../old_doc/admin_manual
/core/scripts/php/vendor/psr/http-message/LICENSE
../old_doc
../old_doc/admin_manual/appliance
/core/scripts/php/vendor/psr/http-message/README.md
../old_doc/developer_manual/app/fundamentals
/core/scripts/php/vendor/psr/http-message/composer.json
../old_doc/developer_manual/app/tutorial
/core/scripts/recipient/search.php
../old_doc/admin_manual/configuration/server
/core/scripts/responses/recipients/response-success.json
../old_doc/developer_manual/core
@mmattel, is this now complete?
Yes it is. If we fix those once and rerun the script(s) above, it will (should) show the following:
What Needs to be Documented?
Unincluded example files found in developer manual (orphaned)
Where Does This Need To Be Documented?
These files should be either:
We may have to check the old documentation...
Why Should This Change Be Made? (Optional)
Doc Quality
What Type Of Content Change Is This? (Optional)
Which Manual Does This Relate To? (Optional)
Script used
Result
@settermjd @phil-davis @voroyam @phil-davis your issue: https://github.com/owncloud/docs/issues/758 (Invalid code in MyStorage.php) matches one of the orphanded files found, array item [4]...