Download the PHP package sageit/phalcon-micro-annotations without Composer

On this page you can find all versions of the php package sageit/phalcon-micro-annotations. 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 phalcon-micro-annotations

Phalcon Micro-Annotation

[![Latest Stable Version](http://poser.pugx.org/sageit/phalcon-micro-annotations/v?style=plastic)](https://packagist.org/packages/sageit/phalcon-micro-annotations) [![Total Downloads](http://poser.pugx.org/sageit/phalcon-micro-annotations/downloads?style=plastic)](https://packagist.org/packages/sageit/phalcon-micro-annotations) [![License](http://poser.pugx.org/sageit/phalcon-micro-annotations/license?style=plastic)](https://packagist.org/packages/sageit/phalcon-micro-annotations) [![PHP Version Require](http://poser.pugx.org/sageit/phalcon-micro-annotations/require/php?style=plastic)](https://packagist.org/packages/sageit/phalcon-micro-annotations) [![Phalcon Version](https://img.shields.io/packagist/dependency-v/sageit/phalcon-micro-annotations/ext-phalcon?label=Phalcon&logo=Phalcon%20Version&style=plastic)](https://packagist.org/packages/sageit/phalcon-micro-annotations)

Allows you to use annotations for routing on Phalcon Micro Applications. While the built in Phalcon class for an annotation based router works on full suite Phalcon apps, Micro uses a different mounting methodology and does not support this. The Micro-Annotation Router leverages the build in Micro mounting method while allowing for annotation parsing with the caching method of your choice.

**[Explore the docs »](https://github.com/SageITSolutions/phalcon-micro-annotations)** **[Report Bug](https://github.com/SageITSolutions/phalcon-micro-annotations/issues)** · **[Request Feature](https://github.com/SageITSolutions/phalcon-micro-annotations/issues)**

Table of Contents


About The Project

Built With


Installation

Git:

Composer:


Usage

This project consists of an included Router class extension which follows closely to the Phalcon 5 Namespace convention. Once a service is added in the micro app, this can easily be leveraged.

Create a Service (Example)

When creating the service, MicroRouter requires 2 parameters.

  1. The Dependancy Injector the service is added to.
  2. An Object containing optional settings.

The provided example demonstrates the default values assumed if the option is ommited.

Mount Micro to the service

From within the Micro class call:

this will pass the micro app ($this) to the parsor and call the micro mount method using the parsed annotions


Caching

This class supports safeguarded Caching. You can choose between APCu, Stream, or Memory (Not Caching) when creating the router service to optimize usage.

Specifying Cache Method

Within the Options array passed to the MicroRouter, specify the adapter of choice.

APCu

APCu

Memory

technically, Memory is the fallback when all others fail, so any value not APCU or Stream would resolve to memory

Safeguards

Once specified, the class checks for the presence of the required components before using a caching method. This works in a tiered manner.

  1. APCu is specified, checks are made if APCu is installed and enabled, if not the adapter will revert to Stream
  2. Stream is specified (or APCu specification failed), checks are made that the directory specified for cachedirectory exists, if not adapter will revert to Memory
  3. Memory is specified (or result of reverting), no checks are required, all parsing is done in memory each time.

Parsing

When caching methods are enabled, they are processed first before iterating files producing I/O calls. If annotations are present, no files are parsed, and routes are generated from memory. When no annotations are present (first call or after clearing cache) then Controller files are parsed from the provided directory and annotations are added.

Clearing Cache

A public utility method is included to facilitate the need to rebuild the cache either in testing or publishing scenarios. Clearing Cache is dependant on the adapter specified.

From within the micro class

This will remove all APCu entries with the prefix _phan or removing all files in the cachedirectory depending on the adaptor type.

if the dependancy injector identifies as logger service, the notices are logged indicating the cleared cache


Roadmap

See the open issues for a list of proposed features (and known issues).


Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request


License

Distributed under the MIT License. See LICENSE for more information.


Contact

Sage IT Solutions - Email

Project Link: https://github.com/SageITSolutions/phalcon-micro-annotations


Acknowledgements


All versions of phalcon-micro-annotations with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-phalcon Version 4.* || 5.*
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 sageit/phalcon-micro-annotations contains the following files

Loading the files please wait ....