[commits] [Wiki] changed: Doc/Dev/Shares

Jan Schneider jan at horde.org
Wed Sep 4 12:17:29 UTC 2013


jan  Wed, 04 Sep 2013 12:17:29 +0000

Modified page: http://wiki.horde.org/Doc/Dev/Shares
New Revision:  6
Change log:  Tweaks

@@ -1,23 +1,26 @@
  + Horde_Shares
+
+[[toc]]

  Some performance charts with the sql driver:

  [[image  
http://chart.apis.google.com/chart?chxl=0:|pdo_sqlite|pdo_pgsql|pdo_mysql|mysqli|mysql&chxp=0,4,3,2,1,0&chxr=0,0,4&chxt=x&chs=440x220&cht=lxy&chco=008000,FF9900,AA0033,3072F3&chd=s:_,NPNpH,_,PPPQH,_,OOQuJ,_,BBBBB&chdl=Share+creation+(Sql)|listShares()+(Sql)|Share+creation+(Sqlng)|listShares()+(Sqlng)&chdlp=b&chls=1|1|1|1&chma=15,15,5,25|0,10&chtt=Horde_Share+performance+(less+is+better)]]

  Note: the sqlite driver was test with an in-memory database
-----
-(wip)
-++ How to use horde shares in your custom application ++
+
+++ How to use horde shares in your custom application
+
+//work in progress//

  Let's assume you followed the  [CreatingYourFirstModule Creating  
your first module] guide as far as it applies to horde4 and created a  
new horde app called "hort". Hort is an old German word for treasure  
as well as the place where the treasure is kept. Hort should keep  
safes which hold user/password pairs or other secret credentials.  
Those safes should be shareable among users. This is where  
horde_shares comes into play.


  +++ basic setup in Application.php _init()

  We want to add an injector for the shares API whenever the app is  
initialized and we want to auto-create an initial "home" share for  
users which do not yet own one.

-<code>
+<code type="php">
      protected function _init()
      {
          // Create a share instance.
          $GLOBALS['hort_shares'] =  
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create();
@@ -42,18 +45,18 @@

  Next we want to add a page with a list of safes (shares) in the menu.
  Go to the menu() function in Application.php

-<code>
+<code type="php">
          $menu->add(Horde::url('safes.php'), _("Password Safes"), 'user.png');
  </code>


  +++ migrations script (database setup) for shares and sharesng driver tables
  Create a directory hort/migrations/ with a file 1_hort_tables.php


-<code>
+<code type="php">
  class HortBaseTables extends Horde_Db_Migration_Base
  {
      /**
       * Upgrade.



More information about the commits mailing list