/** * Recursive function which list all folders and subfolders with his files from an defined path * * @param string $dir path * @return array */ function dirContents($dir, &$results = []) { if (!is_dir($dir)) { return []; } $files = scandir($dir); foreach ($files as $key => $value) { $path = realpath($dir . DS . $value); if (!is_dir($path)) { $results[] = $path; } else { if (is_dir($path) && $value != "." && $value != "..") { $results[] = $path . DS; dirContents($path, $results); } } } return $results; }
function dirContents($searchDir, $pregarr = array(), $inclusive = false){ $lar = array(array(), array()); if(false === $handle = opendir($searchDir)) return false; while(false !== $link = readdir($handle)){ if($link !== '.' && $link !== '..'){ $validLink = true; foreach($pregarr as $value){ $validLink ^= preg_match($value, $link); } $validLink ^= $inclusive; if($validLink){ $temp = $searchDir . DIRECTORY_SEPARATOR . $link; if(is_dir($temp)){ array_push($lar[0], $temp); $temp = dirContents($temp, $pregarr, $inclusive); $lar[0] = array_merge($lar[0], $temp[0]); $lar[1] = array_merge($lar[1], $temp[1]); }else{ array_push($lar[1], $temp); } } } } closedir($handle); return $lar; }
standards-based, patent and royalty-free license. This means that, just like all other successful Web technologies, any person or organization is free to implement the specifications and inter-operate with one another without the express permission or consent of the group that created PaySwarm. </p> <h2>WordPress</h2> <ul> <li> A WordPress plugin powered by PaySwarm that enables content owners to get paid for access to their content. Code available on <a href="https://github.com/digitalbazaar/payswarm-wordpress">GitHub</a>. <ul> <?php dirContents("wordpress"); ?> </ul> </li> </ul> </div> </div> </div> <div class="container vspacing"> <div class="row"> <div class="threecol"> <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" src="https://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a> </div> <div class="ninecol last">
</div><!-- col-lg-6 --> </div><!-- row --> </div><!-- container --> </section> <!-- ==== ARCHIVES ==== --> <section> <div class="container" id="use-cases"> <div class="row white"> <br> <h1 class="centered">ARCHIVES</h1> <hr> <div class="col-lg-offset-1 col-lg-10"> <p> <a href="source/web-api">PaySwarm Web API</a>: The initial PaySwarm protocol designed to allow open listing, buying, and selling digital assets over the Web. Time-stamped drafts: <?php dirContents("ED/web-api"); ?> </p> </div><!-- col-lg-6 --> </div><!-- row --> </div><!-- container --> </section> <?php $TOP_DIR = '..'; include '../footer.inc'; ?>
dirContents("ED/glossary"); ?> </p> </div><!-- col-md-10 --> </div><!-- row --> </div><!-- container --> </section> <!-- ==== Identity Credentials ==== --> <section class="light-bg"> <div class="container" id="credentials"> <div class="row white"> <div class="col-md-8 col-md-offset-2 inner-bottom-xs"> <h3>Credentials</h3> <p> <a href="source/identity-credentials/">Identity Credentials</a>: A decentralized identity mechanism for the Web that allows arbitrary Linked Data to be read from and written to an identity URL. <?php dirContents("ED/identity-credentials"); ?> </p> </div><!-- col-md-10 --> </div><!-- row --> </div><!-- container --> </section> <?php $TOP_DIR = '..'; include '../footer.inc';