本文整理汇总了PHP中Tinebase_Core::isFilesystemAvailable方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Core::isFilesystemAvailable方法的具体用法?PHP Tinebase_Core::isFilesystemAvailable怎么用?PHP Tinebase_Core::isFilesystemAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Core
的用法示例。
在下文中一共展示了Tinebase_Core::isFilesystemAvailable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* the constructor
*/
public function __construct()
{
$this->_fileObjectBackend = new Tinebase_Tree_FileObject();
$this->_treeNodeBackend = new Tinebase_Tree_Node();
if (!Tinebase_Core::isFilesystemAvailable()) {
throw new Tinebase_Exception_Backend('No base path (filesdir) configured or path not writeable');
}
$this->_basePath = Tinebase_Core::getConfig()->filesdir;
}
示例2: _getAnonymousRegistryData
/**
* get anonymous registry
*
* @return array
*/
protected function _getAnonymousRegistryData()
{
$locale = Tinebase_Core::get('locale');
$tbFrontendHttp = new Tinebase_Frontend_Http();
// default credentials
if (isset(Tinebase_Core::getConfig()->login)) {
$loginConfig = Tinebase_Core::getConfig()->login;
$defaultUsername = isset($loginConfig->username) ? $loginConfig->username : '';
$defaultPassword = isset($loginConfig->password) ? $loginConfig->password : '';
} else {
$defaultUsername = '';
$defaultPassword = '';
}
$symbols = Zend_Locale::getTranslationList('symbols', $locale);
$registryData = array('modSsl' => Tinebase_Auth::getConfiguredBackend() == Tinebase_Auth::MODSSL, 'serviceMap' => $tbFrontendHttp->getServiceMap(), 'locale' => array('locale' => $locale->toString(), 'language' => Zend_Locale::getTranslation($locale->getLanguage(), 'language', $locale), 'region' => Zend_Locale::getTranslation($locale->getRegion(), 'country', $locale)), 'version' => array('buildType' => TINE20_BUILDTYPE, 'codeName' => TINE20_CODENAME, 'packageString' => TINE20_PACKAGESTRING, 'releaseTime' => TINE20_RELEASETIME, 'filesHash' => TINE20_BUILDTYPE != 'DEVELOPMENT' ? $tbFrontendHttp->getJsCssHash() : null), 'defaultUsername' => $defaultUsername, 'defaultPassword' => $defaultPassword, 'denySurveys' => Tinebase_Core::getConfig()->denySurveys, 'titlePostfix' => Tinebase_Config::getInstance()->get(Tinebase_Config::PAGETITLEPOSTFIX), 'redirectUrl' => Tinebase_Config::getInstance()->get(Tinebase_Config::REDIRECTURL), 'helpUrl' => Tinebase_Core::getConfig()->helpUrl, 'maxFileUploadSize' => Tinebase_Helper::convertToBytes(ini_get('upload_max_filesize')), 'maxPostSize' => Tinebase_Helper::convertToBytes(ini_get('post_max_size')), 'thousandSeparator' => $symbols['group'], 'decimalSeparator' => $symbols['decimal'], 'filesystemAvailable' => Tinebase_Core::isFilesystemAvailable());
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Anonymous registry: ' . print_r($registryData, TRUE));
}
return $registryData;
}
示例3: fromTine20RecordSet
/**
* converts Tinebase_Record_RecordSet to external format
*
* @param Tinebase_Record_RecordSet $_records
* @param Tinebase_Model_Filter_FilterGroup $_filter
* @param Tinebase_Model_Pagination $_pagination
*
* @return mixed
*/
public function fromTine20RecordSet(Tinebase_Record_RecordSet $_records = NULL, $_filter = NULL, $_pagination = NULL)
{
if (count($_records) == 0) {
return array();
}
Tinebase_Notes::getInstance()->getMultipleNotesOfRecords($_records);
Tinebase_Tags::getInstance()->getMultipleTagsOfRecords($_records);
if (Tinebase_Core::isFilesystemAvailable()) {
Tinebase_FileSystem_RecordAttachments::getInstance()->getMultipleAttachmentsOfRecords($_records);
}
Calendar_Model_Attender::resolveAttendee($_records->attendee, TRUE, $_records);
Calendar_Convert_Event_Json::resolveRrule($_records);
Calendar_Controller_Event::getInstance()->getAlarms($_records);
Calendar_Convert_Event_Json::resolveGrantsOfExternalOrganizers($_records);
Calendar_Model_Rrule::mergeAndRemoveNonMatchingRecurrences($_records, $_filter);
$_records->sortByPagination($_pagination);
Tinebase_Frontend_Json_Abstract::resolveContainersAndTags($_records, array('container_id'));
$_records->setTimezone(Tinebase_Core::getUserTimezone());
$_records->convertDates = true;
$eventsData = $_records->toArray();
foreach ($eventsData as $idx => $eventData) {
if (!(isset($eventData[Tinebase_Model_Grants::GRANT_READ]) || array_key_exists(Tinebase_Model_Grants::GRANT_READ, $eventData)) || !$eventData[Tinebase_Model_Grants::GRANT_READ]) {
$eventsData[$idx] = array_intersect_key($eventsData[$idx], array_flip(array('id', 'dtstart', 'dtend', 'transp', 'is_all_day_event')));
}
}
return $eventsData;
}
示例4: _deleteLinkedObjects
/**
* delete linked objects (notes, relations, ...) of record
*
* @param Tinebase_Record_Interface $_record
*/
protected function _deleteLinkedObjects(Tinebase_Record_Interface $_record)
{
// delete notes & relations
if ($_record->has('notes')) {
Tinebase_Notes::getInstance()->deleteNotesOfRecord($this->_modelName, $this->_getBackendType(), $_record->getId());
}
if ($_record->has('relations')) {
$this->_deleteLinkedRelations($_record);
}
if ($_record->has('attachments') && Tinebase_Core::isFilesystemAvailable()) {
Tinebase_FileSystem_RecordAttachments::getInstance()->deleteRecordAttachments($_record);
}
}
示例5: _resolveMultipleRecordFields
/**
* resolve multiple record fields (Tinebase_ModelConfiguration._recordsFields)
*
* @param Tinebase_Record_RecordSet $_records
* @param Tinebase_ModelConfiguration $modelConfiguration
* @param boolean $multiple
* @throws Tinebase_Exception_UnexpectedValue
*/
protected function _resolveMultipleRecordFields(Tinebase_Record_RecordSet $_records, $modelConfiguration = NULL, $multiple = false)
{
if (!$modelConfiguration || !$_records->count()) {
return;
}
if (!($resolveFields = $modelConfiguration->recordsFields)) {
return;
}
$ownIds = $_records->{$modelConfiguration->idProperty};
// iterate fields to resolve
foreach ($resolveFields as $fieldKey => $c) {
$config = $c['config'];
// resolve records, if omitOnSearch is definitively set to FALSE (by default they won't be resolved on search)
if ($multiple && !(isset($config['omitOnSearch']) && $config['omitOnSearch'] === FALSE)) {
continue;
}
if (!isset($config['controllerClassName'])) {
throw new Tinebase_Exception_UnexpectedValue('Controller class name needed');
}
// fetch the fields by the refIfField
/** @var Tinebase_Controller_Record_Interface|Tinebase_Controller_SearchInterface $controller */
/** @noinspection PhpUndefinedMethodInspection */
$controller = $config['controllerClassName']::getInstance();
$filterName = $config['filterClassName'];
$filterArray = array();
// addFilters can be added and must be added if the same model resides in more than one records fields
if (isset($config['addFilters']) && is_array($config['addFilters'])) {
$filterArray = $config['addFilters'];
}
/** @var Tinebase_Model_Filter_FilterGroup $filter */
$filter = new $filterName($filterArray);
$filter->addFilter(new Tinebase_Model_Filter_Id(array('field' => $config['refIdField'], 'operator' => 'in', 'value' => $ownIds)));
$paging = NULL;
if (isset($config['paging']) && is_array($config['paging'])) {
$paging = new Tinebase_Model_Pagination($config['paging']);
}
$foreignRecords = $controller->search($filter, $paging);
/** @var Tinebase_Record_Interface $foreignRecordClass */
$foreignRecordClass = $foreignRecords->getRecordClassName();
$foreignRecordModelConfiguration = $foreignRecordClass::getConfiguration();
$foreignRecords->setTimezone(Tinebase_Core::getUserTimezone());
$foreignRecords->convertDates = true;
$fr = $foreignRecords->getFirstRecord();
// @todo: resolve alarms?
// @todo: use parts parameter?
if ($foreignRecordModelConfiguration->resolveRelated && $fr) {
if ($fr->has('notes')) {
Tinebase_Notes::getInstance()->getMultipleNotesOfRecords($foreignRecords);
}
if ($fr->has('tags')) {
Tinebase_Tags::getInstance()->getMultipleTagsOfRecords($foreignRecords);
}
if ($fr->has('relations')) {
$relations = Tinebase_Relations::getInstance()->getMultipleRelations($foreignRecordClass, 'Sql', $foreignRecords->{$fr->getIdProperty()});
$foreignRecords->setByIndices('relations', $relations);
}
if ($fr->has('customfields')) {
Tinebase_CustomField::getInstance()->resolveMultipleCustomfields($foreignRecords);
}
if ($fr->has('attachments') && Tinebase_Core::isFilesystemAvailable()) {
Tinebase_FileSystem_RecordAttachments::getInstance()->getMultipleAttachmentsOfRecords($foreignRecords);
}
}
if ($foreignRecords->count() > 0) {
/** @var Tinebase_Record_Interface $record */
foreach ($_records as $record) {
$filtered = $foreignRecords->filter($config['refIdField'], $record->getId())->toArray();
$filtered = $this->_resolveAfterToArray($filtered, $foreignRecordModelConfiguration, TRUE);
$record->{$fieldKey} = $filtered;
}
} else {
$_records->{$fieldKey} = NULL;
}
}
}
示例6: _deleteLinkedObjects
/**
* delete linked objects (notes, relations, ...) of record
*
* @param Tinebase_Record_Interface $_record
*/
protected function _deleteLinkedObjects(Tinebase_Record_Interface $_record)
{
// delete notes & relations
if ($_record->has('notes')) {
Tinebase_Notes::getInstance()->deleteNotesOfRecord($this->_modelName, $this->_getBackendType(), $_record->getId());
}
if ($_record->has('relations')) {
// TODO check if this needs to be done, as we might already deleting this "from the other side"
$this->deleteLinkedRelations($_record);
}
if ($_record->has('attachments') && Tinebase_Core::isFilesystemAvailable()) {
Tinebase_FileSystem_RecordAttachments::getInstance()->deleteRecordAttachments($_record);
}
}