Load a language file into the appliaction

CCLang::load( 'some/path/to/file' );
CCLang::load( 'controller/example' );
CCLang::load( 'Blog::controller/dashboard' );

@param string			$path
@param bool			$overwrite
@return void
433924
public static function load( $path, $overwrite = false ) 
	{
		if ( array_key_exists( $path, static::$data[static::$current_language] ) && $overwrite === false ) 
		{
			return;
		}
		
		$file_path = CCPath::get( $path, CCDIR_LANGUAGE.static::$current_language.'/', EXT );
		
		if ( !file_exists( $file_path ) ) 
		{
			// as fallback try to load the language file of the default language
			if ( static::$current_language !== ( $default_lang = ClanCats::$config->get( 'language.default' ) ) )
			{
				$file_path = CCPath::get( $path, CCDIR_LANGUAGE.$default_lang.'/', EXT );
				
				if ( !file_exists( $file_path ) ) 
				{
					throw new CCException( "CCLang::load - could not find language file: ".$file_path );
				}
			}
			else
			{
				throw new CCException( "CCLang::load - could not find language file: ".$file_path );
			}
		}
		
		static::$data[static::$current_language][$path] = require( $file_path );
	}
1163490
public function decodeFile( $fileName, $overwrite = FALSE )
	{
		if( file_exists( $fileName ) )
		{
			if( $this->isEncoded( $fileName ) )
			{
				$file	= new FS_File_Editor( $fileName );
				$php	= $file->readString();
				$code	= $this->encode( $php );
				$dirname	= dirname( $fileName );
				$basename	= basename( $fileName );
				$target	= $dirname."/".substr( $basename, strlen( $this->filePrefix) , -strlen( $this->fileSuffix ) );
				if( $fileName == $target && !$overwrite )
					throw new RuntimeException( 'File cannot be overwritten, use Parameter "overwrite".' );
				$file->writeString( $code );
				return TRUE;
			}
		}
		return FALSE;	
	}
475528
public function writeOver($content)
	{
		$this->createPath($this->path);
		file_put_contents($this->getName(), $content);
	}
1367718
public function copy(string $destination, $overwrite = false) : bool
    {
        $copied = false;

        if ($this->isFile()) {
            $exists = file_exists($destination);
            if (!$exists || ($exists && $overwrite)) {
                $copied = copy($this->realPath, $destination);
            }
        }

        return $copied;
    }
273201
private function load()
	{
		if ($this->isLoaded())
		{
			return;
		}

		$path = sprintf('%s/../../lang/%s.php', __DIR__, $this->locale);

		if (file_exists($path))
		{
			$this->loaded[$this->locale] = require $path;
		}
	}
1145820
public static function load($path = BASE_DIR) {
        $librariesDir = dirname(dirname($path)) . DS . 'libraries';
        foreach (glob($librariesDir . DS . "*.php") as $filename) {
            require_once $filename;
        }
    }
564941
public function upload($source, $path, $override = false)
    {
        $path = ltrim($path, "/");
        return copy($source, $this->pathRoot.$path);
    }
268048
public function load($path)
    {
        $tests = $this->getTests($path);
        foreach ($tests as $test) {
            $this->context->setFile($test);
            include $test;
        }
    }
884052
public function importFromStream($overwrite = true) {
        $target = $this->findDestination($this->_data, $overwrite);
        $input = fopen('php://input', 'r');
        $output = fopen($target, 'w');

        $size = stream_copy_to_stream($input, $output);

        fclose($input);
        fclose($output);

        if ($size <= 0) {
            @unlink($target);

            throw new IoException('No file detected in input stream');
        }

        $this->_file = new File($target);

        return $size;
    }
296752
public function load(string $configPath, $overwrite = false): void
    {
        if (!file_exists($configPath)) {
            return;
        }
        $config = include $configPath;
        if (!is_array($config) && !is_object($config)) {
            return;
        }
        if (is_object($config)) {
            $config = get_object_vars($config);
        }
        $this->loadArray($config, $overwrite);
    }
