miha/post-install

This package is abandoned and no longer maintained. No replacement package was suggested.

Create directories, files and links

0.1.1 2016-02-17 09:11 UTC

This package is auto-updated.

Last update: 2024-03-01 10:26:29 UTC


README

What is this repository for?

  • This script can create directory, files or symlinks for you

How do I get set up?

  • Configuration

    Create configuration as array

      $config = array(
          array(
              'type'    => \PostInstall\Entity\ObjectType::DIRECTORY,
              'path'    => '/tmp/mix/test1',
              'user'    => 'mix',
              'group'   => 'mix',
              'mode'    => '0777',
              'replace' => true,
              'backup'  => true,
          ),
          array(
              'type' => \PostInstall\Entity\ObjectType::DIRECTORY,
              'path' => '/tmp/mix/test2',
          ),
      );
    

    And pass it to the service

      $service = new PostInstall\Service\PostInstallService();
      $service->init($config);
    

  • Directory creation

    • type mandatory string \PostInstall\Entity\ObjectType::DIRECTORY
    • path mandatory string directory path
    • user optional string chown
    • group optional string chgrp
    • mode optional string chmod
    • replace optional boolean replace old object with new one, default false
    • backup optional boolean will rename old object to $oldName . '_' . date('Y-m-d_h:i:s'), default false
  • File creation
    • type mandatory string \PostInstall\Entity\ObjectType::FILE,
    • path mandatory string file path
    • user optional string chown
    • group optional string chgrp
    • mode optional string chmod
    • replace optional boolean replace old object with new one, default false
    • backup optional boolean will rename old object to $oldName . '_' . date('Y-m-d_h:i:s'), default false
  • Symlink creation
    • type mandatory string \PostInstall\Entity\ObjectType::LINK,
    • path mandatory string symlink path
    • target mandatory string target directory/file path
    • user optional string chown
    • group optional string chgrp
    • mode optional string chmod
    • replace optional boolean replace old object with new one, default false
    • backup optional boolean will rename old object to $oldName . '_' . date('Y-m-d_h:i:s'), default false