phar-stream-wrapper | Interceptors for PHP 's native phar : // stream | Identity Management library

 by   TYPO3 PHP Version: v2.2.1 License: MIT

kandi X-RAY | phar-stream-wrapper Summary

kandi X-RAY | phar-stream-wrapper Summary

phar-stream-wrapper is a PHP library typically used in Security, Identity Management applications. phar-stream-wrapper has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Interceptors for PHP's native phar:// stream handling in order to enhance security.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              phar-stream-wrapper has a low active ecosystem.
              It has 49 star(s) with 11 fork(s). There are 8 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 15 have been closed. On average issues are closed in 26 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of phar-stream-wrapper is v2.2.1

            kandi-Quality Quality

              phar-stream-wrapper has 0 bugs and 0 code smells.

            kandi-Security Security

              phar-stream-wrapper has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              phar-stream-wrapper code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              phar-stream-wrapper is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              phar-stream-wrapper releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              phar-stream-wrapper saves you 577 person hours of effort in developing the same functionality from scratch.
              It has 1347 lines of code, 119 functions and 20 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed phar-stream-wrapper and discovered the below as its top functions. This is intended to give you an instant insight into phar-stream-wrapper implemented functionality, and help decide if they suit your requirements.
            • Extracts data from a file .
            • Returns canonical path .
            • Resolve base name .
            • Set stream metadata
            • Trigger duplicate alias warning
            • Checks if the base file does not have meta - data issues .
            • Initialize from content .
            • Asserts that the assertion is complete .
            • Initializes the manager .
            • Asserts assertions .
            Get all kandi verified functions for this library.

            phar-stream-wrapper Key Features

            No Key Features are available at this moment for phar-stream-wrapper.

            phar-stream-wrapper Examples and Code Snippets

            PHP Phar Stream Wrapper,Interceptors
            PHPdot img1Lines of Code : 38dot img1License : Permissive (MIT)
            copy iconCopy
            class PharExtensionInterceptor implements Assertable
            {
                /**
                 * Determines whether the base file name has a ".phar" suffix.
                 *
                 * @param string $path
                 * @param string $command
                 * @return bool
                 * @throws Exception
                 */
                 
            PHP Phar Stream Wrapper,Example
            PHPdot img2Lines of Code : 9dot img2License : Permissive (MIT)
            copy iconCopy
            \TYPO3\PharStreamWrapper\Manager::initialize(
                (new \TYPO3\PharStreamWrapper\Behavior())
                    ->withAssertion(new \TYPO3\PharStreamWrapper\Interceptor\PharExtensionInterceptor())
            );
            
            if (in_array('phar', stream_get_wrappers())) {
                stream_  
            PHP Phar Stream Wrapper,Interceptors,ConjunctionInterceptor
            PHPdot img3Lines of Code : 7dot img3License : Permissive (MIT)
            copy iconCopy
            \TYPO3\PharStreamWrapper\Manager::initialize(
                (new \TYPO3\PharStreamWrapper\Behavior())
                    ->withAssertion(new ConjunctionInterceptor([
                        new PharExtensionInterceptor(),
                        new PharMetaDataInterceptor(),
                    ]))
            );
              

            Community Discussions

            QUESTION

            PHP 7.3 Deprecated Namespace Assert in Drupal
            Asked 2020-Jul-31 at 18:11

            English isn't my first language, please be patient.

            From PHP 7.3 Deprecated Features

            Namespaced assert()

            Declaring a function called assert() inside a namespace is deprecated. The assert() function is subject to special handling by the engine, which may lead to inconsistent behavior when defining a namespaced function with the same name.

            I'm working on Drupal 7.72, I was checking the process to migrate to PHP 7.3, when it comes to deprecated features I found that assert() function is used by Drupal core in several files in the folder \misc\typo3\. The ones I have identified as potential risks are the following:

            • docroot\misc\typo3\drupal-security\PharExtensionInterceptor.php
            • docroot\misc\typo3\phar-stream-wrapper\src\Interceptor\ConjunctionInterceptor.php
            • docroot\misc\typo3\phar-stream-wrapper\src\Interceptor\PharExtensionInterceptor.php
            • docroot\misc\typo3\phar-stream-wrapper\src\Interceptor\PharMetaDataInterceptor.php
            • docroot\misc\typo3\phar-stream-wrapper\src\PharStreamWrapper.php
            • docroot\misc\typo3\phar-stream-wrapper\src\Assertable.php
            • docroot\misc\typo3\phar-stream-wrapper\src\Behavior.php
            • docroot\misc\typo3\phar-stream-wrapper\src\Manager.php

            I'm really confused about how Drupal is declaring assert functions even though they are deprecated, maybe I'm misreading the Documentation? There's some way to test these files to be sure that everything will be working on PHP 7.3?

            ...

            ANSWER

            Answered 2020-Jul-31 at 18:11

            Those files should not cause any problems regarding the deprecated namespaced assert().

            That deprecation refers to a namespaced assert() function, but what you have in those files are class methods.

            Here's a basic example of the difference in case my explanation is not clear:

            Namespaced assert function (deprecated)

            Source https://stackoverflow.com/questions/63195510

            QUESTION

            Why does composer create-project for Drupal fail in WSL2?
            Asked 2020-Jul-21 at 13:39

            I am a Drupal site builder experimenting with WSL2 and I am finding the routine creating a Drupal project with composer does not complete.

            My PC has 16GB RAM and composer is allowed unlimited memory. To the best of my understanding I have Docker configured correctly for WSL2.

            The create-project process starts normally but then stalls when installing drupal/core (9.0.2). This appears to be so whether downloading from source or from cache. After a considerable time the process will fail. The contents of the project folder are largely incomplete.

            I first attempted this with a Drupal 9 recipe for DDEV, a container based local dev environment which includes composer.

            Not wishing to point the finger at DDEV, I then installed composer via Homebrew in the Home directory of WSL2 and tried again, independently of DDEV or Docker. After running composer create-project drupal/recommended-project my_site_name_dir I find that composer fails in exactly the same way.

            Composer output follows;

            paul@DESKTOP-TQA1I7L:/mnt/c/Users/Paul/Sites/D9$ composer create-project drupal/recommended-project my_site_name_dir Creating a "drupal/recommended-project" project at "./my_site_name_dir" Installing drupal/recommended-project (9.0.2)

            • Installing drupal/recommended-project (9.0.2): Loading from cache Created project in /mnt/c/Users/Paul/Sites/D9/my_site_name_dir Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Package operations: 59 installs, 0 updates, 0 removals
            • Installing composer/installers (v1.9.0): Loading from cache
            • Installing drupal/core-composer-scaffold (9.0.2): Loading from cache
            • Installing drupal/core-project-message (9.0.2): Loading from cache
            • Installing typo3/phar-stream-wrapper (v3.1.4): Loading from cache
            • Installing symfony/polyfill-mbstring (v1.17.0): Loading from cache
            • Installing symfony/polyfill-ctype (v1.17.0): Loading from cache
            • Installing twig/twig (v2.12.5): Loading from cache
            • Installing symfony/yaml (v4.4.9): Loading from cache
            • Installing symfony/polyfill-php80 (v1.17.0): Loading from cache
            • Installing symfony/var-dumper (v5.1.0): Loading from cache
            • Installing symfony/translation-contracts (v2.1.2): Loading from cache
            • Installing symfony/validator (v4.4.9): Loading from cache
            • Installing symfony/translation (v4.4.9): Loading from cache
            • Installing psr/container (1.0.0): Loading from cache
            • Installing symfony/service-contracts (v2.1.2): Loading from cache
            • Installing symfony/serializer (v4.4.9): Loading from cache
            • Installing symfony/routing (v4.4.9): Loading from cache
            • Installing symfony/polyfill-php72 (v1.17.0): Loading from cache
            • Installing symfony/polyfill-intl-idn (v1.17.0): Loading from cache
            • Installing symfony/mime (v5.1.0): Loading from cache
            • Installing symfony/http-foundation (v4.4.9): Loading from cache
            • Installing psr/http-message (1.0.1): Loading from cache
            • Installing symfony/psr-http-message-bridge (v2.0.0): Loading from cache
            • Installing symfony/process (v4.4.9): Loading from cache
            • Installing symfony/polyfill-php73 (v1.17.0): Loading from cache
            • Installing symfony/polyfill-iconv (v1.17.0): Loading from cache
            • Installing symfony/event-dispatcher-contracts (v1.1.7): Loading from cache
            • Installing symfony/event-dispatcher (v4.4.9): Loading from cache
            • Installing psr/log (1.1.3): Loading from cache
            • Installing symfony/debug (v4.4.9): Loading from cache
            • Installing symfony/error-handler (v4.4.9): Loading from cache
            • Installing symfony/http-kernel (v4.4.9): Loading from cache
            • Installing symfony/dependency-injection (v4.4.9): Loading from cache
            • Installing symfony/console (v4.4.9): Loading from cache
            • Installing symfony-cmf/routing (2.3.2): Loading from cache
            • Installing stack/builder (v1.0.6): Loading from cache
            • Installing ralouphie/getallheaders (3.0.3): Loading from cache
            • Installing psr/http-factory (1.0.1): Loading from cache
            • Installing pear/pear_exception (v1.0.1): Loading from cache
            • Installing pear/console_getopt (v1.4.3): Loading from cache
            • Installing pear/pear-core-minimal (v1.10.10): Loading from cache
            • Installing pear/archive_tar (1.4.9): Loading from cache
            • Installing masterminds/html5 (2.7.0): Loading from cache
            • Installing laminas/laminas-zendframework-bridge (1.0.4): Loading from cache
            • Installing laminas/laminas-stdlib (3.2.1): Loading from cache
            • Installing laminas/laminas-escaper (2.6.1): Loading from cache
            • Installing laminas/laminas-feed (2.12.2): Loading from cache
            • Installing laminas/laminas-diactoros (2.3.0): Loading from cache
            • Installing guzzlehttp/psr7 (1.6.1): Loading from cache
            • Installing guzzlehttp/promises (v1.3.1): Loading from cache
            • Installing guzzlehttp/guzzle (6.5.4): Loading from cache
            • Installing doctrine/lexer (1.2.1): Loading from cache
            • Installing egulias/email-validator (2.1.17): Loading from cache
            • Installing doctrine/annotations (1.10.3): Loading from cache
            • Installing doctrine/reflection (1.2.1): Loading from cache
            • Installing composer/semver (1.5.1): Loading from cache
            • Installing asm89/stack-cors (1.3.0): Loading from cache
            • Installing drupal/core (9.0.2): Loading from cache Failed to download drupal/core from dist: Could not delete /mnt/c/Users/Paul/Sites/D9/my_site_name_dir/vendor/composer/782129de/drupal-core-ea6e0ce/lib/Drupal/Core: Now trying to download from source
            • Installing drupal/core (9.0.2): Cloning ea6e0cef32 from cache

            [Symfony\Component\Process\Exception\ProcessTimedOutException] The process "git checkout '9.0.2' --" exceeded the timeout of 300 seconds.

            create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [] [] []

            paul@DESKTOP-TQA1I7L:/mnt/c/Users/Paul/Sites/D9$ paul@DESKTOP-TQA1I7L:/mnt/c/Users/Paul/Sites/D9$ composer create-project drupal/recommended-project my_site_name_dir Creating a "drupal/recommended-project" project at "./my_site_name_dir"

            [InvalidArgumentException] Project directory "/mnt/c/Users/Paul/Sites/D9/my_site_name_dir" is not empty.

            create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [] [] []

            ...

            ANSWER

            Answered 2020-Jul-20 at 09:31

            After reading some updated documentation I now understand the problem was that I was attempting to perform this operation under the Windows file system at .mnt/c/Users/Paul instead of the Linux location of /home/paul

            As well as completing without errors, performance is vastly improved.

            Source https://stackoverflow.com/questions/62992034

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install phar-stream-wrapper

            The PharStreamWrapper is provided as composer package typo3/phar-stream-wrapper and has minimum requirements of PHP v5.3 (v2 branch) and PHP v7.0 (master branch).

            Support

            In case of finding additional security issues in the TYPO3 project or in this PharStreamWrapper package in particular, please get in touch with the TYPO3 Security Team.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Identity Management Libraries

            vault

            by hashicorp

            k9s

            by derailed

            keepassxc

            by keepassxreboot

            keycloak

            by keycloak

            uuid

            by uuidjs

            Try Top Libraries by TYPO3

            typo3

            by TYPO3PHP

            TYPO3.CMS

            by TYPO3PHP

            Fluid

            by TYPO3PHP

            styleguide

            by TYPO3PHP

            Surf

            by TYPO3PHP