this method send path on dev mode to correct write package name
@param string $package
@return string
181454
private function getPackageDevName(string $package) {
		$bundle = explode("/", $package)[1];
		$explode = explode("-", $bundle);
		
		$package_name = "";
		
		foreach ($explode as $string) {
			$package_name .= ucfirst($string);
		}
		
		return $package_name;
	}
597975
protected function readFromSource(array $source, string $package) : ?string
    {
        // Abort if no name property
        if(!isset($source['name'])){
            return null;
        }

        // Abort if name is not the same a package name
        if($source['name'] != $package){
            return null;
        }

        // At this point it means that the package matches.
        // We check for a version property.
        if(isset($source['version'])){
            return $source['version'];
        }

        // This means that no version property existed - which
        // could mean that the source is an actual composer file.
        // Therefore, we check if there is an branch alias
        // specified. (dev-master assumed)
        if(isset($source['extra']['branch-alias']['dev-master'])){
            return $source['extra']['branch-alias']['dev-master'];
        }

        // Sadly, if reached here then there is no version available
        // nor a branch alias. Therefore, we can only return a default
        // version...
        return self::DEFAULT_VERSION;
    }
235129
protected function getPackagePath($env, $package, $group)
    {
        $file = str_replace('/', DS, "Packages/{$package}/{$env}/{$group}.php");

        return $this->defaultPath .DS .$file;
    }
375580
protected function _getFilenames( $package, $prePath = '' )
	{
		$filenames = array();
		$ds = DIRECTORY_SEPARATOR;

		foreach( $package->fileIncludes as $include )
		{
			if( !is_object( $include ) ) {
				throw new MW_Jsb2_Exception( 'Invalid file inlcude' );
			}

			$filename = $include->path . $include->text;
			$absfilename = $this->_basePath . $filename;

			if( $ds !== '/' ) {
				$absfilename = str_replace( '/', $ds, $absfilename );
			}

			if( !file_exists( $absfilename ) ) {
				throw new MW_Jsb2_Exception( sprintf( 'File does not exists: "%1$s"', $absfilename ) );
			}

			$filenames[] = $prePath . $filename;
		}

		return $filenames;
	}
871513
public function getPackageTranslations(Package $package)
    {
        $localStats = $this->localFactory->getAvailablePackageStats($package);
        $remoteStats = $this->remoteProvider->getAvailablePackageStats($package->getPackageHandle(), $package->getPackageVersion());

        return $this->computeUpdates($localStats, $remoteStats, $package);
    }
116
public function getPattern(PackageInterface $package)
    {
        if (isset($this->packages[$package->getName()])) {
            return $this->packages[$package->getName()];
        } elseif (isset($this->packages[$package->getPrettyName()])) {
            return $this->packages[$package->getPrettyName()];
        } elseif (isset($this->types[$package->getType()])) {
            return $this->types[$package->getType()];
        }
    }
697031
public function resolveName($package)
	{
		if (is_object($package)) {
			$package = get_class($package);
		}

		$package = substr($package, strrpos($package, '\\'));

		$package = trim($package, '\\');

		$package = str_replace(array('Supra', 'Package'), '', $package);

		return $package;
	}
1105929
protected function publishAssets(string $package): void
    {
        if (! is_null($path = $this->getPath())) {
            $this->assets->publish($package, $path);
        } else {
            $this->assets->publishPackage($package);
        }

        $this->output->writeln('<info>Assets published for package:</info> '.$package);
    }
901802
static function appendLicence( $package )
    {
        $package->appendDocument( 'LICENCE', false, false, false, true,
                                  "This file is part of the package " . $package->attribute( 'name' ) . ".\n" .
                                  "\n" .
                                  "This package is free software; you can redistribute it and/or modify\n" .
                                  "it under the terms of the GNU General Public License as published by\n" .
                                  "the Free Software Foundation; either version 2 of the License, or\n" .
                                  "(at your option) any later version.\n" .
                                  "\n" .
                                  "This package is distributed in the hope that it will be useful,\n" .
                                  "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" .
                                  "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n" .
                                  "GNU General Public License for more details.\n" .
                                  "\n" .
                                  "You should have received a copy of the GNU General Public License\n" .
                                  "along with this package; if not, write to the Free Software\n" .
                                  "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n" );
    }
