Fontis Notes

2017-10-05  本文已影响0人  easyFroce

Jargon

常用部署工具

PHP

<?php
$myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!");

echo fread($myfile,filesize("webdictionary.txt"));

while(!feof($myfile)) {
  echo fgets($myfile) . "<br>";
  echo fgetc($myfile);
}

fclose($myfile);

// Upload file
if (file_exists("upload/" . $_FILES["file"]["name"])) {
  echo $_FILES["file"]["name"] . " already exists. ";
} else {
  move_uploaded_file($_FILES["file"]["tmp_name"],
  "upload/" . $_FILES["file"]["name"]);
  echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}

?>
// setcookie(name, value, expire, path, domain);

setcookie("user", "Alex Porter", time()+3600);
// Print a cookie
echo $_COOKIE["user"];

// A way to view all cookies
print_r($_COOKIE);

if (isset($_COOKIE["user"]))
  echo "Welcome " . $_COOKIE["user"] . "!<br />";

// Delete cookie
// set the expiration date to one hour ago
setcookie("user", "", time()-3600);

<?php
session_start();
// store session data
$_SESSION['views']=1;

if(isset($_SESSION['views']))
  $_SESSION['views']=$_SESSION['views']+1;

unset($_SESSION['views']);

session_destroy();

Build Management Tool

Phing

Phing is a project build system based on Apache ant.

Grunt (Gulp, Webpack)

Automation tool. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes.

JavaScript

ES6

上一篇 下一篇

猜你喜欢

热点阅读