PHP Zend

Page last edited 361 giorni 17 ore fa
Da wiki.betaingegneria.it.

Vedere gli opcode Zend di un programma PHP[modifica]

Installazione di Box[modifica]

box2

    $  curl -LSs https://box-project.github.io/box2/installer.php | php
    Box Installer
    =============
    
    Environment Check
    -----------------
    
    "-" indicates success.
    "*" indicates error.
    
     - You have a supported version of PHP (>= 5.3.3).
     - You have the "phar" extension installed.
     - You have a supported version of the "phar" extension.
     - You have the "openssl" extension installed.
     * Notice: The "phar.readonly" setting needs to be off to create Phars.
     - The "detect_unicode" setting is off.
     - The "allow_url_fopen" setting is on.
    
    Everything seems good!
    
    Download
    --------
    
     - Downloading manifest...
     - Reading manifest...
     - Downloading Box v2.7.5...
     - Checking file checksum...
     - Checking if valid Phar...
     - Making Box executable...
    
    Box installed!

viene generato uno shell script bx.phar; è conveniente spostarlo nella directory dei comandi utente:

    $ sudo mv box.phar /usr/local/bin/

quindi

   $ box.phar --version
   Box version 2.7.5 build 8ce371cdc1f0005e087e9ca5c265b52b5f560fd4

Installazione di Pickle[modifica]

$ git clone https://github.com/FriendsOfPHP/pickle.git Cloning into 'pickle'... remote: Counting objects: 4421, done. remote: Total 4421 (delta 0), reused 0 (delta 0), pack-reused 4421 Ricezione degli oggetti: 100% (4421/4421), 688.19 KiB | 543.00 KiB/s, done. Risoluzione dei delta: 100% (2562/2562), done. Checking connectivity... fatto.

Usando composer

       $ cp composer.json composer.json.old

copiare e incollare dentro al nuovo file composer.json questo file:

    {
          "name": "friendsofphp/pickle",
          "type": "application",
          "description": "Installer for PHP extension, supports pecl package or install from src tree directly",
          "homepage": "https://github.com/FriendsOfPHP/pickle",
          "license": "PHP-3.01",
          "authors": [
              {
                  "name": "Pierre Joye",
                  "email": "pierre.php@gmail.com",
                  "homepage": "http://pecl.php.net/user/pajoye",
                  "role": "Developer"
              },
              {
                  "name": "Community",
                  "homepage": "https://github.com/FriendsOfPHP/pickle/graphs/contributors"
              }
          ],
          "require": {
              "php": ">=5.4",
              "ext-zlib": "*",
              "ext-mbstring": "*",
              "ext-simplexml": "*",
              "ext-json": "*",
              "ext-dom": "*",
              "ext-openssl": "*",
              "ext-zip": "*",
              "symfony/console": "~2.5",
              "justinrainbow/json-schema": "~1.5",
              "composer/composer": "~1.0-alpha8",
              "padraic/phar-updater": "~1.0@dev"
          },
          "require-dev": {
              "atoum/atoum": "~2.1",
              "atoum/praspel-extension": "~0.1",
              "atoum/visibility-extension": "~1.0",
              "behat/behat": "~3.0",
              "symfony/process": "~2.5",
              "fabpot/php-cs-fixer": "~1.7"
          },
          "autoload": {
              "psr-4": {
                  "Pickle\\": ["src/"]
              }
          },
          "bin": ["bin/pickle"],
          "scripts": {
              "cs": "vendor/bin/php-cs-fixer --ansi fix --config=sf23"
          }
    }

