function updateAutoload($tpl = null) { $autoloadGenerator = new eZAutoloadGenerator(); try { $autoloadGenerator->buildAutoloadArrays(); $messages = $autoloadGenerator->getMessages(); foreach ($messages as $message) { eZDebug::writeNotice($message, 'eZAutoloadGenerator'); } $warnings = $autoloadGenerator->getWarnings(); foreach ($warnings as &$warning) { eZDebug::writeWarning($warning, "eZAutoloadGenerator"); // For web output we want to mark some of the important parts of // the message $pattern = '@^Class\\s+(\\w+)\\s+.* file\\s(.+\\.php).*\\n(.+\\.php)\\s@'; preg_match($pattern, $warning, $m); $warning = str_replace($m[1], '<strong>' . $m[1] . '</strong>', $warning); $warning = str_replace($m[2], '<em>' . $m[2] . '</em>', $warning); $warning = str_replace($m[3], '<em>' . $m[3] . '</em>', $warning); } if ($tpl !== null) { $tpl->setVariable('warning_messages', $warnings); } } catch (Exception $e) { eZDebug::writeError($e->getMessage()); } }
protected static function initializeAutoload() { $autoloadOptions = new ezpAutoloadGeneratorOptions(); $autoloadOptions->basePath = 'extension/ezdbintegrity'; $autoloadOptions->searchKernelFiles = false; $autoloadOptions->searchKernelOverride = false; $autoloadOptions->searchExtensionFiles = true; $autoloadOptions->searchTestFiles = false; $autoloadOptions->writeFiles = false; $autoloadOptions->displayProgress = false; $autoloadGenerator = new eZAutoloadGenerator($autoloadOptions); // We have to jump through hoops to get eZAutoloadGenerator give us back an array $autoloadGenerator->setOutputCallback(array('ezdbiAutoloadHelper', 'autoloadCallback')); try { $autoloadGenerator->buildAutoloadArrays(); $autoloadGenerator->printAutoloadArray(); } catch (Exception $e) { echo $e->getMessage() . "\n"; } }
public static function updateExtensionAutoloadArray() { $autoloadGenerator = new eZAutoloadGenerator(); try { $autoloadGenerator->buildAutoloadArrays(); self::reset(); } catch (Exception $e) { echo $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine(); } }
$autoloadOptions->displayProgress = $displayProgressOption->value; if (!empty($targetOption->value)) { $autoloadOptions->outputDir = $targetOption->value; } $autoloadOptions->excludeDirs = $excludeDirs; $autoloadGenerator = new eZAutoloadGenerator($autoloadOptions); if (defined('EZP_AUTOLOAD_OUTPUT')) { $outputClass = EZP_AUTOLOAD_OUTPUT; $autoloadCliOutput = new $outputClass(); } else { $autoloadCliOutput = new ezpAutoloadCliOutput(); } $autoloadGenerator->setOutputObject($autoloadCliOutput); $autoloadGenerator->setOutputCallback(array($autoloadCliOutput, 'outputCli')); try { $autoloadGenerator->buildAutoloadArrays(); $autoloadGenerator->buildPHPUnitConfigurationFile(); // If we are showing progress output, let's print the list of warnings at // the end. if ($displayProgressOption->value) { $warningMessages = $autoloadGenerator->getWarnings(); foreach ($warningMessages as $msg) { $autoloadCliOutput->outputCli($msg, "warning"); } } if ($verboseOption->value) { $autoloadGenerator->printAutoloadArray(); } } catch (Exception $e) { echo $e->getMessage() . "\n"; }