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


PHP mslib_fe::file_get_contents方法代码示例

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


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

示例1: saveImportedProductImages

 public function saveImportedProductImages($products_id, $input, $item, $oldproduct = array(), $log_file = '')
 {
     if (!is_numeric($products_id)) {
         return false;
     }
     if (is_numeric($products_id)) {
         for ($x = 0; $x < $this->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $x++) {
             // hidden filename that is retrieved from the ajax upload
             $i = $x;
             if ($i == 0) {
                 $i = '';
             }
             $colname = 'products_image' . $i;
             if (!$oldproduct[$colname]) {
                 if ($item[$colname]) {
                     $plaatje1 = $item[$colname];
                     $data = mslib_fe::file_get_contents($plaatje1);
                     if ($data) {
                         $plaatje1_name = $products_id . '-' . $colname . '-' . time();
                         $tmpfile = PATH_site . 'uploads/tx_multishop/tmp/' . $plaatje1_name;
                         file_put_contents($tmpfile, $data);
                         $plaatje1 = $tmpfile;
                         if (($extentie1 = mslib_befe::exif_imagetype($plaatje1)) && $plaatje1_name != '') {
                             $extentie1 = image_type_to_extension($extentie1, false);
                             $ext = $extentie1;
                             $ix = 0;
                             $filename = mslib_fe::rewritenamein($item['products_name']) . '.' . $ext;
                             $folder = mslib_befe::getImagePrefixFolder($filename);
                             if (!is_dir(PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder)) {
                                 \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir(PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder);
                             }
                             $folder .= '/';
                             $target = PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder . $filename;
                             if (file_exists($target)) {
                                 do {
                                     $filename = mslib_fe::rewritenamein($item['products_name']) . ($ix > 0 ? '-' . $ix : '') . '.' . $ext;
                                     $folder = mslib_befe::getImagePrefixFolder($filename);
                                     if (!is_dir(PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder)) {
                                         \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir(PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder);
                                     }
                                     $folder .= '/';
                                     $target = PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder . $filename;
                                     $ix++;
                                 } while (file_exists($target));
                             }
                             // end
                             $products_image = $path . '/' . $naam;
                             // backup original
                             $target = PATH_site . $this->ms['image_paths']['products']['original'] . '/' . $folder . $filename;
                             copy($tmpfile, $target);
                             // backup original eof
                             $products_image_name = mslib_befe::resizeProductImage($target, $filename, PATH_site . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey), 1);
                             $item['img'][$i] = $products_image_name;
                             if ($log_file) {
                                 file_put_contents($log_file, 'Downloading product' . $i . ' image (' . $item[$colname] . ') succeeded and has been resized to ' . $item['img'][$i] . '.' . "\n", FILE_APPEND);
                             }
                         } else {
                             $item['img'][$i] = '';
                         }
                     } else {
                         $item['img'][$i] = '';
                         if ($log_file) {
                             file_put_contents($log_file, 'Downloading product' . $i . ' image (' . $item[$colname] . ') failed.' . "\n", FILE_APPEND);
                         }
                     }
                     if ($tmpfile and file_exists($tmpfile)) {
                         @unlink($tmpfile);
                     }
                 } else {
                     $item['img'][$i] = '';
                 }
             } else {
                 $item['img'][$i] = '';
             }
         }
         if (count($item['img']) > 0) {
             $array = array();
             for ($x = 0; $x < $this->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $x++) {
                 $i = $x;
                 if ($i == 0) {
                     $i = '';
                 }
                 if ($item['img'][$i]) {
                     $colname = 'products_image' . $i;
                     $array[$colname] = $item['img'][$i];
                 }
             }
             if (count($array) > 0) {
                 if ($array['products_image']) {
                     $array['contains_image'] = 1;
                 } else {
                     $array['contains_image'] = 0;
                 }
                 $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_products', 'products_id=' . $products_id, $array);
                 $res = $GLOBALS['TYPO3_DB']->sql_query($query);
             }
         }
     }
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:99,代码来源:class.mslib_befe.php