dopodiché si può lanciare l'aggiornamento:

    $ composer update
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
      - Removing mikehaertl/phpwkhtmltopdf (2.2.0)
      - Removing mikehaertl/php-tmpfile (1.1.0)
      - Removing mikehaertl/php-shellcommand (1.2.3)
      - Installing symfony/process (v2.8.22)
          Downloading: 100%         
    
      - Installing symfony/finder (v3.3.2)
          Downloading: 100%         
    
      - Installing symfony/filesystem (v3.3.2)
          Downloading: 100%         
    
      - Installing symfony/polyfill-mbstring (v1.4.0)
          Downloading: 100%         
    
      - Installing psr/log (1.0.2)
          Loading from cache
    
      - Installing symfony/debug (v3.0.9)
          Loading from cache
    
      - Installing symfony/console (v2.8.22)
          Downloading: 100%         
    
      - Installing seld/phar-utils (1.0.1)
          Downloading: 100%         
    
      - Installing seld/jsonlint (1.6.1)
          Downloading: 100%         
    
      - Installing seld/cli-prompt (1.0.3)
          Downloading: 100%         
    
      - Installing justinrainbow/json-schema (1.6.1)
          Downloading: 100%         
    
      - Installing composer/spdx-licenses (1.1.6)
          Downloading: 100%         
    
      - Installing composer/semver (1.4.2)
          Downloading: 100%         
    
      - Installing composer/ca-bundle (1.0.7)
          Downloading: 100%         
    
      - Installing composer/composer (1.3.3)
          Downloading: 100%         
    
      - Installing padraic/humbug_get_contents (1.1.0)
          Downloading: 100%         
    
      - Installing padraic/phar-updater (dev-master 088a716)
          Cloning 088a716b9eb61325f9d84d7038a43dc52fd2fa07
    
      - Installing hoa/exception (1.17.01.16)
          Downloading: 100%         
    
      - Installing hoa/event (1.17.01.13)
          Downloading: 100%         
    
      - Installing hoa/consistency (1.17.05.02)
          Downloading: 100%         
    
      - Installing hoa/visitor (2.17.01.16)
          Downloading: 100%         
    
      - Installing hoa/zformat (1.17.01.10)
          Downloading: 100%         
    
      - Installing hoa/router (3.17.01.14)
          Downloading: 100%         
    
      - Installing hoa/ustring (4.17.01.16)
          Downloading: 100%         
    
      - Installing hoa/protocol (1.17.01.14)
          Downloading: 100%         
    
      - Installing hoa/iterator (2.17.01.10)
          Downloading: 100%         
    
      - Installing hoa/regex (1.17.01.13)
          Downloading: 100%         
    
      - Installing hoa/math (1.17.05.16)
          Downloading: 100%         
    
      - Installing hoa/compiler (3.17.01.10)
          Downloading: 100%         
    
      - Installing hoa/stream (1.17.02.21)
          Downloading: 100%         
    
      - Installing hoa/file (1.17.01.13)
          Downloading: 100%         
    
      - Installing hoa/realdom (1.17.01.13)
          Downloading: 100%         
    
      - Installing hoa/praspel (1.17.01.10)
          Downloading: 100%         
    
      - Installing hoa/dispatcher (1.17.05.02)
          Downloading: 100%         
    
      - Installing hoa/console (3.17.05.02)
          Downloading: 100%         
    
      - Installing atoum/atoum (2.9.0)
          Downloading: 100%         
    
      - Installing atoum/praspel-extension (0.17.02.24)
          Downloading: 100%         
    
      - Installing atoum/visibility-extension (1.3.0)
          Downloading: 100%         
    
      - Installing symfony/yaml (v3.3.2)
          Downloading: 100%         
    
      - Installing symfony/translation (v3.3.2)
          Downloading: 100%         
    
      - Installing symfony/event-dispatcher (v3.3.2)
          Downloading: 100%         
    
      - Installing psr/container (1.0.0)
          Downloading: 100%         
    
      - Installing symfony/dependency-injection (v3.3.2)
          Downloading: 100%         
    
      - Installing symfony/config (v3.3.2)
          Downloading: 100%         
    
      - Installing symfony/class-loader (v3.3.2)
          Downloading: 100%         
    
      - Installing container-interop/container-interop (1.2.0)
          Downloading: 100%         
    
      - Installing behat/transliterator (v1.2.0)
          Downloading: 100%         
    
      - Installing behat/gherkin (v4.4.5)
          Downloading: 100%         
    
      - Installing behat/behat (v3.3.1)
          Downloading: 100%         
    
      - Installing symfony/stopwatch (v3.3.2)
          Downloading: 100%         
    
      - Installing sebastian/diff (1.4.3)
          Downloading: 100%         
    
      - Installing fabpot/php-cs-fixer (v1.13.1)
          Downloading: 100%         
    
    hoa/ustring suggests installing ext-intl (To get a better Hoa\Ustring::toAscii() and Hoa\Ustring::compareTo().)
    hoa/dispatcher suggests installing hoa/view (Provide view interface.)
    atoum/atoum suggests installing atoum/stubs (Provides IDE support (like autocompletion) for atoum)
    symfony/event-dispatcher suggests installing symfony/http-kernel ()
    symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
    symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
    symfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)
    behat/behat suggests installing behat/symfony2-extension (for integration with Symfony2 web framework)
    behat/behat suggests installing behat/yii-extension (for integration with Yii web framework)
    behat/behat suggests installing behat/mink-extension (for integration with Mink testing framework)
    Package fabpot/php-cs-fixer is abandoned, you should avoid using it. Use friendsofphp/php-cs-fixer instead.
    Writing lock file
    Generating autoload files
    $ 

