Geschrieben von artodeto am Sonntag, Februar 8. 2015
I happy to announce the release of 1.4.1 of bazzlines locator generator component for php. Important changes are:
removed dependency to apigen
implemented generation of "LocatorGeneratorInterface"
easy up usage of examples by adding command "execute_example"
added example for "method_name_without_namespace"
updated api
updated dependencies
easy up usage of examples (by adding a "run.php" in the directories
implemented "method_name_without_namespace" option in "FromPropelSchemaXmlAssembler" ("createMyTable" instead of "createMyNamespaceMyTable")
refactored Command
refactored FromArrayAssembler
refactored FromPropelSchemaXmlAssembler
fixed bug in propel name space FromPropelSchemaXmlAssembler
refactored FromPropelSchemaXmlAssembler
extended usage output
enhanced Command (absolute configuration paths are now supported)
fixed (stupid) broken unittest
fixed error in Command (check if "bootstrap_file" exists in configuration was not well implemented)
updated dependencies
Geschrieben von artodeto am Mittwoch, Dezember 17. 2014
I am happy to announce the release of 1.0.3 of bazzlines command component for php. This component will easy up the usage of system commands.
Major improvement is the public method "validateSystemEnvironment". You should use this (maybe in your factory) to validate if the system environment is valid (e.g. "/usr/bin/ls" exists and is executable). An exception should be thrown, so you can easily track back the source of the validation error.
Enjoy it.
Kategorien: coding Tags für diesen Artikel:
bazzline ,
command ,
component ,
composer ,
english ,
git ,
github.com ,
link ,
open source ,
packagist ,
php
Geschrieben von artodeto am Sonntag, Dezember 14. 2014
I am happy to announce the release of 1.0.2 of bazzlines command component for php. This component will easy up the usage of system commands.
Indeed, I missed to announce 1.0.0 , but you know, christmas is hard time and this component is really a small one.
This project aims to deliver a easy to use php command component. It adds a very thin layer but hopefully adds a lot of usage and handling benefits :-).
Usage
usage Net\Bazzline\Component\Command\Command;
class Zip extends Command
{
/**
* @param string $archiveName
* @param array $items
* @return array
* @throws RuntimeException
* @todo implement parameter validation
*/
public function zip($archiveName, array $items)
{
$command = '/usr/bin/zip -r ' . $archiveName . ' ' . implode(' ' , $items);
return $this->execute($command);
}
/**
* @param string $pathToArchive
* @param null|string $outputPath
* @return array
* @throws RuntimeException
* @todo implement parameter validation
*/
public function unzip($pathToArchive, $outputPath = null)
{
if (!is_null($outputPath)) {
$command = '/usr/bin/unzip ' . $pathToArchive . ' -d ' . $outputPath;
} else {
$command = '/usr/bin/unzip ' . $pathToArchive;
}
return $this->execute($command);
}
/**
* @param string $pathToArchive
* @return array
* @throws RuntimeException
* @todo implement parameter validation
*/
public function listContent($pathToArchive)
{
$command = '/usr/bin/unzip -l ' . $pathToArchive;
return $this->execute($command);
}
}
$zip = new Zip();
$pathToZipArchive = '/tmp/my.zip';
echo 'list archive content' . PHP_EOL;
$lines = $zip->listContent($pathToZipArchive);
foreach ($lines as $line) {
echo $line . PHP_EOL;
}
echo 'unzip archive' . PHP_EOL;
$zip->unzip($pathToZipArchive, '/tmp/my_directory');
echo 'zip directory' . PHP_EOL;
$zip->zip($pathToZipArchive, array('/tmp/my_directory'));
How to install?
By Hand
mkdir -p vendor/net_bazzline/php_component_command
cd vendor/net_bazzline/php_component_command
git clone https://github.com/bazzline/php_component_command .
composer require net_bazzline/php_component_command:dev-master
Kategorien: coding Tags für diesen Artikel:
bazzline ,
command ,
component ,
composer ,
english ,
git ,
github.com ,
link ,
open source ,
packagist ,
php
Geschrieben von artodeto am Donnerstag, November 13. 2014
I happy to announce the release of 1.0.0 of bazzlines process pipeline component for php.
This component will easy up the creation of process pipe .
Indeed, it is a pseudo pipeline (process collection or process batch) since the php process is single threaded so far.
Special thanks to Ralf Westphal and especially for his book the architects napkin .
Why?
separate complex operations into simpler
easy up unit testing for smaller processes
separate responsibility (data generator/transformer/validator/flow manipulator)
create process chains you can read in the code (separate integration code from operation code)
no dependencies (except you want to join the development team)
How to use?
use Net\Bazzline\Component\ProcessPipe\ExecutableException;
use Net\Bazzline\Component\ProcessPipe\InvalidArgumentException;
use Net\Bazzline\Component\ProcessPipe\Pipe;
try {
$pipe = new Pipe();
$pipe->pipe(
new ProcessOne(),
new ProcessTwo()
);
$output = $pipe->execute($input);
} catch (ExecutableException) {
//handle process exception
} catch (InvalidArgumentException) {
//handle pipe exception
}
How to install?
By Hand
mkdir -p vendor/net_bazzline/php_component_process_pipe
cd vendor/net_bazzline/php_component_process_pipe
git clone https://github.com/bazzline/php_component_process_pipe
composer require net_bazzline/php_component_process_pipe:dev-master
Kategorien: coding Tags für diesen Artikel:
bazzline ,
component ,
composer ,
english ,
git ,
github.com ,
link ,
open source ,
packagist ,
php ,
pipeline ,
process