Loads project data by namespace:name
@param string $project_name namespace:name
@return \stdClass
@throws \Exception
874
protected function getByName($project_name) {

        if (!strstr($project_name, ":")) {
            throw (new \Exception("You must search for project with namespace: prefix"));
        }
        $parts = explode(':', $project_name);

        $projects = $this->_client->get('/projects/search/' . urlencode($parts[1]));

        $found_project = false;
        foreach ($projects as $project) {
            if (preg_match("~^" . $parts[0] . "$~", $project->namespace->name)) {
                return $project;
            }
        }

        if (!$found_project) {
            return false;
        }
    }
544382
final public static function getInstance($class_name = null)
    {
        if (is_null($class_name)) {
            $class_name = get_called_class();
        }

        $reflection = new \ReflectionClass($class_name);
        if (!$reflection->isInstantiable()) {
            throw new \Exception("The constructor of the class '$class_name' must be protected", 1);
        }

        if (empty(self::$pool[$class_name])) {
            self::$pool[$class_name] = new $class_name();
        }

        return self::$pool[$class_name];
    }
622761
public static function Load($name, $force_raw_return = false)
  {
    $dir = phoxy::Config()['api_dir'];
    $names = explode('/', $name);

    $module = array_pop($names);
    $directory = $dir.'/'.implode('/', $names);

    return LoadModule($directory, $module, $force_raw_return);
  }
110691
protected function retrieveNamespaces() {
		if ( is_array( $this->namespaces ) ) {
			return;
		}
		$params = [ 'meta' => 'siteinfo', 'siprop' => 'namespaces' ];
		$namespaces = $this->api->getRequest( new SimpleRequest( 'query', $params ) );
		if ( isset( $namespaces['query']['namespaces'] ) ) {
			$this->namespaces = $namespaces['query']['namespaces'];
		}
	}
1019017
protected static function _namespaceIsset($namespace, $name = null)
    {
        if (self::$_readable === false) {
            /**
             * @see Zend_Session_Exception
             */
            require_once 'Zend/Session/Exception.php';
            throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
        }

        if ($name === null) {
            return ( isset($_SESSION[$namespace]) || isset(self::$_expiringData[$namespace]) );
        } else {
            return ( isset($_SESSION[$namespace][$name]) || isset(self::$_expiringData[$namespace][$name]) );
        }
    }
1121572
private function buildNamespaces(Project $project): void
    {
        foreach ($project->getFiles() as $file) {
            foreach ($file->getNamespaces() as $namespaceFqsen) {
                $namespace = $this->getNamespaceByName($project, (string) $namespaceFqsen);
                $this->buildNamespace($file, $namespace);
            }
        }
    }
439977
public static function loadController($class_name)
    {
        foreach (self::$class_folders as $f) {
            $f = rtrim($f, '/');
            $filename = $f . '/' . $class_name . '.php';
            if (file_exists($filename)) {
                require_once $filename;
                if (class_exists($class_name)) {
                    return true;
                } else {
                    throw new TaskManagerException('file found but class ' . $class_name . ' not loaded');
                }
            }
        }

        throw new TaskManagerException('class ' . $class_name . ' not found');
    }
1215032
public function loadObject($class_name = "stdClass")
    {
        if ($this->stmt === null) {
            return null;
        }

        return $this->stmt->fetchObject($class_name);
    }
414845
public function GenerateClassesHeader($header_name)
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        $header_object = $this->symbols->headers[$header_name];
        $header_define = $this->GetHeaderDefine($header_name);

        $header_content = "";

        if($header_object->HasClasses())
        {
            // Get heading of header file
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "headers",
                    "header",
                    "classes",
                    "header"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();

            foreach($header_object->namespaces as $namespace_name=>$namespace_object)
            {
                if($namespace_name == "\\")
                    $namespace_name = "";

                $namespace_name_cpp = str_replace(
                    "\\",
                    "::",
                    $namespace_name
                );

                $namespace_name_var = str_replace(
                    "\\",
                    "_",
                    $namespace_name
                );

                foreach($namespace_object->classes as $class_name=>$class_object)
                {
                    $constructor_code = "";
                    $virtual_methods_code = "";
                    $properties_init_code = "";
                    $properties_uninit_code = "";

                    // Get class declaration code
                    ob_start();
                        include($this->GetTemplatePath(
                            $class_name,
                            "",
                            "declaration",
                            "classes",
                            "declaration"
                        ));
                        $header_content .= ob_get_contents();
                    ob_end_clean();

                    $header_content .= "\n";
                }
            }

            // Get footer of header file
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "headers",
                    "footer",
                    "classes",
                    "header"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();
        }

        return $header_content;
    }
