Ejemplo n.º 1
0
 /** Gets a library reference
  *
  * @param $name
  * @return \ActivityLib|\AdminLib|\AreasLib|\ArtLib|\AttributeLib|\AutoSaveLib|\BannerLib|\BigBlueButtonLib|\BlogLib|\CacheLib|\CalendarLib|\Captcha|\CartLib|\CategLib|\Comments|\ContactLib|\ContributionLib|\CreditsLib|\CryptLib|\cssLib|\DCSLib|\EditLib|\ErrorReportLib|\FaqLib|\FederatedSearchLib|\FileGalBatchLib|\FileGalLib|\FlaggedRevisionLib|\FreetagLib|\GeoLib|\GoalEventLib|\GoalLib|\GoalRewardLib|\GroupAlertLib|\HeaderLib|\HistLib|\IconsetLib|\ImageGalsLib|\KalturaLib|\KalturaLib|\Language|\LanguageTranslations|\LdapLib|\LoginLib|\LogsLib|\LogsQueryLib|\MailinLib|\Memcachelib|\MenuLib|\Messu|\MimeLib|\ModLib|\MonitorLib|\MonitorMailLib|\MultilingualLib|\NotificationLib|\OAuthLib|\ObjectLib|\PageContentLib|\ParserLib|\PaymentLib|\PerspectiveLib|\PollLib|\PreferencesLib|\QuantifyLib|\QueueLib|\QuizLib|\RatingConfigLib|\RatingLib|\ReferencesLib|\RegistrationLib|\RelationLib|\RSSLib|\ScoreLib|\ScormLib|\SearchStatsLib|\SemanticLib|\ServiceLib|\SheetLib|\Smarty_Tiki|\SocialLib|\StatsLib|\StoredSearchLib|\StructLib|\TemplatesLib|\ThemeControlLib|\ThemeLib|\Tiki_Connect_Client|\Tiki_Connect_Server|\Tiki_Event_Manager|\Tiki_Profile_SymbolLoader|\Tiki\Object\Selector|\Tiki\Recommendation\BatchProcessor|\Tiki\Wiki\SlugManager|\TikiAccessLib|\TikiCalendarLib|\TikiDate|\TodoLib|\Tracker\Tabular\Manager|\TrackerLib|\UnifiedSearchLib|\UserMailinLib|\UserModulesLib|\UserPrefsLib|\UsersLib|\Validators|\VimeoLib|\WikiLib|\WikiLingoTikiEvents|\WizardLib|\WYSIWYGLib|\ZoteroLib
  * @throws Exception
  */
 public static function lib($name)
 {
     if (isset(self::$libraries[$name])) {
         return self::$libraries[$name];
     }
     $container = TikiInit::getContainer();
     //if no period in the lib name, default to tiki.lib prefix.
     if (strpos($name, ".") !== false) {
         $service = $name;
     } else {
         $service = "tiki.lib.{$name}";
     }
     if ($lib = $container->get($service, \Symfony\Component\DependencyInjection\ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
         return $lib;
     }
     // One-time inits of the libraries provided
     switch ($name) {
         case 'tiki':
             global $tikilib;
             return self::$libraries[$name] = $tikilib;
     }
     unlink('temp/cache/container.php');
     // Remove the container cache to help transition
     throw new Exception(tr("%0 library not found. This may be due to a typo or caused by a recent update.", $name));
 }
Ejemplo n.º 2
0
 public static function fromDb(array $acc)
 {
     $account = new self();
     $account->source = self::getSource($acc);
     $wikiParams = ['namespace' => $acc['namespace'], 'structure_routing' => $acc['routing'] == 'y'];
     try {
         $container = \TikiInit::getContainer();
         $type = str_replace('-', '', $acc['type']);
         $provider = $container->get("tiki.mailin.provider.{$type}");
         $account->actionFactory = $provider->getActionFactory($acc);
     } catch (ServiceNotFoundException $e) {
         throw new Exception\MailInException("Action factory not found.");
     }
     $account->accountAddress = $acc['account'];
     $account->anonymousAllowed = $acc['anonymous'] == 'y';
     $account->adminAllowed = $acc['admin'] == 'y';
     $account->sendResponses = $acc['respond_email'] == 'y';
     $account->discardAfter = $acc['discard_after'];
     $account->defaultCategory = $acc['categoryId'];
     $account->saveHtml = $acc['save_html'] == 'y';
     $account->deleteOnError = $acc['leave_email'] != 'y';
     $account->auto_attachments = $acc['attachments'] == 'y';
     $account->inline_attachments = $acc['show_inlineImages'] == 'y';
     return $account;
 }
Ejemplo n.º 3
0
 function list_available_types()
 {
     $container = TikiInit::getContainer();
     $list = $container->get('tiki.mailin.providerlist');
     $out = [];
     foreach ($list->getList() as $provider) {
         $out[$provider->getType()] = ['name' => $provider->getLabel(), 'enabled' => $provider->isEnabled()];
     }
     return $out;
 }
Ejemplo n.º 4
0
 function lib($name)
 {
     if (isset($this->libraries[$name])) {
         return $this->libraries[$name];
     }
     $container = TikiInit::getContainer();
     $service = 'tikiaddon.' . $this->getVendor() . '.' . $this->getShortName() . '.' . $name;
     if ($lib = $container->get($service, \Symfony\Component\DependencyInjection\ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
         return $lib;
     }
     unlink(TIKI_PATH . '/temp/cache/container.php');
     // Remove the container cache to help transition
     throw new Exception(tr("%0 library not found. This may be due to a typo or caused by a recent update.", $name));
 }
Ejemplo n.º 5
0
 function getBroker($addonpackage = '')
 {
     if ($addonpackage) {
         $utilities = new TikiAddons_Utilities();
         if (!$utilities->isInstalled(str_replace('.', '/', $addonpackage))) {
             $addonpackage = '';
         }
     }
     if ($addonpackage && !isset($this->addonbrokers[$addonpackage])) {
         $this->addonbrokers[$addonpackage] = new Services_Broker(TikiInit::getContainer(), $addonpackage);
     } else {
         if (!$this->broker) {
             $this->broker = new Services_Broker(TikiInit::getContainer());
         }
     }
     if ($addonpackage) {
         return $this->addonbrokers[$addonpackage];
     } else {
         return $this->broker;
     }
 }
Ejemplo n.º 6
0
 private function getEngineSet($set)
 {
     $container = TikiInit::getContainer();
     return $container->get("tiki.recommendation.{$set}.set");
 }