Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.VaultEngine.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Tranformation Engine Definition
9  *
10  * @author Anakeen 2005
11  * @version $Id: Class.VaultEngine.php,v 1.2 2007/05/23 16:01:51 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  */
15 /**
16  */
17 
18 include_once ("Class.DbObj.php");
19 class VaultEngine extends DbObj
20 {
21  public $fields = array(
22  "name",
23  "mime",
24  "command",
25  "comment"
26  // comment text
27 
28  );
29  /**
30  * transformation name
31  * @public string
32  */
33  public $name;
34  /**
35  * compatible system mime type with the command (like text/html)
36  * @public string
37  */
38  public $mime;
39  /**
40  * complete path of the program to use for transformation
41  * @public string
42  */
43  public $command;
44  /**
45  * description of the command
46  * @public string
47  */
48  public $comment;
49 
50  public $id_fields = array(
51  "name",
52  "mime"
53  );
54 
55  public $dbtable = "vaultengine";
56 
57  public $sqlcreate = "
58 create table vaultengine ( name text not null,
59  mime text not null,
60  command text not null,
61  comment text );
62 ";
63 
64  function getNearEngine($engine, $mime)
65  {
66 
67  if (!$this->isAffected()) {
68  $mime = strtok($mime, ";");
69  $eng = new VaultEngine($this->dbaccess, array(
70  $engine,
71  $mime
72  ));
73  }
74  if (!$eng->isAffected()) {
75  $mime = strtok($mime, "/");
76  $eng = new VaultEngine($this->dbaccess, array(
77  $engine,
78  $mime
79  ));
80  }
81  if (!$eng->isAffected()) {
82  $eng = new VaultEngine($this->dbaccess, array(
83  $engine,
84  $mime . '/*'
85  ));
86  }
87  if (!$eng->isAffected()) {
88  $eng = new VaultEngine($this->dbaccess, array(
89  $engine,
90  '*'
91  ));
92  }
93  if ($eng->isAffected()) return $eng;
94  return false;
95  }
96 }
97 ?>
← centre documentaire © anakeen - published under CC License - Dynacase