Updates the Composer config

@param string $currName The current application name
@param string $newName The new application name
483166
protected function updateComposer(string $currName, string $newName)
    {
        $rootPath = Config::get('paths', 'root');
        $currComposerContents = $this->fileSystem->read("$rootPath/composer.json");
        // Change the PSR-4 namespace
        $updatedComposerContents = str_replace(
            "$currName\\\\",
            "$newName\\\\",
            $currComposerContents
        );
        $this->fileSystem->write("$rootPath/composer.json", $updatedComposerContents);
    }
663458
function updated($new = null)
    {
        if (isset($new) && ($this->_attributes['updated'] != $new)){
            $this->change('updated', (int)$new);
        }
        return $this->_attributes['updated'];
    }
827412
public function setName($name)
    {
        if (empty($name))
            throw new NoticeException('Command "'.$this->key.'": No name given.');

        // Checkfor MVC configuration file
        if (empty($this->configFilename))
            throw new NoticeException('Command "'.$this->key.'": No configuration file found.');
        $currentname = $this->config['namespace'];

        $this->replaceInFile($currentname, $name, $this->configFilename);
        if (file_exists($this->rootPath . '/app/Main.php'))
            $this->replaceInFile( 
                'namespace ' . $currentname,
                'namespace ' . $name
                , $this->rootPath.'/app/Main.php'
            );

        foreach (scandir($this->rootPath.'/app/Models') as $filename) {
            $this->replaceInFile( 
                'namespace ' . $currentname,
                'namespace ' . $name,
                $this->rootPath.'/app/Models/' . $filename
            );
        }

        foreach (scandir($config['paths']['controllers']) as $filename) {
            $this->replaceInFile( 
                'namespace ' . $currentname,
                'namespace ' . $name,
                $config['paths']['controllers'] . $filename
            );
            $this->replaceInFile( 
                'use ' . $currentname,
                'use ' . $name,
                $config['paths']['controllers'] . $filename
            );
        }

        if (file_exists($this->rootPath . '/composer.json'))
            $this->replaceInFile( 
                '"' . $currentname,
                '"' . $name,
                $this->rootPath . '/composer.json'
            );

        if (file_exists($this->rootPath . '/package.json'))
            $this->replaceInFile( 
                '"' . strtolower($currentname),
                '"' . strtolower($name),
                $this->rootPath . '/package.json'
            );

        $this->_print('Namespace changed!');
        $this->_lineBreak();

        if (file_exists($this->rootPath . '/composer.json'))
            exec( 'composer dump-autoload' );
    }
450886
private function setNewFilename($newfilename = null)
    {
        $extension = $this->results['original_extension'];
        $originalFilename = $this->results['original_filename'];

        $timestamp = Carbon::now()->getTimestamp();

        switch ($this->newfilename) {
            case 'hash':
                $newfilename = md5($originalFilename.$timestamp);
                break;
            case 'random':
                $newfilename = Str::random(16);
                break;
            case 'timestamp':
                $newfilename = $timestamp;
                break;
            case 'custom':
                $newfilename = (! empty($newfilename) ? $newfilename : $originalFilename);
                break;
            default:
                $newfilename = pathinfo($originalFilename, PATHINFO_FILENAME);
        }

        $this->results['basename'] = (string) $newfilename;
        $this->results['filename'] = $newfilename.'.'.$extension;

        return $this;
    }
1274542
private function setConfigNamespace($oldNamespace, $newNamespace)
    {
        $files = $this->filesystem->files(base_path() . '/config');

        foreach ($files as $file) {
            $content = $this->filesystem->get($file);
            $this->filesystem->create($file, preg_replace("/\\b" . $oldNamespace . "\\b/", $newNamespace, $content));
        }
    }
1240339
public function renameName($nameIndex, $newName)
    {
        foreach ($this->lines as $line) {
            $line->renameName($nameIndex, $newName);
        }
    }
