Generate user administration and profile

@param Filesystem $files
@return void
9981
private function generateUserStuff(Filesystem $files)
    {
        // TODO this is probably redundant?
        // Migrate
        $this->call('migrate');

        // Generate User CRUD (with new model)
        $this->call('admin:generate:admin-user', [
            '--force' => true,
        ]);

        // Generate user profile
        $this->call('admin:generate:admin-user:profile');
    }
166798
public function registerFiles($files)
    {
        foreach ((array)$files as $file) {
            if (isset($this->_files[$file])) {
                continue;
            }

            if ($file[0] === '@') {
                $file = Di::getDefault()->getShared('alias')->resolve($file);
            }
            $this->_files[$file] = 1;

            /** @noinspection PhpIncludeInspection */
            require $file;
        }

        return $this;
    }
38404
public function generateFiles()
    {
        foreach ($this->getFiles() as $stub => $file) {
            $path = $this->module->getModulePath($this->getName()) . $file;

            if (!$this->filesystem->isDirectory($dir = dirname($path))) {
                $this->filesystem->makeDirectory($dir, 0775, true);
            }

            $this->filesystem->put($path, $this->getStubContents($stub));
        }
    }
1061287
public function write($file, $settings)
    {
        $file = '/settings/' . $file;

        /**
         * @todo validate that $file is a string
         * @todo validate that $settings is a string
         */

        $settings = json_decode(json_encode($settings), true);

        $settings = $this->yaml->dump($settings);

        $this->source_filesystem->put($file . '.yml', $settings);
    }
781647
private function runHousekeeping(): void
    {
        $data_filesystem = app(FilesystemInterface::class);
        $root_filesystem = new Filesystem(new Local(Webtrees::ROOT_DIR));

        // Clear files in the (user-specified) data folder - which might not be local files
        $this->housekeeping_service->deleteOldFiles($data_filesystem, 'cache', self::MAX_CACHE_AGE);

        $this->housekeeping_service->deleteOldFiles($data_filesystem, 'thumbnail-cache', self::MAX_THUMBNAIL_AGE);

        // Clear files in /data - which need to be local files
        $this->housekeeping_service->deleteOldFiles($root_filesystem, self::TMP_DIR, self::MAX_TMP_FILE_AGE);

        // Clear entries in database tables
        $this->housekeeping_service->deleteOldLogs(self::MAX_LOG_AGE);

        $this->housekeeping_service->deleteOldSessions(self::MAX_SESSION_AGE);
    }
1112801
private function createInstaller($files)
	{
		$this->say("Creating library installer");

		$xmlFile = $this->target . "/" . $this->libName . ".xml";

		// Version & Date Replace
		$this->replaceInFile($xmlFile);

		// Files and folders
		$f = $this->generateFileList($files);

		$this->taskReplaceInFile($xmlFile)
			->from('##LIBRARYFILES##')
			->to($f)
			->run();

		// Language backend files
		$f = $this->generateLanguageFileList($this->getFiles('backendLanguage'));

		$this->taskReplaceInFile($xmlFile)
			->from('##BACKEND_LANGUAGE_FILES##')
			->to($f)
			->run();

		// Language frontend files
		$f = $this->generateLanguageFileList($this->getFiles('frontendLanguage'));

		$this->taskReplaceInFile($xmlFile)
			->from('##FRONTEND_LANGUAGE_FILES##')
			->to($f)
			->run();

		// Media files
		$f = $this->generateFileList($this->getFiles('media'));

		$this->taskReplaceInFile($xmlFile)
			->from('##MEDIA_FILES##')
			->to($f)
			->run();
	}
1125686
public function setFiles($files)
    {
        $this->_files = array();
        $token        = ' ,;';
        $file         = strtok($files, $token);

        while ($file !== false) {
            $this->_files[] = $file;
            $file           = strtok($token);
        }

    }
63153
public static function addGeneratingFile( $file )
    {
        if ( !( $file instanceof eZDFSFileHandler ) )
            return false; // @todo Exception

        self::$generatingFiles[$file->filePath] = $file;
    }
18268
public function setUser($user)
    {
        $fs = FileSystem::getFileSystem();

        $fs->chown($this->getPath(), $user);
    }
252357
protected function registerAssets($files)
    {
        foreach ($files as $type => $_files) {
            if ($type == 'script') {
                foreach ($_files as $file) {
                    $this->view->registerJsFile($this->assetUrl . $file);
                }
            } else {
                foreach ($_files as $file) {
                    $this->view->registerCssFile($this->assetUrl . $file);
                }
            }
        }
    }
1185019
public function watch($files)
    {
        $files = (array) $files;

        foreach ($files as $file) {
            $path = realpath($file);
            $this->_watched[$path] = $path;
        }
        $this->refreshWatched();
    }
702508
public function setupDrupalFilesystem()
    {
        $this->taskFilesystemStack()
            ->chmod($this->sitesPath, 0775, 0000, true)
            ->mkdir("{$this->sitesPath}/default/files", 0775, true)
            ->run();

        if ($this->getProjectVersion() >= 8) {
            $install_path = $this->getInstallPath();

            $this->taskFilesystemStack()
                ->mkdir("{$install_path}/profiles/custom", 0775, true)
                ->mkdir("{$install_path}/modules/custom", 0775, true)
                ->mkdir("{$install_path}/modules/contrib", 0775, true)
                ->run();
        }

        return $this;
    }
7696
public function chown($source, $files, $user)
    {
        foreach ($files as $file => $value) {
            if (file_exists($source.$value)) {
                @chown($file, $user);
            }
        }
    }
233844
public function fire(Filesystem $files)
    {
        if (! defined('SLEEPINGOWL_STUB_PATH')) {
            define('SLEEPINGOWL_STUB_PATH', __DIR__.'/stubs');
        }

        if (! $this->confirmToProceed('SleepingOwl Admin')) {
            return;
        }

        $this->call('vendor:publish', [
            '--tag' => 'config',
            '--provider' => SleepingOwlServiceProvider::class,
        ]);
        $this->config = new Repository($this->laravel['config']->get('sleeping_owl'));

        $this->files = $files;

        $this->runInstaller();
    }
417827
public function dump($file, $contents)
    {
        $filesystem = new Filesystem();
        $filesystem->dumpFile($file, $contents);
        $filesystem->chmod($file, 0644);
    }
1240395
public function copy($file)
    {
        $fs = new Filesystem;

        if (! $fs->exists(dirname($file))) {
            $fs->mkdir(dirname($file), 0755);
        }

        $fs->copy($this->source, $file, true);
    }
88366
protected function GenerateApplicationFile($files) {
        $filePath = $this->GenerateConstantsClass($files);
        array_push($this->filesGenerated, $filePath);
        return $filePath;
    }