PHP Class ConvertM1M2, convertm1m2

Copyright (c) 2015 Boris Gurvich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Mostra file Open project: unirgy/convertm1m2 Class Usage Examples

Protected Properties

Property Type Description
$_aliases
$_autoloadMode
$_classFileCache
$_currentFile
$_env
$_fileCache
$_layouts
$_replace Sources: http://mage2.ru, https://wiki.magento.com/display/MAGE2DOC/Class+Mage
$_reservedWordsRe
$_skipConvertToDiRegex .. )$#ix
$_testInputFiles
$_testMode
$_testOutputFiles

Public Methods

Method Description
__construct ( $sourceDir, $mage1Dir, $mage2Dir )
addTestInputFile ( $contents, $filename = null )
autoloadCallback ( $class )
collectCoreModulesConfigs ( )
collectCoreModulesLayouts ( )
convertAllConfigs ( )
convertAllControllers ( )
convertAllExtensions ( $stage )
convertAllI18n ( )
convertAllLayouts ( )
convertAllObservers ( )
convertAllOtherFiles ( )
convertAllPhpFilesDI ( )
convertAllTemplates ( )
convertAllWebAssets ( )
convertCodeContents ( $contents, $mode = 'php' )
convertCodeContentsPhpMode ( $contents )
convertCodeObjectManagerToDI ( $contents )
convertCodeParseMethods ( $contents, $fileType = false, $returnResult = false )
convertConfigAcl ( )
convertConfigAclRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml, $path = '' )
convertConfigAdminhtmlDI ( )
convertConfigCatalogAttributes ( )
convertConfigCrontab ( )
convertConfigDI ( )
convertConfigDefaults ( )
convertConfigEmailTemplates ( )
convertConfigEvents ( )
convertConfigFieldset ( )
convertConfigFrontendDI ( )
convertConfigMenu ( )
convertConfigMenuRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml, $parent = null )
convertConfigModule ( )
convertConfigPdf ( )
convertConfigResources ( )
convertConfigRoutesAdmin ( )
convertConfigRoutesFrontend ( )
convertConfigSales ( )
convertConfigSystem ( )
convertConfigSystemNode ( $type, SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
convertConfigWidget ( )
convertConfigWidgetDataRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
convertController ( $file, $sourceDir, $targetDir )
convertControllerContext ( $contents )
convertDIGetParentConstructArgs ( $contents )
convertExtensionStage1 ( $extName, $rootDir )
convertExtensionStage2 ( $extName )
convertFindParentConstruct ( $contents, $first = true )
convertGenerateComposerFile ( )
convertGenerateMetaFiles ( )
convertGenerateRegistrationFile ( )
convertGetFullClassName ( $contents, $contentsClass, $shortClass ) : string
convertLayoutAreaTheme ( $area, $theme )
convertLayoutArgumentRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
convertLayoutFile ( $area, $file, $outputDir )
convertLayoutHeadNode ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
convertLayoutRecursive ( $area, SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
convertNamespaceUse ( $contents )
convertObserver ( $sourceFile, $targetDir )
convertPhpClasses ( $folder, $callback = null )
convertShortArraySyntax ( $contents )
convertTemplatesAreaTheme ( $area, $theme )
convertTemplatesEmails ( )
copyFile ( $src, $dst, $expand = false )
copyRecursive ( $src, $dst, $expand = false )
createConfigXml ( string $schemaPath, string $rootTagName = 'config' ) : SimpleDOM
deleteFile ( $filename, $expand = false )
expandOutputPath ( $path )
expandSourcePath ( $path )
findFilesRecursive ( $dir, $expand = false )
getClassName ( $type, $moduleClassKey, $m2 = true )
getOpportunisticArgValue ( $value )
getReplaceMaps ( )
getTestOutputFile ( $filename = null )
log ( $msg, $continue = false )
readFile ( $filename, $expand = false )
setTestMode ( $testMode = true )
writeFile ( $filename, $contents, $expand = false )

Method Details

__construct() public method

public __construct ( $sourceDir, $mage1Dir, $mage2Dir )

addTestInputFile() public method

public addTestInputFile ( $contents, $filename = null )

autoloadCallback() public method

public autoloadCallback ( $class )

collectCoreModulesConfigs() public method

collectCoreModulesLayouts() public method

convertAllConfigs() public method

public convertAllConfigs ( )

convertAllControllers() public method

convertAllExtensions() public method

public convertAllExtensions ( $stage )

convertAllI18n() public method

public convertAllI18n ( )

convertAllLayouts() public method

public convertAllLayouts ( )

convertAllObservers() public method

public convertAllObservers ( )

convertAllOtherFiles() public method

convertAllPhpFilesDI() public method

convertAllTemplates() public method

public convertAllTemplates ( )

convertAllWebAssets() public method

public convertAllWebAssets ( )

convertCodeContents() public method

public convertCodeContents ( $contents, $mode = 'php' )

convertCodeContentsPhpMode() public method

public convertCodeContentsPhpMode ( $contents )

convertCodeObjectManagerToDI() public method

public convertCodeObjectManagerToDI ( $contents )

convertCodeParseMethods() public method

public convertCodeParseMethods ( $contents, $fileType = false, $returnResult = false )

convertConfigAcl() public method

public convertConfigAcl ( )

convertConfigAclRecursive() public method

public convertConfigAclRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml, $path = '' )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertConfigAdminhtmlDI() public method

convertConfigCatalogAttributes() public method

convertConfigCrontab() public method

convertConfigDI() public method

public convertConfigDI ( )

convertConfigDefaults() public method

convertConfigEmailTemplates() public method

convertConfigEvents() public method

public convertConfigEvents ( )

convertConfigFieldset() public method

convertConfigFrontendDI() public method

convertConfigMenu() public method

public convertConfigMenu ( )

convertConfigMenuRecursive() public method

public convertConfigMenuRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml, $parent = null )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertConfigModule() public method

