Exemple #1
0
echo "\t" . 'styles file ' . $oneFormCSSFull . ' ... ';
$string = <<<CODE
/* vim: set ts=2 sw=2 sts=2 et: */

/**
 * {$targetOneHumanReadableName} view model styles
 *
 * @author    Creative Development LLC <*****@*****.**>
 * @copyright Copyright (c) 2011 Creative Development LLC <*****@*****.**>. All rights reserved
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link      http://www.litecommerce.com/
 * @since     1.0.0
 */

CODE;
macro_file_put_contents($oneFormCSSFull, $string);
echo 'done' . PHP_EOL;
// }}}
// }}}
die(0);
// {{{ Help
function macro_help()
{
    $script = __FILE__;
    return <<<HELP
Usage: {$script} --entity=XLite\\Model\\Entity --fields=fld1,fld2,...,fldn [--edit=fld1,fld2,...,fldn] [--target=target_name] [--removable] [--switchable] [--sortable] [--search=fld1,fld2,...,fldn] [--pagintation] [--sort=fld1,fld2,...,fldn] [--createInline] [--menu=section]

    --entity=class_name
        Entity class (XLite\\Model\\Product) or full path to class repository file (src/class/XLite/Model/Product.php) or relative path to class repository file (XLite/Model/Product.php)

    --fields=fld1,fld2,...,fldn
Exemple #2
0
}
$targetClass = 'XLite\\Module\\' . $author . '\\' . $module . '\\' . implode('\\', $parts);
// Assemble target file path
$targetPath = macro_convert_class_name_to_path($targetClass);
// Get file content
$decoratedClassFull = '\\' . $decoratedClass;
$className = array_pop($parts);
$content = macro_get_class_repo_header($targetPath) . macro_get_class_header($path) . <<<CODE

abstract class {$className} extends {$decoratedClassFull} implements \\XLite\\Base\\IDecorator
{
}

CODE;
// Write content
macro_file_put_contents($targetPath, $content);
echo $targetPath . ' create' . PHP_EOL;
die(0);
/**
 * Help
 */
function macro_help()
{
    return <<<HELP
Usage: decorate.php file_path module_author module_name

Example: .dev/macro/decorate.php src/classes/XLite.php Tester Test

As a result of the operation will create a file src/classes/XLite/Module/Tester/Test/XLite.php,
which will be decorated class \\XLite.
HELP;