示例2: time

     }
 }
 if ($this->post['file_url']) {
     if (strstr($this->post['file_url'], "../")) {
         die;
     }
     $filename = time();
     $file = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename;
     file_put_contents($file, mslib_fe::file_get_contents($this->post['file_url']));
 }
 if ($this->post['filename']) {
     $file = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $this->post['filename'];
 }
 if ($this->post['database_name'] or $file) {
     if ($file) {
         $str = mslib_fe::file_get_contents($file);
     }
     if ($this->post['parser_template']) {
         // include a pre-defined xml to php array way
         require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'scripts/admin_pages/includes/admin_import_parser_templates/' . $this->post['parser_template'] . ".php";
         // include a pre-defined xml to php array way eof
     } else {
         if ($this->post['database_name']) {
             if ($log_file) {
                 file_put_contents($log_file, $this->FULL_HTTP_URL . ' - loading random products.(' . date("Y-m-d G:i:s") . ")\n", FILE_APPEND);
             }
             if (is_numeric($this->get['limit'])) {
                 $limit = $this->get['limit'];
             } else {
                 $limit = 2000;
             }
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_customer_import.php

示例3: array

 $image = $item['manufacturers_image'];
 $strchk = "SELECT * from tx_multishop_manufacturers m where m.manufacturers_id='" . $item['manufacturers_id'] . "'";
 $qrychk = $GLOBALS['TYPO3_DB']->sql_query($strchk);
 if ($GLOBALS['TYPO3_DB']->sql_num_rows($qrychk)) {
     $rowchk = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qrychk);
     // custom hook that can be controlled by third-party plugin
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_import.php']['fetchManufacturersImagePreProc'])) {
         $params = array('rowchk' => &$rowchk, 'item' => &$item, 'column' => 'manufacturers_image');
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_import.php']['fetchManufacturersImagePreProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     // custom hook that can be controlled by third-party plugin eof
     if (!$rowchk['manufacturers_image']) {
         // download image
         $data = mslib_fe::file_get_contents($image);
         if ($data) {
             $plaatje1_name = $item['manufacturers_id'] . '-' . $colname . '-' . time();
             $tmpfile = PATH_site . 'uploads/tx_multishop/tmp/' . $plaatje1_name;
             file_put_contents($tmpfile, $data);
             $plaatje1 = $tmpfile;
             if (($extentie1 = mslib_befe::exif_imagetype($plaatje1)) && $plaatje1_name != '') {
                 $extentie1 = image_type_to_extension($extentie1, false);
                 $ext = $extentie1;
                 $ix = 0;
                 $filename = mslib_fe::rewritenamein($categories_name) . '.' . $ext;
                 $folder = mslib_befe::getImagePrefixFolder($filename);
                 if (!is_dir(PATH_site . $this->ms['image_paths']['manufacturers']['original'] . '/' . $folder)) {
                     \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir(PATH_site . $this->ms['image_paths']['manufacturers']['original'] . '/' . $folder);
                 }
                 $folder .= '/';
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_import.php

示例4: basename

         \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
     }
 }
 // custom page hook that can be controlled by third-party plugin eof
 // download action is valid. lets proceed
 if (!$row['file_location'] && $row['file_remote_location']) {
     // file is stored on remote location. lets download it and send it to the browser
     $body_data = mslib_fe::file_get_contents($row['file_remote_location']);
     if (!$row['file_label']) {
         $row['file_label'] = basename($row['file_remote_location']);
     }
     if (!$row['file_label']) {
         $row['file_label'] = $row['products_name'];
     }
 } elseif ($row['file_location'] and file_exists($row['file_location'])) {
     $body_data = mslib_fe::file_get_contents($row['file_location']);
     if (!$row['file_label']) {
         $row['file_label'] = $row['products_name'];
     }
 }
 if ($body_data) {
     if (!isset($this->get['tx_multishop_pi1']['from_interface'])) {
         $query = "update tx_multishop_orders_products set file_downloaded=(file_downloaded+1) where orders_products_id='" . $row['orders_products_id'] . "'";
         $res = $GLOBALS['TYPO3_DB']->sql_query($query);
         $row['file_downloaded']++;
         if ($row['file_downloaded'] >= $row['file_number_of_downloads']) {
             // maximum allowed downloads exceeded. lets lock it.
             $updateArray = array('file_locked' => '1');
             $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_orders_products', 'orders_products_id=' . addslashes($row['orders_products_id']), $updateArray);
             $res = $GLOBALS['TYPO3_DB']->sql_query($query);
         }
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:core.php

示例5: foreach

}
if ($this->get) {
    foreach ($this->get as $get_idx => $get_val) {
        $this->post[$get_idx] = $get_val;
    }
}
$postErno = array();
switch ($this->post['tx_multishop_pi1']['action']) {
    case 'download_selected_orders_packingslips_in_one_pdf':
        if (is_array($this->post['selected_orders']) && count($this->post['selected_orders'])) {
            $attachments = array();
            foreach ($this->post['selected_orders'] as $order_id) {
                $order = mslib_fe::getOrder($order_id);
                $pdfFileName = 'packingslip_' . $order_id . '.pdf';
                $packingslip_path = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $pdfFileName;
                $packingslip_data = mslib_fe::file_get_contents($this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=download_packingslip&tx_multishop_pi1[order_hash]=' . $order['hash']));
                // write temporary to disk
                file_put_contents($packingslip_path, $packingslip_data);
                $attachments[] = $packingslip_path;
            }
            if (count($attachments)) {
                $combinedPdfFile = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . time() . '_' . uniqid() . '.pdf';
                $prog = \TYPO3\CMS\Core\Utility\CommandUtility::exec('which gs');
                //hook to let other plugins further manipulate the settings
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['overrideGhostScripPath'])) {
                    $params = array('prog' => &$prog);
                    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['overrideGhostScripPath'] as $funcRef) {
                        \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                    }
                }
                if ($prog && is_file($prog)) {
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_orders.php

示例6: mailOrder


//.........这里部分代码省略.........
             }
             if ($page[0]['name']) {
                 $page[0]['name'] = str_replace($array1, $array2, $page[0]['name']);
             }
             // replacing the variables with dynamic values eof
             $user = array();
             $user['name'] = $full_customer_name;
             $user['email'] = $custom_email_address;
             //hook
             $send_mail = 1;
             $mail_attachment = array();
             $add_invoice_attachment_on_templates = array();
             $add_invoice_attachment_on_templates[] = 'email_order_paid_letter';
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrder'])) {
                 $params = array('this' => &$this, 'page' => &$page, 'content' => &$content, 'send_mail' => &$send_mail, 'user' => $user, 'order' => $order, 'order_details' => $ORDER_DETAILS, 'copy_to_merchant' => $copy_to_merchant, 'mail_attachment' => &$mail_attachment, 'loadFromPids' => $loadFromPids, 'add_invoice_attachment_on_templates' => &$add_invoice_attachment_on_templates);
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrder'] as $funcRef) {
                     \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                 }
             }
             if ($send_mail) {
                 if ($user['email']) {
                     if (in_array($mail_template, $add_invoice_attachment_on_templates) && $this->ms['MODULES']['ATTACH_INVOICE_PDF_IN_PAID_LETTER_EMAIL'] > 0) {
                         $filterInvoice = array();
                         $filterInvoice[] = 'orders_id=' . $order['orders_id'];
                         $invoices = mslib_befe::getRecords('', 'tx_multishop_invoices', '', $filterInvoice, '', 'id desc');
                         $invoice = $invoices[0];
                         $pdfFileName = $invoice['invoice_id'] . '_' . $invoice['orders_id'] . '.pdf';
                         $pdfFilePath = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $pdfFileName;
                         // generate the invoice PDF
                         // Get Language code (ie nl, en, de)
                         $language_code = mslib_befe::getLanguageIso2ByLanguageUid($order['language_id']);
                         $language_code = strtolower($language_code);
                         // Download invoice in the language of the order
                         $invoice_data = mslib_fe::file_get_contents($this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=download_invoice&tx_multishop_pi1[hash]=' . $invoice['hash'] . '&tx_multishop_pi1[forceRecreate]=1&language=' . $language_code));
                         file_put_contents($pdfFilePath, $invoice_data);
                         $mail_attachment[] = $pdfFilePath;
                     }
                     mslib_fe::mailUser($user, $page[0]['name'], $page[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME'], $mail_attachment);
                     // moved to cleaning up section
                     //if (strpos($mail_template, 'email_order_paid_letter')!==false && $this->ms['MODULES']['ATTACH_INVOICE_PDF_IN_PAID_LETTER_EMAIL']>0 && file_exists($pdfFilePath)) {
                     //	unlink($pdfFilePath);
                     //}
                 }
                 if ($copy_to_merchant) {
                     $mailSubject = '';
                     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrderToMerchant'])) {
                         $conf = array('this' => &$this, 'page' => &$page, 'content' => &$content, 'send_mail' => &$send_mail, 'user' => $user, 'order' => $order, 'order_details' => $ORDER_DETAILS, 'mail_attachment' => &$mail_attachment, 'mail_template' => $mail_template, 'psp_mail_template' => $psp_mail_template, 'loadFromPids' => $loadFromPids, 'mailSubject' => &$mailSubject, 'pageCopyToMerchant' => &$pageCopyToMerchant, 'array1' => &$array1, 'array2' => &$array2);
                         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['mailOrderToMerchant'] as $funcRef) {
                             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $conf, $this);
                         }
                     }
                     if ($pageCopyToMerchant[0]['content']) {
                         $pageCopyToMerchant[0]['content'] = str_replace($array1, $array2, $pageCopyToMerchant[0]['content']);
                     }
                     if ($pageCopyToMerchant[0]['name']) {
                         $pageCopyToMerchant[0]['name'] = str_replace($array1, $array2, $pageCopyToMerchant[0]['name']);
                     }
                     if ($mailSubject == '') {
                         $mailSubject = $this->pi_getLL('copy_for_merchant') . ': ' . $pageCopyToMerchant[0]['name'];
                     }
                     // now mail a copy to the merchant
                     $merchant = array();
                     $merchant['name'] = $this->ms['MODULES']['STORE_NAME'];
                     $merchant['email'] = $this->ms['MODULES']['STORE_EMAIL'];
                     mslib_fe::mailUser($merchant, $mailSubject, $pageCopyToMerchant[0]['content'], $this->ms['MODULES']['STORE_EMAIL'], $this->ms['MODULES']['STORE_NAME'], $mail_attachment);
                     if ($this->ms['MODULES']['SEND_ORDER_CONFIRMATION_LETTER_ALSO_TO']) {
开发者ID:bvbmedia,项目名称:multishop,代码行数:67,代码来源:class.tx_mslib_order.php

示例7: renderInterface

    function renderInterface($params, &$that)
    {
        mslib_fe::init($that);
        if ($that->post['job_id']) {
            $that->get['job_id'] = $that->post['job_id'];
        }
        if ($that->get['delete'] and is_numeric($that->get['job_id'])) {
            // delete job
            $query = $GLOBALS['TYPO3_DB']->DELETEquery('tx_multishop_import_jobs', 'id=' . $that->get['job_id'] . ' and type=\'' . addslashes($params['importKey']) . '\'');
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        }
        if (is_numeric($that->get['job_id']) and is_numeric($that->get['status'])) {
            // update the status of a job
            $updateArray = array();
            $updateArray['status'] = $that->get['status'];
            $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=\'' . $that->get['job_id'] . '\' and type=\'' . addslashes($params['importKey']) . '\'', $updateArray);
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
            // update the status of a job eof
        }
        if (isset($that->get['download']) && $that->get['download'] == 'task' && is_numeric($that->get['job_id'])) {
            $sql = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_import_jobs ', 'id= \'' . $that->get['job_id'] . '\'', '', '', '');
            $qry = $GLOBALS['TYPO3_DB']->sql_query($sql);
            if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
                $data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                $jobArray = $row;
                $serial_value = array();
                foreach ($data as $key_idx => $key_val) {
                    if ($key_idx != 'id' && $key_idx != 'page_uid') {
                        $serial_value[$key_idx] = $key_val;
                    }
                }
                $serial_data = '';
                if (count($serial_value) > 0) {
                    $serial_data = serialize($serial_value);
                }
                $filename = 'multishop_' . $params['importKey'] . '_import_task_' . date('YmdHis') . '_' . $that->get['job_id'] . '.txt';
                $filepath = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/' . $filename;
                file_put_contents($filepath, $serial_data);
                header("Content-disposition: attachment; filename={$filename}");
                //Tell the filename to the browser
                header('Content-type: application/octet-stream');
                //Stream as a binary file! So it would force browser to download
                readfile($filepath);
                //Read and stream the file
                @unlink($filepath);
                exit;
            }
        }
        if (isset($that->get['upload']) && $that->get['upload'] == 'task' && $_FILES) {
            if (!$_FILES['task_file']['error']) {
                $filename = $_FILES['task_file']['name'];
                $target = $that->DOCUMENT_ROOT . '/uploads/tx_multishop' . $filename;
                if (move_uploaded_file($_FILES['task_file']['tmp_name'], $target)) {
                    $task_content = file_get_contents($target);
                    $unserial_task_data = unserialize($task_content);
                    $insertArray = array();
                    $insertArray['page_uid'] = $that->showCatalogFromPage;
                    foreach ($unserial_task_data as $col_name => $col_val) {
                        if ($col_name == 'code') {
                            $insertArray[$col_name] = md5(uniqid());
                        } else {
                            if ($col_name == 'name' && isset($that->post['new_cron_name']) && !empty($that->post['new_cron_name'])) {
                                $insertArray[$col_name] = $that->post['new_cron_name'];
                            } else {
                                if ($col_name == 'prefix_source_name' && isset($that->post['new_prefix_source_name']) && !empty($that->post['new_prefix_source_name'])) {
                                    $insertArray[$col_name] = $that->post['new_prefix_source_name'];
                                } else {
                                    $insertArray[$col_name] = $col_val;
                                }
                            }
                        }
                    }
                    $query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_import_jobs', $insertArray);
                    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                    @unlink($target);
                }
            }
            header('Location: ' . $that->FULL_HTTP_URL . $params['postForm']['actionUrl'] . '#tasks');
        }
        $GLOBALS['TSFE']->additionalHeaderData['tx_multishop_pi1_block_ui'] = mslib_fe::jQueryBlockUI();
        if (is_numeric($that->post['job_id']) && $that->post['action'] == 'import-preview') {
            if ($that->post['job_id']) {
                $that->get['job_id'] = $that->post['job_id'];
            }
            $str = "SELECT * from tx_multishop_import_jobs where id='" . $that->post['job_id'] . "' and type='" . addslashes($params['importKey']) . "'";
            $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
            $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
            $jobArray = $row;
            $updateArray = array();
            $cron_data = array();
            $cron_data[0] = array();
            $that->post['cron_period'] = '';
            $cron_data[1] = $that->post;
            $updateArray['data'] = serialize($cron_data);
            $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $that->post['job_id'], $updateArray);
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        }
        if ($that->post['action'] == 'import-preview' or is_numeric($that->get['job_id']) and $_REQUEST['action'] == 'edit_job') {
            // preview
            if (is_numeric($that->get['job_id'])) {
//.........这里部分代码省略.........
开发者ID:bvbmedia,项目名称:multishop,代码行数:101,代码来源:class.tx_mslib_admin_import.php

示例8: copy

                     $folder = mslib_befe::getImagePrefixFolder($record['products_image' . $cur]);
                     $source_file = $this->DOCUMENT_ROOT . $this->ms['image_paths']['products']['original'] . '/' . $folder . '/' . $record['products_image' . $cur];
                     if (file_exists($source_file)) {
                         copy($source_file, PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder . '/images/products/' . $record['products_image' . $cur]);
                     }
                 }
             }
         }
         // copy the products images to the backup folder eof
     }
     if (!file_put_contents(PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder . '/data.sql', $output)) {
         die(PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder . '/data.sql is not writable.');
     } else {
         $backup_file = date("Y-m-d_G-i-s");
         if ($this->zipPack(PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder . '/', PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder . '/' . $backup_file . '.zip')) {
             $output = mslib_fe::file_get_contents(PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder . '/' . $backup_file . '.zip');
             $content = ob_get_contents();
             // now remove the backup folder
             if ($backup_folder) {
                 $tmp = $this->deltree(PATH_site . 'uploads/tx_multishop/tmp/' . $backup_folder);
             }
             ob_end_clean();
             header('Content-Disposition: attachment; filename="' . $backup_file . '.t3xms"');
             echo $output;
             exit;
         } else {
             die('Backupping failed (can\'t create the compressed backup file).');
         }
     }
 }
 // backup database eof
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:administration.php

示例9: array

    $this->post['selected_invoices'] = $this->get['selected_invoices'];
}
$postErno = array();
switch ($this->post['tx_multishop_pi1']['action']) {
    case 'download_selected_invoices':
    case 'mail_selected_invoices_to_merchant':
        // send invoices by mail
        if (is_array($this->post['selected_invoices']) and count($this->post['selected_invoices'])) {
            $attachments = array();
            foreach ($this->post['selected_invoices'] as $invoice) {
                if (is_numeric($invoice)) {
                    $invoice = mslib_fe::getInvoice($invoice, 'id');
                    if ($invoice['id']) {
                        // invoice as attachment
                        $invoice_path = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $invoice['invoice_id'] . '.pdf';
                        $invoice_data = mslib_fe::file_get_contents($this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=download_invoice&tx_multishop_pi1[hash]=' . $invoice['hash']));
                        // write temporary to disk
                        file_put_contents($invoice_path, $invoice_data);
                        $attachments[$invoice['invoice_id']] = $invoice_path;
                    } else {
                        $postErno[] = array('status' => 'error', 'message' => 'Failed to retrieve invoice record id ' . $invoice);
                    }
                }
            }
            if (count($attachments)) {
                // combine all PDF files in 1 (needs GhostScript on the server: yum install ghostscript)
                $combinedPdfFile = $this->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . time() . '_' . uniqid() . '.pdf';
                $prog = \TYPO3\CMS\Core\Utility\CommandUtility::exec('which gs');
                //hook to let other plugins further manipulate the settings
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['overrideGhostScripPath'])) {
                    $params = array('prog' => &$prog);
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:admin_invoices.php


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