confirm/PhpZabbixApi

Composer issues and class not found

gboddin opened this issue · 8 comments

I cannot get this library to work, steps to reproduce :

  • create a new project dir
  • run composer require 'confirm-it-solutions/php-zabbix-api:2.4.2'
  • create test.php with the following content :
<?php
require 'vendor/autoload.php';
use ZabbixApi\ZabbixApi;
$test = new ZabbixApi();

or

<?php
require 'vendor/autoload.php';
$test = new \ZabbixApi\ZabbixApi();

Result is :

PHP Fatal error:  Class 'ZabbixApi\ZabbixApi' not found in /home/boddigr/Projects/new/index.php on line 4
PHP Stack trace:
PHP   1. {main}() /home/boddigr/Projects/new/index.php:0

php & composer info :

PHP 5.6.12-1 (cli) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

Composer version 1.0-dev (afd98b74f13b9def1b2447f16fd0bfd4d96dff94) 2015-08-31 09:58:50

should be working with the latest 2.2 and 2.4 dev branches...
@DavidBadura @gboddin can you test it and give me a feedback? I no longer use the API myself... ;)

Tested on 2.2 dev and it is working correctly now.

Thanks for the fix ! :)

Hi all !
I want to use it in my symfony project, but i have the same problem.
Tested with dev, 2.4.2 and 2.2.2.
Unable to find namespace.

Any ideas ?
Thanks.

Rectification !
It works with 2.4.x-dev.
Maybe for next version ?

@domibarton Can I suggest using a 2.4.2.1 tag ?

That way, using "^2.4.2" in your composer.json would still make sure you're running against the version of Zabbix you're working with and still get updates and bug fixes.

Then we can close the issue I think :)

Hi there.

I created new tags / releases:

  • v2.2.3
  • v2.4.3

@gboddin I think we shouldn't change the tag version numbers and I don't think we should (re)move existing tags to keep up to date. If you want to stay on the latest 2.4 changes you should use the 2.4 branch instead of tags. IMHO that's the "nature of git" ;)

However we can think about a proper git (work)flow with proper release branches etc.

Cheers
Domi