Esempio n. 1
0
 /**
  * Generates proforma invoice for order and returns it's file path
  * 
  * @param Order $order
  * 
  * @return string absolute filepath 
  */
 public function generate(Order $order)
 {
     $outputFile = $this->getFilePath($order);
     vBuilder\Utils\FileSystem::createFilePath($outputFile);
     $orderInvoice = new vStore\Invoicing\ShopOrderInvoice($order);
     $this->renderer->renderToFile($orderInvoice, $outputFile);
     return $outputFile;
 }
Esempio n. 2
0
    $sql .= "COMMIT;\n";
    if (file_put_contents($file, $sql) === FALSE) {
        throw new Nette\IOException("Cannot write to file '{$file}'");
    }
}
// -----------------------------------------------------------------------------
// DB
// -----------------------------------------------------------------------------
$existingTables = $db->getDatabaseInfo()->getTableNames();
foreach ($existingTables as $table) {
    // Get script file paths
    $dumpPaths = array('structure' => $tm->getDdlScript($table), 'data' => $tm->getDataScript($table));
    // Create parent directories
    foreach ($dumpPaths as $path) {
        if ($path) {
            FileSystem::createFilePath($path);
        }
    }
    $relPath = FileSystem::getRelativePath($workPath, $dumpPaths['structure']);
    echo "\n{$table} in {$relPath}: ";
    switch (dumpStructure($db, $table, $dumpPaths['structure'])) {
        case 0:
            echo "ok";
            break;
        case 1:
            echo "created";
            break;
        case 2:
            echo "updated";
            break;
    }