Installer::update PHP Method

update() public static method

public static update ( $app = 'application' )
    public static function update($app = 'application')
    {
        $target_dir = $app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test';
        self::recursiveUnlink($target_dir);
        self::recursiveCopy(dirname(__FILE__) . '/application/tests/_ci_phpunit_test', $target_dir);
    }

Usage Example

Ejemplo n.º 1
0
 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>');
     }
 }
All Usage Examples Of Installer::update