1347099
protected function update($newModulePath, $moduleName)
    {
        $curModulePath = $this->getModuleDirectory($moduleName);

        $curVersion = $this->def($moduleName, 'version');
        $newVersion = $this->def($newModulePath, 'version', true);

        $curVersion = new Version($curVersion);
        $newVersion = new Version($newVersion);

        if (!$newVersion->greaterThan($curVersion))
        {
            $this->errors->add('update_version', 'Current version is greater than or equal uploaded version.');
            return false;
        }

        if ($this->checkModuleDepends($moduleName, $curVersion, $newVersion))
            return false;

        $moduleDependency = $this->def($newModulePath, 'require', true);
        if (!$moduleDependency = $this->checkDependency($moduleDependency))
            return false;

        //Move and replace new version
        if (!$this->removeModuleDirectory($moduleName))
            return false;

        if (!$this->files->copyDirectory($newModulePath, $curModulePath))
        {
            $this->errors->add('move_files', 'Can not move new version files to '.$newModulePath);
            return false;
        }

        $this->removeAssets($moduleName);
        $this->buildAssets($moduleName);

        $this->updateRegisteredModule($moduleName);

        return true;
    }
692511
public function rename(string $newName): bool {
		return $this->manager->rename($this->getUrl(), Paths::getPath($this->getAbsolutePath()) . "/" . $newName);
	}
795801
public static function build(Table $table, $columnName, $newName)
    {
        $column = new Column();
        $column->setName($columnName);

        return new static($table, $column, $newName);
    }
568733
public function alterDbTable($model, $oldDbTableName, $newDbTableName)
    {
        if ($oldDbTableName === $newDbTableName) {
            return;
        }
        $this->renameTable($oldDbTableName, $newDbTableName);
    }
912902
protected function renameFile($path, $newName)
    {
        $newPath = pathinfo($path, PATHINFO_DIRNAME) . '/' . $newName;

        try {
            $success = rename($path, $newPath);

            // @codeCoverageIgnoreStart
        } catch (\Exception $e) {
            throw new CouldNotRetrieveRemoteFileException("Failed to rename '{$path}' to '{$newName}'", $e->getCode(), $e);
            // @codeCoverageIgnoreEnd
        }

        // @codeCoverageIgnoreStart
        if ( ! $success) {
            throw new CouldNotRetrieveRemoteFileException("Failed to rename '{$path}' to '{$newName}'");
        }
        // @codeCoverageIgnoreEnd

        return $newPath;
    }
604396
public function updateNamedFormulas(PHPExcel $pPhpExcel, $oldName = '', $newName = '')
    {
        if ($oldName == '') {
            return;
        }

        foreach ($pPhpExcel->getWorksheetIterator() as $sheet) {
            foreach ($sheet->getCellCollection(false) as $cellID) {
                $cell = $sheet->getCell($cellID);
                if (($cell !== null) && ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA)) {
                    $formula = $cell->getValue();
                    if (strpos($formula, $oldName) !== false) {
                        $formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula);
                        $formula = str_replace($oldName . "!", $newName . "!", $formula);
                        $cell->setValueExplicit($formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
                    }
                }
            }
        }
    }
1033655
public function renameView($oldName, $newName)
    {
        if (!$this->hasView($oldName)) {
            throw SchemaException::schemaViewDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasView($newName)) {
            throw SchemaException::schemaViewAlreadyExists($this->getName(), $newName);
        }

        $this->views[$oldName]->setName($newName);
        $this->views[$newName] = $this->views[$oldName];

        unset($this->views[$oldName]);
    }
1287456
public function renameColumn($oldName, $newName)
    {
        $action = RenameColumn::build($this->table, $oldName, $newName);
        $this->actions->addAction($action);

        return $this;
    }
208172
public function renameFolder($name, $newname) {
        return imap_renamemailbox($this->imap, $this->mailbox . $name, $this->mailbox . $newname);
    }
604289
public function rename($oldName, $newName)
    {
        if (! ftp_rename($this->session, $oldName, $newName)) {
            throw new \RuntimeException('Name can not be changed');
        }
        return true;
    }
204702
public function renameSection($old, $new, $log = false)
    {
        Daemon::$config->{$new} = Daemon::$config->{$old};
        unset(Daemon::$config->{$old});
        if ($log) {
            Daemon::log('Config section \'' . $old . '\' -> \'' . $new . '\'');
        }
    }