1121875
public function createProjectSkel($projectName)
    {
        $rootDir = $this->config->get('phpalchemy.root_dir');
        $defAppIniFile = $rootDir . '/config/defaults.application.ini';

        if (! self::validateProjectName($projectName)) {
            throw new \Exception(
                "Error: Invalid project name!\nProject name can be contains only alphanumeric characteres."
            );
        }

        $newProjectDir = getcwd() . '/' . $projectName;

        if (! file_exists($defAppIniFile)) {
            throw new \Exception("FATAL ERROR: File: 'defaults.application.ini' is missing!");
        }

        $this->projectDir = $newProjectDir;
        $this->config->set('app.root_dir', $newProjectDir);

        // create main project dir
        self::createDir($newProjectDir);

        $this->config->load($this->homeDir . DS . 'config' . DS . 'defaults.application.ini');
        $this->config->load($this->projectDir . DS . 'application.ini');

        $appInitConf = $this->config->all();
        //print_r($appInitConf); die;

        // creating directories skel.
        foreach ($appInitConf as $key => $targetDir) {
            // process only directory path ini. conf.
            //if (strpos($key, '_dir') !== false) {
            if (preg_match('/^app\.[\w]+_dir/', $key, $m) && $key !== 'app.root_dir') {
                //echo $key.' -> '.$targetDir . PHP_EOL;
                self::createDir($targetDir);
            }
        }

        // defining vars
        $data = array();
        $data['appName'] = $projectName;
        $data['namespace'] = self::camelize($projectName);
        $data['framework_dir'] = $this->homeDir;

        // read project templates & others files
        $projectFiles = glob($rootDir . '/templates/project/*');

        foreach ($projectFiles as $file) {
            $targetFile = $this->projectDir.'/'.str_replace('|', DIRECTORY_SEPARATOR, basename($file));
            self::createDir(pathinfo($targetFile, PATHINFO_DIRNAME));

            if (substr($file, -4) === '.tpl') {
                $contents = file_get_contents($file);
                $targetFile = str_replace('.tpl', '', $targetFile);

                // replace data on template
                foreach ($data as $key => $value) {
                    $contents = str_replace('{'.$key.'}', $value, $contents);
                }

                // write the composed template to target file
                file_put_contents($targetFile, $contents);
            } else {
                // just we need to copy file
                copy($file, $targetFile);
            }
        }

        return $projectName;
    }
980401
public function loadData($name) {

        $file = sprintf('%s/../Resources/fixtures/%s.yml', __DIR__ , $name);
        if(!file_exists($file)) {
            throw new \Exception(sprintf('fixtures file "%s" not found for name "%s"', $file, $name));
        }

        $data = Yaml::parse($file);

        $items = [];
        foreach ($data as $args) {
            $item = $this->create($args);
            $this->manager->persist($item);
            $items[] = $item;
        }

        $this->manager->flush();
    }
774224
static function &loadExistingReport($reportfile, $projects_folder = "projects")
    {
        $q = new Reportico();
        $q->reports_path = $projects_folder . "/" . ReporticoApp::getconfig("project");
        $q->projects_folder = $projects_folder;

        $reader = new XmlReader ($q, $reportfile, false);
        $reader->xml2query();

        return $q;
    }
385274
public function getIdByName($project, $name)
    {
        $arr = $this->listing($project);
        if (!isset($arr[$name])) {
            return false;
        }

        return $arr[(string) $name];
    }
157328
public static function load ($class_name)
	{
		$file_name = str_replace(self::MOLLIE_PREFIX, '', strtolower($class_name), $count);
		if (empty($count)) {
			return;
		}

		if (file_exists($file_name = __DIR__ . DIRECTORY_SEPARATOR . "$file_name.php")) {
			require $file_name;
		}
	}
1267915
public function namespaced_inc_dot(string $class_name)
    {
        $namespace = $this->get_namespace($class_name);

		$file = $this->filename_normal($namespace);
		if(is_file($file))
		{
			require_once($file);
		}
		else
		{
			if($this->debug) echo "\r\n", "Not found: ", $file;
		}
    }
28896
static function getParameters($connection_name) {
		if (!array_key_exists($connection_name, self::$parameters)) {
			throw new RuntimeException("Configuration for database '$connection_name' not loaded");
		}

		return self::$parameters[$connection_name];
	}
409804
public function getProject($name)
    {
        if ( ! $this->hasProject($name) )
        {
            throw new \InvalidArgumentException("Project [$name] could not be found in [{$this->rootDir}]");
        }

        return $this->projects->get($name);
    }