Skip to content

Building a Yaf Scaffold

Install the Yaf Extension

  1. Start by checking phpinfo to confirm whether your PHP build is Thread Safe (TS) or Non-Thread Safe (NTS).

    file

  2. Visit the PECL website to download the extension.

    file

    file

  3. After extracting the archive, move the php_yaf.dll file into your PHP extension directory.

    TIP

    Make sure to locate your own extension directory—don't copy the path blindly.

    file

  4. Edit the PHP configuration file.

    file

    Add the following block in an appropriate location:

    ini
    extension=php_yaf.dll
    [yaf]
    yaf.use_namespace=1
    yaf.use_spl_autoload=1
  5. Restart Nginx and check phpinfo again. Seeing the section below means the installation succeeded.

    TIP

    A full system reboot may be required before the change takes effect.

    file

Install the Scaffold

TIP

I chose the overtrue/yaf-skeleton scaffold because the blank framework felt too barebones—this one comes with some sensible defaults.

  1. Pull the code: composer create-project overtrue/yaf-skeleton skeleton
  2. Install the template engine: composer require league/plates
  3. Configure the Nginx site and you are ready to run 🎉

file

Released under the MIT License.