PHP code example of codenamephp / installer

1. Go to this page and download the library: Download codenamephp/installer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codenamephp / installer example snippets


use de\codenamephp\installer\StepExecutor;
use de\codenamephp\installer\steps\CopyTemplateFolder;
use de\codenamephp\installer\steps\CreateFolders;
use de\codenamephp\installer\steps\DeleteFilesAndFolders;
use de\codenamephp\installer\steps\SequentialCollection;
use de\codenamephp\installer\templateCopy\directoryHandler\CreateDirectoryWithSymfonyFilesystem;
use de\codenamephp\installer\templateCopy\fileHandler\RenderWithTwigAndDumpWithSymfonyFilesystem;
use de\codenamephp\installer\templateCopy\variableReplacer\FramedStringReplace;
use Symfony\Component\Filesystem\Filesystem;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;

return call_user_func(static function() {
  ithSymfonyFilesystem($filesystem, $variableReplacer, new Environment(new FilesystemLoader('/', '/')))
        ),
        __DIR__ . '/templates',
        dirname(__DIR__),
        $variables
      ),
      new CreateFolders($variableReplacer, $filesystem, [dirname(__DIR__) . '/src'], $variables),
      new DeleteFilesAndFolders($variableReplacer, $filesystem, [__DIR__], $variables),
    )
  ))->run();
});
json
{
  "name": "{{vendor}}/{{componentName}}",
  "description": "",
  "type": "library",
  "license": "Apache-2.0",
  "bility/php-compatibility": "^9.0",
    "squizlabs/php_codesniffer": "^3.5",
    "mikey179/vfsstream": "^1.6.8"
  },
  "autoload": {
    "psr-4": {
      "{{namespace|replace({'\\':'\\\\'})}}\\": [
        "src"
      ]
    }
  },
  "autoload-dev": {
    "psr-4": {
      "{{namespace|replace({'\\':'\\\\'})}}\\test\\": [
        "test"
      ]
    }
  }
}