public function addFile(array $info)
{
$this->_vfsInit();
- $dir = TURBA_VFS_PATH . '/' . $this->getValue('__uid');
+ $dir = Turba::VFS_PATH . '/' . $this->getValue('__uid');
$file = $info['name'];
while ($this->_vfs->exists($dir, $file)) {
if (preg_match('/(.*)\[(\d+)\](\.[^.]*)?$/', $file, $match)) {
{
$this->_vfsInit();
try {
- $this->_vfs->deleteFile(TURBA_VFS_PATH . '/' . $this->getValue('__uid'), $file);
+ $this->_vfs->deleteFile(Turba::VFS_PATH . '/' . $this->getValue('__uid'), $file);
} catch (VFS_Exception $e) {
throw new Turba_Exception($e);
}
public function deleteFiles()
{
$this->_vfsInit();
- if ($this->_vfs->exists(TURBA_VFS_PATH, $this->getValue('__uid'))) {
+ if ($this->_vfs->exists(Turba::VFS_PATH, $this->getValue('__uid'))) {
try {
- $this->_vfs->deleteFolder(TURBA_VFS_PATH, $this->getValue('__uid'), true);
+ $this->_vfs->deleteFolder(Turba::VFS_PATH, $this->getValue('__uid'), true);
} catch (VFS_Exception $e) {
throw new Turba_Exception($e);
}
{
try {
$this->_vfsInit();
- if ($this->_vfs->exists(TURBA_VFS_PATH, $this->getValue('__uid'))) {
- return $this->_vfs->listFolder(TURBA_VFS_PATH . '/' . $this->getValue('__uid'));
+ if ($this->_vfs->exists(Turba::VFS_PATH, $this->getValue('__uid'))) {
+ return $this->_vfs->listFolder(Turba::VFS_PATH . '/' . $this->getValue('__uid'));
}
} catch (Turba_Exception $e) {}
<?php
-/** The virtual path to use for VFS data. */
-define('TURBA_VFS_PATH', '.horde/turba/documents');
-
/**
* Turba Base Class.
*
class Turba
{
/**
+ * The virtual path to use for VFS data.
+ */
+ const VFS_PATH = '.horde/turba/documents';
+
+ /**
* @todo Consolidate on a single mail/compose method.
*
* @param mixed $data Either a single email address or an array of email
}
try {
- $data = $vfs->read(TURBA_VFS_PATH . '/' . $object->getValue('__uid'), $filename);
+ $data = $vfs->read(Turba::VFS_PATH . '/' . $object->getValue('__uid'), $filename);
} catch (VFS_Exception $e) {
Horde::logMessage($e, 'ERR');
throw new Turba_Exception(sprintf(_("Access denied to %s"), $filename));