本文整理汇总了PHP中TrackerFactory::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP TrackerFactory::instance方法的具体用法?PHP TrackerFactory::instance怎么用?PHP TrackerFactory::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackerFactory
的用法示例。
在下文中一共展示了TrackerFactory::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
/**
* Returns an instance of Tracker_HierarchyFactory (creating it when needed).
*
* We should usually prefer dependency injection over static methods, but
* there are some cases in Tuleap legacy code where injection would require
* a lot of refactoring (e.g. Tracker/FormElement).
*
* @return Tracker_HierarchyFactory
*/
public static function instance()
{
if (!self::$_instance) {
self::$_instance = new Tracker_HierarchyFactory(new Tracker_Hierarchy_Dao(), TrackerFactory::instance(), Tracker_ArtifactFactory::instance());
}
return self::$_instance;
}
示例2: instance
/**
* The singleton method
*
* @return Tracker_Hierarchy_HierarchicalTrackerFactory
*/
public static function instance()
{
if (!self::$instance) {
self::$instance = new Tracker_Hierarchy_HierarchicalTrackerFactory(TrackerFactory::instance(), new Tracker_Hierarchy_Dao());
}
return self::$instance;
}
示例3: __construct
public function __construct(AgileDashboard_Kanban $kanban, PFUser $user, $user_is_kanban_admin, $language, $project_id)
{
$user_preferences = new AgileDashboard_KanbanUserPreferences();
$kanban_representation_builder = new Tuleap\AgileDashboard\REST\v1\Kanban\KanbanRepresentationBuilder($user_preferences, new AgileDashboard_KanbanColumnFactory(new AgileDashboard_KanbanColumnDao(), $user_preferences), TrackerFactory::instance(), Tracker_FormElementFactory::instance());
$this->kanban_representation = json_encode($kanban_representation_builder->build($kanban, $user));
$this->user_is_kanban_admin = (int) $user_is_kanban_admin;
$this->language = $language;
$this->project_id = $project_id;
}
示例4: activatePlugins
public function activatePlugins()
{
$this->activatePlugin('tracker');
$this->activatePlugin('agiledashboard');
$this->activatePlugin('cardwall');
PluginManager::instance()->loadPlugins();
$this->tracker_artifact_factory = Tracker_ArtifactFactory::instance();
$this->tracker_formelement_factory = Tracker_FormElementFactory::instance();
$this->tracker_factory = TrackerFactory::instance();
return $this;
}
示例5: instance
/**
* The singleton method
*
* @return WorkflowFactory
*/
public static function instance()
{
if (!isset(self::$_instance)) {
$formelement_factory = Tracker_FormElementFactory::instance();
$logger = new WorkflowBackendLogger(new BackendLogger());
$trigger_rules_manager = new Tracker_Workflow_Trigger_RulesManager(new Tracker_Workflow_Trigger_RulesDao(), $formelement_factory, new Tracker_Workflow_Trigger_RulesProcessor(UserManager::instance()->getUserById(Tracker_Workflow_WorkflowUser::ID), $logger), $logger);
$c = __CLASS__;
self::$_instance = new $c(TransitionFactory::instance(), TrackerFactory::instance(), $formelement_factory, $trigger_rules_manager, $logger);
}
return self::$_instance;
}
示例6: getConfigFactory
public function getConfigFactory()
{
if (!$this->config_factory) {
require_once 'OnTop/ConfigFactory.class.php';
require_once TRACKER_BASE_DIR . '/Tracker/TrackerFactory.class.php';
$tracker_factory = TrackerFactory::instance();
$element_factory = Tracker_FormElementFactory::instance();
$this->config_factory = new Cardwall_OnTop_ConfigFactory($tracker_factory, $element_factory);
}
return $this->config_factory;
}
示例7: __construct
public function __construct(AgileDashboard_Kanban $kanban, PFUser $user, $user_is_kanban_admin, $language, $project_id)
{
$user_preferences = new AgileDashboard_KanbanUserPreferences();
$kanban_representation_builder = new Tuleap\AgileDashboard\REST\v1\Kanban\KanbanRepresentationBuilder($user_preferences, new AgileDashboard_KanbanColumnFactory(new AgileDashboard_KanbanColumnDao(), $user_preferences), new AgileDashboard_KanbanActionsChecker(TrackerFactory::instance(), new AgileDashboard_PermissionsManager(), Tracker_FormElementFactory::instance()));
$this->kanban_representation = json_encode($kanban_representation_builder->build($kanban, $user));
$this->user_is_kanban_admin = (int) $user_is_kanban_admin;
$this->language = $language;
$this->project_id = $project_id;
$this->user_id = $user->getId();
$this->view_mode = $user->getPreference('agiledashboard_kanban_item_view_mode_' . $kanban->getId());
$this->nodejs_server = ForgeConfig::get('nodejs_server');
}
示例8: activatePlugins
public function activatePlugins()
{
$this->activatePlugin('tracker');
$this->activatePlugin('agiledashboard');
$this->activatePlugin('cardwall');
PluginManager::instance()->invalidateCache();
PluginManager::instance()->loadPlugins();
$this->tracker_artifact_factory = Tracker_ArtifactFactory::instance();
$this->tracker_formelement_factory = Tracker_FormElementFactory::instance();
$this->tracker_factory = TrackerFactory::instance();
$this->hierarchy_checker = new AgileDashboard_HierarchyChecker(PlanningFactory::build(), new AgileDashboard_KanbanFactory($this->tracker_factory, new AgileDashboard_KanbanDao()), $this->tracker_factory);
return $this;
}
示例9: getKanbanFactory
/**
* @return AgileDashboard_KanbanFactory
*/
private function getKanbanFactory()
{
return new AgileDashboard_KanbanFactory(TrackerFactory::instance(), new AgileDashboard_KanbanDao());
}
示例10: getTrackerFactory
public function getTrackerFactory()
{
return TrackerFactory::instance();
}
示例11: build
/**
* @return TrackerXmlImport
*/
public static function build()
{
$builder = new Tracker_Artifact_XMLImportBuilder();
$tracker_factory = TrackerFactory::instance();
return new TrackerXmlImport($tracker_factory, EventManager::instance(), new Tracker_Hierarchy_Dao(), Tracker_CannedResponseFactory::instance(), Tracker_FormElementFactory::instance(), Tracker_SemanticFactory::instance(), new Tracker_RuleFactory(new Tracker_RuleDao()), Tracker_ReportFactory::instance(), WorkflowFactory::instance(), new XML_RNGValidator(), $tracker_factory->getTriggerRulesManager(), $builder->build());
}
示例12: service_public_areas
function service_public_areas($params)
{
require_once 'Tracker/TrackerFactory.class.php';
if ($params['project']->usesService('plugin_tracker')) {
$tf = TrackerFactory::instance();
// Get the artfact type list
$trackers = $tf->getTrackersByGroupId($params['project']->getGroupId());
if ($trackers) {
$entries = array();
foreach ($trackers as $t) {
if ($t->userCanView()) {
$entries[] = '<a href="' . TRACKER_BASE_URL . '/?tracker=' . $t->id . '">' . $t->name . '</a>';
}
}
if ($entries) {
$area = '';
$area .= '<a href="' . TRACKER_BASE_URL . '/?group_id=' . $params['project']->getGroupId() . '">';
$area .= $GLOBALS['HTML']->getImage('ic/clipboard-list.png');
$area .= ' ' . $GLOBALS['Language']->getText('plugin_tracker', 'service_lbl_key');
$area .= '</a>';
$area .= '<ul><li>' . implode('</li><li>', $entries) . '</li></ul>';
$params['areas'][] = $area;
}
}
}
}
示例13: get_projectid_from_url
public function get_projectid_from_url($params)
{
$url = $params['url'];
if (strpos($url, '/plugins/tracker/') === 0) {
if (!$params['request']->get('tracker')) {
return;
}
$tracker = TrackerFactory::instance()->getTrackerById($params['request']->get('tracker'));
if ($tracker) {
$params['project_id'] = $tracker->getGroupId();
}
}
}
示例14: XMLImportHelper
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tuleap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
*/
require_once 'pre.php';
try {
$user_manager = UserManager::instance();
$user_manager->forceLogin($argv[1]);
$tracker = TrackerFactory::instance()->getTrackerById($argv[2]);
if ($tracker) {
$xml_import_builder = new Tracker_Artifact_XMLImportBuilder();
$xml_import = $xml_import_builder->build(new XMLImportHelper($user_manager));
$zip = new ZipArchive();
if ($zip->open($argv[3]) !== true) {
echo 'Impossible to open archive ' . $argv[3] . PHP_EOL;
exit(1);
}
$archive = new Tracker_Artifact_XMLImport_XMLImportZipArchive($tracker, $zip, ForgeConfig::get('tmp_dir'));
$xml_import->importFromArchive($tracker, $archive);
}
} catch (XML_ParseException $exception) {
echo $exception->getMessage() . PHP_EOL;
echo $exception->getIndentedXml() . PHP_EOL;
echo implode(PHP_EOL, $exception->getErrors()) . PHP_EOL;
示例15: getTracker
/**
* Returns the tracker this artifact belongs to
*
* @return Tracker The tracker this artifact belongs to
*/
public function getTracker()
{
return TrackerFactory::instance()->getTrackerByid($this->tracker_id);
}