dasauser/shitty-lib

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.
There is no license information available for the latest version (v1.1.0) of this package.

Library for searching string in file

v1.1.0 2020-03-27 09:58 UTC

This package is auto-updated.

Last update: 2020-07-27 15:09:15 UTC


README

Basic usage:

  1. in console in project root dir: composer require "dasauser/shitty-lib" "^v1.1.0"
  2. create config (php, yaml):
      max_size: 6000,                     #(int): max size of uploading file (bytes)
      max_file_reading_duration: 120,     #(int): max duration of reading file (seconds)
      extensions:                         #allowed file extension
        - txt
      mime_types:                         #allowed file mime types
        - text/plain
  3. in code:
    $config = 'path/to/config.php';
    $config = 'path/to/config.yaml';
    $config = '';
    
    $module = ModuleClass::class;
    $module = '\Module\Class\Namespace\ModuleClass';
    
    $searcher = new \dasauser\ShittyLib\StringSearcher($config, $module);
    $searcher->find('needle', 'path/to/haystack/file.extension');

Tests

Unit

tests dir: vendor/dasauser/shitty-lib/tests

run unit tests: php vendor/bin/codecept run unit