153899
private function parse_files($path, $overwrite = true)
    {
        if (\is_dir($path)) {
            $files = \glob($path . '*.php');
        }

        if (!empty($files)) {
            foreach ($files as $file) {
                /** @noinspection PhpIncludeInspection */
                $parsed_options = require $file;

                $option_set = $this->get_filename($file);

                if (!\is_array($parsed_options)) {
                    continue;
                }

                if (isset($this->config[ $option_set ])) {
                    if ($overwrite) {
                        $this->config[ $option_set ] = \array_merge($this->config[ $option_set ], $parsed_options);
                    } else {
                        $this->config[ $option_set ] = \array_merge($parsed_options, $this->config[ $option_set ]);
                    }
                } else {
                    $this->config[ $option_set ] = $parsed_options;
                }
            }
        }
    }
286254
public function loadFromIni(string $iniPath, bool $overwrite = false): void
    {
        if (!file_exists($iniPath)) {
            return;
        }
        
        $iniArr = null;
        try {
            $iniArr = parse_ini_file($iniPath, false, INI_SCANNER_TYPED);
        } catch (\Throwable $e) {
        }
        if (!is_array($iniArr)) {
            return;
        }
        $iniArr = array_change_key_case($iniArr, CASE_LOWER);
        
        $arr = [];
        foreach ($iniArr as $name => $value) {
            $arr[lcfirst(str_replace('_', '', ucwords(str_replace('.', '_', $name), '_')))] = $value;
        }
        
        $this->loadArray($arr, $overwrite);
    }
900271
public function upload($source, $path, $override = false)
    {
        $fd = fopen($source, "rb");
        $writeMode = ($override===true) ? WriteMode::force() : WriteMode::add();
        $metadata = $this->dropbox->uploadFile($this->pathRoot.$path, $writeMode, $fd);
        fclose($fd);

        return !is_null($metadata);
    }
1084953
public function load($overwrite = false)
	{
		$lang = array();

		foreach ($this->languages as $language)
		{
			// try to retrieve the config from the database
			try
			{
				$result = \DB::select('lang')->from($this->table)->where('identifier', '=', $this->identifier)->where('language', '=', $language)->execute();
			}
			catch (Database_Exception $e)
			{
				// strip the actual query from the message
				$msg = $e->getMessage();
				$msg = substr($msg, 0, strlen($msg)  - strlen(strrchr($msg, ':')));

				// and rethrow it
				throw new \Database_Exception($msg);
			}

			// did we succeed?
			if ($result->count())
			{
				if ( ! empty($result[0]['lang']))
				{
					$lang = $overwrite ?
						array_merge($lang, unserialize($this->parse_vars($result[0]['lang']))) :
						\Arr::merge($lang, unserialize($this->parse_vars($result[0]['lang'])));
				}
			}
		}


		return $lang;
	}
837212
protected function loadRoutesFrom($path): void
    {
        if (Str::contains($this->app->version(), 'Lumen')) {
            require realpath($path);

            return;
        }

        parent::loadRoutesFrom($path);
    }
829539
public function syncWithTemplate($filePath, $overwrite = FALSE) {
    $sourcePath = $this->getBltRoot() . '/template/' . $filePath;
    $targetPath = $this->getRepoRoot() . '/' . $filePath;

    if ($this->getFileSystem()->exists($sourcePath)) {
      try {
        $this->getFileSystem()->copy($sourcePath, $targetPath, $overwrite);
      }
      catch (IOException $e) {
        throw $e;
      }
    }

  }
645515
public function overwrite($filepath)
    {
        $result = $this->sendOverwrite($filepath,
            $this->handle, $this->api_key, $this->security);

        // update metadata
        $this->metadata['filename'] = $result->metadata['filename'];
        $this->metadata['mimetype'] = $result->metadata['mimetype'];
        $this->metadata['size'] = $result->metadata['size'];

        return true;
    }