本文共 3089 字,大约阅读时间需要 10 分钟。
Recki what?
雷基什么?
If you don’t know what Recki-CT is, see or , we won’t go into depth here. This quick tip will merely show you how to install it on a Homestead Improved box, much like we did with other software .
如果您不知道什么是Recki-CT,请参阅或 ,我们在这里不做进一步介绍。 这个快速提示将仅向您展示如何将其安装在Homestead Enhanced盒子上,就像我们之前使用其他软件所做的 。
First and foremost, get a instance up and running.
首先,要启动并运行实例。
Give it a new virtual host like so:
为它提供一个新的虚拟主机,如下所示:
- map: test.app to: /home/vagrant/Code/recki
Boot the VM and vagrant ssh
into it.
启动VM,然后将vagrant ssh
导入其中。
Recki-CT needs to be installed.
Recki-CT需要安装 。
As per instructions, run the following commands in order while you’re in the VM.
按照说明,在虚拟机中时,请依次运行以下命令。
sudo apt-get install bison flex texinfogit clone git://git.sv.gnu.org/libjit.git libijt-fucd libjit-fu./auto_gen.sh./configure --prefix=/optmakesudo make installgit clone https://github.com/krakjoe/jitfucd jitfuphpize./configure --with-jitfu=/optmakesudo make installsudo suecho "extension=jitfu.so" >> /etc/php5/fpm/conf.d/20-jitfu.iniecho "extension=jitfu.so" >> /etc/php5/cli/conf.d/20-jitfu.iniexitsudo service nginx restartsudo service php5-fpm restart
To see if we installed it successfully:
要查看我们是否成功安装了它:
cd ~/Codegit clone https://github.com/Swader/publicinfo reckimv recki/public/index.php recki/touch recki/recki.php
Open recki.php
and paste the following content inside it:
打开recki.php
并将以下内容粘贴到其中:
doIf( $this->doEq($args[0], $zero), function() use ($zero) { $this->doReturn($zero); } ); /* if ($arg == 1) return 1; */ $this->doIf( $this->doEq($args[0], $one), function() use($one) { $this->doReturn($one); } ); /* return $function($arg-1) + $function($arg-2); */ $this->doReturn( $this->doAdd( $this->doCall($this, [$this->doSub($args[0], $one)]), $this->doCall($this, [$this->doSub($args[0], $two)]))); });$function->dump("Fibonacci");var_dump($function(40)); /* __invoke with magicalness */?>
If you go to test.app:8000
now, you should see JitFu support enabled in the PHPInfo screen. If you go to test.app:8000/recki.php
, you should get int 102334155
as output rather quickly.
如果现在转到test.app:8000
,则应该在PHPInfo屏幕中看到启用了JitFu支持。 如果转到test.app:8000/recki.php
,则应该很快获得int 102334155
作为输出。
Next up, we’ll need to clone the Recki repo, and download dependencies with Composer.
接下来,我们需要克隆Recki存储库,并使用Composer下载依赖项。
cd ~/Coderm -rf reckigit clone https://github.com/google/recki-ct reckicd reckicomposer install
To see if it works, just run the examples via the command line:
要查看它是否有效,只需通过命令行运行示例:
php examples/01-basic-usage.php
or through the browser:
或通过浏览器:
test.app:8000/examples/01-basic-usage.php
That’s all there is to it. Now you can focus on brutal optimizations of your PHP code in certain parts without having to replace the entire PHP engine your app is spinning on.
这里的所有都是它的。 现在,您可以集中精力对某些部分中PHP代码进行残酷的优化,而不必替换您的应用程序所依赖的整个PHP引擎。
翻译自:
转载地址:http://mxrgb.baihongyu.com/