Get project from URL

@return DNProject
351165
protected function getProject() {
		$projectName = $this->getRequest()->param('Project');
		return DNProject::get()->filter('Name', $projectName)->first();
	}
1139358
public function getProject($id, $hostname = null, $https = true)
    {
        // Search for a project in the user's project list.
        foreach ($this->getProjects() as $project) {
            if ($project->id === $id) {
                return $project;
            }
        }

        // Look for a project directly if the hostname is known.
        if ($hostname !== null) {
            return $this->getProjectDirect($id, $hostname, $https);
        }

        // Use the project locator.
        if ($url = $this->locateProject($id)) {
            return Project::get($url, null, $this->connector->getClient());
        }

        return false;
    }
853832
public static function create_from_path($path) {
		$project = DNProject::create();
		$project->Name = $path;
		$project->write();

		// add the administrators group as the viewers of the new project
		$adminGroup = Group::get()->filter('Code', 'administrators')->first();
		if($adminGroup && $adminGroup->exists()) {
			$project->Viewers()->add($adminGroup);
		}
		return $project;
	}
821844
function getProjects() {
		$getUserProjectsRequest = new getUserProjects ();
		$getUserProjectsRequest->isSubProjectIncluded = TRUE;
		$projects = $this->projectService->getUserProjects ( $getUserProjectsRequest )->return;

		$i = 0;
		$proj_arr = array ();
		if (is_array ( $projects )) {
			foreach ( $projects as $project ) {
				$pdproject = new PDProject ( $project );
				$proj_arr [$i ++] = $pdproject;
			}
		} else {
			$fullProject = $this->getProject ( $projects->projectInfo->shortCode );
			$proj_arr [0] = $fullProject;
		}
		
		return $proj_arr;
	}
237620
public function get($project, $firewall, $optParams = array()) {
      $params = array('project' => $project, 'firewall' => $firewall);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Firewall($data);
      } else {
        return $data;
      }
    }
1082329
public function get($project, $network, $optParams = array()) {
      $params = array('project' => $project, 'network' => $network);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Google_Network($data);
      } else {
        return $data;
      }
    }
1348598
public function getProjects($reset = false)
    {
        $data = $this->getAccountInfo($reset);
        $client = $this->connector->getClient();
        $projects = [];
        foreach ($data['projects'] as $project) {
            // Each project has its own endpoint on a Platform.sh region.
            $projects[] = new Project($project, $project['endpoint'], $client);
        }

        return $projects;
    }
143173
function fetchProject(projectId) {
	return cocoonSDK.ProjectAPI.get(projectId)
	.catch((error) => {
		console.error("Project with ID: " + projectId + " couldn't be fetched.");
		console.trace(error);
		throw error;
	});
}
1263914
public function getAllApps():\stdClass
    {
        $file = JL::open(FEnv::get("framework.config.core.apps.file"));
        foreach ($file as $one) {
            $one->link_edit_save = $this->generateRoute(
                "iumio_manager_app_manager_edit_save_app",
                array("appname" => $one->name),
                null,
                true
            );

            $one->link_auto_dis_ena = $this->generateRoute(
                "iumio_manager_app_manager_auto_dis_ena_app",
                array("appname" => $one->name),
                null,
                true
            );

            $one->link_remove = $this->generateRoute(
                "iumio_manager_app_manager_remove_app",
                array("appname" => $one->name),
                null,
                true
            );

            $one->link_export = $this->generateRoute(
                "iumio_manager_app_manager_export_app",
                array("appname" => $one->name),
                null,
                true
            );

            $one->link_config = $this->generateRoute(
                "iumio_manager_app_manager_get_config_app",
                array("appname" => $one->name),
                null,
                true
            );
        }
        return ($file);
    }
1252700
public function getProjectData()
	{
		$data		= $this->readProjectDates();
		$meetings	= $this->readMeetingDates();
		$data['meetings']	= $meetings;
		return $data;
	}
765920
protected function getStub()
    {
        $projectRootDirectory = $this->filesystem
            ->projectRootDirectory();
        $path = Path::fromStrings(
            $projectRootDirectory,
            'src',
            'Stubs',
            \ucfirst($this->type() . 'Task.php')
        );

        return $this->filesystem
            ->readContent($path->toString());
    }
