Подключение к источнику данных

@throws Eresus_Exception_ComponentCorrupted
10522
private function initDataSource()
	{
        $className = $this->conf['db']['engine'];
		if (class_exists($className))
		{
			$this->db = new $className;
			$this->db->init($this->conf['db']['host'], $this->conf['db']['user'],
				$this->conf['db']['password'], $this->conf['db']['name'],
                $this->conf['db']['prefix']);
		}
		else
		{
            throw new Eresus_Exception_ComponentCorrupted(
                sprintf('Library "%s" not found!', $this->conf['db']['engine']));
		}
	}
563779
public final void mEXPONENT() throws RecognitionException {
        try {
            // EventFilter.g:243:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
            // EventFilter.g:243:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
            {
            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            // EventFilter.g:243:22: ( '+' | '-' )?
            int alt19=2;
            int LA19_0 = input.LA(1);

            if ( (LA19_0=='+'||LA19_0=='-') ) {
                alt19=1;
            }
            switch (alt19) {
                case 1 :
                    // EventFilter.g:
                    {
                    if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
                        input.consume();
                    }
                    else {
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        recover(mse);
                        throw mse;
                    }


                    }
                    break;

            }


            // EventFilter.g:243:33: ( '0' .. '9' )+
            int cnt20=0;
            loop20:
            do {
                int alt20=2;
                int LA20_0 = input.LA(1);

                if ( ((LA20_0 >= '0' && LA20_0 <= '9')) ) {
                    alt20=1;
                }


                switch (alt20) {
            	case 1 :
            	    // EventFilter.g:
            	    {
            	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    if ( cnt20 >= 1 ) break loop20;
                        EarlyExitException eee =
                            new EarlyExitException(20, input);
                        throw eee;
                }
                cnt20++;
            } while (true);


            }


        }
        finally {
        	// do for sure before leaving
        }
    }
410685
private function init()
    {
        Eresus_Kernel::app()->getEventDispatcher()->dispatch('cms.client.start');

        $item = $this->loadPage();
        if ($item)
        {
            if (count(Eresus_CMS::getLegacyKernel()->request['params']))
            {
                if (preg_match('/p[\d]+/i', Eresus_CMS::getLegacyKernel()->request['params'][0]))
                {
                    $this->subpage = substr(array_shift(Eresus_CMS::getLegacyKernel()->request['params']), 1);
                }

                if (count(Eresus_CMS::getLegacyKernel()->request['params']))
                {
                    $this->topic = array_shift(Eresus_CMS::getLegacyKernel()->request['params']);
                }
            }
            $this->dbItem = $item;
            $this->id = $item['id'];
            $this->name = $item['name'];
            $this->owner = $item['owner'];
            $this->title = $item['title'];
            $this->description = $item['description'];
            $this->keywords = $item['keywords'];
            $this->caption = $item['caption'];
            $this->hint = $item['hint'];
            $this->access = $item['access'];
            $this->visible = $item['visible'];
            $this->type = $item['type'];
            $this->setTemplate($item['template']);
            $this->content = $item['content'];
            $this->scripts = '';
            $this->styles = '';
            $this->options = $item['options'];
        }
        else
        {
            throw new Eresus_CMS_Exception_NotFound;
        }
    }
790796
private static function component()
    {
        $files = ['Component'];
        $folder = static::$root.'Foundation'.'/';

        self::call($files, $folder);
        //
        $files = ['SurfaceDisabledException'];
        $folder = static::$root.'Foundation/Exceptions'.'/';

        self::call($files, $folder);
    }
995503
@Override
  public void componentResized(ComponentEvent e) {
    if (e.getComponent() == component) {
      double newRatio = getCurrentRatio();
      if (Math.abs(newRatio - activeRatio) > threshold) {
        activeRatio = newRatio;
        executeResize(newRatio);
      }
    }
  }
326384
public function completeComponents(): void
    {
        $components = $this->getComponents();

        foreach ($components as $id => $component) {
            if (ArrayHelper::remove($component, 'podiumBridge', false)) {
                $component['podium'] = $this;
                $this->set($id, $component);
            }
        }
    }
1374278
public function init() {
		
		if (!$this->model instanceof CActiveRecord) {
			throw new CException(Yii::t('zii', '"model" attribute must be an CActiveRecord type of component'));
		}

		if (!$this->grid instanceof CGridView) {
			throw new CException(Yii::t('zii', '"grid" attribute must be an CGridView type of component'));
		}

		if (!$this->redirectRoute === null) {
			throw new CException(Yii::t('zii', '"redirectRoute" cannot be empty'));
		}

		$this->registry .= '-' . $this->grid->id;

		$this->jsonStorage = new JSONStorage();
		$this->jsonStorage->addRegistry($this->registry);

		$this->filteredBy = array_filter(
			$this->model->getAttributes(),
			function ($i) {
				return $i != null;
			}
		);

		$this->checkRequestRemovalFilter();
		$this->checkRequestFilters();

		$this->registerClientScript();
	}
901650
@Override
	public void dismissed(ExtensionPopupMenuComponent selectedMenuComponent) {
		for (int i = 0; i < getMenuComponentCount(); ++i) {
			Component menuComponent = getMenuComponent(i);
			if (PopupMenuUtils.isExtensionPopupMenuComponent(menuComponent)) {
				((ExtensionPopupMenuComponent) menuComponent).dismissed(selectedMenuComponent);
			}
		}
	}
