本文整理汇总了PHP中store函数的典型用法代码示例。如果您正苦于以下问题:PHP store函数的具体用法?PHP store怎么用?PHP store使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了store函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
function store($data, $csum)
{
$status = 0;
$csumn = new Csum($data);
if (!is_object($csum)) {
return null;
}
if (!$csum->matches($csumn)) {
return null;
}
return store($data, $csum);
}
示例2: PunkRecordIntakeHandler
function PunkRecordIntakeHandler()
{
global $l;
$l = new llog();
global $generalAuthKey;
if (authorized($generalAuthKey)) {
$l->a("Started DataIntakeHandler<br>");
$status = 0;
if (isset($_FILES['uploadedfile'])) {
$ulfilename = base64_encode($_FILES['uploadedfile']['name']);
$ulsize = base64_encode($_FILES['uploadedfile']['size']);
} else {
$ulfilename = null;
$ulsize = null;
}
$filename = "coal_temp/" . "data." . guidv4() . ".stt";
if (isset($_FILES['uploadedfile'])) {
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $filename)) {
} else {
$status = 2;
$l->a("error 2<br>");
}
} else {
$status = 6;
$l->a("error 6<br>");
}
$csum = new Csum(null, $filename);
$insertion = store(file_get_contents($filename), $csum);
$id = $insertion['id'];
$status = $insertion['status'];
$db = new FractureDB('futuqiur_ember');
if (isset($_REQUEST['punkUser'])) {
$addedTree = $db->addRow('trees', 'user, collection, number, csum', "'" . $_REQUEST['punkUser'] . "', '" . $_REQUEST['punkCollection'] . "', '" . $id . "', '" . $csum->len . '|' . $csum->md5 . '|' . $csum->sha . '|' . $csum->s512 . "'");
}
if (check($status, true)) {
echo $id . '|' . $csum->len . '|' . $csum->md5 . '|' . $csum->sha . '|' . $csum->s512;
}
}
}
示例3: dirname
$logfile = dirname(__FILE__) . '/logs/storedata.log';
//si aggiorna verso le 10.00 del mattino
$biometeo_ITA_file = BIOMETEO_ITA_LINK;
$biometeo_ENG_file = BIOMETEO_ENG_LINK;
//si aggiorna verso le 8.30 del mattino
$meteo_file = METEO_LINK;
//si aggiorna dalle 10 alle 13 del mattino
//$risk_file = RISK_LINK. $today.".xml";
// RISK_LINK Puglia
$risk_file = RISK_LINK;
store($biometeo_ITA_file, dirname(__FILE__) . "/data/biometeo_ITA.xml", $logfile);
store($biometeo_ENG_file, dirname(__FILE__) . "/data/biometeo_ENG.xml", $logfile);
store($meteo_file, dirname(__FILE__) . "/data/meteo.xml", $logfile);
//cancello il file in locale in quanto cambia il nome da un giorno all'altro ed esiste un momento del giorno in cui non esiste il file (la mattina)
unlink(dirname(__FILE__) . "/data/risk.xml");
store($risk_file, dirname(__FILE__) . "/data/risk.xml", $logfile);
//download pics
download_remote_file(IDROMETRIA_Bisenzio_Prato, dirname(__FILE__) . "/data/IDROMETRIA_Bisenzio_Prato.jpg", $logfile);
download_remote_file(IDROMETRIA_Bisenzio_Vaiano_Gamberame, dirname(__FILE__) . "/data/IDROMETRIA_Bisenzio_Vaiano_Gamberame.jpg", $logfile);
download_remote_file(IDROMETRIA_Ombrone_PonteAlleVanne, dirname(__FILE__) . "/data/IDROMETRIA_Ombrone_PonteAlleVanne.jpg", $logfile);
download_remote_file(IDROMETRIA_Ombrone_PoggioACaiano, dirname(__FILE__) . "/data/IDROMETRIA_Ombrone_PoggioACaiano.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Prato_Città, dirname(__FILE__) . "/data/PLUVIOMETRIA_Prato_Città.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Prato_Università, dirname(__FILE__) . "/data/PLUVIOMETRIA_Prato_Università.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Galceti_Montemurlo, dirname(__FILE__) . "/data/PLUVIOMETRIA_Galceti_Montemurlo.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Vaiano_Gamberame, dirname(__FILE__) . "/data/PLUVIOMETRIA_Vaiano_Gamberame.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Vaiano_Acquedotto, dirname(__FILE__) . "/data/PLUVIOMETRIA_Vaiano_Acquedotto.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Fattoria_Iavello_Montemurlo, dirname(__FILE__) . "/data/PLUVIOMETRIA_Fattoria_Iavello_Montemurlo.jpg", $logfile);
download_remote_file(PLUVIOMETRIA_Cantagallo, dirname(__FILE__) . "/data/PLUVIOMETRIA_Cantagallo.jpg", $logfile);
download_remote_file(TERMOMETRIA_Prato_Università, dirname(__FILE__) . "/data/TERMOMETRIA_Prato_Università.jpg", $logfile);
download_remote_file(TERMOMETRIA_Galceti_Montemurlo, dirname(__FILE__) . "/data/TERMOMETIRIA_Galceti_Montemurlo.jpg", $logfile);
download_remote_file(ANEMOMETRIA_Prato_Università, dirname(__FILE__) . "/data/ANEMOMETRIA_Prato_Università.jpg", $logfile);
示例4: deactivate
if (lateForms($value)) {
// echo "late with forms <br>";
deactivate($value["id"]);
} else {
if (lateAssessment($value)) {
deactivate($value["id"]);
} else {
if (needAssessmentReminder($curr)) {
remind($curr);
}
}
}
}
//store disabled users
if ($value["activated"] == -1) {
store($value["id"], $value["email"]);
remove($value["id"]);
}
}
}
}
function remind($curr)
{
//update reminder value
$assessments = getLastAssessment($curr);
$update = QueryFactory::Build("update");
$update->Table("assessments")->Where(["id", "=", $curr["id"]], ["TestNumber", "=", $assessments["TestNumber"]])->Set(["reminded", "1"]);
$cinfo = DatabaseManager::Query($complete);
//write email
Mailer::Send($curr["email"], "This is an email reminder that your Sit And Be Fit assessment is due in a week./nPlease go to sbfresearch.org and login to complete the assessment");
}
示例5: array_filter
if (!is_dir($path)) {
$output->writeln('<error>Path "' . $path . '" not found.</error>');
return;
}
$locales = array_filter(scandir($path), function ($path) {
return '.' !== $path[0];
});
$availableLocales = array();
$root = (include __DIR__ . '/data_root.php');
foreach ($locales as $locale) {
$output->write('Processing locale <comment>' . $locale . '</comment>...');
$data = parse($path, $locale);
if (null === $data) {
$output->writeln('<error>No data found</error>.');
continue;
}
$filled = array_replace_recursive($root, $data);
store($locale, $filled);
$availableLocales[] = $locale;
$output->writeln('<info>Done</info>.');
}
$output->write('Storing root file...');
store('root', $root);
$output->writeln('<info>Done</info>.');
$output->write('Storing meta file...');
$meta = array('locales' => $availableLocales);
store('meta', $meta);
$output->writeln('<info>Done</info>.');
$output->writeln('<info>Finished processing ' . count($locales) . ' locales.</info>');
});
$console->run();
示例6: template
$filelist .= template($mode . '_image_' . $layout, $array);
} elseif ($extension == 'zip') {
# Item is a zip file=> add change to folder
$icone_visu = '<a class="tofolder" href="index.php?p=admin&unzip=' . $id . '&token=' . returnToken() . '" title="' . e('Convert this zip file to folder', false) . '"> </a>';
$array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
$filelist .= template($mode . '_file_' . $layout, $array);
} else {
# all other types
$array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
$filelist .= template($mode . '_file_' . $layout, $array);
}
}
}
echo $folderlist . $filelist;
if ($save) {
store($ids);
}
// save in case of new files
} else {
e('No file on the server');
}
?>
<script src="core/qr.js"></script>
<script>
function put_file(fichier){
document.getElementById('filename').value=fichier;
document.getElementById('filename_hidden').value=fichier;
}
function put_id(id){document.getElementById('ID_hidden').value=id;}
function put_link(id){document.getElementById('link').value="<?php
示例7: load
} else {
$user = load($_GET['id']);
if ($user == NULL) {
$result['success'] = false;
$result['msg'] = "Error : User could not be found.";
$result['id'] = $_GET['id'];
} else {
if (property_exists('user', $_GET['field']) == false) {
$result['success'] = false;
$result['msg'] = "Error : Unknown field.";
$result['field'] = $_GET['field'];
} else {
//TODO check if field exists
$methodName = "set" . ucfirst($_GET['field']);
$user->{$methodName}($_GET['value']);
if (store($user) == false) {
$result['success'] = false;
$result['msg'] = "Error : User could not be saved.";
$result['id'] = $_GET['id'];
} else {
$result['success'] = true;
}
}
}
}
}
break;
default:
echo "ERR : No actions given. :(";
break;
}
示例8: updateIDs
function updateIDs($ids = null, $folder_id = null)
{
if (!$ids) {
$ids = unstore();
}
$ids = array_map(function ($id) {
return str_replace('//', '/', $id);
}, $ids);
$sdi = array_flip($ids);
$saveid = $savetree = false;
$ids = array_flip($sdi);
# here, all the redundant ids have gone ^^
# scann all uploads folder (can be long but it's important)
# or only the requested folder
if (!empty($folder_id)) {
$tree = recursive_glob(id2file($folder_id), true);
} else {
$tree = recursive_glob($_SESSION['upload_root_path'], true);
}
unset($tree[0]);
# add missing ids
foreach ($tree as $index => $file) {
if (!isset($sdi[$file])) {
$saveid = true;
$id = uniqid(true);
$ids[$id] = $file;
} else {
unset($sdi[$file]);
}
}
if (empty($folder_id)) {
# remove ids with no file (not required for single folder update)
if (!empty($sdi)) {
$saveid = true;
foreach ($sdi as $file => $id) {
if (!is_dir($file) && !is_file($file)) {
unset($ids[$id]);
if ($remove = array_search($file, $tree)) {
unset($tree[$remove]);
}
}
}
}
}
if ($saveid) {
store($ids);
regen_tree($_SESSION['login'], $ids);
}
return $ids;
}
示例9: lstore
function lstore($data, $language)
{
//Store a localizable string.
$db = new FractureDB('futuqiur_ember');
$store = store($data);
$sid = $store['id'];
$id = $db->addRow('strings', 'language, data', '\'' . $language . '\', \'' . $sid . '\'');
$store['id'] = $id;
return $store;
}
示例10: ajaxCheckStoreSlugUnique
public function ajaxCheckStoreSlugUnique(Request $request)
{
if ($request->ajax() && $request->isMethod('POST')) {
$slug = str_slug($request->get('slug'));
$stores = Store::where('id', '!=', store()->id)->where('slug', $slug)->get();
return pong(1, ['data' => ['stores' => ['count' => $stores->count(), 'message' => _t('store_slug_unique')]]]);
}
}
示例11: copy_slice
function copy_slice($source, $dest)
{
global $SLICE_LEN;
$i = 0;
while ($i < $SLICE_LEN) {
store(fetch($source, $i), $dest, $i);
$i += 1;
}
}
示例12: ajaxChangeCover
public function ajaxChangeCover(Request $request)
{
if ($request->isMethod('POST') && user()->has_store) {
$rules = $this->_getCoverRules();
$messages = $this->_getCoverMessages();
$validator = Validator::make($request->all(), $rules, $messages);
if ($validator->fails()) {
return file_pong(['status' => _const('AJAX_ERROR'), 'messages' => $validator->errors()->first()], 403);
}
/**
* 1. Get file, path and info
* 2. Generate file name
* 3. Upload
* 4. Resize
* 5. Delete old cover images and upload image
* 6. Save new info
*/
try {
// 1
$store = store();
$coverPath = config('front.cover_path');
$file = $request->file('__file');
// 2
$filename = new FileName($coverPath, $file->getClientOriginalExtension());
$filename->cover()->generate();
$filename->setPrefix(_const('COVER_PREFIX'));
$filename->cover()->group($this->_getCoverGroup(), true);
// 3
$upload = new Upload($file);
$upload->setDirectory($coverPath)->setName($filename->getName())->move();
// 4
$image = new Image($coverPath . $upload->getName());
$image->setDirectory($coverPath)->resizeGroup($filename->getGroup());
// 5
delete_file([$coverPath . $upload->getName(), $coverPath . $store->cover_original, $coverPath . $store->cover_big, $coverPath . $store->cover_medium, $coverPath . $store->cover_small]);
// 5
$resizes = $image->getResizes();
$store->cover_original = $resizes['original'];
$store->cover_big = $resizes['big'];
$store->cover_medium = $resizes['medium'];
$store->cover_small = $resizes['small'];
$store->update();
} catch (Exception $ex) {
$validator->errors()->add('__file', _t('opp'));
return file_pong(['status' => _const('AJAX_OK'), 'messages' => $validator->errors()->first()], 500);
}
return file_pong(['status' => _const('AJAX_OK'), 'messages' => _t('saved_info'), 'data' => ['big' => asset($coverPath . $resizes['big']), 'medium' => asset($coverPath . $resizes['medium']), 'small' => asset($coverPath . $resizes['small'])]]);
}
}
示例13: lstore
function lstore($data, $csum, $language, $fallbackLanguage = 0)
{
//Store a localizable string.
$db = new FractureDB('futuqiur_ember');
$csumn = new Csum($data);
if (!$csum->matches($csumn)) {
return null;
}
$store = store($data, $csum);
$sid = $store['id'];
//deduplicate rows here...
$test = ltest($language, $sid);
if (is_null($test)) {
$id = $db->addRow('localized', 'language, data', '\'' . $language . '\', \'' . $sid . '\'');
$store['id'] = $id;
return $store;
}
$store['id'] = $test;
return $store;
}
示例14: save
function save()
{
inlog('Saving snippet file');
cache_clear();
global $config, $snippets;
$snippets['tag_list'] = list_tags();
$snippets['tag_private_list'] = list_tags(false);
if (!store($config['data_file'], $snippets)) {
return alert('Error');
} else {
return success('saved');
}
}
示例15: template
$filelist .= template($mode . '_image_item', $array);
} elseif ($extension == 'zip') {
# Item is a zip file=> add change to folder
$icone_visu = '<a class="tofolder" href="admin.php?unzip=' . $id . '&token=' . returnToken() . '" title="' . e('Convert this zip file to folder', false) . '"> </a>';
$array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
$filelist .= template($mode . '_file_item', $array);
} else {
# all other types
$array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
$filelist .= template($mode . '_file_item', $array);
}
}
}
echo $folderlist . $filelist;
if ($save) {
store();
}
// save in case of new files
} else {
e('No file on the server');
}
?>
<script>
function put_file(fichier){
document.getElementById('filename').value=fichier;
document.getElementById('filename_hidden').value=fichier;
}
function put_id(id){document.getElementById('ID_hidden').value=id;}
function put_link(id){document.getElementById('link').value="<?php