Download the PHP package sirmekus/igwe without Composer

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

Igwe

Igwe is a PHP file uploader with validation support to add power to an exisitng web app. One of the additional benefits include enforcing (or constraining) image dimension. For instance, imagine your application expects image dimension to be 300/300px (height/width) and a user uploads an image with a dimension of 500/200px. Strictly constraining the dimension (using traditional approach) may result in low quality and a not-too-nice image. This library takes care of this effectively without sacrificing quality of the uploaded image.

Please note that this package is not limited to image upload; It takes care of any type of file upload in general - pdf, doc, audio, video, image, etc, as you will learn shortly.

Installation

To get started all you need to do is:

Please note that this package stores uploaded files/images relative to your web root.

That's all.

Igwe, in Igbo language, means "King/Chief".


After installing the package you should then create an igwe.php configuration file and place it in your root directory or your config directory. This file will contain "directives" on how to configure the package for your service. You can just copy and paste the content below into your own igwe.php file for starters (remember that you can always configure the settings):

Please note that if you don't create the file the package will use its default settings. The default settings are the values in the array above.


Usage


Receiving/Accepting file/image from client

Example:

Just that single line of code is what is needed to use this package. The package assumes the name (parameter) of the incoming file from the client is image. If it isn't then you can specify the name as the first argument. Example:

It doesn't matter if the file is an array or a single file, the package takes care of that, stores the uploaded file in disk and returns the new file name. If an array was detected the returned value will be an array containing the uploaded file names else a string that contains the file which you will want to save in the database.

You can set the configuration during runtime (if you choose to not use the configuration settings at any point in time) or overwrite the public properties of the class. The properties are:

By default the upload() method checks if the specified key exists in the incoming request and is filled. If it is not it throws an error. In certain cases image upload may be optional, thus the application should still continue with the request processing. To enable this the method takes a second argument that suppresses the error. Example

or, if you use use PHP 8.0 and above and the parameter name from the request is image.

Deleting Image/File

To delete an image it follows the same logic and configuration as if uploading the image/file. Simply pass the image/file name(s) - string or array - to the remove() method and the job is done. Example:

Meanwhile

You can connect with me on LinkedIn for insightful tips and so we can grow our networks together.

Check our educational platform for High Schools i-runs.

And follow me on Twitter.

I encourage contribution even if it's in the documentation. Thank you, and I really hope you find this package helpful.


All versions of igwe with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
intervention/image Version ^2.7
sirmekus/zam Version ^2.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 sirmekus/igwe contains the following files

Loading the files please wait ....