Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Lib.VaultCommon.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * @author Anakeen
8  * @package FDL
9  */
10 // ---------------------------------------------------------------
11 // $Id: Lib.VaultCommon.php,v 1.7 2007/03/07 18:43:26 eric Exp $
12 // $Source: /home/cvsroot/anakeen/freedom/vault/Class/Lib.VaultCommon.php,v $
13 // ---------------------------------------------------------------
14 // ---------------------------------------------------------
15 function fileextension($filename, $ext = "nop")
16 {
17  $te = explode(".", basename($filename));
18  if (count($te) > 1) $ext = $te[count($te) - 1];
19  return $ext;
20 }
21 // ---------------------------------------------------------
22 function vaultfilename($fspath, $name, $id)
23 {
24  return str_replace('//', '/', $fspath . "/" . $id . "." . fileextension($name));
25 }
26 
27 function my_basename($p)
28 {
29  //return basename($p);
30  $r = strrpos($p, "/");
31  return ($r !== false) ? substr($p, $r + 1) : $p;
32 }
33 ?>
vaultfilename($fspath, $name, $id)
$filename
fileextension($filename, $ext="nop")
my_basename($p)
← centre documentaire © anakeen