Download the PHP package overtrue/yaf-skeleton without Composer

On this page you can find all versions of the php package overtrue/yaf-skeleton. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yaf-skeleton

Yaf skeleton

The Yaf testable skeleton and composer supported.

Sponsor me

Requirement

Installation

  1. Update yaf.ini:

  2. Create project.

  3. Web server rewrite rules:

    Apache

    Nginx

    Lighttpd

Application structor

Controllers

All controllers are created in the app/controllers directory,and test files are also created in the tests/controllers directorty.

Of course, you can also create tests independently:

The handle() method

The controller entry method handle():

Views

There is no built-in template engine. If you need to use a PHP template, we recommend that you use Plates, Plates is a native PHP template system that's fast, easy to use and easy to extend.

You can use view(string $template, array $data) helper in controller handle method as a result.

for example:

More usage please read the Plates Docs.

Unit tests

The difficulty of writing unit tests is inversely proportional to the quality of your code. The higher the code quality, the lower the difficulty of unit testing, so design your code well.

The unit test for creating the controller can be done with the following command:

Write test cases

To create a controller test object, use,you can use the mock_controller function:

Assertion

We have such a controller:

So the test should cover the above three behaviors:

Facade Assertion

Built-in auxiliary assertion methods

They are used to correspond to exceptions thrown by abort($message, $code); in the controller

Some helper methods in test case classes

Mock request method:

Mock request uri

Mock config:

Mock request IP:

Mock $_SERVER vars:

Docs

:heart: Sponsor me

Sponsor me

如果你喜欢我的项目并想支持它,点击这里 :heart:

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》

License

MIT


All versions of yaf-skeleton with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-yaf Version *
psr/http-message Version ~1.0
symfony/console Version 3.*
monolog/monolog Version ~1.0
psr/container Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package overtrue/yaf-skeleton contains the following files

Loading the files please wait ....