public convertConfigModule ( )

convertConfigPdf() public method

public convertConfigPdf ( )

convertConfigResources() public method

convertConfigRoutesAdmin() public method

convertConfigRoutesFrontend() public method

convertConfigSales() public method

public convertConfigSales ( )

convertConfigSystem() public method

public convertConfigSystem ( )

convertConfigSystemNode() public method

public convertConfigSystemNode ( $type, SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertConfigWidget() public method

public convertConfigWidget ( )

convertConfigWidgetDataRecursive() public method

public convertConfigWidgetDataRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertController() public method

public convertController ( $file, $sourceDir, $targetDir )

convertControllerContext() public method

public convertControllerContext ( $contents )

convertDIGetParentConstructArgs() public method

public convertDIGetParentConstructArgs ( $contents )

convertExtensionStage1() public method

public convertExtensionStage1 ( $extName, $rootDir )

convertExtensionStage2() public method

public convertExtensionStage2 ( $extName )

convertFindParentConstruct() public method

public convertFindParentConstruct ( $contents, $first = true )

convertGenerateComposerFile() public method

convertGenerateMetaFiles() public method

convertGenerateRegistrationFile() public method

convertGetFullClassName() public method

public convertGetFullClassName ( $contents, $contentsClass, $shortClass ) : string
$contents
$contentsClass
$shortClass
return string full class with first backslash for consistency

convertLayoutAreaTheme() public method

public convertLayoutAreaTheme ( $area, $theme )

convertLayoutArgumentRecursive() public method

public convertLayoutArgumentRecursive ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertLayoutFile() public method

public convertLayoutFile ( $area, $file, $outputDir )

convertLayoutHeadNode() public method

public convertLayoutHeadNode ( SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertLayoutRecursive() public method

public convertLayoutRecursive ( $area, SimpleXMLElement $sourceXml, SimpleXMLElement $targetXml )
$sourceXml SimpleXMLElement
$targetXml SimpleXMLElement

convertNamespaceUse() public method

public convertNamespaceUse ( $contents )

convertObserver() public method

public convertObserver ( $sourceFile, $targetDir )

convertPhpClasses() public method

public convertPhpClasses ( $folder, $callback = null )

convertShortArraySyntax() public method

public convertShortArraySyntax ( $contents )

convertTemplatesAreaTheme() public method

public convertTemplatesAreaTheme ( $area, $theme )

convertTemplatesEmails() public method

copyFile() public method

public copyFile ( $src, $dst, $expand = false )

copyRecursive() public method

public copyRecursive ( $src, $dst, $expand = false )

createConfigXml() public method

public createConfigXml ( string $schemaPath, string $rootTagName = 'config' ) : SimpleDOM
$schemaPath string
$rootTagName string
return SimpleDOM

deleteFile() public method

public deleteFile ( $filename, $expand = false )

expandOutputPath() public method

public expandOutputPath ( $path )

expandSourcePath() public method

public expandSourcePath ( $path )

findFilesRecursive() public method

public findFilesRecursive ( $dir, $expand = false )

getClassName() public method

public getClassName ( $type, $moduleClassKey, $m2 = true )

getOpportunisticArgValue() public method

public getOpportunisticArgValue ( $value )

getReplaceMaps() public method

public getReplaceMaps ( )

getTestOutputFile() public method

public getTestOutputFile ( $filename = null )

log() public method

public log ( $msg, $continue = false )

readFile() public method

public readFile ( $filename, $expand = false )

setTestMode() public method

public setTestMode ( $testMode = true )

writeFile() public method

public writeFile ( $filename, $contents, $expand = false )

Property Details

$_aliases protected_oe property

protected $_aliases

$_autoloadMode protected_oe property

protected $_autoloadMode

$_classFileCache protected_oe property

protected $_classFileCache

$_currentFile protected_oe property

protected $_currentFile

$_env protected_oe property

protected $_env

$_fileCache protected_oe property

protected $_fileCache

$_layouts protected_oe property

protected $_layouts

$_replace protected_oe property

Sources: http://mage2.ru, https://wiki.magento.com/display/MAGE2DOC/Class+Mage
protected $_replace

$_reservedWordsRe protected_oe property

protected $_reservedWordsRe

$_skipConvertToDiRegex protected_oe property

.. )$#ix
protected $_skipConvertToDiRegex

$_testInputFiles protected_oe property

protected $_testInputFiles

$_testMode protected_oe property

protected $_testMode

$_testOutputFiles protected_oe property

protected $_testOutputFiles