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