Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106852 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4234 invoked from network); 4 Sep 2019 15:10:11 -0000 Received: from unknown (HELO mail-lj1-f195.google.com) (209.85.208.195) by pb1.pair.com with SMTP; 4 Sep 2019 15:10:11 -0000 Received: by mail-lj1-f195.google.com with SMTP id x18so19500400ljh.1 for ; Wed, 04 Sep 2019 05:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=KO0hoAlhccEDiHQo11+HxomC/tUiwOxNw7zbGSZffQM=; b=ewJ4DXpkArB7FKMBn3Vi9U+YJ97ldNJ+7yqWCzwYc4ViZ0VigBwCAP3JJ4cCObTKPi dg2t9zt0b7zYJ5+wfxHAKrew3SsNDJ8wmwOHQuLJSML3XC3k81GWhoZ5wY4tQo09miLe x0/nC5HOHLq4W+xWnBYb7ZBM1HLMpdjEVhSPqHRwyKGcQsR8T+oqsXVXqnuV7mYwPxbD YS6orGOF+24nFqymk3D4htW06mdOSJKqGIV7AhKf7TqJFFzeQNXOcOIp0SaXBd7CbGTm k/dgnqSWs1g07CmARmy05j/RVzghuw6+CVCQRtui6vwJ94tkwRovmV+Enhmr+qumGgCt ik0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=KO0hoAlhccEDiHQo11+HxomC/tUiwOxNw7zbGSZffQM=; b=MSOaE7/zhyqgLE2jtuUKfLMUGbI+TpVdy7nR3YPC5r3sNlSbYNoJqylcphbUPGl7+K Wkp/KBsmVD6/ZzOm9UvAmLwfJEtyZwbrehIV/gZXJjUlmwL0+j00DvBtbzTuCSllhSOk fK1o3VuvLDNA0bnJbqeOpvGdiovNOrJoQ43HHVvcWAbhSDv1FsrtI+zi0hrxgjGElv9L 9RATh9vKJL3ggV0iqr/YFHRoU+xlO2wBDOsJa7pQRGdBcijUCmcRMcieOfn03DLJ+t7c jgNoRn5vt22E2M3mmSp5VrFKnuf/I2N22sAJEBmIUsiIGdQ7uURUeFr89MWzZ27ws4NS K0bA== X-Gm-Message-State: APjAAAVr4OHqZvjEb2738Joo0MByuGC+jK6+rX0QQC0sYNXrUb5KCQTt n7xVCDKuw/tyl6d0CZTxCr6tKx7UeyA= X-Google-Smtp-Source: APXvYqz2bgDK0+zUmWdlGoFY9tUyPNughFoK5T4oxhTCRqs7nx6y2AfxzNokRMQ6V23Oe5VPArDxYg== X-Received: by 2002:a2e:860c:: with SMTP id a12mr9432973lji.116.1567601043906; Wed, 04 Sep 2019 05:44:03 -0700 (PDT) Received: from [192.168.1.102] ([62.44.138.138]) by smtp.gmail.com with ESMTPSA id k13sm1340253ljc.96.2019.09.04.05.44.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2019 05:44:03 -0700 (PDT) To: internals@lists.php.net Message-ID: Date: Wed, 4 Sep 2019 14:44:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Thunderbird/71.0a1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------6F666EAE602D2042FC852A2E" Content-Language: en-US Subject: PHP 7 + bcgen extension + PHAR extension From: henry.wood.dk@gmail.com (Henrik Skov) --------------6F666EAE602D2042FC852A2E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi ! I hope this is the right mailing list to post my request to. I found a port of bcompiler here: https://github.com/vjardin/bcgen/ which is PHP7 compatible. By mailing here, I am trying to reach out to the authors of the PHAR extension since the author(s) of bcgen have said that they don't know enough about the PHAR extension. I am trying to get bcgen to work with PHAR files. I have added the compiled PHP files to the PHAR file (using their PHP extension within the PHAR file) The stub of the PHP archive is: |#!/usr/bin/env php| | The file app.php is in the root of the PHAR archive and is compiled by bcgen. When I run the phar (on the commandline), all I get is some gibberish output (to STDOUT) and the process exits with exitcode 130 ? My understanding is that bcgen extension will inspect the file which is included/required (ie. app.php) and then - if it is bytecode - then simply execute the bytecode - If it is not, then it will parse the included file normally ? (from the description found in the README of bcgen in github) However it seems that what actually happens, is that the header of the PHAR file itself is checked and since that is obviously not a BCGEN header or a normal PHP file, processing is aborted. If we could skip this check when running from a PHAR archive (from the commandline or when the PHAR is included within some other PHP file) and in this scenario only "react" to include/require/autoloading statements (ie. check if a file that is about to be included is bytecode or not - if it is, then run it - If it is not then compile it first and then run the resulting bytecode), then - in my humble opinion - we would have a way of adding minimal protection to PHAR files - useful when redistributing PHARs (since such a PHAR archive would then simply contain a number of files that are bytecode - except for the stub of course...) and that would - I think - make PHAR files even cooler and provide a most sought-after feature. Could anyone help getting "PHAR support" to work with the bcgen extension ? I would be willing to help but my C skills are not that great and I know little about the ZendEngine. Thanks in advance ! Best regards, Henrik Skov Secuno A/S www.secuno.dk --------------6F666EAE602D2042FC852A2E--