bitstadium / HockeyKit

HockeyApp was retired and the SDKs are deprecated. Please use App Center instead.

Home Page:http://appcenter.ms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bizarre PHP error in logger.php

haggisman opened this issue · comments

Hi folks

I received this gem after installing the HockeyKit 2.0 server on my MacBook Pro - when calling localhost/AppsBase/Public/index.php ........

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting '{' in /Library/WebServer/Documents/AppsBase/includes/logger.php on line 6 /* which points to the "Class Logger" line */

Apparently this is a known issue and relates to 'double colons' and is related to a bug in Zend

Has anyone seen this, and knows of a workaround? I'm running HockeyKit 2.0 (downloaded this morning from github) on a MacBook Pro OSX Lion 10.7.2

  1. PHP
    Steve-Howies-MacBook-Pro:includes Scotty$ php -v
    PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep 8 2011 19:34:00)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

This is the builtin PHP interpreter NOT the MacPorts one.

  1. APACHE
    Steve-Howies-MacBook-Pro:sbin Scotty$ ./httpd -v
    Server version: Apache/2.2.20 (Unix)
    Server built: Sep 8 2011 18:13:15

Suggestions?

Thanks,

Steve

Hi Steve,

this works for me jus fine. How exactly did you download HockeyKit? I just cloned the github repository (Branch develop) and all is ok. Could you please check the file server/php/includes/logger.php, is should look like this: https://github.com/TheRealKerni/HockeyKit/blob/develop/server/php/includes/logger.php

The error message says that there is a double colon after the class declaration like class Logger::, which should not be there. The error itself is not a bug in php but an error message from the php parser.

Hi Soryu

I clicked on the download button for the .zip package ... I'll try cloning the branch instead since my logger.php is identical.

thanks !

Steve

oops sorry accidently closed it

Thanks Soryu,

I cloned the branch and the funny message has vanished.

However, I uploaded the .ipa archive and plist files and am still encountering an issue. The information about the app shows the approximate size, but blank field for the version number. When I click on the 'Install Application' link, it just says ' Cannot connect to '.

I did notice in 'router.php' a number of mentions made for '/apps/' and /api/ in the route table information. Is there something hard-coded in the directory naming conventions which might be messing it up?

The log for Hockey is full of these message clumps which are repeating each time the download is attempted:

[ ... ]

Router (Router)::init :: 92 /
Router (Router)::routeV1 :: 271 arg bundleidentifier not set
Router (Router)::routeV1 :: 272 arg type not set
AppUpdater (AppUpdater)::getApplicationVersions :: 296 arg lang not set
AppUpdater (AppUpdater)::getApplicationVersions :: 296 arg lang not set
AppUpdater (AppUpdater)::getApplicationVersions :: 296 arg lang not set
AppUpdater (AppUpdater)::getApplicationVersions :: 296 arg lang not set


Here is content of my .plist file:

CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles Icon.png CFBundleIcons CFBundlePrimaryIcon CFBundleIconFiles Icon.png UIPrerenderedIcon CFBundleIdentifier ca.puddockplace.vctest CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight

Just to verify, I installed the .ipa archive and the manifest files in a folder called [$Server-docroot]/Hockey/public/ca.puddockplace.vctest. I'm only testing with one version of the app.

where 'ca.puddockplace.vctest is my bundle-identifier.

I point the browser from my iphone to http://www.puddockplace.ca/Hockey/public and when the download attempt fails, it says 'cannot connect to www.puddockplace.ca'

Anyone have any insight?

Thanks,

Steve

I am using HockeyKit with xampp on windows (XP) and the case with that setup is:

PHP Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\hockeykit\server\php\includes\platforms\ios.php on line 34

(look at your logs for php and apache)

The quick fix for me was to change the line 34 in ios.php from:

$dir = array_shift(array_keys($files[self::VERSIONS_SPECIFIC_DATA]));

to:

$tmp = array_keys($files[self::VERSIONS_SPECIFIC_DATA]);
$dir = array_shift($tmp);

I had the same problem as @radekskowron and solved it in the same way, please change this in future versions to enable compatibility with newer PHP systems. Thanks.

Pull requests are always welcome.

I am also getting a could not connect error when trying to install a sample application. The URL that is being sent back looks like this:
itms-services://?action=download-manifest&url=http%3A%2F%2Fsvn.int.dahbura.com%2Fappstore%2Fapi%2F2%2Fapps%2Fcom.dahbura.AddrNameFixer%3Fformat%3Dplist

I am not sure what api/apps is as there is nothing underneath the appstore directory except the files installed under server/php/ in the zip distro which included blueprint directory, config.php, css directory, feed.php, index.php, etc...

The plist file has been marked up with the URL parameter as well. Any help or reference to fix this would be appreciated-I am not a PHP whiz!

I did apply the changes to line 34 in the ios.php as recommended....

Thanks,
Tony

@tdahbura You probably did not setup the rewrite rules. The URL looks perfectly fine. Please check the documentation on how to do that.

commented

@radekskowron solution of changing the line 34 to the below fixed the issue for me. I was constantly getting Cannot connect to "<<MY_SERVER>>" even after .htaccess rewrite rules were properly defined.
$tmp = array_keys($files[self::VERSIONS_SPECIFIC_DATA]);
$dir = array_shift($tmp);

Thanks @radekskowron