Introduce full compatibility with PHP 7.0, including the already-in-use Phalcon 3.0.

This commit is contained in:
Buster Silver 2016-09-09 00:07:40 -05:00
parent ade03d316b
commit 0ed275f62d
7 changed files with 82 additions and 87 deletions

View File

@ -184,7 +184,10 @@ class InfluxDb
throw new \Exception($message, $statusCode);
} else if ($statusCode == self::STATUS_CODE_OK) {
try {
return $response->json();
if (!empty((string)$response->getBody()))
return $response->json();
else
return array();
} catch (ParseException $ex) {
throw new \Exception(
sprintf("%s; Response is '%s'", $ex->getMessage(), (string)$response->getBody()),

View File

@ -2,7 +2,6 @@
namespace Entity;
use \Doctrine\Common\Collections\ArrayCollection;
use \GetId3\GetId3Core as GetId3;
/**
* @Table(name="station_media", indexes={
@ -114,12 +113,13 @@ class StationMedia extends \App\Doctrine\Entity
if ($media_mtime >= $this->mtime)
{
// Load metadata from MP3 file.
$id3 = new GetId3();
$id3 = new \getID3();
$file_info = $id3->setOptionMD5Data(true)
->setOptionMD5DataSource(true)
->setEncoding('UTF-8')
->analyze($media_path);
$id3->option_md5_data = true;
$id3->option_md5_data_source = true;
$id3->encoding = 'UTF-8';
$file_info = $id3->analyze($media_path);
if (isset($file_info['error']))
\App\Debug::log('Error processing file: '.$file_info['error']);

View File

@ -204,7 +204,8 @@ header("Content-type: text/html; charset=utf-8");
</section>
<footer id="footer">
Powered by <a href="https://github.com/SlvrEagle23/AzuraCast" target="_blank"><?=$this->config->application->name ?></a> <?=\App\Version::getVersionText() ?>.
Powered by <a href="https://github.com/SlvrEagle23/AzuraCast" target="_blank"><?=$this->config->application->name ?></a> <?=\App\Version::getVersionText() ?>.<br>
PHP <?=\PHP_VERSION ?>, Phalcon <?=phpversion('phalcon') ?>.
</footer>
<!-- Page Loader -->
@ -229,7 +230,7 @@ $this->assets->outputJs('footer_js');
<script type="text/javascript">
$(function() {
<? foreach($this->flash->getMessages() as $message): ?>
notify('<?=$this->escaper->escapeJs(str_replace(array("\n", "\r"), array('<br>', ''), $message['text'])) ?>', '<?=$message['color'] ?>');
notify("<?=str_replace(array('"', "\n"), array('\'', '<br>'), $message['text']) ?>", '<?=$message['color'] ?>');
<? endforeach; ?>
});
</script>

View File

@ -19,7 +19,7 @@
"aws/aws-sdk-php": "3.*",
"phpoffice/phpexcel": "1.8.0",
"ise/php-soundcloud": "dev-master",
"phansys/getid3": "~2.1@dev"
"james-heinrich/getid3": "~1.9"
},
"require-dev": {
"phalcon/devtools": "~3@dev"

108
composer.lock generated
View File

@ -4,21 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "fca2e10d1f6100695c06bddcbea07298",
"content-hash": "b6b73096c6732da2bc257b77718c959d",
"hash": "98a3c4a314b9a11c3898bb5ac6964571",
"content-hash": "7b197beedcc0e08d1b0420a743d4de84",
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.19.4",
"version": "3.19.6",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "f67bc37fa4b76d85423052eae2a9577aab99adc1"
"reference": "34060bf0db260031697b17dbb37fa1bbec92f1c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f67bc37fa4b76d85423052eae2a9577aab99adc1",
"reference": "f67bc37fa4b76d85423052eae2a9577aab99adc1",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/34060bf0db260031697b17dbb37fa1bbec92f1c4",
"reference": "34060bf0db260031697b17dbb37fa1bbec92f1c4",
"shasum": ""
},
"require": {
@ -85,7 +85,7 @@
"s3",
"sdk"
],
"time": "2016-09-01 21:37:32"
"time": "2016-09-08 20:27:15"
},
{
"name": "container-interop/container-interop",
@ -1108,6 +1108,42 @@
],
"time": "2016-03-26 04:30:24"
},
{
"name": "james-heinrich/getid3",
"version": "v1.9.12",
"source": {
"type": "git",
"url": "https://github.com/JamesHeinrich/getID3.git",
"reference": "41c05612d532d30f07680cad3a4a6efbec7fc7f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/JamesHeinrich/getID3/zipball/41c05612d532d30f07680cad3a4a6efbec7fc7f5",
"reference": "41c05612d532d30f07680cad3a4a6efbec7fc7f5",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"getid3/getid3.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL"
],
"description": "PHP script that extracts useful information from popular multimedia file formats",
"homepage": "http://www.getid3.org/",
"keywords": [
"codecs",
"php",
"tags"
],
"time": "2016-03-02 13:13:30"
},
{
"name": "mtdowling/jmespath.php",
"version": "2.3.0",
@ -1278,53 +1314,6 @@
"homepage": "https://nette.org",
"time": "2016-06-17 13:28:41"
},
{
"name": "phansys/getid3",
"version": "2.1.x-dev",
"source": {
"type": "git",
"url": "https://github.com/phansys/GetId3.git",
"reference": "6d3f04b2781bb3d545fabfc4d1636c9bf5ac03f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phansys/GetId3/zipball/6d3f04b2781bb3d545fabfc4d1636c9bf5ac03f9",
"reference": "6d3f04b2781bb3d545fabfc4d1636c9bf5ac03f9",
"shasum": ""
},
"require": {
"php": "~5.3"
},
"suggest": {
"ext-exif": "EXIF extension is required for graphic modules.",
"ext-rar": "RAR extension is required for RAR archive module."
},
"type": "library",
"autoload": {
"psr-4": {
"GetId3\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL"
],
"authors": [
{
"name": "James Heinrich",
"email": "info@getid3.org",
"homepage": "http://www.getid3.org"
}
],
"description": "This fork of GetId3 library updates to PSR-2 / PSR-4 CS, adds namespaces and makes it installable by composer.",
"homepage": "http://www.getid3.org",
"keywords": [
"getid3",
"metadata",
"tags"
],
"time": "2015-06-28 12:06:17"
},
{
"name": "phpoffice/phpexcel",
"version": "1.8.0",
@ -1524,16 +1513,16 @@
},
{
"name": "symfony/console",
"version": "v2.8.9",
"version": "v2.8.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "36e62335caca8a6e909c5c5bac4a8128149911c9"
"reference": "3d3e4fa5f0614c8e45220e5de80332322e33bd90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/36e62335caca8a6e909c5c5bac4a8128149911c9",
"reference": "36e62335caca8a6e909c5c5bac4a8128149911c9",
"url": "https://api.github.com/repos/symfony/console/zipball/3d3e4fa5f0614c8e45220e5de80332322e33bd90",
"reference": "3d3e4fa5f0614c8e45220e5de80332322e33bd90",
"shasum": ""
},
"require": {
@ -1580,7 +1569,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2016-07-30 07:20:35"
"time": "2016-09-06 10:55:00"
},
{
"name": "symfony/polyfill-mbstring",
@ -2304,7 +2293,6 @@
"stability-flags": {
"google/apiclient": 10,
"ise/php-soundcloud": 20,
"phansys/getid3": 20,
"phalcon/devtools": 20
},
"prefer-stable": false,

View File

@ -1,3 +1,3 @@
---
- name: restart php5-fpm
service: name=php5-fpm enabled=yes state=restarted
- name: restart php-fpm
service: name=php7.0-fpm enabled=yes state=restarted

View File

@ -1,11 +1,13 @@
---
- name: Add PHP PPA repository
become: true
apt_repository: repo=ppa:ondrej/php5
apt_repository: repo=ppa:ondrej/php
- name: Add Phalcon PPA repository
become: true
apt_repository: repo=ppa:phalcon/stable
shell: curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh | sudo bash
args:
warn: no
- name: Update apt again
become: true
@ -15,20 +17,21 @@
become: true
apt: package="{{ item }}" state=latest
with_items:
- php5-fpm
- php5-cli
- php5-gd
- php5-mysqlnd
- php5-curl
- php5-phalcon
- php7.0-fpm
- php7.0-cli
- php7.0-gd
- php7.0-mysqlnd
- php7.0-curl
- php7.0-xml
- php7.0-phalcon
- name: Configure PHP FPM Pool
template: src=fpmpool.j2 dest=/etc/php5/fpm/pool.d/www.conf force=true
notify: restart php5-fpm
template: src=fpmpool.j2 dest=/etc/php/7.0/fpm/pool.d/www.conf force=true
notify: restart php-fpm
- name: Configure php5-fpm php.ini
- name: Configure php-fpm php.ini
ini_file:
dest: /etc/php5/fpm/php.ini
dest: /etc/php/7.0/fpm/php.ini
section: PHP
option: "{{ item.option }}"
value: "{{ item.value }}"
@ -36,11 +39,11 @@
- { option: 'post_max_size', value: "50M" }
- { option: 'short_open_tag', value: "On" }
- { option: 'upload_max_filesize', value: "25M" }
notify: restart php5-fpm
notify: restart php-fpm
- name: Configure php5-cli php.ini
- name: Configure php-cli php.ini
ini_file:
dest: /etc/php5/cli/php.ini
dest: /etc/php/7.0/cli/php.ini
section: PHP
option: "{{ item.option }}"
value: "{{ item.value }}"