Coder Social home page Coder Social logo

bcgen's Introduction

BCgen
=====

BCgen is derived from the Zend OPcache source code.

It provides a single function to compile a PHP script into binary bytecode file.
BCgen is similiar to bcompiler, but not a direct replacement.

Compatibility
-------------

Only PHP-7.2 is supported for now. There are currently no plans to support earlier PHP versions as well.
Supporting different PHP versions with their different internal data structures is really a hassle.

So if you distribute your BCGen compiled PHP files to protect you code, make sure that the user uses the correct PHP version that matches the BCgen version.
In times of docker et al it should be a problem to achive this.

Quick Install
-------------

- Compile

 $PHP_DIR/bin/phpize
 ./configure \
      --with-php-config=$PHP_DIR/bin/php-config
 make

- Install

 make install # this will copy bcgen.so into PHP extension directory

- Edit php.ini

 zend_extension=/...full path.../bcgen.so

NOTE: In case you are going to use BCgen together with Xdebug or Zend Debugger,
be sure that the debugger is loaded after BCgen. "php -v" must show the debugger
after BCgen.

- Restart PHP

Configuration Directives
------------------------

bcgen.enable (default "1")
	BCgen On/Off switch. When set to Off, bytecode files cannot be read

bcgen.save_comments (default "1")
	If disabled, all PHPDoc comments are dropped from the code to reduce the
	size of the optimized code. Disabling "Doc Comments" may break some
	existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)

bcgen.optimization_level (default "0xffffffff")
	A bitmask, where each bit enables or disables the appropriate BCgen
	passes

bcgen.dups_fix (default "0")
	Enable this hack as a workaround for "Cannot redeclare class" errors.

bcgen.file_consistency_checks (default "0")
	Check the file checksum on each request.
	The default value of "0" means that the check is disabled.
	Because calculating the checksum impairs performance, this directive should
	be enabled only as part of a debugging process.

bcgen.error_log
	BCgen error_log file name. Empty string assumes "stderr".

bcgen.log_verbosity_level (default "1")
	All BCgen errors go to the Web server log.
	By default, only fatal errors (level 0) or errors (level 1) are logged.
	You can also enable warnings (level 2), info messages (level 3) or
	debug messages (level 4).

bcgen's People

Contributors

nanosonde avatar vjardin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.