Problem require steam condenser with composer

121 views
Skip to first unread message

CenT

unread,
Jun 5, 2017, 10:17:51 AM6/5/17
to Steam Condenser


Hello, I have to install steam condenser via "composer" but impossible to make it work ...

Composer version : 1.4.2, PHP Version : 7.
1.5
composer.json :


{
"require": {
"twig/twig": "~1.0",
"silex/silex": "~2.0",
"koraktor/steam-condenser": "^1.3"
},
"autoload": {
"classmap":["app/src/class/"]
}
}

index.php (test) :
$server = new SourceServer('79.137.59.184', '27020');
var_dump($server);

Error php :

Fatal error: Uncaught Error: Class 'SourceServer' not found in /var/www/clients/client0/web5/web/index.php:5 Stack trace: #0 {main} thrown in /var/www/clients/client0/web5/web/index.php on line 5


Is there anything else to do to include it ?

Sebastian Staudt

unread,
Jun 5, 2017, 11:05:46 AM6/5/17
to Steam Condenser
Hi.

Did you add this line?

require 'vendor/autoload.php';

Best regards
Sebastian
--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/12ef253f-0a50-4fe4-9185-a84f2bb3dd5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CenT

unread,
Jun 5, 2017, 11:14:31 AM6/5/17
to Steam Condenser
Yes,

I use silex and twig via composer and works.

Sebastian Staudt

unread,
Jun 5, 2017, 11:29:43 AM6/5/17
to Steam Condenser
Can you provide the content of your autoload.php?

CenT

unread,
Jun 5, 2017, 11:40:05 AM6/5/17
to Steam Condenser
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit1df5846ba2c663164f838db377d1bbb7::getLoader();

CenT

unread,
Jun 5, 2017, 11:54:04 AM6/5/17
to Steam Condenser
I tested with the archive source and it works :

http://koraktor.de/steam-condenser/install/

There is a problem with the install package with composer

Sebastian Staudt

unread,
Jun 5, 2017, 11:55:30 AM6/5/17
to Steam Condenser
Hmm ok.

And autoload_real.php?

CenT

unread,
Jun 5, 2017, 11:56:14 AM6/5/17
to Steam Condenser
<?php

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit7d859d6cd446bc7ff12ba5e32c56d918
{
private static $loader;

public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}

public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit7d859d6cd446bc7ff12ba5e32c56d918', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7d859d6cd446bc7ff12ba5e32c56d918', 'loadClassLoader'));

$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
set_include_path(implode(PATH_SEPARATOR, $includePaths));

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';

call_user_func(\Composer\Autoload\ComposerStaticInit7d859d6cd446bc7ff12ba5e32c56d918::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}

$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}

$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}

$loader->register(true);

return $loader;
}
}

Sebastian Staudt

unread,
Jun 5, 2017, 12:18:13 PM6/5/17
to Steam Condenser
Uhm sorry, include_paths.php should have the relevant code.

CenT

unread,
Jun 5, 2017, 2:26:40 PM6/5/17
to Steam Condenser

Sorry for the wait, I had to be absent, here is include_path:


<?php

// include_paths.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
$vendorDir . '/koraktor/steam-condenser/lib',
);

Sebastian Staudt

unread,
Jun 5, 2017, 2:33:04 PM6/5/17
to Steam Condenser
Ok. I've had to wrap my head around the old way to include with Composer.

Although you're already requiring autoload.php you still have to require the individual classes of Steam Condenser 1.3. So you're probably missing:

require_once 'steam/servers/SourceServer.php';

CenT

unread,
Jun 5, 2017, 3:05:17 PM6/5/17
to Steam Condenser
I tried to include it, but I got this error:

Warning: require_once(STEAM_CONDENSER_PATHexceptions/RCONNoAuthException.php): failed to open stream: No such file or directory in /var/www/clients/client0/web5/web/vendor/koraktor/steam-condenser/lib/steam/servers/SourceServer.php on line 11

I have to add this inclusion in a particular file ?

 

CenT

unread,
Jun 5, 2017, 3:35:17 PM6/5/17
to Steam Condenser
I put this:

require_once 'steam-condenser.php';


And it works.


Another thing how can I force webapi communication with https for testing ?

Sebastian Staudt

unread,
Jun 5, 2017, 3:35:30 PM6/5/17
to Steam Condenser
Ah ok. Please try also including this before SourceServer.php:

require_once 'steam-condenser.php'

Sebastian Staudt

unread,
Jun 5, 2017, 3:37:37 PM6/5/17
to Steam Condenser
Wow, what a coincidence.

Web API uses HTTPS by default, if you want to change to HTTP use:

WebApi::setSecure(false);


CenT

unread,
Jun 5, 2017, 3:38:26 PM6/5/17
to Steam Condenser
I put this only:

require_once 'steam-condenser.php';


And it works.


Another thing how can I force webapi communication with https for testing ?
Reply all
Reply to author
Forward
0 new messages