1234173
private function getOrCreate($package)
    {
        if (isset($this->packages[strtolower($package)])) {
            return $this->packages[strtolower($package)];
        }

        return $this->packages[strtolower($package)] = new PackageNode($package);
    }
872790
public function setPackage($package)
    {
        if ($package instanceof AbstractPackage) {
            $this->package = $package;
        } else {
            $this->package = PackageHelper::getPackage($package);
        }

        return $this;
    }
899162
public function getInstallPath(PackageInterface $package)
    {
        $flowPackageType = $this->getFlowPackageType($package->getType());
        $camelCasedType = $this->camelCaseFlowPackageType($flowPackageType);
        $flowPackageName = $this->deriveFlowPackageName($package);

        if (isset($this->packageTypeToPathMapping[$flowPackageType])) {
            $installPath = $this->packageTypeToPathMapping[$flowPackageType];
        } else {
            $installPath = $this->packageTypeToPathMapping['*'];
        }

        return $this->replacePlaceholdersInPath($installPath, compact('flowPackageType', 'camelCasedType', 'flowPackageName'));
    }
108321
public function getDeployInfo($package) {
    $deployInfoFile = $package->getRootDirectory()->getFile('deploy-info.json');

    $deployInfo = new \stdClass;
    if ($deployInfoFile->exists()) {
      $deployInfo = JSONConverter::create()->parseFile($deployInfoFile);
    }

    if (!isset($deployInfo->isStaging)) {
      $deployInfo->isStaging = NULL;
    }

    if (!isset($deployInfo->isDevelopment)) {
      $deployInfo->isDevelopment = NULL;
    }

    if (!isset($deployInfo->isBuilt)) {
      $deployInfo->isBuilt = NULL;
    }

    return $deployInfo;
  }
1214360
protected function getConfigPackagePath(string $dir, PackageInterface $package): ?string
    {
        $dir = preg_replace(
            '#^(' . preg_quote(getcwd() . DIRECTORY_SEPARATOR, '#') . ')#',
            '.' . DIRECTORY_SEPARATOR,
            $dir
        );

        $path = $this->getConfigPath($dir);
        if (file_exists($path))
        {
            $this->getLogger()->write(
                sprintf(
                    '  - Found in <info>%s</info>',
                    $package->getPrettyName()
                )
            );

            return $path;
        }

        return null;
    }
90106
public function findPackageConfiguration($package)
    {
        $paths = [
            $this->paths->getBasePath().'vendor/%s/src/config',
            $this->paths->getBasePath().'vendor/%s/config',
            $this->paths->getRocketeerPath().'/vendor/%s/src/config',
            $this->paths->getRocketeerPath().'/vendor/%s/config',
            $this->paths->getUserHomeFolder().'/.composer/vendor/%s/src/config',
            $this->paths->getUserHomeFolder().'/.composer/vendor/%s/config',
        ];

        // Check for the first configuration path that exists
        $paths = array_map(function ($path) use ($package) {
            return sprintf($path, $package);
        }, $paths);

        return $paths;
    }
490467
protected function searchProvides($package)
    {
        $packageName = $package instanceof Package ? $package->getName() : $package;
        $providesJsonLocation = base_path("vendor/{$packageName}/provides.json");
        if (file_exists($providesJsonLocation)) {
            $provides = json_decode(str_replace('\\', '\\\\', file_get_contents($providesJsonLocation)), true);
            $return = array('providers' => array(), 'aliases' => array());
            if (isset($provides['providers']) && is_array($provides['providers'])) {
                $return['providers'] = $provides['providers'];
            }
            if (isset($provides['aliases']) && is_array($provides['aliases'])) {
                $return['aliases'] = $provides['aliases'];
            }
            return $return;
        }
        return false;
    }
1136654
public static function provider($package)
    {
        $location = __DIR__.'/../../'.$package.'/src';

        $files = is_dir($location) ? scandir($location) : [];

        foreach ($files as $file) {
            if (strpos($file, 'ServiceProvider') !== false) {
                return str_replace('.php', '', $file);
            }
        }

        return false;
    }