Download the PHP package mfn/cakephp2-magic-properties without Composer

On this page you can find all versions of the php package mfn/cakephp2-magic-properties. 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 cakephp2-magic-properties

Abandoned

This repository is archived, it served its purpose.


Automatically add class documentation for CakePHP2 magic properties Travis Build Status

Homepage: https://github.com/mfn/cakephp2-magic-properties

Blurb

When working with CakePHP2, dependency injection happens via magic properties like uses, helpers, etc.

Unfortunately not many editors/IDEs are capable of understanding this special syntax and thus almost none provide autocompletion for the resulting magic properties.

By running this script against your CakePHP2 sources, PHPDOC @property is addded to the class definitions which aids into autocompletion the propert types.

Just pass any files/directories to the script and they will be parsed and PHPDOC properties added. Note that every class will be resolved via it's parents to figure out if it's a Controller or Helper, thus the script must be able to find all relevant parent classes to properly resolve them. Usually, just passing your Controller/ and/or Helper/ direcotries should do fine.

This code uses the excellent PhpParser library by Nikita Popov.

What injected properties are supported?

The className setting is also supported.

For details please see res/configuration.php.

Usage

cakephp2_magic_properties magic app/Controller/

or

cakephp2_magic_properties magic app/View/Helper/

or just your whole app (note that it will recursively parse all *.php files):

cakephp2_magic_properties magic ../path/to/your/app/

It will convert:

into

By default, existing properties will not be touched but care is taken to not create duplicates. If however you want to remove all existing @property documentation, use the --remove flag cakephp2_magic_properties magic --remove ../path/to/your/app/:

into

Note: it may also cause to re-order your existing properties if none have really changed (because interally first all properties are always removed).

See the --help flag for other options. The library is designed to act idempotent.

Integration with phing

A phing task is also provided for better phing integration. Use taskdef to define a new custom task.

The following attributes are supported:

Note: due the use of namespaces this will only work properly if phing is used via composer too.

Configuration file

In res/configuration.php the projects default configuration is provided which all runners allow to override.

This file contains the mapping:

  1. from "top level class" to properties
  2. and those properties map to a closure which transform the name of a injected virtual property

The closure approach is required because e.g. helpers and components have different rules how the actual class names have to be called.

Requirements

Installation

TODOs / Ideas

© Markus Fischer [email protected]


All versions of cakephp2-magic-properties with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
nikic/php-parser Version ~1.0
mfn/util-simpleorderedmap Version 0.0.2
psr/log Version ~1.0
symfony/console Version ~2.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 mfn/cakephp2-magic-properties contains the following files

Loading the files please wait ....