This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (empty($_FILES) || $_FILES['file']['error']) { | |
die('{"OK": 0, "info": "Failed to move uploaded file."}'); | |
} | |
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0; | |
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0; | |
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : $_FILES["file"]["name"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Plupload - Getting Started: Chunking</title> | |
<script type="text/javascript" src="js/plupload.full.min.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Plupload - Getting Started</title> | |
<script type="text/javascript" src="js/plupload.full.min.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install -y --force-yes apache2 | |
sudo a2enmod actions | |
sudo a2enmod rewrite | |
echo "export PATH=/home/vagrant/.phpenv/bin:$PATH" | sudo tee -a /etc/apache2/envvars > /dev/null | |
echo "$(cat scripts/travis/assets/phpconfig.txt)" | sudo tee /etc/apache2/conf.d/phpconfig > /dev/null | |
echo "$(cat scripts/travis/assets/vhost.txt)" | sed -e "s,PATH,`pwd`/web,g" | sudo tee /etc/apache2/sites-available/default > /dev/null | |
echo "date.timezone = UTC" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` | |
sudo service apache2 restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
php: | |
- 5.3 | |
- 5.4 | |
before_script: | |
- sudo apt-get install apache2 | |
- sudo a2enmod actions | |
- sudo a2enmod rewrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
php: | |
- 5.3 | |
- 5.4 | |
before_script: | |
- sudo apt-get install apache2 | |
- sudo a2enmod actions | |
- sudo a2enmod rewrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
php: | |
- 5.3 | |
- 5.4 | |
before_script: | |
- sudo apt-get install apache2 | |
- sudo a2enmod actions | |
- sudo a2enmod rewrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hex_darker($hex, $factor = 30) | |
{ | |
$new_hex = ''; | |
$base['R'] = hexdec($hex{0}.$hex{1}); | |
$base['G'] = hexdec($hex{2}.$hex{3}); | |
$base['B'] = hexdec($hex{4}.$hex{5}); | |
foreach ($base as $k => $v) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function truncate($text, $length, $more = '...') | |
{ | |
$text = strip_shortcodes( $text ); | |
//$text = apply_filters('the_content', $text); | |
$text = str_replace(']]>', ']]>', $text); | |
$text = strip_tags($text); | |
$words = explode(' ', $text, $length + 1); | |
if (count($words) > $length) { | |
array_pop($words); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ignore specific path (/administrator/ - in this case) | |
RewriteCond %{REQUEST_URI} ^/?administrator($|\/|\/.*) [NC] | |
RewriteRule ^.*$ - [NC,L] | |
# redirect non-www to www | |
RewriteCond %{HTTP_HOST} ^yoursite\.com [NC] | |
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L] |