737560
def get_project(self) -> str:
        """"""
        xdoc = self.connection.soap_action('/ws/ControllerService',
                                           'getIHCProject', "")
        if xdoc:
            base64data = xdoc.find(
                './SOAP-ENV:Body/ns1:getIHCProject1/ns1:data',
                IHCSoapClient.ihcns).text
            if not base64:
                return False
            compresseddata = base64.b64decode(base64data)
            return zlib.decompress(compresseddata,
                                   16+zlib.MAX_WBITS).decode('ISO-8859-1')
        return False
887104
public function onAttachProject()
    {
        try {
            if (!$projectId = trim(post('project_id'))) {
                throw new ApplicationException(Lang::get('system::lang.project.id.missing'));
            }

            $manager = UpdateManager::instance();
            $result = $manager->requestProjectDetails($projectId);

            Parameter::set([
                'system::project.id'    => $projectId,
                'system::project.name'  => $result['name'],
                'system::project.owner' => $result['owner'],
            ]);

            return $this->onForceUpdate();
        }
        catch (Exception $ex) {
            $this->handleError($ex);
            return $this->makePartial('project_form');
        }
    }
873480
public final function getParentProject() {
        if (\is_null($this->__parent__project)) {
            $result = ProjectUtil::searchRelativeProject($this);
            if (\count($result) < 1) {
                throw new ProjectMemberNotFoundException("SOURCE ROAD NOT FOUND");
            }
            $this->__parent__project = $result[0];
        }
        return $this->__parent__project;
    }
1284953
public function getProject($id, $host = null, $refresh = null)
    {
        // Find the project in the user's main project list. This uses a
        // separate cache.
        $projects = $this->getProjects($refresh);
        if (isset($projects[$id])) {
            return $projects[$id];
        }

        // Find the project directly.
        $cacheKey = sprintf('%s:project:%s:%s', $this->sessionId, $id, $host);
        $cached = $this->cache->fetch($cacheKey);
        if ($refresh || !$cached) {
            $scheme = 'https';
            if ($host !== null && (($pos = strpos($host, '//')) !== false)) {
                $scheme = parse_url($host, PHP_URL_SCHEME);
                $host = substr($host, $pos + 2);
            }
            $project = $this->getClient()
                ->getProject($id, $host, $scheme !== 'http');
            if ($project) {
                $toCache = $project->getData();
                $toCache['_endpoint'] = $project->getUri(true);
                $this->cache->save($cacheKey, $toCache, $this->config->get('api.projects_ttl'));
            }
        } else {
            $guzzleClient = $this->getHttpClient();
            $baseUrl = $cached['_endpoint'];
            unset($cached['_endpoint']);
            $project = new Project($cached, $baseUrl, $guzzleClient);
        }

        return $project;
    }
1013974
public function getProjects($refresh = null)
    {
        $cacheKey = sprintf('%s:projects', $this->sessionId);

        /** @var Project[] $projects */
        $projects = [];

        $cached = $this->cache->fetch($cacheKey);

        if ($refresh === false && !$cached) {
            return [];
        } elseif ($refresh || !$cached) {
            foreach ($this->getClient()->getProjects() as $project) {
                $projects[$project->id] = $project;
            }

            $cachedProjects = [];
            foreach ($projects as $id => $project) {
                $cachedProjects[$id] = $project->getData();
                $cachedProjects[$id]['_endpoint'] = $project->getUri(true);
            }

            $this->cache->save($cacheKey, $cachedProjects, $this->config->get('api.projects_ttl'));
        } else {
            $guzzleClient = $this->getHttpClient();
            foreach ((array) $cached as $id => $data) {
                $projects[$id] = new Project($data, $data['_endpoint'], $guzzleClient);
            }
        }

        return $projects;
    }
20893
protected CmsProject getOfflineIndexProject() {

        CmsProject result = null;
        for (I_CmsSearchIndex index : m_offlineIndexes) {
            try {
                result = m_adminCms.readProject(index.getProject());

                if (!result.isOnlineProject()) {
                    break;
                }
            } catch (Exception e) {
                // may be a missconfigured index, ignore
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }