Esempio n. 1
0
 public function __construct($mode = null)
 {
     if (!$this->setNamespacePrefix('Mtlda')) {
         static::raiseError(__METHOD__ . '(), unable to set namespace prefix!', true);
         return false;
     }
     try {
         $this->registerModel('archive', 'ArchiveModel');
         $this->registerModel('documentindex', 'DocumentIndexModel');
         $this->registerModel('documentindices', 'DocumentIndicesModel');
         $this->registerModel('document', 'DocumentModel');
         $this->registerModel('documentproperties', 'DocumentPropertiesModel');
         $this->registerModel('documentproperty', 'DocumentPropertyModel');
         $this->registerModel('keywordassignment', 'KeywordAssignmentModel');
         $this->registerModel('keyword', 'KeywordModel');
         $this->registerModel('keywords', 'KeywordsModel');
         $this->registerModel('queueitem', 'QueueItemModel');
         $this->registerModel('queue', 'QueueModel');
     } catch (\Exception $e) {
         static::raiseError(__CLASS__ . '::__construct(), error on registering models!"', true);
         return false;
     }
     $GLOBALS['mtlda'] =& $this;
     parent::__construct();
     global $jobs;
     if (isset($mode) and $mode == "queue_only") {
         if (!$jobs->createJob('import-request')) {
             static::raiseError(get_class($jobs) . '::createJob() returned false!');
             return false;
         }
     }
     try {
         $this->registerHandler('image', array($this, 'imageHandler'));
         $this->registerHandler('document', array($this, 'documentHandler'));
         $this->registerHandler('upload', array($this, 'uploadHandler'));
     } catch (\Exception $e) {
         static::raiseError(__METHOD__ . '(), failed to register handlers!', true);
     }
     return true;
 }
Esempio n. 2
0
 public function __construct($mode = null)
 {
     if (!$this->setNamespacePrefix('MasterShaper')) {
         static::raiseError(__METHOD__ . '(), unable to set namespace prefix!', true);
         return;
     }
     try {
         $this->registerModel('chain', 'ChainModel');
         $this->registerModel('chains', 'ChainsModel');
         $this->registerModel('auditentry', 'AuditEntryModel');
         $this->registerModel('auditlog', 'AuditLogModel');
         $this->registerModel('filter', 'FilterModel');
         $this->registerModel('filters', 'FiltersModel');
         $this->registerModel('host_profile', 'HostProfileModel');
         $this->registerModel('host_profiles', 'HostProfilesModel');
         $this->registerModel('host_task', 'HostTaskModel');
         $this->registerModel('host_tasks', 'HostTasksModel');
         $this->registerModel('network_interface', 'NetworkInterfaceModel');
         $this->registerModel('network_interfaces', 'NetworkInterfacesModel');
         $this->registerModel('network_path', 'NetworkPathModel');
         $this->registerModel('network_paths', 'NetworkPathsModel');
         $this->registerModel('pipe', 'PipeModel');
         $this->registerModel('pipes', 'PipesModel');
         $this->registerModel('port', 'PortModel');
         $this->registerModel('ports', 'PortsModel');
         $this->registerModel('protocol', 'ProtocolModel');
         $this->registerModel('protocols', 'ProtocolsModel');
         $this->registerModel('service_level', 'ServiceLevelModel');
         $this->registerModel('service_levels', 'ServiceLevelsModel');
         $this->registerModel('target', 'TargetModel');
         $this->registerModel('targets', 'TargetsModel');
         $this->registerModel('user', 'UserModel');
         $this->registerModel('users', 'UsersModel');
         $this->registerModel('atg', 'AssignTargetToGroupModel');
         $this->registerModel('atgs', 'AssignTargetToGroupsModel');
         $this->registerModel('apf', 'AssignPortToFilterModel');
         $this->registerModel('apfs', 'AssignPortToFiltersModel');
         $this->registerModel('apc', 'AssignPipeToChainModel');
         $this->registerModel('apcs', 'AssignPipeToChainsModel');
         $this->registerModel('afp', 'AssignFilterToPipeModel');
         $this->registerModel('afps', 'AssignFilterToPipesModel');
         $this->registerModel('setting', 'SettingModel');
         $this->registerModel('settings', 'SettingsModel');
         $this->registerModel('tcid', 'TcIdModel');
         $this->registerModel('tcids', 'TcIdsModel');
     } catch (\Exception $e) {
         static::raiseError(__CLASS__ . '::__construct(), error on registering models!', true, $e);
         return;
     }
     if (extension_loaded('Zend OPcache')) {
         $this->zend_opcache_available = true;
     }
     $GLOBALS['ms'] =& $this;
     parent::__construct();
     global $config;
     if (($timeout = $config->getScriptTimeout()) !== false) {
         set_time_limit($timeout);
     }
     if (!$this->loadSettings()) {
         static::raiseError(__CLASS__ . '::loadSettings() returned false!', true);
         return false;
     }
     return;
 }