340614
private void attach(JComponent componentToBeDecorated) {
        detach();

        decoratedComponent = componentToBeDecorated;

        if (decoratedComponent != null) {
            decoratedComponent.addComponentListener(decoratedComponentTracker);
            decoratedComponent.addAncestorListener(decoratedComponentTracker);
            decoratedComponent.addHierarchyBoundsListener(decoratedComponentTracker);
            decoratedComponent.addHierarchyListener(decoratedComponentTracker);
            decoratedComponent.addPropertyChangeListener("enabled", decoratedComponentTracker);
            decoratedComponent.addPropertyChangeListener("ancestor", decoratedComponentTracker);

            attachToLayeredPane();
        }
    }
30742
public function addComponent(self $component, $key = null)
    {
        if (null == $key) {
            $this->components[] = $component;
        } else {
            $this->components[$key] = $component;
        }
    }
1221349
private void updateComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> complete) {
    for (final ComponentContext<?> component : components) {
      final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(component.instances().size());
      counter.setHandler(new Handler<AsyncResult<Void>>() {
        @Override
        public void handle(AsyncResult<Void> result) {
          if (result.failed()) {
            complete.fail(result.cause());
          } else {
            complete.succeed();
          }
        }
      });
      updateInstances(component.instances(), counter);
    }
  }
1139261
public function handle(ComponentContext $componentContext)
    {
        $httpRequest = $componentContext->getHttpRequest();
        $widgetContext = $this->extractWidgetContext($httpRequest);
        if ($widgetContext === null) {
            return;
        }

        $componentContext = $this->prepareActionRequest($componentContext);
        /** @var $actionRequest ActionRequest */
        $actionRequest = $componentContext->getParameter(DispatchComponent::class, 'actionRequest');
        $actionRequest->setArgument('__widgetContext', $widgetContext);
        $actionRequest->setControllerObjectName($widgetContext->getControllerObjectName());
        $this->setDefaultControllerAndActionNameIfNoneSpecified($actionRequest);

        $actionResponse = new ActionResponse($componentContext->getHttpResponse());

        $this->dispatcher->dispatch($actionRequest, $actionResponse);
        $componentContext->replaceHttpResponse($actionResponse);
        // stop processing the current component chain
        $componentContext->setParameter(\Neos\Flow\Http\Component\ComponentChain::class, 'cancel', true);
    }
848435
public void registerComponents() throws Exception {
		Debug.logVerbose("[JdonFramework] note: registe all basic components in container.xml size=" + basicComponents.size(), module);
		try {
			Iterator iter = basicComponents.iterator();
			while (iter.hasNext()) {
				String name = (String) iter.next();
				ComponentMetaDef componentMetaDef = basicComponents.getComponentMetaDef(name);
				xmlcontainerRegistry.registerComponentMetaDef(componentMetaDef);
			}
		} catch (Exception ex) {
			Debug.logError("[JdonFramework] register basiceComponents error:" + ex, module);
			throw new Exception(ex);
		}

	}
1291719
private void undeployRemovedComponents(final NetworkContext context, final NetworkContext runningContext, final Handler<AsyncResult<Void>> doneHandler) {
    // Undeploy any components that were removed from the network.
    final List<ComponentContext<?>> removedComponents = new ArrayList<>();
    for (ComponentContext<?> runningComponent : runningContext.components()) {
      if (context.component(runningComponent.name()) == null) {
        removedComponents.add(runningComponent);
      }
    }

    if (!removedComponents.isEmpty()) {
      final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(removedComponents.size());
      counter.setHandler(new Handler<AsyncResult<Void>>() {
        @Override
        public void handle(AsyncResult<Void> result) {
          if (result.failed()) {
            new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
          } else {
            log.info(String.format("%s - Removed %d components", NetworkManager.this, removedComponents.size()));
            new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
          }
        }
      });
      undeployComponents(removedComponents, counter);
    } else {
      new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
    }
  }
793045
public function setup()
	{
		$this->addRule('component', function($data)
		{
			self::$connection->setQuery("SELECT element FROM `#__extensions` AS e WHERE e.type = 'component' ORDER BY e.name ASC");
			$extensions = self::$connection->loadColumn();
			if (!in_array($data['component'], $extensions))
			{
				return Lang::txt('Component does not exist.');
			}
			return false;
		});
	}
833374
private void resume() throws RepositoryException
   {
      WorkspaceResumer workspaceResumer = getWorkspaceResumer();
      if (workspaceResumer != null)
      {
         workspaceResumer.onResume();
      }

      // components should be resumed in reverse order
      List<Suspendable> components = getComponentInstancesOfType(Suspendable.class);
      Comparator<Suspendable> c = new Comparator<Suspendable>()
      {
         public int compare(Suspendable s1, Suspendable s2)
         {
            return s1.getPriority() - s2.getPriority();
         };
      };
      Collections.sort(components, c);

      for (Suspendable component : components)
      {
         try
         {
            if (component.isSuspended())
            {
               component.resume();
            }
         }
         catch (ResumeException e)
         {
            throw new RepositoryException("Can't set component online", e);
         }
      }
   }
439327
public void setRootComponent(Component component) throws IllegalRootComponentException {
        if (component != null && component.getParent() != null) {
            throw new IllegalRootComponentException("A component with parent cannot be set as a graph's root component. Make sure the component doesn't parent.");
        }
        this.rootComponent = component;
    }