Download the PHP package kamranahmedse/smasher without Composer

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

Smasher - Smash your directories

Easily turn your directory structure to JSON or Array and vice versa

Build Status Scrutinizer Code Quality Code Coverage

Introduction

Smasher is a php utility that lets you get a JSON or array~~ representation from your directory structure, or use the specified representations to create the directory structure

When you smash a directory, all the subdirectories, files, symlinks are converted to the representation that you specify and when you build, the representaion is processed to create the specified structure i.e. directories, files and symlinks are automatically created.

..all the subdirectories, files, symlinks are converted to the representation that you need ...and back

Where to Use?

Originally it was written for a friend to let him use it in the cloud formation scripts. However you can use it wherever you want.

Here are some of the ideas to get you started. For example, you can use it:

I would love to know how you end up using it.

Requirements

php >= 5.4.0 is required

Installation

The recommended way of installation is using composer. Update your project's composer.json file and add the following:

And run composer install or simply run

Getting Started

Currently json and array are the only supported representations however you can easily extend it to add support for other formats such as XML or YML etc, I will show you how easy it is to do that in a moment.

Let's stick to the topic, how to use, for now.

Introducing the classes First things first, introduce the classes that we are going to use, in your scope.

Smashing a directory Generating JSON representation from the directory

..back to directory structure Turning the JSON representation back to directory structure

Example

Assuming the following directory structure.

If I want to generate the JSON representation for the sample-path and save it inside output directory

This will create the json file in output/sample-path.json with the representation similar to the following:

Image of JSON

Also note that: @ symbol in the beginning of a key represents the property and the keys without the @ symbol represents a directory. If you'd like to look at the full JSON representation, have a look at this file

Extending to support other formats

In order to extend smasher for other formats, all you have to do is create a response class by implementing the KamranAhmed\Smasher\Contracts\ResponseContract and pass the instance of that class to the Scanner object

Contributing

Feedback

I'd love to hear what you have to say. Please open an issue for any feature requests that you may want or the bugs that you notice. Also you can contact me at [email protected] or you can also find me at twitter @kamranahmed_se


All versions of smasher with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 kamranahmedse/smasher contains the following files

Loading the files please wait ....