Download the PHP package mario-legenda/code-workflow without Composer

On this page you can find all versions of the php package mario-legenda/code-workflow. 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 code-workflow

Php code workflow

For the last few months, I've been working on a SPA project written in Symfony2 on the server and Angular on the client. Most of the code revolves on calling a controller from the browser. The controller then fetches the data from the database and returns it to the client. I tried to make it uniformed with some design patterns, but different data sent from the client had to be processed with different design patterns. Some were uniformed and easy to read but some were messy and hard to read. So I decided to create a workflow design pattern that will be the same for every code execution.

I got the idea from ASP.NET world, mainly Microsoft Workflow Foundation. By no means is this project anything even remotly similar to Workflow Foundation but it made me think. Why not make something similar for Php? Most of you will think this is totally unnecessary + overkill. I actually agree. With this design pattern, there is a lot more code to be written but there are some benefits.

For example, Code Workflow checks for returns types of methods that you want to execute, so when some method does not return the desired type, error is thrown. But that could also be an overkill since PHP is not designed to be a strongly typed programming language. All things aside, this could be the most pointless project ever created but after I started working on it, I became stuborn and had to make it work. Someone might like it, most of you will hate it. That is the way of the samurai :).

Everything will be clear from the examples below, so continue reading.

The example objects are in src/Demo directory.

The basic way

In the examples in src/Demo directory, you can find the Company and Person object. Basic way of using these objects would be like this...

And this is just fine. It's readable and maintable. But what happens when you have to fetch company data from the database based on some JSON data sent by the client? What happens when you have to create a Factory that creates Person object based on database data? Even with pristine usage of design patterns, this code could become unreadable.

With Code workflow, the same code above could be rewritten to this code...

This is the same code executed but with human readable code. This could be read as follows:

NOTE

What happens when you wish to view the returned value of a method? That is also possible...

If you wish to get the the return value of a method in the success anonymous function then use this...

You can chain as much objects as you like and the workflow compiler will work.

That is it. I'm not going to make a detailed documentation on this beacuse I don't know if this will be of any use to anyone. If only ONE developers likes this, I will make a detailed documentation with phpdocumentator and the full documentation on github. I will also thoroughly comment all the code so you can see how it works.

Cheers and good life to everyone.


All versions of code-workflow with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
mario-legenda/php-strong-types Version 0.0.1
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 mario-legenda/code-workflow contains the following files

Loading the files please wait ....