当前位置: 首页>>代码示例>>PHP>>正文


PHP Installer::recordPatch方法代码示例

本文整理汇总了PHP中Installer::recordPatch方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::recordPatch方法的具体用法?PHP Installer::recordPatch怎么用?PHP Installer::recordPatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Installer的用法示例。


在下文中一共展示了Installer::recordPatch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $autoRegister = $input->getOption('auto-register');
     $installer = new \Installer();
     $installed = $installer->tableExists('users_users');
     if ($installed) {
         $installer->update();
         $output->writeln('Update completed.');
         if (count($installer->installed)) {
             foreach ($installer->installed as $patch) {
                 $output->writeln("<info>Installed: {$patch}</info>");
             }
         }
         if (count($installer->executed)) {
             foreach ($installer->executed as $script) {
                 $output->writeln("<info>Executed: {$script}</info>");
             }
         }
         $output->writeln('<info>Queries executed successfully: ' . count($installer->success) . '</info>');
         if (count($installer->failures)) {
             foreach ($installer->failures as $key => $error) {
                 list($query, $message, $patch) = $error;
                 $output->writeln("<error>Error {$key} in {$patch}\n\t{$query}\n\t{$message}</error>");
                 if ($autoRegister) {
                     $installer->recordPatch($patch);
                 }
             }
         }
         $cachelib = \TikiLib::lib('cache');
         $cachelib->empty_cache();
     } else {
         $output->writeln('<error>Database not found.</error>');
     }
 }
开发者ID:rjsmelo,项目名称:tiki,代码行数:34,代码来源:UpdateCommand.php

示例2: foreach

    $installer->update();
    if (count($installer->installed)) {
        echo "\tPatches installed:\n";
        foreach ($installer->installed as $patch) {
            echo "\t\t{$patch}\n";
        }
    }
    if (count($installer->executed)) {
        echo "\tScripts executed:\n";
        foreach ($installer->executed as $script) {
            echo "\t\t{$script}\n";
        }
    }
    echo "\tQueries executed successfully: " . count($installer->success) . "\n";
    if (count($installer->failures)) {
        echo "\tErrors:\n";
        foreach ($installer->failures as $key => $error) {
            list($query, $message, $patch) = $error;
            if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'skiperrors') {
                echo "\tSkipping {$patch}\n";
                $installer->recordPatch($patch);
            } else {
                echo "\t===== Error {$key} in {$patch} =====\n\t{$query}\n\t{$message}\n";
            }
        }
    }
}
# Clear caches, since patches often manipulate the database directly without using the functions normally available outside the installer.
# All caches, even though scripts and patches surely don't affect them all.
require_once 'lib/cache/cachelib.php';
$cachelib->empty_cache();
开发者ID:jkimdon,项目名称:cohomeals,代码行数:31,代码来源:shell.php


注:本文中的Installer::recordPatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。