PHP Classes

SouthCoast PHP Helpers Classes: General purpose classes to help PHP development

Recommend this page to a friend!
  Info   View files Example   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 77 All time: 10,134 This week: 560Up
Version License PHP version Categories
southcoast-helpers 1.0.0The PHP License7PHP 5, Tools
Description 

Author

This package provides general purpose classes to help PHP development.

It comes with a collection of classes that can be used to help developers solve common Web development problems. Currently it provide helpers for:

- Manipulating arrays
- Logging actions
- Display messages in a console
- Load environment variables in a console
- Generate unique identifiers
- Validate and process JSON encode variable values
- Process hashed values
- Validate string values of several types
- Working with files on the local filesystem

Picture of Corné de Jong
  Performance   Level  
Name: Corné de Jong <contact>
Classes: 1 package by
Country: The Netherlands The Netherlands
Age: ???
All time rank: 4450105 in The Netherlands The Netherlands
Week rank: 321 Up9 in The Netherlands The Netherlands Up

Example

<?php

File
::setBaseDirectory(TEMP_FOLDER);
File::defineDirectory('dir_identifier', '/Path/To/Dir', 'index_23');

File::list();
File::list('$dir_identifier');

File::list(File::BaseDirectory, 'txt');

/* Save file to defined directory */
File::save('$dir_identifier/thisname.tmp', $data);

File::get('$dir_identifier/thisname.tmp');

/* Save file to base directory as Json */
File::saveJson('thisname', $data, File::Minified);

File::getJson('thisname', true);

File::saveCsv('thiscsv', $data, true||[]);

File::getCsv('thiscsv', true);

/* Open a Write Stream to a file */
$stream = File::writeStream('anothername.txt');
/* Loop over all lines in a file */
foreach(File::readStream('thisname') as $line) {
   
$stream->write($line);
}
/* Close the stream */
$stream->close();

/* Move a file to another directory */
File::move('$dir_identifier/thisname.tmp', '$another_defined_dir');
/* Rename a file */
File::rename('$dir_identifier/thisname.tmp', 'thisnewname');

/* Get File Extention */
File::getExtention('thisname');
/* Get mime type */
File::getMimeType('thisname');

File::delete('thisname');

File::describe('thisname');

File::getDirectories();

File::getPath('thisname.json');


Details

SouthCoast | Helpers

A Collection of helper classes for PHP

Could be installed via composer:

$ composer require southcoast/helpers:dev-master

Or by manualy downloading the .zip file.

Enviroment

Create a file called 'sc.env'. This file should countain the following structure:

{
    "dev": true,
    "machine": "<Machine ID/Developer ID>",
    "...": "Any other parameters you'd like to add to your enviroment"
}

In your main php file load the env file.

$path_to_env = './sc.env';
Env::load($path_to_env);

  Files folder image Files  
File Role Description
Files folder imageExamples (4 files)
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  Examples  
File Role Description
  Accessible without login Plain text file ArrayHelper.php Aux. Auxiliary script
  Accessible without login Plain text file Dev.php Aux. Auxiliary script
  Accessible without login Plain text file Env.php Aux. Auxiliary script
  Accessible without login Plain text file File.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imagehelpers (8 files)

  Files folder image Files  /  src  /  helpers  
File Role Description
  Plain text file ArrayHelper.php Class Class source
  Plain text file Dev.php Class Class source
  Plain text file Env.php Class Class source
  Accessible without login Plain text file File.php Aux. Auxiliary script
  Plain text file Identifier.php Class Class source
  Plain text file Json.php Class Class source
  Plain text file Spice.php Class Class source
  Plain text file Validate.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:77
This week:0
All time:10,134
This week:560Up