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


PHP archive函数代码示例

本文整理汇总了PHP中archive函数的典型用法代码示例。如果您正苦于以下问题:PHP archive函数的具体用法?PHP archive怎么用?PHP archive使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: getSources

function getSources($data, $hit, $name)
{
    $dom = (new Dom())->load($data);
    $randomId = function () {
        return mt_rand(1, 999999999999999999);
    };
    // Images.
    foreach ($dom->find('img') as $img) {
        $value = $img->getAttribute('src');
        $filename = $randomId();
        $storage = archive($name, $filename);
        $file = fopen($storage, 'w');
        $publicUrl = '/' . $name . '/' . $filename;
        $hitting = $hit;
        if (substr($value, 0, 2) === '//') {
            $hitting = 'http:' . $value;
        } elseif (substr($value, 0, 1) === '/') {
            $hitting .= $value;
        } else {
            $hitting = $value;
        }
        fwrite($file, curl($hitting));
        fclose($file);
        $data = str_replace($value, $publicUrl, $data);
    }
    // Styleheets.
    foreach ($dom->find('link') as $stylesheet) {
        $value = $stylesheet->getAttribute('href');
        // If the link is to root, skip it.
        if ($value === '/') {
            continue;
        }
        $filename = $randomId();
        $storage = archive($name, $filename);
        $publicUrl = '/' . $name . '/' . $filename;
        $hitting = $hit;
        if (substr($value, 0, 1) === '/') {
            $hitting .= $value;
        } else {
            $hitting = $value;
        }
        $contents = curl($hitting);
        $file = fopen($storage, 'w');
        fwrite($file, $contents);
        fclose($file);
        $data = str_replace($value, $publicUrl, $data);
    }
    return $data;
}
开发者ID:zeyla,项目名称:website-a.iili.li,代码行数:49,代码来源:index.php

示例2: isset

<div id="main-content">

	<div class="container header-bump">
      

	        <h1 class="hotfire">That Hotfire</h1>



	<?php 
require "config.php";
require "classes/article.php";
$action = isset($_GET['action']) ? $_GET['action'] : "";
switch ($action) {
    case 'archive':
        archive();
        break;
    case 'viewArticle':
        viewArticle();
        break;
    default:
        homepage();
}
function archive()
{
    $results = array();
    $data = Article::getList();
    $results['articles'] = $data['results'];
    $results['totalRows'] = $data['totalRows'];
    $results['pageTitle'] = "Article Archive | Widget News";
    require "templates/archive.php";
开发者ID:gazeis77,项目名称:hotfire_jamz,代码行数:31,代码来源:index.php

示例3: foreach

#
#
#
# get settings
require "settings.php";
foreach ($_GET as $key => $value) {
    $_POST[$key] = $value;
}
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "account_info":
            $OUTPUT = account_info($_POST);
            break;
        case "archive":
            $OUTPUT = archive();
            break;
        default:
            $OUTPUT = order($_POST);
    }
} elseif (isset($_GET["id"])) {
    # Display default output
    $_POST["id"] = $_GET["id"];
    if (isset($_GET["tripid"])) {
        $_POST["tripid"] = $_GET["tripid"];
    }
    if (isset($_GET["proid"])) {
        $_POST["proid"] = $_GET["proid"];
    }
    if (isset($_GET["proid"])) {
        $_POST["busy"] = "No";
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:31,代码来源:todo.php

示例4: addPrevision

        $value = addPrevision($json);
    } else {
        if (isset($_GET['saveCarry'])) {
            $value = saveCarry($json);
        } else {
            if (isset($_GET['edit']) && isset($_GET['isNumeric'])) {
                $value = editDispatchPrevisionNumberField($json, $_GET['edit']);
            } else {
                if (isset($_GET['edit'])) {
                    $value = editDispatchPrevisionField($json, $_GET['edit']);
                } else {
                    if (isset($_GET['updatePrevisionCarry'])) {
                        $value = updateDispatchPrevisionCarry($json);
                    } else {
                        if (isset($_GET['archive'])) {
                            $value = archive($json);
                        } else {
                            if (isset($_GET['restore'])) {
                                $value = restore($json);
                            } else {
                                $value = saveDispatch($json);
                            }
                        }
                    }
                }
            }
        }
    }
    //return JSON array
    exit(json_encode($value));
}
开发者ID:eznibe,项目名称:north-telas,代码行数:31,代码来源:dispatchs_POST.php

