<?php\r
+\r
class commonDAOFichier extends commonDAO {\r
+\r
public $entreprise_id;\r
- public function singleton($infos)\r
- {\r
+\r
+ public function singleton($infos) {\r
$path = path::real($infos['path']);\r
$rel_path = str_replace(FTPROOT, '', $path);\r
$fichier = new commonFichier();\r
return $fichier;\r
}\r
\r
- public function getListe($orderby = null, $sens = null, $limit = null)\r
- {\r
+ public function getListe($orderby = null, $sens = null, $limit = null) {\r
$dao = new commonDAOEntreprise($this->con);\r
$contacts = $dao->getContacts($this->entreprise_id);\r
$daoEquipiers = new commonDAOEquipier($this->con);\r
$eq = $daoEquipiers->selectAll();\r
$equipiers = array();\r
- foreach($eq as $e) {\r
+ foreach ($eq as $e) {\r
$equipiers[$e->utilisateur_id] = $e;\r
}\r
\r
$paths = array();\r
$c = array();\r
- foreach($contacts as $contact) {\r
+ foreach ($contacts as $contact) {\r
$c[$contact->utilisateur_id] = $contact;\r
$paths[$contact->utilisateur_id] = array();\r
cubeFiles::scanRecursiveDir(FTPROOT . $contact->utilisateur_id, $paths[$contact->utilisateur_id]);\r
}\r
\r
$liste = array();\r
- foreach($paths as $utilisateur_id => $files) {\r
- foreach($files as $file) {\r
+ foreach ($paths as $utilisateur_id => $files) {\r
+ foreach ($files as $file) {\r
if (stristr($file, '/.in/')) {\r
$p = explode('/', str_replace(FTPROOT . $utilisateur_id . '/.in/', '', $file));\r
$equipier_id = array_shift($p);\r
return $fichiers;\r
}\r
\r
- public function count()\r
- {\r
+ public function count() {\r
$dao = new commonDAOEntreprise($this->con);\r
$contacts = $dao->getContacts($this->entreprise_id);\r
$res = 0;\r
- foreach($contacts as $contact) {\r
+ foreach ($contacts as $contact) {\r
$t = array();\r
cubeFiles::scanRecursiveDir(FTPROOT . $contact->utilisateur_id, $t);\r
$res += count($t);\r
return $res;\r
}\r
\r
- public function sort($a, $b)\r
- {\r
- $a1 = $a-> {\r
- $this->orderby} ;\r
- $b1 = $b-> {\r
- $this->orderby} ;\r
+ public function sort($a, $b) {\r
+ $a1 = $a->{\r
+ $this->orderby};\r
+ $b1 = $b->{\r
+ $this->orderby};\r
\r
if (is_numeric($a1) && is_numeric($b1)) {\r
if ($a1 == $b1) {\r
}\r
}\r
\r
- protected function search($fichiers)\r
- {\r
+ protected function search($fichiers) {\r
$res = array();\r
- foreach($fichiers as $k => $f) {\r
- if (stristr((string)$f, $this->q)) {\r
+ foreach ($fichiers as $k => $f) {\r
+ if (stristr((string) $f, $this->q)) {\r
$res[$k] = $f;\r
}\r
}\r
return $res;\r
}\r
\r
- public function supprime($path)\r
- {\r
+ public function supprime($path) {\r
if (file_exists(FTPROOT . $path)) {\r
unlink(FTPROOT . $path);\r
}\r
}\r
\r
- public function deleteOldFiles()\r
- {\r
- cubeFiles::deleteFilesOlderThan(FTPROOT, 60);\r
+ public function deleteOldFiles() {\r
+ cubeFiles::deleteFilesOlderThan(FTPROOT, 60, array('*.ipa', '*.apk'));\r
}\r
+\r
}\r
\r
?>
\ No newline at end of file