per evitare il warning rifaccio l'update modificando prima la riga del file json

   "require-dev": {
       "atoum/atoum": "~2.1",
       "atoum/praspel-extension": "~0.1",
       "atoum/visibility-extension": "~1.0",
       "behat/behat": "~3.0",
       "symfony/process": "~2.5",
       "friendsofphp/php-cs-fixer": "~1.7"
   },


e rilanciando l'update:


   $ composer update
   Loading composer repositories with package information
   Updating dependencies (including require-dev)
     - Removing fabpot/php-cs-fixer (v1.13.1)
     - Installing friendsofphp/php-cs-fixer (v1.13.1)
       Downloading: 100%         
   
   Writing lock file
   Generating autoload files
   $

e finalmente l'installazione

    $ cd pickle
    $
    $ composer install --no-dev --optimize-autoloader
    Loading composer repositories with package information
    Installing dependencies
      - Installing symfony/process (v3.3.2)
        Downloading: 100%         
    
      - Installing symfony/finder (v3.3.2)
        Loading from cache
    
      - Installing symfony/filesystem (v3.3.2)
        Loading from cache
    
      - Installing symfony/polyfill-mbstring (v1.4.0)
        Loading from cache
    
      - Installing psr/log (1.0.2)
        Loading from cache
    
      - Installing symfony/debug (v3.0.9)
        Loading from cache
    
      - Installing symfony/console (v2.8.22)
        Loading from cache
    
      - Installing seld/phar-utils (1.0.1)
        Loading from cache
    
      - Installing seld/jsonlint (1.6.1)
        Loading from cache
    
      - Installing seld/cli-prompt (1.0.3)
        Loading from cache
    
      - Installing justinrainbow/json-schema (1.6.1)
        Loading from cache
    
      - Installing composer/spdx-licenses (1.1.6)
        Loading from cache
    
      - Installing composer/semver (1.4.2)
        Loading from cache
    
      - Installing composer/ca-bundle (1.0.7)
        Loading from cache
    
      - Installing composer/composer (1.3.3)
        Loading from cache
    
      - Installing padraic/humbug_get_contents (1.1.0)
        Loading from cache
    
      - Installing padraic/phar-updater (dev-master 088a716)
        Cloning 088a716b9eb61325f9d84d7038a43dc52fd2fa07
    
    Writing lock file
    Generating optimized autoload files
    $

proviamo ad installare

   $ cd pickle/
   $ php -d phar.readonly=0 /usr/local/bin/box.phar build
   Building...
   $ 

pickle