ブラウザの入力欄に以下を打ち込む
data:text/html, <html contenteditable>
なるほどー意外と簡単
随机应变 ABCD: Always Be Coding and … : хороший
ブラウザの入力欄に以下を打ち込む
data:text/html, <html contenteditable>
なるほどー意外と簡単
To change the user running Apache, you need to change the user specification in httpd.conf. If nothing is specified, the daemon user is specified.
[vagrant@localhost ~]$ ps aux | grep http
root 2040 0.0 2.4 384472 12512 ? Ss 11:44 0: 02 /usr/sbin/httpd
jenkins 2083 0.5 56.8 2273640 285232 ? Ssl 11:45 2: 54 /etc/alternatives/java -Dcom.sun.akuma.Daemon=daemonized -D java.awt.headless=true -DJENKINS_HOME=/var/lib/jenkins -jar /u sr/lib/jenkins/jenkins.war –logfile=/var/log/jenkins/jenkins. log –webroot=/var/cache/jenkins/war –daemon –httpPort=8080 –debug=5 –handlerCountMax=100 –handlerCountMaxIdle=20
apache 2488 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2489 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2490 0.0 2.0 386112 10300 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2491 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2492 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2493 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2494 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
apache 2495 0.0 2.0 386112 10280 ? S 12:23 0: 00 /usr/sbin/httpd
vagrant 4449 0.0 0.1 103320 872 pts/0 D+ 20:52 0: 00 grep http
うーん、apacheって書いてあるように見える。。
[vagrant@localhost ~]$ id apache
uid=48(apache) gid=48(apache) 所属グループ=48(apache)
<?php use Illuminate\Support\Facades\Schema\; use Illuminate\Database\Schema\Blueprint\; use Innuminate\Database\Migrations\Migration; class AddColumnSalesHogeTable extends Migration{ public function up(){ Schema::table('books', function(Blueprint $table){ $table->integer('sales')->default(0)->index('index_sales')->after('price')->comment('販売数'); }); } public function down() { Schema::table('books', function(Blueprint $table){ $table->dropColumn('sales'); }); } }
CHARACTER_OCTET_LENGTH must be the same as CHARACTER_MAXIMUM_LENGTH except for multibyte character set.
mysql> select * from `information_schema`.`columns` where `table_schema` = “test”;
+—————+————–+————+————-+——————+—————-+————-+———–+————————–+————————+——————-+—————+——————–+——————–+—————–+————–+————+—————-+———————————+—————-+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT | IS_NULLABLE | DATA_TYPE | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH | NUMERIC_PRECISION | NUMERIC_SCALE | DATETIME_PRECISION | CHARACTER_SET_NAME | COLLATION_NAME | COLUMN_TYPE | COLUMN_KEY | EXTRA | PRIVILEGES | COLUMN_COMMENT |
+—————+————–+————+————-+——————+—————-+————-+———–+————————–+————————+——————-+—————+——————–+——————–+—————–+————–+————+—————-+———————————+—————-+
| def | test | items | item_id | 1 | NULL | NO | int | NULL | NULL | 10 | 0 | NULL | NULL | NULL | int(11) | PRI | auto_increment | select,insert,update,references | |
| def | test | items | name | 2 | NULL | YES | text | 65535 | 65535 | NULL | NULL | NULL | utf8 | utf8_general_ci | text | | | select,insert,update,references | |
| def | test | items | price | 3 | NULL | YES | int | NULL | NULL | 10 | 0 | NULL | NULL | NULL | int(11) | | | select,insert,update,references | |
| def | test | name | name | 1 | NULL | YES | varchar | 255 | 765 | NULL | NULL | NULL | utf8 | utf8_general_ci | varchar(255) | | | select,insert,update,references | |
| def | test | name | password | 2 | NULL | YES | varchar | 255 | 765 | NULL | NULL | NULL | utf8 | utf8_general_ci | varchar(255) | | | select,insert,update,references | |
| def | test | news | id | 1 | NULL | NO | int | NULL | NULL | 10 | 0 | NULL | NULL | NULL | int(11) | PRI | auto_increment | select,insert,update,references | |
| def | test | news | content | 2 | NULL | YES | varchar | 100 | 300 | NULL | NULL | NULL | utf8 | utf8_general_ci | varchar(100) | | | select,insert,update,references | |
| def | test | user | id | 1 | NULL | NO | int | NULL | NULL | 10 | 0 | NULL | NULL | NULL | int(11) | MUL | auto_increment | select,insert,update,references | |
| def | test | user | name | 2 | NULL | YES | varchar | 20 | 60 | NULL | NULL | NULL | utf8 | utf8_general_ci | varchar(20) | | | select,insert,update,references | |
+—————+————–+————+————-+——————+—————-+————-+———–+————————–+————————+——————-+—————+——————–+——————–+—————–+————–+————+—————-+———————————+—————-+
9 rows in set (0.15 sec)
なんじゃーこりゃーーー
Even after restarting Apache, sometimes has internal chaches that don’t reflect the updated program.
php artisan cache: clear php artisan config: clear php artisan route: clear php artisan view clear
If you want to do autoloading and re-optimize, you want to recreate the cache entirely.
composer dump-autoload php artisan clear-compiled php artisan optimize php artisan config:cache
When recreating a new key and completely invalidate the previous cache.
php artisan key:generate
set_time_limit(0); $zip_name = 'create_zip_'.date('Ymd').'.zip'; $zip_tmp_dir = dirname(__FILE__).'/tmp_zip/'; $zip_obj = new ZipArchive(); $result = $zip_obj -> open($zip_tmp_dir.$zip_name, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE); if(!$result){ echo 'error code : '.$result; exit(); } $files[] = [ 'zip_path' => 'building.jpg', 'file_path' => dirname(__FILE__)."/".'building.jpg' ]; foreach ($files as $file) { //ファイルを追加する場合 $zip_obj -> addFile($file['file_path'], $file['zip_path']); } $zip_obj -> addFromString('test.txt', 'test'); $zip_obj -> close(); header('Content-Type: application/force-download;'); header('Content-Length: '.filesize($zip_tmp_dir.$zip_name)); header('Content-Disposition: attachment; filename="'.$zip_name.'"'); readfile($zip_tmp_dir.$zip_name);
$files[] = [ 'zip_path' => ['building.jpg', 'monkey.jpg'], 'file_path' => ['building.jpg', 'monkey.jpg'] ]; foreach ($files as $file) { //ファイルを追加する場合 $zip_obj -> addFile( dirname(__FILE__)."/".$file['file_path'], $file['zip_path']); }
[Sun Apr 7 16:33:50 2019] PHP Notice: Undefined index: /home/vagrant/local/app/test/file_path in /home/vagrant/local/app/test/index.php on line 24
[Sun Apr 7 16:33:50 2019] PHP Warning: ZipArchive::addFile() expects parameter 2 to be string, array given in /home/vagrant/local/app/test/index.php on line 24
うん、まー要するに配列で渡せば、zipで複数ダウンロードできるってわけね。
チェックボックスなら、POSTで対象ファイルを渡せばOK
Check if PHP has Zip extension
[vagrant@localhost test]$ php -m [PHP Modules] bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv intl json libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar readline Reflection session SimpleXML sockets SPL sqlite3 standard tokenizer wddx xml xmlreader xmlwriter xsl zip zlib
うん、ありますね。
$file_name = "building.jpg"; $file_path = dirname(__FILE__)."/".$file_name; $download_file_name = "building.jpg"; header('Content-Type: application/force-download;'); header('Content-Length: '.filesize($file_path)); header('Content-Disposition: attachment; filename="'.$file_name.'"'); readfile($download_file_name);
特に問題なし
うーん、複数のファイルをDLしたいです。
Config::Simple – 簡単な設定ファイルクラス
use Config::Simple;
Config::Simple->import_from(‘app.ini’, \%Config);
$cfg = new Config::Simple(‘app.ini’);
$user = $cfg->param(‘User’);
%Config = $cfg->vars();
$cfg->param(‘User’, ‘sherzodR’);
$cfg->param(‘Users’, [‘sherzodR’, ‘geek’, ‘merlyn’]);
$cfg->param(-block=>’last-access’, -value=>{‘time’=>time()});
$mysql = $cfg->param(-block=>’mysql’);
$cfg->save();
Perl has three basic data types: scalars, scalar arrays, and scalar associative arrays. In this context, scalar data refers to simple data such as numbers and strings. Also, as an essential element of programming, there is the concept of variables. Variables are “value containers” that are used to temporarily store various values.
In Perl, there are three variables, scalar variable, array, and associative array respectively, in the form corresponding to each data type, and the scalar variable is the most basic one among them, and stores numerical value and character string can do.
Scalar variable names can start with $ (dollar) + one alphabetic character, and can use numbers, alphabetic characters and underscores thereafter. Also, because it is cause sensitive, $ a and $ A, for example, are treated as different things.
OK
$abc123
$abc_123
NG
$123abc
$abc-123