/**
  * @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());
 }
 *
 * 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;
    exit(1);
}
 *
 * 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();
        $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;
    exit(1);
}