Adds a project.

@param Project $project A Project instance
328195
public function addProject(Project $project)
    {
        $this->storage->updateProject($project);

        $this->projects[$project->getSlug()] = $project;
    }
1341964
public function add($project_id, $person_id)
    {
        $this->validates($project_id, $person_id);
        return $this->rest->post("projects/$project_id/people/$person_id");
    }
589483
public function handle(Project $project, $existingResult = null)
    {
        $zipFile = __DIR__ . '/../../../../../data/source.zip';
        $archive = new \ZipArchive();
        $archive->open($zipFile, \ZipArchive::OVERWRITE | \ZipArchive::CREATE);
        $finder = new FinderFacade(array($project->baseDir), $project->excludes, array('*.php'));
        foreach ($finder->findFiles() as $existingResult) {
            $archive->addFile($existingResult, ltrim(str_replace($project->baseDir, '', $existingResult), '/'));
        }
        $archive->close();
    }
969057
public ItemRequest<Project> addMembers(String project) {
    
        String path = String.format("/projects/%s/addMembers", project);
        return new ItemRequest<Project>(this, Project.class, path, "POST");
    }
1078464
public void setProjects(java.util.Collection<String> projects) {
        if (projects == null) {
            this.projects = null;
            return;
        }

        this.projects = new java.util.ArrayList<String>(projects);
    }
15722
private function addBuildListeners(Project $project)
    {
        // Add the default listener
        $project->addBuildListener($this->createLogger());

        foreach ($this->listeners as $listenerClassname) {
            try {
                $clz = Phing::import($listenerClassname);
            } catch (Exception $e) {
                $msg = "Unable to instantiate specified listener "
                    . "class " . $listenerClassname . " : "
                    . $e->getMessage();
                throw new ConfigurationException($msg);
            }

            $listener = new $clz();

            if ($listener instanceof StreamRequiredBuildLogger) {
                throw new ConfigurationException("Unable to add " . $listenerClassname . " as a listener, since it requires explicit error/output streams. (You can specify it as a -logger.)");
            }
            $project->addBuildListener($listener);
        }
    }
606289
private function collectProjectFilesUseData(Project $project)
    {
        /** @var File $file */
        foreach ($project['compiled'] as $file) {
            if (! $uses = $file->getData('use')) {
                continue;
            }
            foreach ($uses as $use) {
                if (! $items = $file->getData($use.'_items')) {
                    continue;
                }

                array_walk_recursive($items, function (&$file, $fileKey) use ($project) {
                    /** @var File $compiledFile */
                    if (! $compiledFile = $project->get('compiled.'.$fileKey)) {
                        $file = null;
                    } else {
                        $file = new ViewFile($project, $compiledFile->getUid());
                    }
                });

                // Filter out deleted pages, such as drafts
                $items = array_filter($items, function ($value) {
                    return ! is_null($value);
                });

                $file->setData([$use.'_items' => $items]);
            }
        }
    }
170944
public function addText(Project $project, $element, $text)
    {
        if ($this->methodAddText === null) {
            $msg = $this->getElementName($project, $element) . " doesn't support nested text data.";
            throw new BuildException($msg);
        }
        try {
            $method = $this->methodAddText;
            $method->invoke($element, $text);
        } catch (Exception $exc) {
            throw new BuildException($exc->getMessage(), $exc);
        }
    }
1245128
public function execute(ProjectDescriptor $project): void
    {
        /** @var Collection|DescriptorAbstract[] $elementCollection */
        $this->elementCollection = $project->getIndexes()->get('elements');

        foreach ($this->elementCollection as $descriptor) {
            $this->resolveSeeAndLinkTags($descriptor);
        }
    }
567384
private function getTree(Project $project)
    {
        $key = $project->getBuildDir();
        if (!isset($this->cachedTree[$key])) {
            $this->cachedTree[$key] = $this->tree->getTree($project);
        }

        return $this->cachedTree[$key];
    }
304593
private void addSingleProjectToProjects(ProjectsDetails projectsDetails, String projectName, ProjectsDetails projects) {
        if (projectsDetails == null || projects == null || projectName == null) {
            logger.debug("projectsDetails {} , projects {} , projectName {}", projectsDetails, projectName, projects);
            return;
        }
        if (projectsDetails.getProjects().size() == 1) {
            String projectVersion = config.getRequest().getProjectVersion();
            AgentProjectInfo projectInfo = projectsDetails.getProjects().stream().findFirst().get();
            projectInfo.setCoordinates(new Coordinates(null, projectName, projectVersion));
            LinkedList<ViaComponents> viaComponents = projectsDetails.getProjectToViaComponents().get(projectInfo);
            projects.getProjectToViaComponents().put(projectInfo, viaComponents);
        } else {
            for (AgentProjectInfo projectInfo : projectsDetails.getProjects()) {
                logger.debug("Project not added - {}", projectInfo);
            }
        }
    }
976715
public function createProject(Project $project)
    {
        $request = $this->client->createRequest('POST', '/api/projects', null, array('insight_project' => $project->toArray()));

        return $this->serializer->deserialize(
            (string) $this->send($request)->getBody(),
            'SensioLabs\Insight\Sdk\Model\Project',
            'xml'
        );
    }
1362728
public function setProjectPath($path)
    {
        if (!($path instanceof \Phrozn\Path\Project)) {
            $path = new ProjectPath($path);
        }
        $this->projectPath = $path->get(); // calculate path

        return $this;
    }
343283
function addProject(project) {
		var hub = generateUniqueHubId();
		//TODO Also add name of project owner? Replace by projectJSON all over the file.
		var query = sharedProject.findOne({location: project});
		return query.exec()
		.then(function(doc) {
			return doc ? Promise.resolve(doc) : sharedProject.create({location: project, hubid: hub});
		});
	}
1105899
public static final function registerProject(Project $project) {
        if (isset(self::$REGISTERED_PRROJECT_INSTANCES[$project->getProjectName()])) {
            throw new ConflictProjectNameException(sprintf("The project \"%s\" EXISTS.", $project->getProjectName()));
        }
        self::$REGISTERED_PRROJECT_INSTANCES[$project->getProjectName()] = $project;
    }
166603
public function mapDirectory($directory, Project $project)
    {
        if (!file_exists($directory . '/.git')) {
            throw new \InvalidArgumentException('Not a Git repository: ' . $directory);
        }
        $projectConfig = [
            'id' => $project->id,
        ];
        if ($host = parse_url($project->getUri(), PHP_URL_HOST)) {
            $projectConfig['host'] = $host;
        }
        $this->writeCurrentProjectConfig($projectConfig, $directory, true);
        $this->ensureGitRemote($directory, $project->getGitUrl());
    }
87353
public function execute(ProjectDescriptor $project)
    {
        $rootPackageDescriptor = new PackageDescriptor();
        $rootPackageDescriptor->setName('\\');
        $project->getIndexes()->set('packages', new Collection());
        $project->getIndexes()->packages['\\'] = $rootPackageDescriptor;

        foreach ($project->getFiles() as $file) {
            $this->addElementsOfTypeToPackage($project, array($file), 'files');
            $this->addElementsOfTypeToPackage($project, $file->getConstants()->getAll(), 'constants');
            $this->addElementsOfTypeToPackage($project, $file->getFunctions()->getAll(), 'functions');
            $this->addElementsOfTypeToPackage($project, $file->getClasses()->getAll(), 'classes');
            $this->addElementsOfTypeToPackage($project, $file->getInterfaces()->getAll(), 'interfaces');
            $this->addElementsOfTypeToPackage($project, $file->getTraits()->getAll(), 'traits');
        }
    }