├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── test.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bin └── install-wp-tests.sh ├── composer.json ├── composer.lock ├── phpcs.xml ├── phpunit.xml ├── src └── Filesystem.php └── tests ├── assets └── file.txt ├── bootstrap.php └── test-filesystem.php /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_style = tab 9 | 10 | [{*.txt,wp-config-sample.php}] 11 | end_of_line = crlf 12 | 13 | [*.yml] 14 | indent_style = space 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | PHPCS: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Set default PHP version 10 | run: sudo update-alternatives --set php /usr/bin/php7.4 11 | - name: Set Composer version 12 | run: sudo composer self-update --1 13 | - name: Checkout 14 | uses: actions/checkout@v2 15 | - name: Install dependencies 16 | run: composer install --no-progress 17 | - name: Coding Standards 18 | run: composer phpcs 19 | PHPUnit: 20 | runs-on: ubuntu-latest 21 | strategy: 22 | matrix: 23 | php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] 24 | services: 25 | mysql: 26 | image: mysql:5.7 27 | env: 28 | MYSQL_ROOT_PASSWORD: root 29 | MYSQL_DATABASE: wordpress_test 30 | ports: 31 | - 3306 32 | options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 33 | steps: 34 | - name: Setup PHP 35 | uses: shivammathur/setup-php@v1 36 | with: 37 | php-version: ${{ matrix.php }} 38 | extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick 39 | coverage: none 40 | tools: composer:v1 41 | - name: Checkout 42 | uses: actions/checkout@v2 43 | - name: Install dependencies 44 | run: composer install --no-progress 45 | - name: PHPUnit 46 | run: | 47 | chmod 777 bin/install-wp-tests.sh 48 | bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }} latest true 49 | composer phpunit 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Project ### 2 | *.log 3 | /vendor/ 4 | 5 | ### Windows ### 6 | # Windows image file caches 7 | Thumbs.db 8 | ehthumbs.db 9 | 10 | # Folder config file 11 | Desktop.ini 12 | 13 | # Recycle Bin used on file shares 14 | $RECYCLE.BIN/ 15 | 16 | # Windows Installer files 17 | *.cab 18 | *.msi 19 | *.msm 20 | *.msp 21 | 22 | # Windows shortcuts 23 | *.lnk 24 | 25 | 26 | ### macOS ### 27 | *.DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Icon must end with two \r 32 | Icon 33 | 34 | 35 | # Thumbnails 36 | ._* 37 | 38 | # Files that might appear in the root of a volume 39 | .DocumentRevisions-V100 40 | .fseventsd 41 | .Spotlight-V100 42 | .TemporaryItems 43 | .Trashes 44 | .VolumeIcon.icns 45 | .com.apple.timemachine.donotpresent 46 | 47 | # Directories potentially created on remote AFP share 48 | .AppleDB 49 | .AppleDesktop 50 | Network Trash Folder 51 | Temporary Items 52 | .apdisk 53 | 54 | 55 | ### Sass ### 56 | .sass-cache/ 57 | *.css.map 58 | 59 | 60 | ### SublimeText ### 61 | # cache files for sublime text 62 | *.tmlanguage.cache 63 | *.tmPreferences.cache 64 | *.stTheme.cache 65 | 66 | # workspace files are user-specific 67 | *.sublime-workspace 68 | .vscode 69 | 70 | # project files should be checked into the repository, unless a significant 71 | # proportion of contributors will probably not be using SublimeText 72 | # *.sublime-project 73 | 74 | # sftp configuration file 75 | sftp-config.json 76 | 77 | # postcss sorting config file 78 | settings.json 79 | 80 | # Package control specific files 81 | Package Control.last-run 82 | Package Control.ca-list 83 | Package Control.ca-bundle 84 | Package Control.system-ca-bundle 85 | Package Control.cache/ 86 | Package Control.ca-certs/ 87 | bh_unicode_properties.cache 88 | 89 | # Sublime-github package stores a github token in this file 90 | # https://packagecontrol.io/packages/sublime-github 91 | GitHub.sublime-settings 92 | 93 | 94 | ### Vim ### 95 | # swap 96 | [._]*.s[a-w][a-z] 97 | [._]s[a-w][a-z] 98 | # session 99 | Session.vim 100 | # temporary 101 | .netrwhist 102 | *~ 103 | # auto-generated tag files 104 | tags 105 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | ## 1.1.5 5 | 6 | ### Changed: 7 | - License from GPL to MIT 8 | 9 | ## 1.1.4 10 | 11 | ### Changed: 12 | - Allows mkdir method to get empty parameter. 13 | 14 | ## 1.1.3 - 15.06.2020 15 | 16 | ### Fixed: 17 | - WP_CONTENT_URL not returning proper protocol. Replaced with `content_url()`, thanks to @matt-bernhardt 18 | 19 | ## 1.1.3 - 15.06.2020 20 | 21 | ### Fixed: 22 | - WP_CONTENT_URL not returning proper protocol. Replaced with `content_url()`, thanks to @matt-bernhardt 23 | 24 | ## 1.1.2 - 10.02.2020 25 | 26 | ### Changed: 27 | - WP Filesystem is not cached scroll all Filesystem instances for better performance. 28 | 29 | ## 1.1.1 - 05.02.2020 30 | 31 | ### Fixed: 32 | - Path to URL rewrite on Windows machines. The WP_CONTENT_DIR is now normalized. 33 | 34 | ## 1.1.0 - 29.01.2020 35 | 36 | ### Added: 37 | - mkdir support for recursive dir creation when using Direct method. 38 | 39 | ### Fixed: 40 | - Invalid method name causing warning. 41 | 42 | ## 1.0.0 - 28.01.2020 43 | 44 | Initial release 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Micropackage 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Filesystem 2 | 3 | [![BracketSpace Micropackage](https://img.shields.io/badge/BracketSpace-Micropackage-brightgreen)](https://bracketspace.com) 4 | [![Latest Stable Version](https://poser.pugx.org/micropackage/filesystem/v/stable)](https://packagist.org/packages/micropackage/filesystem) 5 | [![PHP from Packagist](https://img.shields.io/packagist/php-v/micropackage/filesystem.svg)](https://packagist.org/packages/micropackage/filesystem) 6 | [![Total Downloads](https://poser.pugx.org/micropackage/filesystem/downloads)](https://packagist.org/packages/micropackage/filesystem) 7 | [![License](https://poser.pugx.org/micropackage/filesystem/license)](https://packagist.org/packages/micropackage/filesystem) 8 | 9 |

10 | Micropackage logo 11 |

