Esempio n. 1
0
File: core.php Progetto: kingsj/core
/**
 * Check class repo file path 
 * 
 * @param string $path Path
 *  
 * @return void
 * @see    ____func_see____
 * @since  1.0.18
 */
function macro_check_class_file_path($path)
{
    macro_check_file_path($path);
    if (0 !== strcmp(LC_DIR_CLASSES, $path, strlen(LC_DIR_CLASSES))) {
        macro_error('Path \'' . $path . '\' is not LC class repository!!');
    }
}
Esempio n. 2
0
 * @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/
 * @see       ____file_see____
 * @since     1.0.18
 */
/**
 * Decorate class by file path
 */
require_once __DIR__ . '/core.php';
// get arguments
$path = macro_get_plain_argument(0);
$author = macro_get_plain_argument(1);
$module = macro_get_plain_argument(2);
// Check arguments
macro_check_file_path($path);
macro_check_module($author, $module);
// Assemble decorate class name
$decoratedClass = macro_convert_path_to_class_name($path);
// Assemble target class name
$parts = explode('\\', $decoratedClass);
array_shift($parts);
$parts = array_values($parts);
if (0 == count($parts)) {
    $parts = array('XLite');
} elseif ('Module' == $parts[0]) {
    $parts = array_slice($parts, 3);
}
$targetClass = 'XLite\\Module\\' . $author . '\\' . $module . '\\' . implode('\\', $parts);
// Assemble target file path
$targetPath = macro_convert_class_name_to_path($targetClass);