This article is inspired by Brad Cypert's blog post: http://www.bradcypert.com/building-a-simple-api-in-php-using-lumen/.
Why should we build a API with Vanilla PHP? Because you can, and it makes fun.
- Create a directory /src
<?php | |
/** | |
* Simple MySQLi Class 0.3 | |
* | |
* @author JReam | |
* @license GNU General Public License 3 (http://www.gnu.org/licenses/) | |
* | |
* This program is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License as published by the | |
* Free Software Foundation; either version 3 of the License, or |
<?php | |
// @source: http://www.paulund.co.uk/resize-image-class-php | |
/** | |
* Resize image class will allow you to resize an image | |
* | |
* Can resize to exact size | |
* Max width size while keep aspect ratio | |
* Max height size while keep aspect ratio | |
* Automatic while keep aspect ratio |
<?php | |
file_put_contents( 'progress.txt', '' ); | |
$targetFile = fopen( 'testfile.iso', 'w' ); | |
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt( $ch, CURLOPT_NOPROGRESS, false ); | |
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' ); | |
curl_setopt( $ch, CURLOPT_FILE, $targetFile ); |
<?php | |
// String obtida | |
$macAddress = '10.19.60.72 --- 0x3 Endereço IP Endereço físico Tipo 10.19.63.117 70-85-c2-f6-28-f8 dinâmico'; | |
// Expressão regular pra extrair o MAC ADDRESS | |
preg_match_all('/[a-fA-F0-9-]{17}|[a-fA-F0-9]{12}$/', $macAddress, $mac); | |
// Printa o resultado | |
print_r($mac); |
This article is inspired by Brad Cypert's blog post: http://www.bradcypert.com/building-a-simple-api-in-php-using-lumen/.
Why should we build a API with Vanilla PHP? Because you can, and it makes fun.
Fique atento ao uso correto do prefixo da tabela do wordpress.
No caso deste exemplo, foi usado o prefixo wp_
UPDATE wp_options SET option_value = replace(option_value, 'antigaurl', 'novaurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'antigaurl','novaurl');
UPDATE wp_posts SET post_content = replace(post_content, 'antigaurl', 'novaurl');
cd /usr/local/vesta/ssl
mv certificate.crt certificate.crt_old
mv certificate.key certificate.key_old
cp /home/admin/conf/web/ssl.[Domain].crt /usr/local/vesta/ssl/certificate.crt
cp /home/admin/conf/web/ssl.[Domain].key /usr/local/vesta/ssl/certificate.key
v-add-letsencrypt-domain USER DOMAIN [ALIASES] [RESTART]
v-add-letsencrypt-user USER [EMAIL]
v-check-letsencrypt-domain USER DOMAIN
v-list-letsencrypt-user USER [FORMAT]
v-sign-letsencrypt-csr USER DOMAIN CSR_DIR [FORMAT]
v-update-letsencrypt-ssl
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
Os nomes das tabelas e colunas devem estar minúsculas e as palavras devem ser separadas por underscore, seguindo o padrão snake case. E todos os termos devem estar em inglês, exceto alguns termos que não há tradução apropriada para o inglês. Sempre prefira nomes descritivos, evitando ao máximo contrações.
Os nomes das tabelas devem estar no plural.