12 | 13 | ## 🧬 About Filesystem 14 | 15 | This micropackage is a wrapper for WordPress filesystem intended to be used within the `wp-content` directory. 16 | 17 | Supports: 18 | - plugins 19 | - must-use plugins 20 | - themes 21 | - custom upload directories 22 | - custom wp-content directories 23 | 24 | This package will prefix all the relative paths to full paths giving a convinient way to manipulate files. 25 | 26 | ## 💾 Installation 27 | 28 | ``` bash 29 | composer require micropackage/filesystem 30 | ``` 31 | 32 | ## 🕹 Usage 33 | 34 | Initializing the Filesystem class from the main plugin/theme file. It just needs a base directory. 35 | 36 | ```php 37 | use Micropackage\Filesystem\Filesystem; 38 | 39 | $filesystem = new Filesystem( __DIR__ ); 40 | ``` 41 | 42 | Using the micropackage to obtain full paths (plugin example). 43 | 44 | ```php 45 | echo $filesystem->path(); 46 | // /var/www/html/wp-content/plugins/my-plugin/ 47 | 48 | echo $filesystem->path( 'src/templates/full-width.php' ); 49 | // /var/www/html/wp-content/plugins/my-plugin/src/templates/full-width.php 50 | ``` 51 | 52 | Using the micropackage to obtain full URL (plugin example). 53 | 54 | ```php 55 | echo $filesystem->url(); 56 | // https://my.plugin/wp-content/plugins/my-plugin/ 57 | 58 | echo $filesystem->url( 'assets/images/logo.svg' ); 59 | // https://my.plugin/wp-content/plugins/my-plugin/assets/images/logo.svg 60 | ``` 61 | 62 | Convert image file to base64 URL. 63 | 64 | ```php 65 | printf( '', $filesystem->image_to_base64( 'assets/images/logo.svg' ) ); 66 | // 67 | ``` 68 | 69 | On top of that, you can use any method provided by WP_Filesystem class, which includes: 70 | - `get_contents()` 71 | - `exists()` 72 | - `is_file()`, `is_dir()` 73 | - `mkdir()` 74 | - `delete()` 75 | - ... 76 | 77 | [See all available methods](https://developer.wordpress.org/reference/classes/wp_filesystem_base/#methods) 78 | 79 | ## 📦 About the Micropackage project 80 | 81 | Micropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development. 82 | 83 | The aim is to have multiple packages which can be put together to create something bigger by defining only the structure. 84 | 85 | Micropackages are maintained by [BracketSpace](https://bracketspace.com). 86 | 87 | ## 📖 Changelog 88 | 89 | [See the changelog file](./CHANGELOG.md). 90 | 91 | ## 📃 License 92 | 93 | This software is released under MIT license. See the [LICENSE](./LICENSE) file for more information. 94 | -------------------------------------------------------------------------------- /bin/install-wp-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -lt 3 ]; then 4 | echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" 5 | exit 1 6 | fi 7 | 8 | DB_NAME=$1 9 | DB_USER=$2 10 | DB_PASS=$3 11 | DB_HOST=${4-localhost} 12 | WP_VERSION=${5-latest} 13 | SKIP_DB_CREATE=${6-false} 14 | 15 | TMPDIR=${TMPDIR-/tmp} 16 | TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") 17 | WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} 18 | WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/} 19 | 20 | download() { 21 | if [ `which curl` ]; then 22 | curl -s "$1" > "$2"; 23 | elif [ `which wget` ]; then 24 | wget -nv -O "$2" "$1" 25 | fi 26 | } 27 | 28 | if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then 29 | WP_TESTS_TAG="branches/$WP_VERSION" 30 | elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then 31 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 32 | # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 33 | WP_TESTS_TAG="tags/${WP_VERSION%??}" 34 | else 35 | WP_TESTS_TAG="tags/$WP_VERSION" 36 | fi 37 | elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 38 | WP_TESTS_TAG="trunk" 39 | else 40 | # http serves a single offer, whereas https serves multiple. we only want one 41 | download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json 42 | grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json 43 | LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') 44 | if [[ -z "$LATEST_VERSION" ]]; then 45 | echo "Latest WordPress version could not be found" 46 | exit 1 47 | fi 48 | WP_TESTS_TAG="tags/$LATEST_VERSION" 49 | fi 50 | 51 | set -ex 52 | 53 | install_wp() { 54 | 55 | if [ -d $WP_CORE_DIR ]; then 56 | return; 57 | fi 58 | 59 | mkdir -p $WP_CORE_DIR 60 | 61 | if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 62 | mkdir -p $TMPDIR/wordpress-nightly 63 | download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip 64 | unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ 65 | mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR 66 | else 67 | if [ $WP_VERSION == 'latest' ]; then 68 | local ARCHIVE_NAME='latest' 69 | elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then 70 | # https serves multiple offers, whereas http serves single. 71 | download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json 72 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 73 | # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 74 | LATEST_VERSION=${WP_VERSION%??} 75 | else 76 | # otherwise, scan the releases and get the most up to date minor version of the major release 77 | local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` 78 | LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) 79 | fi 80 | if [[ -z "$LATEST_VERSION" ]]; then 81 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 82 | else 83 | local ARCHIVE_NAME="wordpress-$LATEST_VERSION" 84 | fi 85 | else 86 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 87 | fi 88 | download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz 89 | tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR 90 | fi 91 | 92 | download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php 93 | } 94 | 95 | install_test_suite() { 96 | # portable in-place argument for both GNU sed and Mac OSX sed 97 | if [[ $(uname -s) == 'Darwin' ]]; then 98 | local ioption='-i .bak' 99 | else 100 | local ioption='-i' 101 | fi 102 | 103 | # set up testing suite if it doesn't yet exist 104 | if [ ! -d $WP_TESTS_DIR ]; then 105 | # set up testing suite 106 | mkdir -p $WP_TESTS_DIR 107 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes 108 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data 109 | fi 110 | 111 | if [ ! -f wp-tests-config.php ]; then 112 | download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php 113 | # remove all forward slashes in the end 114 | WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") 115 | sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php 116 | sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php 117 | sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php 118 | sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php 119 | sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php 120 | fi 121 | 122 | } 123 | 124 | install_db() { 125 | 126 | if [ ${SKIP_DB_CREATE} = "true" ]; then 127 | return 0 128 | fi 129 | 130 | # parse DB_HOST for port or socket references 131 | local PARTS=(${DB_HOST//\:/ }) 132 | local DB_HOSTNAME=${PARTS[0]}; 133 | local DB_SOCK_OR_PORT=${PARTS[1]}; 134 | local EXTRA="" 135 | 136 | if ! [ -z $DB_HOSTNAME ] ; then 137 | if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then 138 | EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" 139 | elif ! [ -z $DB_SOCK_OR_PORT ] ; then 140 | EXTRA=" --socket=$DB_SOCK_OR_PORT" 141 | elif ! [ -z $DB_HOSTNAME ] ; then 142 | EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" 143 | fi 144 | fi 145 | 146 | # create database 147 | mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA 148 | } 149 | 150 | install_wp 151 | install_test_suite 152 | install_db 153 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "micropackage/filesystem", 3 | "description": "Wrapper for WordPress' Filesystem for easier file manipulations.", 4 | "license": "GPL-3.0-or-later", 5 | "authors": [ 6 | { 7 | "name": "Jakub Mikita", 8 | "email": "jakub@bracketspace.com" 9 | } 10 | ], 11 | "scripts": { 12 | "phpcs": "phpcs", 13 | "phpcbf": "phpcbf", 14 | "phpunit": "phpunit", 15 | "phpunit-coverage": "phpunit --coverage-text", 16 | "setup-local-tests": "bash bin/install-wp-tests.sh wordpress_test root root localhost latest" 17 | }, 18 | "require": { 19 | "php": ">=5.6" 20 | }, 21 | "require-dev": { 22 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", 23 | "phpcompatibility/php-compatibility": "^9.1", 24 | "wp-coding-standards/wpcs": "^2.0", 25 | "phpunit/phpunit": "^6.5.5" 26 | }, 27 | "autoload": { 28 | "psr-4" : { 29 | "Micropackage\\Filesystem\\" : "src" 30 | } 31 | }, 32 | "autoload-dev": { 33 | "psr-4" : { 34 | "Micropackage\\Filesystem\\Test\\" : "tests" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "5f00091c7c320819a9b2dfc862bb2541", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "dealerdirect/phpcodesniffer-composer-installer", 12 | "version": "v0.5.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", 16 | "reference": "e749410375ff6fb7a040a68878c656c2e610b132" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", 21 | "reference": "e749410375ff6fb7a040a68878c656c2e610b132", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "composer-plugin-api": "^1.0", 26 | "php": "^5.3|^7", 27 | "squizlabs/php_codesniffer": "^2|^3" 28 | }, 29 | "require-dev": { 30 | "composer/composer": "*", 31 | "phpcompatibility/php-compatibility": "^9.0", 32 | "sensiolabs/security-checker": "^4.1.0" 33 | }, 34 | "type": "composer-plugin", 35 | "extra": { 36 | "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 37 | }, 38 | "autoload": { 39 | "psr-4": { 40 | "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "MIT" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Franck Nijhof", 50 | "email": "franck.nijhof@dealerdirect.com", 51 | "homepage": "http://www.frenck.nl", 52 | "role": "Developer / IT Manager" 53 | } 54 | ], 55 | "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 56 | "homepage": "http://www.dealerdirect.com", 57 | "keywords": [ 58 | "PHPCodeSniffer", 59 | "PHP_CodeSniffer", 60 | "code quality", 61 | "codesniffer", 62 | "composer", 63 | "installer", 64 | "phpcs", 65 | "plugin", 66 | "qa", 67 | "quality", 68 | "standard", 69 | "standards", 70 | "style guide", 71 | "stylecheck", 72 | "tests" 73 | ], 74 | "time": "2018-10-26T13:21:45+00:00" 75 | }, 76 | { 77 | "name": "doctrine/instantiator", 78 | "version": "1.3.0", 79 | "source": { 80 | "type": "git", 81 | "url": "https://github.com/doctrine/instantiator.git", 82 | "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" 83 | }, 84 | "dist": { 85 | "type": "zip", 86 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", 87 | "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", 88 | "shasum": "" 89 | }, 90 | "require": { 91 | "php": "^7.1" 92 | }, 93 | "require-dev": { 94 | "doctrine/coding-standard": "^6.0", 95 | "ext-pdo": "*", 96 | "ext-phar": "*", 97 | "phpbench/phpbench": "^0.13", 98 | "phpstan/phpstan-phpunit": "^0.11", 99 | "phpstan/phpstan-shim": "^0.11", 100 | "phpunit/phpunit": "^7.0" 101 | }, 102 | "type": "library", 103 | "extra": { 104 | "branch-alias": { 105 | "dev-master": "1.2.x-dev" 106 | } 107 | }, 108 | "autoload": { 109 | "psr-4": { 110 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 111 | } 112 | }, 113 | "notification-url": "https://packagist.org/downloads/", 114 | "license": [ 115 | "MIT" 116 | ], 117 | "authors": [ 118 | { 119 | "name": "Marco Pivetta", 120 | "email": "ocramius@gmail.com", 121 | "homepage": "http://ocramius.github.com/" 122 | } 123 | ], 124 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 125 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html", 126 | "keywords": [ 127 | "constructor", 128 | "instantiate" 129 | ], 130 | "time": "2019-10-21T16:45:58+00:00" 131 | }, 132 | { 133 | "name": "myclabs/deep-copy", 134 | "version": "1.9.5", 135 | "source": { 136 | "type": "git", 137 | "url": "https://github.com/myclabs/DeepCopy.git", 138 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" 139 | }, 140 | "dist": { 141 | "type": "zip", 142 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", 143 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", 144 | "shasum": "" 145 | }, 146 | "require": { 147 | "php": "^7.1" 148 | }, 149 | "replace": { 150 | "myclabs/deep-copy": "self.version" 151 | }, 152 | "require-dev": { 153 | "doctrine/collections": "^1.0", 154 | "doctrine/common": "^2.6", 155 | "phpunit/phpunit": "^7.1" 156 | }, 157 | "type": "library", 158 | "autoload": { 159 | "psr-4": { 160 | "DeepCopy\\": "src/DeepCopy/" 161 | }, 162 | "files": [ 163 | "src/DeepCopy/deep_copy.php" 164 | ] 165 | }, 166 | "notification-url": "https://packagist.org/downloads/", 167 | "license": [ 168 | "MIT" 169 | ], 170 | "description": "Create deep copies (clones) of your objects", 171 | "keywords": [ 172 | "clone", 173 | "copy", 174 | "duplicate", 175 | "object", 176 | "object graph" 177 | ], 178 | "time": "2020-01-17T21:11:47+00:00" 179 | }, 180 | { 181 | "name": "phar-io/manifest", 182 | "version": "1.0.1", 183 | "source": { 184 | "type": "git", 185 | "url": "https://github.com/phar-io/manifest.git", 186 | "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" 187 | }, 188 | "dist": { 189 | "type": "zip", 190 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", 191 | "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", 192 | "shasum": "" 193 | }, 194 | "require": { 195 | "ext-dom": "*", 196 | "ext-phar": "*", 197 | "phar-io/version": "^1.0.1", 198 | "php": "^5.6 || ^7.0" 199 | }, 200 | "type": "library", 201 | "extra": { 202 | "branch-alias": { 203 | "dev-master": "1.0.x-dev" 204 | } 205 | }, 206 | "autoload": { 207 | "classmap": [ 208 | "src/" 209 | ] 210 | }, 211 | "notification-url": "https://packagist.org/downloads/", 212 | "license": [ 213 | "BSD-3-Clause" 214 | ], 215 | "authors": [ 216 | { 217 | "name": "Arne Blankerts", 218 | "email": "arne@blankerts.de", 219 | "role": "Developer" 220 | }, 221 | { 222 | "name": "Sebastian Heuer", 223 | "email": "sebastian@phpeople.de", 224 | "role": "Developer" 225 | }, 226 | { 227 | "name": "Sebastian Bergmann", 228 | "email": "sebastian@phpunit.de", 229 | "role": "Developer" 230 | } 231 | ], 232 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 233 | "time": "2017-03-05T18:14:27+00:00" 234 | }, 235 | { 236 | "name": "phar-io/version", 237 | "version": "1.0.1", 238 | "source": { 239 | "type": "git", 240 | "url": "https://github.com/phar-io/version.git", 241 | "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" 242 | }, 243 | "dist": { 244 | "type": "zip", 245 | "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", 246 | "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", 247 | "shasum": "" 248 | }, 249 | "require": { 250 | "php": "^5.6 || ^7.0" 251 | }, 252 | "type": "library", 253 | "autoload": { 254 | "classmap": [ 255 | "src/" 256 | ] 257 | }, 258 | "notification-url": "https://packagist.org/downloads/", 259 | "license": [ 260 | "BSD-3-Clause" 261 | ], 262 | "authors": [ 263 | { 264 | "name": "Arne Blankerts", 265 | "email": "arne@blankerts.de", 266 | "role": "Developer" 267 | }, 268 | { 269 | "name": "Sebastian Heuer", 270 | "email": "sebastian@phpeople.de", 271 | "role": "Developer" 272 | }, 273 | { 274 | "name": "Sebastian Bergmann", 275 | "email": "sebastian@phpunit.de", 276 | "role": "Developer" 277 | } 278 | ], 279 | "description": "Library for handling version information and constraints", 280 | "time": "2017-03-05T17:38:23+00:00" 281 | }, 282 | { 283 | "name": "phpcompatibility/php-compatibility", 284 | "version": "9.3.5", 285 | "source": { 286 | "type": "git", 287 | "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 288 | "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 289 | }, 290 | "dist": { 291 | "type": "zip", 292 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 293 | "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 294 | "shasum": "" 295 | }, 296 | "require": { 297 | "php": ">=5.3", 298 | "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 299 | }, 300 | "conflict": { 301 | "squizlabs/php_codesniffer": "2.6.2" 302 | }, 303 | "require-dev": { 304 | "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 305 | }, 306 | "suggest": { 307 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 308 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 309 | }, 310 | "type": "phpcodesniffer-standard", 311 | "notification-url": "https://packagist.org/downloads/", 312 | "license": [ 313 | "LGPL-3.0-or-later" 314 | ], 315 | "authors": [ 316 | { 317 | "name": "Wim Godden", 318 | "homepage": "https://github.com/wimg", 319 | "role": "lead" 320 | }, 321 | { 322 | "name": "Juliette Reinders Folmer", 323 | "homepage": "https://github.com/jrfnl", 324 | "role": "lead" 325 | }, 326 | { 327 | "name": "Contributors", 328 | "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 329 | } 330 | ], 331 | "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 332 | "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 333 | "keywords": [ 334 | "compatibility", 335 | "phpcs", 336 | "standards" 337 | ], 338 | "time": "2019-12-27T09:44:58+00:00" 339 | }, 340 | { 341 | "name": "phpdocumentor/reflection-common", 342 | "version": "2.0.0", 343 | "source": { 344 | "type": "git", 345 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 346 | "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" 347 | }, 348 | "dist": { 349 | "type": "zip", 350 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", 351 | "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", 352 | "shasum": "" 353 | }, 354 | "require": { 355 | "php": ">=7.1" 356 | }, 357 | "require-dev": { 358 | "phpunit/phpunit": "~6" 359 | }, 360 | "type": "library", 361 | "extra": { 362 | "branch-alias": { 363 | "dev-master": "2.x-dev" 364 | } 365 | }, 366 | "autoload": { 367 | "psr-4": { 368 | "phpDocumentor\\Reflection\\": "src/" 369 | } 370 | }, 371 | "notification-url": "https://packagist.org/downloads/", 372 | "license": [ 373 | "MIT" 374 | ], 375 | "authors": [ 376 | { 377 | "name": "Jaap van Otterdijk", 378 | "email": "opensource@ijaap.nl" 379 | } 380 | ], 381 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 382 | "homepage": "http://www.phpdoc.org", 383 | "keywords": [ 384 | "FQSEN", 385 | "phpDocumentor", 386 | "phpdoc", 387 | "reflection", 388 | "static analysis" 389 | ], 390 | "time": "2018-08-07T13:53:10+00:00" 391 | }, 392 | { 393 | "name": "phpdocumentor/reflection-docblock", 394 | "version": "4.3.4", 395 | "source": { 396 | "type": "git", 397 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 398 | "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" 399 | }, 400 | "dist": { 401 | "type": "zip", 402 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", 403 | "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", 404 | "shasum": "" 405 | }, 406 | "require": { 407 | "php": "^7.0", 408 | "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", 409 | "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", 410 | "webmozart/assert": "^1.0" 411 | }, 412 | "require-dev": { 413 | "doctrine/instantiator": "^1.0.5", 414 | "mockery/mockery": "^1.0", 415 | "phpdocumentor/type-resolver": "0.4.*", 416 | "phpunit/phpunit": "^6.4" 417 | }, 418 | "type": "library", 419 | "extra": { 420 | "branch-alias": { 421 | "dev-master": "4.x-dev" 422 | } 423 | }, 424 | "autoload": { 425 | "psr-4": { 426 | "phpDocumentor\\Reflection\\": [ 427 | "src/" 428 | ] 429 | } 430 | }, 431 | "notification-url": "https://packagist.org/downloads/", 432 | "license": [ 433 | "MIT" 434 | ], 435 | "authors": [ 436 | { 437 | "name": "Mike van Riel", 438 | "email": "me@mikevanriel.com" 439 | } 440 | ], 441 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 442 | "time": "2019-12-28T18:55:12+00:00" 443 | }, 444 | { 445 | "name": "phpdocumentor/type-resolver", 446 | "version": "1.0.1", 447 | "source": { 448 | "type": "git", 449 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 450 | "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" 451 | }, 452 | "dist": { 453 | "type": "zip", 454 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", 455 | "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", 456 | "shasum": "" 457 | }, 458 | "require": { 459 | "php": "^7.1", 460 | "phpdocumentor/reflection-common": "^2.0" 461 | }, 462 | "require-dev": { 463 | "ext-tokenizer": "^7.1", 464 | "mockery/mockery": "~1", 465 | "phpunit/phpunit": "^7.0" 466 | }, 467 | "type": "library", 468 | "extra": { 469 | "branch-alias": { 470 | "dev-master": "1.x-dev" 471 | } 472 | }, 473 | "autoload": { 474 | "psr-4": { 475 | "phpDocumentor\\Reflection\\": "src" 476 | } 477 | }, 478 | "notification-url": "https://packagist.org/downloads/", 479 | "license": [ 480 | "MIT" 481 | ], 482 | "authors": [ 483 | { 484 | "name": "Mike van Riel", 485 | "email": "me@mikevanriel.com" 486 | } 487 | ], 488 | "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", 489 | "time": "2019-08-22T18:11:29+00:00" 490 | }, 491 | { 492 | "name": "phpspec/prophecy", 493 | "version": "v1.10.2", 494 | "source": { 495 | "type": "git", 496 | "url": "https://github.com/phpspec/prophecy.git", 497 | "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" 498 | }, 499 | "dist": { 500 | "type": "zip", 501 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", 502 | "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", 503 | "shasum": "" 504 | }, 505 | "require": { 506 | "doctrine/instantiator": "^1.0.2", 507 | "php": "^5.3|^7.0", 508 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", 509 | "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", 510 | "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" 511 | }, 512 | "require-dev": { 513 | "phpspec/phpspec": "^2.5 || ^3.2", 514 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" 515 | }, 516 | "type": "library", 517 | "extra": { 518 | "branch-alias": { 519 | "dev-master": "1.10.x-dev" 520 | } 521 | }, 522 | "autoload": { 523 | "psr-4": { 524 | "Prophecy\\": "src/Prophecy" 525 | } 526 | }, 527 | "notification-url": "https://packagist.org/downloads/", 528 | "license": [ 529 | "MIT" 530 | ], 531 | "authors": [ 532 | { 533 | "name": "Konstantin Kudryashov", 534 | "email": "ever.zet@gmail.com", 535 | "homepage": "http://everzet.com" 536 | }, 537 | { 538 | "name": "Marcello Duarte", 539 | "email": "marcello.duarte@gmail.com" 540 | } 541 | ], 542 | "description": "Highly opinionated mocking framework for PHP 5.3+", 543 | "homepage": "https://github.com/phpspec/prophecy", 544 | "keywords": [ 545 | "Double", 546 | "Dummy", 547 | "fake", 548 | "mock", 549 | "spy", 550 | "stub" 551 | ], 552 | "time": "2020-01-20T15:57:02+00:00" 553 | }, 554 | { 555 | "name": "phpunit/php-code-coverage", 556 | "version": "5.3.2", 557 | "source": { 558 | "type": "git", 559 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 560 | "reference": "c89677919c5dd6d3b3852f230a663118762218ac" 561 | }, 562 | "dist": { 563 | "type": "zip", 564 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", 565 | "reference": "c89677919c5dd6d3b3852f230a663118762218ac", 566 | "shasum": "" 567 | }, 568 | "require": { 569 | "ext-dom": "*", 570 | "ext-xmlwriter": "*", 571 | "php": "^7.0", 572 | "phpunit/php-file-iterator": "^1.4.2", 573 | "phpunit/php-text-template": "^1.2.1", 574 | "phpunit/php-token-stream": "^2.0.1", 575 | "sebastian/code-unit-reverse-lookup": "^1.0.1", 576 | "sebastian/environment": "^3.0", 577 | "sebastian/version": "^2.0.1", 578 | "theseer/tokenizer": "^1.1" 579 | }, 580 | "require-dev": { 581 | "phpunit/phpunit": "^6.0" 582 | }, 583 | "suggest": { 584 | "ext-xdebug": "^2.5.5" 585 | }, 586 | "type": "library", 587 | "extra": { 588 | "branch-alias": { 589 | "dev-master": "5.3.x-dev" 590 | } 591 | }, 592 | "autoload": { 593 | "classmap": [ 594 | "src/" 595 | ] 596 | }, 597 | "notification-url": "https://packagist.org/downloads/", 598 | "license": [ 599 | "BSD-3-Clause" 600 | ], 601 | "authors": [ 602 | { 603 | "name": "Sebastian Bergmann", 604 | "email": "sebastian@phpunit.de", 605 | "role": "lead" 606 | } 607 | ], 608 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 609 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 610 | "keywords": [ 611 | "coverage", 612 | "testing", 613 | "xunit" 614 | ], 615 | "time": "2018-04-06T15:36:58+00:00" 616 | }, 617 | { 618 | "name": "phpunit/php-file-iterator", 619 | "version": "1.4.5", 620 | "source": { 621 | "type": "git", 622 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 623 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" 624 | }, 625 | "dist": { 626 | "type": "zip", 627 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", 628 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", 629 | "shasum": "" 630 | }, 631 | "require": { 632 | "php": ">=5.3.3" 633 | }, 634 | "type": "library", 635 | "extra": { 636 | "branch-alias": { 637 | "dev-master": "1.4.x-dev" 638 | } 639 | }, 640 | "autoload": { 641 | "classmap": [ 642 | "src/" 643 | ] 644 | }, 645 | "notification-url": "https://packagist.org/downloads/", 646 | "license": [ 647 | "BSD-3-Clause" 648 | ], 649 | "authors": [ 650 | { 651 | "name": "Sebastian Bergmann", 652 | "email": "sb@sebastian-bergmann.de", 653 | "role": "lead" 654 | } 655 | ], 656 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 657 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 658 | "keywords": [ 659 | "filesystem", 660 | "iterator" 661 | ], 662 | "time": "2017-11-27T13:52:08+00:00" 663 | }, 664 | { 665 | "name": "phpunit/php-text-template", 666 | "version": "1.2.1", 667 | "source": { 668 | "type": "git", 669 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 670 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 671 | }, 672 | "dist": { 673 | "type": "zip", 674 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 675 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 676 | "shasum": "" 677 | }, 678 | "require": { 679 | "php": ">=5.3.3" 680 | }, 681 | "type": "library", 682 | "autoload": { 683 | "classmap": [ 684 | "src/" 685 | ] 686 | }, 687 | "notification-url": "https://packagist.org/downloads/", 688 | "license": [ 689 | "BSD-3-Clause" 690 | ], 691 | "authors": [ 692 | { 693 | "name": "Sebastian Bergmann", 694 | "email": "sebastian@phpunit.de", 695 | "role": "lead" 696 | } 697 | ], 698 | "description": "Simple template engine.", 699 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 700 | "keywords": [ 701 | "template" 702 | ], 703 | "time": "2015-06-21T13:50:34+00:00" 704 | }, 705 | { 706 | "name": "phpunit/php-timer", 707 | "version": "1.0.9", 708 | "source": { 709 | "type": "git", 710 | "url": "https://github.com/sebastianbergmann/php-timer.git", 711 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" 712 | }, 713 | "dist": { 714 | "type": "zip", 715 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 716 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 717 | "shasum": "" 718 | }, 719 | "require": { 720 | "php": "^5.3.3 || ^7.0" 721 | }, 722 | "require-dev": { 723 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 724 | }, 725 | "type": "library", 726 | "extra": { 727 | "branch-alias": { 728 | "dev-master": "1.0-dev" 729 | } 730 | }, 731 | "autoload": { 732 | "classmap": [ 733 | "src/" 734 | ] 735 | }, 736 | "notification-url": "https://packagist.org/downloads/", 737 | "license": [ 738 | "BSD-3-Clause" 739 | ], 740 | "authors": [ 741 | { 742 | "name": "Sebastian Bergmann", 743 | "email": "sb@sebastian-bergmann.de", 744 | "role": "lead" 745 | } 746 | ], 747 | "description": "Utility class for timing", 748 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 749 | "keywords": [ 750 | "timer" 751 | ], 752 | "time": "2017-02-26T11:10:40+00:00" 753 | }, 754 | { 755 | "name": "phpunit/php-token-stream", 756 | "version": "2.0.2", 757 | "source": { 758 | "type": "git", 759 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 760 | "reference": "791198a2c6254db10131eecfe8c06670700904db" 761 | }, 762 | "dist": { 763 | "type": "zip", 764 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", 765 | "reference": "791198a2c6254db10131eecfe8c06670700904db", 766 | "shasum": "" 767 | }, 768 | "require": { 769 | "ext-tokenizer": "*", 770 | "php": "^7.0" 771 | }, 772 | "require-dev": { 773 | "phpunit/phpunit": "^6.2.4" 774 | }, 775 | "type": "library", 776 | "extra": { 777 | "branch-alias": { 778 | "dev-master": "2.0-dev" 779 | } 780 | }, 781 | "autoload": { 782 | "classmap": [ 783 | "src/" 784 | ] 785 | }, 786 | "notification-url": "https://packagist.org/downloads/", 787 | "license": [ 788 | "BSD-3-Clause" 789 | ], 790 | "authors": [ 791 | { 792 | "name": "Sebastian Bergmann", 793 | "email": "sebastian@phpunit.de" 794 | } 795 | ], 796 | "description": "Wrapper around PHP's tokenizer extension.", 797 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 798 | "keywords": [ 799 | "tokenizer" 800 | ], 801 | "time": "2017-11-27T05:48:46+00:00" 802 | }, 803 | { 804 | "name": "phpunit/phpunit", 805 | "version": "6.5.14", 806 | "source": { 807 | "type": "git", 808 | "url": "https://github.com/sebastianbergmann/phpunit.git", 809 | "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" 810 | }, 811 | "dist": { 812 | "type": "zip", 813 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", 814 | "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", 815 | "shasum": "" 816 | }, 817 | "require": { 818 | "ext-dom": "*", 819 | "ext-json": "*", 820 | "ext-libxml": "*", 821 | "ext-mbstring": "*", 822 | "ext-xml": "*", 823 | "myclabs/deep-copy": "^1.6.1", 824 | "phar-io/manifest": "^1.0.1", 825 | "phar-io/version": "^1.0", 826 | "php": "^7.0", 827 | "phpspec/prophecy": "^1.7", 828 | "phpunit/php-code-coverage": "^5.3", 829 | "phpunit/php-file-iterator": "^1.4.3", 830 | "phpunit/php-text-template": "^1.2.1", 831 | "phpunit/php-timer": "^1.0.9", 832 | "phpunit/phpunit-mock-objects": "^5.0.9", 833 | "sebastian/comparator": "^2.1", 834 | "sebastian/diff": "^2.0", 835 | "sebastian/environment": "^3.1", 836 | "sebastian/exporter": "^3.1", 837 | "sebastian/global-state": "^2.0", 838 | "sebastian/object-enumerator": "^3.0.3", 839 | "sebastian/resource-operations": "^1.0", 840 | "sebastian/version": "^2.0.1" 841 | }, 842 | "conflict": { 843 | "phpdocumentor/reflection-docblock": "3.0.2", 844 | "phpunit/dbunit": "<3.0" 845 | }, 846 | "require-dev": { 847 | "ext-pdo": "*" 848 | }, 849 | "suggest": { 850 | "ext-xdebug": "*", 851 | "phpunit/php-invoker": "^1.1" 852 | }, 853 | "bin": [ 854 | "phpunit" 855 | ], 856 | "type": "library", 857 | "extra": { 858 | "branch-alias": { 859 | "dev-master": "6.5.x-dev" 860 | } 861 | }, 862 | "autoload": { 863 | "classmap": [ 864 | "src/" 865 | ] 866 | }, 867 | "notification-url": "https://packagist.org/downloads/", 868 | "license": [ 869 | "BSD-3-Clause" 870 | ], 871 | "authors": [ 872 | { 873 | "name": "Sebastian Bergmann", 874 | "email": "sebastian@phpunit.de", 875 | "role": "lead" 876 | } 877 | ], 878 | "description": "The PHP Unit Testing framework.", 879 | "homepage": "https://phpunit.de/", 880 | "keywords": [ 881 | "phpunit", 882 | "testing", 883 | "xunit" 884 | ], 885 | "time": "2019-02-01T05:22:47+00:00" 886 | }, 887 | { 888 | "name": "phpunit/phpunit-mock-objects", 889 | "version": "5.0.10", 890 | "source": { 891 | "type": "git", 892 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 893 | "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" 894 | }, 895 | "dist": { 896 | "type": "zip", 897 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", 898 | "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", 899 | "shasum": "" 900 | }, 901 | "require": { 902 | "doctrine/instantiator": "^1.0.5", 903 | "php": "^7.0", 904 | "phpunit/php-text-template": "^1.2.1", 905 | "sebastian/exporter": "^3.1" 906 | }, 907 | "conflict": { 908 | "phpunit/phpunit": "<6.0" 909 | }, 910 | "require-dev": { 911 | "phpunit/phpunit": "^6.5.11" 912 | }, 913 | "suggest": { 914 | "ext-soap": "*" 915 | }, 916 | "type": "library", 917 | "extra": { 918 | "branch-alias": { 919 | "dev-master": "5.0.x-dev" 920 | } 921 | }, 922 | "autoload": { 923 | "classmap": [ 924 | "src/" 925 | ] 926 | }, 927 | "notification-url": "https://packagist.org/downloads/", 928 | "license": [ 929 | "BSD-3-Clause" 930 | ], 931 | "authors": [ 932 | { 933 | "name": "Sebastian Bergmann", 934 | "email": "sebastian@phpunit.de", 935 | "role": "lead" 936 | } 937 | ], 938 | "description": "Mock Object library for PHPUnit", 939 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 940 | "keywords": [ 941 | "mock", 942 | "xunit" 943 | ], 944 | "abandoned": true, 945 | "time": "2018-08-09T05:50:03+00:00" 946 | }, 947 | { 948 | "name": "sebastian/code-unit-reverse-lookup", 949 | "version": "1.0.1", 950 | "source": { 951 | "type": "git", 952 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 953 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" 954 | }, 955 | "dist": { 956 | "type": "zip", 957 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 958 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 959 | "shasum": "" 960 | }, 961 | "require": { 962 | "php": "^5.6 || ^7.0" 963 | }, 964 | "require-dev": { 965 | "phpunit/phpunit": "^5.7 || ^6.0" 966 | }, 967 | "type": "library", 968 | "extra": { 969 | "branch-alias": { 970 | "dev-master": "1.0.x-dev" 971 | } 972 | }, 973 | "autoload": { 974 | "classmap": [ 975 | "src/" 976 | ] 977 | }, 978 | "notification-url": "https://packagist.org/downloads/", 979 | "license": [ 980 | "BSD-3-Clause" 981 | ], 982 | "authors": [ 983 | { 984 | "name": "Sebastian Bergmann", 985 | "email": "sebastian@phpunit.de" 986 | } 987 | ], 988 | "description": "Looks up which function or method a line of code belongs to", 989 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 990 | "time": "2017-03-04T06:30:41+00:00" 991 | }, 992 | { 993 | "name": "sebastian/comparator", 994 | "version": "2.1.3", 995 | "source": { 996 | "type": "git", 997 | "url": "https://github.com/sebastianbergmann/comparator.git", 998 | "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" 999 | }, 1000 | "dist": { 1001 | "type": "zip", 1002 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", 1003 | "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", 1004 | "shasum": "" 1005 | }, 1006 | "require": { 1007 | "php": "^7.0", 1008 | "sebastian/diff": "^2.0 || ^3.0", 1009 | "sebastian/exporter": "^3.1" 1010 | }, 1011 | "require-dev": { 1012 | "phpunit/phpunit": "^6.4" 1013 | }, 1014 | "type": "library", 1015 | "extra": { 1016 | "branch-alias": { 1017 | "dev-master": "2.1.x-dev" 1018 | } 1019 | }, 1020 | "autoload": { 1021 | "classmap": [ 1022 | "src/" 1023 | ] 1024 | }, 1025 | "notification-url": "https://packagist.org/downloads/", 1026 | "license": [ 1027 | "BSD-3-Clause" 1028 | ], 1029 | "authors": [ 1030 | { 1031 | "name": "Jeff Welch", 1032 | "email": "whatthejeff@gmail.com" 1033 | }, 1034 | { 1035 | "name": "Volker Dusch", 1036 | "email": "github@wallbash.com" 1037 | }, 1038 | { 1039 | "name": "Bernhard Schussek", 1040 | "email": "bschussek@2bepublished.at" 1041 | }, 1042 | { 1043 | "name": "Sebastian Bergmann", 1044 | "email": "sebastian@phpunit.de" 1045 | } 1046 | ], 1047 | "description": "Provides the functionality to compare PHP values for equality", 1048 | "homepage": "https://github.com/sebastianbergmann/comparator", 1049 | "keywords": [ 1050 | "comparator", 1051 | "compare", 1052 | "equality" 1053 | ], 1054 | "time": "2018-02-01T13:46:46+00:00" 1055 | }, 1056 | { 1057 | "name": "sebastian/diff", 1058 | "version": "2.0.1", 1059 | "source": { 1060 | "type": "git", 1061 | "url": "https://github.com/sebastianbergmann/diff.git", 1062 | "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" 1063 | }, 1064 | "dist": { 1065 | "type": "zip", 1066 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", 1067 | "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", 1068 | "shasum": "" 1069 | }, 1070 | "require": { 1071 | "php": "^7.0" 1072 | }, 1073 | "require-dev": { 1074 | "phpunit/phpunit": "^6.2" 1075 | }, 1076 | "type": "library", 1077 | "extra": { 1078 | "branch-alias": { 1079 | "dev-master": "2.0-dev" 1080 | } 1081 | }, 1082 | "autoload": { 1083 | "classmap": [ 1084 | "src/" 1085 | ] 1086 | }, 1087 | "notification-url": "https://packagist.org/downloads/", 1088 | "license": [ 1089 | "BSD-3-Clause" 1090 | ], 1091 | "authors": [ 1092 | { 1093 | "name": "Kore Nordmann", 1094 | "email": "mail@kore-nordmann.de" 1095 | }, 1096 | { 1097 | "name": "Sebastian Bergmann", 1098 | "email": "sebastian@phpunit.de" 1099 | } 1100 | ], 1101 | "description": "Diff implementation", 1102 | "homepage": "https://github.com/sebastianbergmann/diff", 1103 | "keywords": [ 1104 | "diff" 1105 | ], 1106 | "time": "2017-08-03T08:09:46+00:00" 1107 | }, 1108 | { 1109 | "name": "sebastian/environment", 1110 | "version": "3.1.0", 1111 | "source": { 1112 | "type": "git", 1113 | "url": "https://github.com/sebastianbergmann/environment.git", 1114 | "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" 1115 | }, 1116 | "dist": { 1117 | "type": "zip", 1118 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", 1119 | "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", 1120 | "shasum": "" 1121 | }, 1122 | "require": { 1123 | "php": "^7.0" 1124 | }, 1125 | "require-dev": { 1126 | "phpunit/phpunit": "^6.1" 1127 | }, 1128 | "type": "library", 1129 | "extra": { 1130 | "branch-alias": { 1131 | "dev-master": "3.1.x-dev" 1132 | } 1133 | }, 1134 | "autoload": { 1135 | "classmap": [ 1136 | "src/" 1137 | ] 1138 | }, 1139 | "notification-url": "https://packagist.org/downloads/", 1140 | "license": [ 1141 | "BSD-3-Clause" 1142 | ], 1143 | "authors": [ 1144 | { 1145 | "name": "Sebastian Bergmann", 1146 | "email": "sebastian@phpunit.de" 1147 | } 1148 | ], 1149 | "description": "Provides functionality to handle HHVM/PHP environments", 1150 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1151 | "keywords": [ 1152 | "Xdebug", 1153 | "environment", 1154 | "hhvm" 1155 | ], 1156 | "time": "2017-07-01T08:51:00+00:00" 1157 | }, 1158 | { 1159 | "name": "sebastian/exporter", 1160 | "version": "3.1.2", 1161 | "source": { 1162 | "type": "git", 1163 | "url": "https://github.com/sebastianbergmann/exporter.git", 1164 | "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" 1165 | }, 1166 | "dist": { 1167 | "type": "zip", 1168 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", 1169 | "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", 1170 | "shasum": "" 1171 | }, 1172 | "require": { 1173 | "php": "^7.0", 1174 | "sebastian/recursion-context": "^3.0" 1175 | }, 1176 | "require-dev": { 1177 | "ext-mbstring": "*", 1178 | "phpunit/phpunit": "^6.0" 1179 | }, 1180 | "type": "library", 1181 | "extra": { 1182 | "branch-alias": { 1183 | "dev-master": "3.1.x-dev" 1184 | } 1185 | }, 1186 | "autoload": { 1187 | "classmap": [ 1188 | "src/" 1189 | ] 1190 | }, 1191 | "notification-url": "https://packagist.org/downloads/", 1192 | "license": [ 1193 | "BSD-3-Clause" 1194 | ], 1195 | "authors": [ 1196 | { 1197 | "name": "Sebastian Bergmann", 1198 | "email": "sebastian@phpunit.de" 1199 | }, 1200 | { 1201 | "name": "Jeff Welch", 1202 | "email": "whatthejeff@gmail.com" 1203 | }, 1204 | { 1205 | "name": "Volker Dusch", 1206 | "email": "github@wallbash.com" 1207 | }, 1208 | { 1209 | "name": "Adam Harvey", 1210 | "email": "aharvey@php.net" 1211 | }, 1212 | { 1213 | "name": "Bernhard Schussek", 1214 | "email": "bschussek@gmail.com" 1215 | } 1216 | ], 1217 | "description": "Provides the functionality to export PHP variables for visualization", 1218 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1219 | "keywords": [ 1220 | "export", 1221 | "exporter" 1222 | ], 1223 | "time": "2019-09-14T09:02:43+00:00" 1224 | }, 1225 | { 1226 | "name": "sebastian/global-state", 1227 | "version": "2.0.0", 1228 | "source": { 1229 | "type": "git", 1230 | "url": "https://github.com/sebastianbergmann/global-state.git", 1231 | "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" 1232 | }, 1233 | "dist": { 1234 | "type": "zip", 1235 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", 1236 | "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", 1237 | "shasum": "" 1238 | }, 1239 | "require": { 1240 | "php": "^7.0" 1241 | }, 1242 | "require-dev": { 1243 | "phpunit/phpunit": "^6.0" 1244 | }, 1245 | "suggest": { 1246 | "ext-uopz": "*" 1247 | }, 1248 | "type": "library", 1249 | "extra": { 1250 | "branch-alias": { 1251 | "dev-master": "2.0-dev" 1252 | } 1253 | }, 1254 | "autoload": { 1255 | "classmap": [ 1256 | "src/" 1257 | ] 1258 | }, 1259 | "notification-url": "https://packagist.org/downloads/", 1260 | "license": [ 1261 | "BSD-3-Clause" 1262 | ], 1263 | "authors": [ 1264 | { 1265 | "name": "Sebastian Bergmann", 1266 | "email": "sebastian@phpunit.de" 1267 | } 1268 | ], 1269 | "description": "Snapshotting of global state", 1270 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1271 | "keywords": [ 1272 | "global state" 1273 | ], 1274 | "time": "2017-04-27T15:39:26+00:00" 1275 | }, 1276 | { 1277 | "name": "sebastian/object-enumerator", 1278 | "version": "3.0.3", 1279 | "source": { 1280 | "type": "git", 1281 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1282 | "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" 1283 | }, 1284 | "dist": { 1285 | "type": "zip", 1286 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", 1287 | "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", 1288 | "shasum": "" 1289 | }, 1290 | "require": { 1291 | "php": "^7.0", 1292 | "sebastian/object-reflector": "^1.1.1", 1293 | "sebastian/recursion-context": "^3.0" 1294 | }, 1295 | "require-dev": { 1296 | "phpunit/phpunit": "^6.0" 1297 | }, 1298 | "type": "library", 1299 | "extra": { 1300 | "branch-alias": { 1301 | "dev-master": "3.0.x-dev" 1302 | } 1303 | }, 1304 | "autoload": { 1305 | "classmap": [ 1306 | "src/" 1307 | ] 1308 | }, 1309 | "notification-url": "https://packagist.org/downloads/", 1310 | "license": [ 1311 | "BSD-3-Clause" 1312 | ], 1313 | "authors": [ 1314 | { 1315 | "name": "Sebastian Bergmann", 1316 | "email": "sebastian@phpunit.de" 1317 | } 1318 | ], 1319 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1320 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1321 | "time": "2017-08-03T12:35:26+00:00" 1322 | }, 1323 | { 1324 | "name": "sebastian/object-reflector", 1325 | "version": "1.1.1", 1326 | "source": { 1327 | "type": "git", 1328 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1329 | "reference": "773f97c67f28de00d397be301821b06708fca0be" 1330 | }, 1331 | "dist": { 1332 | "type": "zip", 1333 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", 1334 | "reference": "773f97c67f28de00d397be301821b06708fca0be", 1335 | "shasum": "" 1336 | }, 1337 | "require": { 1338 | "php": "^7.0" 1339 | }, 1340 | "require-dev": { 1341 | "phpunit/phpunit": "^6.0" 1342 | }, 1343 | "type": "library", 1344 | "extra": { 1345 | "branch-alias": { 1346 | "dev-master": "1.1-dev" 1347 | } 1348 | }, 1349 | "autoload": { 1350 | "classmap": [ 1351 | "src/" 1352 | ] 1353 | }, 1354 | "notification-url": "https://packagist.org/downloads/", 1355 | "license": [ 1356 | "BSD-3-Clause" 1357 | ], 1358 | "authors": [ 1359 | { 1360 | "name": "Sebastian Bergmann", 1361 | "email": "sebastian@phpunit.de" 1362 | } 1363 | ], 1364 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1365 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1366 | "time": "2017-03-29T09:07:27+00:00" 1367 | }, 1368 | { 1369 | "name": "sebastian/recursion-context", 1370 | "version": "3.0.0", 1371 | "source": { 1372 | "type": "git", 1373 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1374 | "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" 1375 | }, 1376 | "dist": { 1377 | "type": "zip", 1378 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", 1379 | "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", 1380 | "shasum": "" 1381 | }, 1382 | "require": { 1383 | "php": "^7.0" 1384 | }, 1385 | "require-dev": { 1386 | "phpunit/phpunit": "^6.0" 1387 | }, 1388 | "type": "library", 1389 | "extra": { 1390 | "branch-alias": { 1391 | "dev-master": "3.0.x-dev" 1392 | } 1393 | }, 1394 | "autoload": { 1395 | "classmap": [ 1396 | "src/" 1397 | ] 1398 | }, 1399 | "notification-url": "https://packagist.org/downloads/", 1400 | "license": [ 1401 | "BSD-3-Clause" 1402 | ], 1403 | "authors": [ 1404 | { 1405 | "name": "Jeff Welch", 1406 | "email": "whatthejeff@gmail.com" 1407 | }, 1408 | { 1409 | "name": "Sebastian Bergmann", 1410 | "email": "sebastian@phpunit.de" 1411 | }, 1412 | { 1413 | "name": "Adam Harvey", 1414 | "email": "aharvey@php.net" 1415 | } 1416 | ], 1417 | "description": "Provides functionality to recursively process PHP variables", 1418 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1419 | "time": "2017-03-03T06:23:57+00:00" 1420 | }, 1421 | { 1422 | "name": "sebastian/resource-operations", 1423 | "version": "1.0.0", 1424 | "source": { 1425 | "type": "git", 1426 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1427 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 1428 | }, 1429 | "dist": { 1430 | "type": "zip", 1431 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1432 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1433 | "shasum": "" 1434 | }, 1435 | "require": { 1436 | "php": ">=5.6.0" 1437 | }, 1438 | "type": "library", 1439 | "extra": { 1440 | "branch-alias": { 1441 | "dev-master": "1.0.x-dev" 1442 | } 1443 | }, 1444 | "autoload": { 1445 | "classmap": [ 1446 | "src/" 1447 | ] 1448 | }, 1449 | "notification-url": "https://packagist.org/downloads/", 1450 | "license": [ 1451 | "BSD-3-Clause" 1452 | ], 1453 | "authors": [ 1454 | { 1455 | "name": "Sebastian Bergmann", 1456 | "email": "sebastian@phpunit.de" 1457 | } 1458 | ], 1459 | "description": "Provides a list of PHP built-in functions that operate on resources", 1460 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1461 | "time": "2015-07-28T20:34:47+00:00" 1462 | }, 1463 | { 1464 | "name": "sebastian/version", 1465 | "version": "2.0.1", 1466 | "source": { 1467 | "type": "git", 1468 | "url": "https://github.com/sebastianbergmann/version.git", 1469 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 1470 | }, 1471 | "dist": { 1472 | "type": "zip", 1473 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 1474 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 1475 | "shasum": "" 1476 | }, 1477 | "require": { 1478 | "php": ">=5.6" 1479 | }, 1480 | "type": "library", 1481 | "extra": { 1482 | "branch-alias": { 1483 | "dev-master": "2.0.x-dev" 1484 | } 1485 | }, 1486 | "autoload": { 1487 | "classmap": [ 1488 | "src/" 1489 | ] 1490 | }, 1491 | "notification-url": "https://packagist.org/downloads/", 1492 | "license": [ 1493 | "BSD-3-Clause" 1494 | ], 1495 | "authors": [ 1496 | { 1497 | "name": "Sebastian Bergmann", 1498 | "email": "sebastian@phpunit.de", 1499 | "role": "lead" 1500 | } 1501 | ], 1502 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1503 | "homepage": "https://github.com/sebastianbergmann/version", 1504 | "time": "2016-10-03T07:35:21+00:00" 1505 | }, 1506 | { 1507 | "name": "squizlabs/php_codesniffer", 1508 | "version": "3.5.3", 1509 | "source": { 1510 | "type": "git", 1511 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 1512 | "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" 1513 | }, 1514 | "dist": { 1515 | "type": "zip", 1516 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", 1517 | "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", 1518 | "shasum": "" 1519 | }, 1520 | "require": { 1521 | "ext-simplexml": "*", 1522 | "ext-tokenizer": "*", 1523 | "ext-xmlwriter": "*", 1524 | "php": ">=5.4.0" 1525 | }, 1526 | "require-dev": { 1527 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 1528 | }, 1529 | "bin": [ 1530 | "bin/phpcs", 1531 | "bin/phpcbf" 1532 | ], 1533 | "type": "library", 1534 | "extra": { 1535 | "branch-alias": { 1536 | "dev-master": "3.x-dev" 1537 | } 1538 | }, 1539 | "notification-url": "https://packagist.org/downloads/", 1540 | "license": [ 1541 | "BSD-3-Clause" 1542 | ], 1543 | "authors": [ 1544 | { 1545 | "name": "Greg Sherwood", 1546 | "role": "lead" 1547 | } 1548 | ], 1549 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 1550 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 1551 | "keywords": [ 1552 | "phpcs", 1553 | "standards" 1554 | ], 1555 | "time": "2019-12-04T04:46:47+00:00" 1556 | }, 1557 | { 1558 | "name": "symfony/polyfill-ctype", 1559 | "version": "v1.13.1", 1560 | "source": { 1561 | "type": "git", 1562 | "url": "https://github.com/symfony/polyfill-ctype.git", 1563 | "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" 1564 | }, 1565 | "dist": { 1566 | "type": "zip", 1567 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", 1568 | "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", 1569 | "shasum": "" 1570 | }, 1571 | "require": { 1572 | "php": ">=5.3.3" 1573 | }, 1574 | "suggest": { 1575 | "ext-ctype": "For best performance" 1576 | }, 1577 | "type": "library", 1578 | "extra": { 1579 | "branch-alias": { 1580 | "dev-master": "1.13-dev" 1581 | } 1582 | }, 1583 | "autoload": { 1584 | "psr-4": { 1585 | "Symfony\\Polyfill\\Ctype\\": "" 1586 | }, 1587 | "files": [ 1588 | "bootstrap.php" 1589 | ] 1590 | }, 1591 | "notification-url": "https://packagist.org/downloads/", 1592 | "license": [ 1593 | "MIT" 1594 | ], 1595 | "authors": [ 1596 | { 1597 | "name": "Gert de Pagter", 1598 | "email": "BackEndTea@gmail.com" 1599 | }, 1600 | { 1601 | "name": "Symfony Community", 1602 | "homepage": "https://symfony.com/contributors" 1603 | } 1604 | ], 1605 | "description": "Symfony polyfill for ctype functions", 1606 | "homepage": "https://symfony.com", 1607 | "keywords": [ 1608 | "compatibility", 1609 | "ctype", 1610 | "polyfill", 1611 | "portable" 1612 | ], 1613 | "time": "2019-11-27T13:56:44+00:00" 1614 | }, 1615 | { 1616 | "name": "theseer/tokenizer", 1617 | "version": "1.1.3", 1618 | "source": { 1619 | "type": "git", 1620 | "url": "https://github.com/theseer/tokenizer.git", 1621 | "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" 1622 | }, 1623 | "dist": { 1624 | "type": "zip", 1625 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", 1626 | "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", 1627 | "shasum": "" 1628 | }, 1629 | "require": { 1630 | "ext-dom": "*", 1631 | "ext-tokenizer": "*", 1632 | "ext-xmlwriter": "*", 1633 | "php": "^7.0" 1634 | }, 1635 | "type": "library", 1636 | "autoload": { 1637 | "classmap": [ 1638 | "src/" 1639 | ] 1640 | }, 1641 | "notification-url": "https://packagist.org/downloads/", 1642 | "license": [ 1643 | "BSD-3-Clause" 1644 | ], 1645 | "authors": [ 1646 | { 1647 | "name": "Arne Blankerts", 1648 | "email": "arne@blankerts.de", 1649 | "role": "Developer" 1650 | } 1651 | ], 1652 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 1653 | "time": "2019-06-13T22:48:21+00:00" 1654 | }, 1655 | { 1656 | "name": "webmozart/assert", 1657 | "version": "1.6.0", 1658 | "source": { 1659 | "type": "git", 1660 | "url": "https://github.com/webmozart/assert.git", 1661 | "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" 1662 | }, 1663 | "dist": { 1664 | "type": "zip", 1665 | "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", 1666 | "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", 1667 | "shasum": "" 1668 | }, 1669 | "require": { 1670 | "php": "^5.3.3 || ^7.0", 1671 | "symfony/polyfill-ctype": "^1.8" 1672 | }, 1673 | "conflict": { 1674 | "vimeo/psalm": "<3.6.0" 1675 | }, 1676 | "require-dev": { 1677 | "phpunit/phpunit": "^4.8.36 || ^7.5.13" 1678 | }, 1679 | "type": "library", 1680 | "autoload": { 1681 | "psr-4": { 1682 | "Webmozart\\Assert\\": "src/" 1683 | } 1684 | }, 1685 | "notification-url": "https://packagist.org/downloads/", 1686 | "license": [ 1687 | "MIT" 1688 | ], 1689 | "authors": [ 1690 | { 1691 | "name": "Bernhard Schussek", 1692 | "email": "bschussek@gmail.com" 1693 | } 1694 | ], 1695 | "description": "Assertions to validate method input/output with nice error messages.", 1696 | "keywords": [ 1697 | "assert", 1698 | "check", 1699 | "validate" 1700 | ], 1701 | "time": "2019-11-24T13:36:37+00:00" 1702 | }, 1703 | { 1704 | "name": "wp-coding-standards/wpcs", 1705 | "version": "2.2.0", 1706 | "source": { 1707 | "type": "git", 1708 | "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 1709 | "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a" 1710 | }, 1711 | "dist": { 1712 | "type": "zip", 1713 | "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/f90e8692ce97b693633db7ab20bfa78d930f536a", 1714 | "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a", 1715 | "shasum": "" 1716 | }, 1717 | "require": { 1718 | "php": ">=5.4", 1719 | "squizlabs/php_codesniffer": "^3.3.1" 1720 | }, 1721 | "require-dev": { 1722 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", 1723 | "phpcompatibility/php-compatibility": "^9.0", 1724 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 1725 | }, 1726 | "suggest": { 1727 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 1728 | }, 1729 | "type": "phpcodesniffer-standard", 1730 | "notification-url": "https://packagist.org/downloads/", 1731 | "license": [ 1732 | "MIT" 1733 | ], 1734 | "authors": [ 1735 | { 1736 | "name": "Contributors", 1737 | "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 1738 | } 1739 | ], 1740 | "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 1741 | "keywords": [ 1742 | "phpcs", 1743 | "standards", 1744 | "wordpress" 1745 | ], 1746 | "time": "2019-11-11T12:34:03+00:00" 1747 | } 1748 | ], 1749 | "aliases": [], 1750 | "minimum-stability": "stable", 1751 | "stability-flags": [], 1752 | "prefer-stable": false, 1753 | "prefer-lowest": false, 1754 | "platform": { 1755 | "php": ">=5.6" 1756 | }, 1757 | "platform-dev": [] 1758 | } 1759 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | . 37 | 38 | 39 | 40 | 41 | tests/* 42 | vendor/* 43 | 44 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | ./tests/ 13 | 14 | 15 | 16 | 17 | ./src 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Filesystem.php: -------------------------------------------------------------------------------- 1 | base_dir = trailingslashit( wp_normalize_path( $base_dir ) ); 75 | 76 | self::init_wp_filesystem(); 77 | 78 | } 79 | 80 | /** 81 | * Initializes the WP_Filesystem 82 | * 83 | * @since 1.0.0 84 | * @return void 85 | */ 86 | private static function init_wp_filesystem() { 87 | 88 | if ( isset( self::$wp_filesystem ) ) { 89 | return; 90 | } 91 | 92 | global $wp_filesystem; 93 | 94 | require_once ABSPATH . '/wp-admin/includes/file.php'; 95 | WP_Filesystem(); 96 | 97 | self::$wp_filesystem = $wp_filesystem; 98 | 99 | } 100 | 101 | /** 102 | * Passes the method call to the WP_Filesystem 103 | * 104 | * @since 1.0.0 105 | * @param string $method_name Called method name. 106 | * @param array $arguments List of arguments passed. 107 | * @return mixed 108 | */ 109 | public function __call( $method_name, $arguments ) { 110 | 111 | // Prefix file/dir with base path for certain methods. 112 | if ( in_array( $method_name, $this->prefixed_methods, true ) ) { 113 | if ( ! isset( $arguments[0] ) ) { 114 | $arguments[0] = ''; 115 | } 116 | $arguments[0] = $this->path( $arguments[0] ); 117 | } 118 | 119 | return call_user_func_array( [ self::$wp_filesystem, $method_name ], $arguments ); 120 | 121 | } 122 | 123 | /** 124 | * Creates a directory. 125 | * 126 | * @throws \Exception If recursive parameter used width filesystem method other than direct. 127 | * @since 1.1.0 128 | * 129 | * @param string $path Path for new directory. 130 | * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). 131 | * Default false. 132 | * @param string|int $chown Optional. A user name or number (or false to skip chown). 133 | * Default false. 134 | * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp). 135 | * Default false. 136 | * @param bool $recursive Whether to act recursively. 137 | * @return bool True on success, false on failure. 138 | */ 139 | public function mkdir( $path = '', $chmod = false, $chown = false, $chgrp = false, $recursive = false ) { 140 | 141 | if ( ! self::$wp_filesystem instanceof \WP_Filesystem_Direct ) { 142 | if ( $recursive ) { 143 | throw new \Exception( 'Current filesystem method does not support recursive directory creation.' ); 144 | } 145 | 146 | self::$wp_filesystem->mkdir( $path, $chmod, $chown, $chgrp ); 147 | } 148 | 149 | // Safe mode fails with a trailing slash under certain PHP versions. 150 | $path = untrailingslashit( $path ); 151 | 152 | if ( ! $chmod ) { 153 | $chmod = FS_CHMOD_DIR; 154 | } 155 | 156 | // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged 157 | if ( ! @mkdir( $this->path( $path ), $chmod, true ) ) { 158 | return false; 159 | } 160 | 161 | if ( $chown ) { 162 | $this->chown( $path, $chown ); 163 | } 164 | 165 | if ( $chgrp ) { 166 | $this->chgrp( $path, $chgrp ); 167 | } 168 | 169 | return true; 170 | 171 | } 172 | 173 | /** 174 | * Changes the path to URL 175 | * 176 | * @since 1.0.0 177 | * @param string $path Full path. 178 | * @return string 179 | */ 180 | public function path_to_url( $path ) { 181 | return str_replace( wp_normalize_path( WP_CONTENT_DIR ), content_url(), $path ); 182 | } 183 | 184 | /** 185 | * Gets the base url 186 | * 187 | * @since 1.0.0 188 | * @return string 189 | */ 190 | protected function base_url() { 191 | return $this->path_to_url( $this->base_dir ); 192 | } 193 | 194 | /** 195 | * Replaces relative path to full path 196 | * 197 | * @since 1.0.0 198 | * @param string $rel_path Relative path to file or dir. 199 | * @return string 200 | */ 201 | public function path( $rel_path = '' ) { 202 | return $this->base_dir . $rel_path; 203 | } 204 | 205 | /** 206 | * Replaces relative URI to full URL 207 | * 208 | * @since 1.0.0 209 | * @param string $uri Relative URI. 210 | * @return string 211 | */ 212 | public function url( $uri = '' ) { 213 | return $this->base_url() . $uri; 214 | } 215 | 216 | /** 217 | * Converts image file to base64 URL 218 | * 219 | * @since 1.0.0 220 | * @param string $image_path Relative image path. 221 | * @return string 222 | */ 223 | public function image_to_base64( $image_path ) { 224 | 225 | if ( ! $this->exists( $image_path ) ) { 226 | return ''; 227 | } 228 | 229 | $type = pathinfo( $this->path( $image_path ), PATHINFO_EXTENSION ); 230 | 231 | // Fix SVG MIME type. 232 | if ( 'svg' === $type ) { 233 | $type = 'svg+xml'; 234 | } 235 | 236 | return sprintf( 237 | 'data:image/%s;base64,%s', 238 | $type, 239 | base64_encode( $this->get_contents( $image_path ) ) // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 240 | ); 241 | 242 | } 243 | 244 | } 245 | -------------------------------------------------------------------------------- /tests/assets/file.txt: -------------------------------------------------------------------------------- 1 | first 2 | second 3 | third 4 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | base_dir = WP_PLUGIN_DIR . '/test/'; 20 | $this->plugin_filesystem = new Filesystem( $this->base_dir ); 21 | } 22 | 23 | public function test_path() { 24 | $this->assertSame( 25 | $this->base_dir . 'dir/file.php', 26 | $this->plugin_filesystem->path( 'dir/file.php' ) 27 | ); 28 | } 29 | 30 | public function test_path_base() { 31 | $this->assertSame( 32 | $this->base_dir, 33 | $this->plugin_filesystem->path() 34 | ); 35 | } 36 | 37 | public function test_url() { 38 | $this->assertSame( 39 | WP_PLUGIN_URL . '/test/dir/file.png', 40 | $this->plugin_filesystem->url( 'dir/file.png' ) 41 | ); 42 | } 43 | 44 | public function test_url_base() { 45 | $this->assertSame( 46 | WP_PLUGIN_URL . '/test/', 47 | $this->plugin_filesystem->url() 48 | ); 49 | } 50 | 51 | } 52 | --------------------------------------------------------------------------------