Openomy-PHP v0.2

openomy is an online file storage system designed to be a platform for Web 2.0 applications, built by Ian Sefferman

See http://www.openomy.com for more information about openomy
See http://documentation.openomy.com for information about the openomy API

Openomy-PHP is a set of PHP bindings to use the openomy web services.

Source

Links

Example Usage

<?php

require 'openomy.class.php';

// -----------------
// ----- INIT ------

/* CREATE THE CONFIG */
$at   = new OpenomyConfig();

/* SET UP THE AUTH AND UTIL CLASSES */
$a = new Auth($at);
$u = new Util($at);

/* GET THE CONFIRMED TOKEN */
if (!$at->readConfirmedToken()) {
   /* if no confirmed token found then generate link to get one */
   $unconfirmed    = $a->GetUnconfirmedToken();
   $uri          = $u->GetWebAuthUrl();
   
   $ct_link = "<a href=\"".$uri."\">Click to Authenticate</a>";
   
   echo $ct_link;
   exit;
}

/* CREATE THE BINDINGS FOR THE Tags AND Files SERVICES */
$t = new Tags($at);
$f = new Files($at);

// -- END OF INIT --
// -----------------
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
dt {
   display: block;
   background-color: #eee;
   padding: 2px;
}
dt span {
   font-size: 0.7em;
   color: #777;
}
</style>
</head>
<body>
<?php

$allTags = $t->GetAllTags();

foreach ($allTags as $tag) {
   $tagDetail = $t->GetTag($tag['id']);
   ?>
   <dl>
      <dt><?=$tag['tag']?> <span>(created <?=$tagDetail['created']?>)</span></dt>
      <dd>
         <ul>
            <?php
            if (sizeof($tagDetail['files'])) {
               foreach ($tagDetail['files'] as $file) {
                  ?>
                  <li><?=$file['file']?></li>
                  <?php
               }
            }
            else {
               ?><li>[ no files ]</li><?php
            }
            ?>
         </ul>
      </dd>
   </dl>
   <?php
}

?>
</body>
</html>

Created by Tony Jeffree