Beispiel #1
0
    file_put_contents($relationsFile, $serializer->serialize($relations));
    // 3. Plugin Definition Compilation
    $pluginScanner = new Scanner\CompositeScanner();
    $pluginScanner->addChild(new Scanner\PluginScanner(), 'di');
    $pluginDefinitions = [];
    $pluginList = $pluginScanner->collectEntities($files);
    $pluginDefinitionList = new \Magento\Framework\Interception\Definition\Runtime();
    foreach ($pluginList as $type => $entityList) {
        foreach ($entityList as $entity) {
            $pluginDefinitions[ltrim($entity, '\\')] = $pluginDefinitionList->getMethodList($entity);
        }
    }
    $output = $serializer->serialize($pluginDefinitions);
    if (!file_exists(dirname($pluginDefFile))) {
        mkdir(dirname($pluginDefFile), 0777, true);
    }
    file_put_contents($pluginDefFile, $output);
    //Reporter
    $log->report();
    if ($log->hasError()) {
        exit(1);
    }
    echo 'On *nix systems, verify the Magento application has permissions to modify files created by the compiler' . ' in the "var" directory. For instance, if you run the Magento application using Apache,' . ' the owner of the files in the "var" directory should be the Apache user (example command:' . ' "chown -R www-data:www-data <MAGENTO_ROOT>/var" where MAGENTO_ROOT is the Magento root directory).' . "\n";
} catch (Zend_Console_Getopt_Exception $e) {
    echo $e->getUsageMessage();
    echo 'Please, use quotes(") for wrapping strings.' . "\n";
    exit(1);
} catch (Exception $e) {
    fwrite(STDERR, "Compiler failed with exception: " . $e->getMessage());
    throw $e;
}