示例5: header

        if (add($_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'edit':
        if (edit($_POST['id'], $_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $_POST['ledgeraccountnumber'], $_POST['taxcode'], $_POST['creditworthy'], $_POST['bkrcheck'], $_POST['open_project'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'archive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        if (archive($db, $_POST['id'])) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('location: ../../public/views/dashboard/dashboard.php');
        }
        break;
    case 'dearchive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        if (dearchive($db, $_POST['id'])) {
            header('location: ../../public/views/dashboard/dashboard.php');
        }
        break;
}
function add($contact_name, $contact_lastname, $companyname, $first_adress, $first_zipcode, $first_city, $first_housenumber, $second_adress, $second_zipcode, $second_city, $second_housenumber, $initials, $first_telephonenumber, $second_telephonenumber, $fax, $email, $db)
{
    global $messageBag;
开发者ID:Teunimli,项目名称:Groep1-Barroc-it,代码行数:31,代码来源:customercontroller.php

示例6: action

 /**
  * The action function for this PHAT_Form.
  *
  *
  * @return mixed  $content Returns the contents handed to it from functions called within.
  * @access public
  */
 function action()
 {
     if (isset($_SESSION['PHAT_Message'])) {
         $content = $_SESSION['PHAT_Message'];
         $GLOBALS['CNT_phatform']['content'] .= $content;
         $_SESSION['PHAT_Message'] = NULL;
     }
     switch ($_REQUEST['PHAT_FORM_OP']) {
         case 'SaveFormSettings':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 if (isset($_REQUEST['PHAT_SaveSettings'])) {
                     $content = $this->_saveSettings();
                     $content = $_SESSION['PHAT_FormManager']->menu() . $content;
                 } else {
                     if ($_REQUEST['PHAT_EditElements']) {
                         if ($this->isSaved()) {
                             $content = $this->_confirmArchive();
                         } else {
                             $content = $_SESSION['PHAT_FormManager']->menu();
                             $content .= $this->view(TRUE);
                         }
                     }
                 }
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'editSettings':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 $content = $_SESSION['PHAT_FormManager']->menu();
                 $content .= $this->editSettings();
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'editElements':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 $content = $_SESSION['PHAT_FormManager']->menu();
                 $content .= $this->view(TRUE);
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'report':
             if (Current_User::allow('phatform', 'report_view')) {
                 $this->report = new PHAT_Report();
                 $content = $this->report->report();
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'archive':
             if (!Current_User::allow('phatform', 'archive_form')) {
                 $this->_accessDenied();
             } else {
                 include PHPWS_SOURCE_DIR . 'mod/phatform/inc/Archive.php';
                 $error = NULL;
                 $error = archive($this->getId());
                 if (PHPWS_Error::isError($error)) {
                     javascript('alert', array('content' => PHPWS_Error::printError($error)));
                 } else {
                     $_SESSION['PHAT_Message'] = sprintf(dgettext('phatform', 'The form %s was successfully archived.'), '<b><i>' . $this->getLabel() . '</i></b>');
                 }
                 $_REQUEST['PHAT_FORM_OP'] = 'report';
                 $this->action();
             }
             break;
         case 'ToolbarAction':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 $content = $this->_toolbarAction();
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'EditAction':
             if (Current_User::allow('phatform', 'edit_forms')) {
                 if (isset($_REQUEST['PHAT_Submit']) || isset($_REQUEST['PHAT_Next']) || isset($_REQUEST['PHAT_Back'])) {
                     $content = $_SESSION['PHAT_FormManager']->menu();
                     $content .= $this->view(TRUE);
                 } else {
                     $content = $this->_editAction();
                 }
             } else {
                 $this->_accessDenied();
             }
             break;
         case 'Action':
             $content = $this->_formAction();
             break;
         case 'ArchiveConfirm':
             $this->_confirmArchive();
             break;
     }
//.........这里部分代码省略.........
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:101,代码来源:Form.php

示例7: archive

#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require "settings.php";
if (isset($_GET["id"])) {
    $OUTPUT = archive($_GET);
} else {
    $OUTPUT = "Invalid.";
}
require "template.php";
function archive($_GET)
{
    extract($_GET);
    $id += 0;
    db_conn('crm');
    $Sl = "SELECT * FROM crms WHERE userid='" . USER_ID . "'";
    $Ri = db_exec($Sl) or errDie("Unable to get data from system.");
    if (pg_num_rows($Ri) < 1) {
        return "Invalid.";
    }
    $crmdata = pg_fetch_array($Ri);
开发者ID:andrecoetzee,项目名称:accounting-123.com,代码行数:31,代码来源:tokens-action-archive.php

示例8: archive

 public function archive()
 {
     $attributes = $this->attributes();
     $attributes['_content'] = $this->content();
     return archive($attributes);
 }
开发者ID:mamtasingh87,项目名称:bytecode,代码行数:6,代码来源:plugin.php

示例9: affiche_relais_demande

<?php

include "./modele/modele_connexion_bdd.php";
include "./modele/modele_fonction.php";
$affiche_relais_demande = affiche_relais_demande();
$archive = archive();
$nb_demande_mail = nb_demande();
$nb_ancienne_star = nb_ancienne_star();
$nb_demande = notifications();
if (isset($_POST["activer_blog"])) {
    $pseudo = $_POST["pseudo"];
    $id = id($pseudo);
    $alerte = "Le blog de cet utilisateur vient d'être activé.";
    $status = "1";
    active_blog($id, $status);
    exec('sudo /var/script/activation_vhost.sh ' . $pseudo);
    // On recupere la liste des utilisateurs
    $results = liste_utilisateur();
    foreach ($results as $cle => $result) {
        $results[$cle]["id_utilisateur"] = nl2br(htmlspecialchars($result["id_utilisateur"]));
        $results[$cle]["pseudo"] = nl2br(htmlspecialchars($result["pseudo"]));
    }
    //On recupere la liste des demandeurs de devenir star
    $liste_demande_star = liste_demande_star();
    foreach ($liste_demande_star as $cle => $result1) {
        $liste_demande_star[$cle]["id_utilisateur"] = nl2br(htmlspecialchars($result1["id_utilisateur"]));
        $liste_demande_star[$cle]["pseudo"] = nl2br(htmlspecialchars($result1["pseudo"]));
    }
    //On recupere la liste des anciennes stars
    $liste_ancienne_star = liste_ancienne_star();
    foreach ($liste_ancienne_star as $cle => $result2) {
开发者ID:OpenWord3,项目名称:openWorld,代码行数:31,代码来源:controleur_admin.php

示例10: center


//.........这里部分代码省略.........
        if (_ADMIN) {
            switch ($action) {
                case 'administration':
                    administration();
                    return;
                    break;
                case 'snews_settings':
                    settings();
                    return;
                    break;
                case 'snews_categories':
                    admin_categories();
                    return;
                    break;
                case 'admin_category':
                    form_categories();
                    return;
                    break;
                case 'admin_subcategory':
                    form_categories('sub');
                    return;
                    break;
                case 'groupings':
                    admin_groupings();
                    return;
                    break;
                case 'admin_groupings':
                    form_groupings();
                    return;
                    break;
                case 'snews_articles':
                    admin_articles('article_view');
                    return;
                    break;
                case 'extra_contents':
                    admin_articles('extra_view');
                    return;
                    break;
                case 'snews_pages':
                    admin_articles('page_view');
                    return;
                    break;
                case 'admin_article':
                    form_articles('');
                    return;
                    break;
                case 'article_new':
                    form_articles('article_new');
                    return;
                    break;
                case 'extra_new':
                    form_articles('extra_new');
                    return;
                    break;
                case 'page_new':
                    form_articles('page_new');
                    return;
                    break;
                case 'editcomment':
                    edit_comment();
                    return;
                    break;
                case 'snews_files':
                    files();
                    return;
                    break;
                case 'process':
                    processing();
                    return;
                    break;
                case 'logout':
                    session_destroy();
                    echo '<meta http-equiv="refresh" content="2; url=' . _SITE . '">';
                    echo '<h2>' . l('log_out') . '</h2>';
                    return;
                    break;
            }
        }
        switch ($action) {
            case 'archive':
                archive();
                break;
            case 'sitemap':
                sitemap();
                break;
            case 'contact':
                contact();
                break;
            case 'login':
                login();
                break;
            case '404':
                echo l('error_404');
                break;
            default:
                articles();
                break;
        }
    }
}
开发者ID:retrofox,项目名称:PCC,代码行数:101,代码来源:snews.php

示例11: foreach

<?php

/**
 * Manually run an SQL patch outside of the general updaters.
 * This ensures that the DB options (charset, prefix, engine) are correctly set.
 *
 * @file
 * @ingroup Maintenance
 */
require_once 'commandLine.inc';
require_once "{$IP}/maintenance/updaters.inc";
if ($args) {
    foreach ($args as $arg) {
        $files = array($arg, archive($arg), archive("patch-{$arg}.sql"));
        foreach ($files as $file) {
            if (file_exists($file)) {
                echo "{$file} ...\n";
                dbsource($file);
                continue 2;
            }
        }
        echo "Could not find {$arg}\n";
    }
    echo "done.\n";
} else {
    echo "Run an SQL file into the DB, replacing prefix and charset vars.\n";
    echo "Usage:\n";
    echo "  php maintenance/patchSql.php file1.sql file2.sql ...\n";
    echo "\n";
    echo "Paths in maintenance/archive are automatically expanded if a local file isn't found.\n";
}
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:patchSql.php

示例12: foreach

    if($('#scroll a').length > 0){
$('#scroll').bxSlider({
auto: true,
displaySlideQty:4,
prevText: '',
nextText: '',
moveSideQty: 1
});
}
});
</script>

<div class="scroll">
<ul id="scroll" class="list-view">
<?php 
foreach (archive($topid, 0, 0, '0,0,0', 20, 'rand()', 10, true, 0) as $i => $archive) {
    ?>
<li><div class="img-wrap"><a title="<?php 
    echo $archive['stitle'];
    ?>
" target="_blank" href="<?php 
    echo $archive['url'];
    ?>
"><img alt="<?php 
    echo $archive['stitle'];
    ?>
" src="<?php 
    echo $archive['thumb'];
    ?>
" onerror='this.src="<?php 
    echo config::get('onerror_pic');
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:31,代码来源:#show_products.php

示例13: header

        if (add($_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
        }
        break;
    case 'edit':
        if (edit($_POST['id'], $_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $_POST['ledgeraccountnumber'], $_POST['taxcode'], $_POST['creditworthy'], $_POST['bkrcheck'], $_POST['open_project'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
        }
        break;
    case 'archive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        archive($db, $_POST['id']);
        break;
}
function alert($string)
{
    echo '<script type="text/javascript">alert("' . $string . '");</script>';
    echo '<script type="text/javascript">history.go(-1);</script>';
}
function add($contact_name, $contact_lastname, $companyname, $first_adress, $first_zipcode, $first_city, $first_housenumber, $second_adress, $second_zipcode, $second_city, $second_housenumber, $initials, $first_telephonenumber, $second_telephonenumber, $fax, $email, $db)
{
    global $messageBag;
    $controle = 2;
    $created_at = time();
    $sql = "SELECT * FROM tbl_customer WHERE companyname = :companyname";
    $q = $db->prepare($sql);
    $q->bindParam(':companyname', $companyname);
开发者ID:Teunimli,项目名称:Groep1-Barroc-it,代码行数:31,代码来源:customercontroller.php

示例14: move_file

    move_file(PATH_TMP . "/" . AREA_OUT, PATH_CSV);
    move_file(PATH_TMP . "/" . AREA . "_html_hash", PATH_VAR);
    move_file(PATH_TMP . "/" . AREA . "_lzh_hash", PATH_VAR);
    unlink_files(array(PATH_TMP . "/" . AREA . ".csv"));
    $updated = true;
} else {
    unlink_files(array(PATH_TMP . "/" . AREA . "_html_hash", PATH_TMP . "/" . AREA . "_lzh_hash"));
}
/*
 * 事業所データの処理
 */
if (capture(FIRM_PAGE, FIRM_URL, FIRM, FIRM_UTF8)) {
    if (!normalize_firm()) {
        exit(1);
    }
    if (!archive($firm_arc_list)) {
        exit(1);
    }
    if (!update_arc_index()) {
        exit(1);
    }
    move_file(PATH_TMP . "/" . FIRM_UTF8, PATH_CSV);
    move_file(PATH_TMP . "/" . FIRM_OUT, PATH_CSV);
    move_file(PATH_TMP . "/" . FIRM . "_html_hash", PATH_VAR);
    move_file(PATH_TMP . "/" . FIRM . "_lzh_hash", PATH_VAR);
    unlink_files(array(PATH_TMP . "/" . FIRM . ".csv"));
    $updated = true;
} else {
    unlink_files(array(PATH_TMP . "/" . FIRM . "_html_hash", PATH_TMP . "/" . FIRM . "_lzh_hash"));
}
/*
开发者ID:BGCX261,项目名称:zippyzipjp-svn-to-git,代码行数:31,代码来源:zippyzip.php


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