-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PhpSoda without Composer #1
Comments
To narrow down the issue, I'd need a bit more information. |
Excuse me. I don't know how to use the php libray!! How to use sodaclient? Is there a concret example? Best regards.
|
It seems you're trying to use the library without Composer handling the autoloading of classes nor are you using an autoloader, which isn't really supported because better practices exist. To solve this, you're going to need have an autoloader to handle files. I've generated an Your file structure would look like this:
PhpSoda/src/autoload.php <?php
// @codingStandardsIgnoreFile
// @codeCoverageIgnoreStart
// this is an autogenerated file - do not edit
function autoloadb1fb9576f6a44a390729a4572cbb3669($class) {
static $classes = null;
if ($classes === null) {
$classes = array(
'allejo\\socrata\\converters\\converter' => '/Converters/Converter.php',
'allejo\\socrata\\converters\\csvconverter' => '/Converters/CsvConverter.php',
'allejo\\socrata\\exceptions\\curlexception' => '/Exceptions/CurlException.php',
'allejo\\socrata\\exceptions\\filenotfoundexception' => '/Exceptions/FileNotFoundException.php',
'allejo\\socrata\\exceptions\\httpexception' => '/Exceptions/HttpException.php',
'allejo\\socrata\\exceptions\\invalidresourceexception' => '/Exceptions/InvalidResourceException.php',
'allejo\\socrata\\exceptions\\sodaexception' => '/Exceptions/SodaException.php',
'allejo\\socrata\\sodaclient' => '/SodaClient.php',
'allejo\\socrata\\sodadataset' => '/SodaDataset.php',
'allejo\\socrata\\soqlorderdirection' => '/SoqlOrderDirection.php',
'allejo\\socrata\\soqlquery' => '/SoqlQuery.php',
'allejo\\socrata\\utilities\\stringutilities' => '/Utilities/StringUtilities.php',
'allejo\\socrata\\utilities\\urlquery' => '/Utilities/UrlQuery.php'
);
}
$cn = strtolower($class);
if (isset($classes[$cn])) {
require dirname(__FILE__) . $classes[$cn];
}
}
spl_autoload_register('autoloadb1fb9576f6a44a390729a4572cbb3669');
// @codeCoverageIgnoreEnd Then, in your index.php <?php
include("PhpSoda/src/autoload.php");
use allejo\Socrata\SodaClient;
$sc = new SodaClient("http://opendata.socrata.com"); |
Hi Sir Thats work very gooood Thanks a lot :) 2015-07-11 22:36 GMT+00:00 Vladimir Jimenez notifications@github.com:
|
No problem! |
PhpSoda is now also distributed as a Phar file which can be used as a simple Take a look at the wiki article which also contains an example. |
Hi,
I want to use the PHP PhpSoda library in my own project how can i add SodaClient in my index.php file
When i add "use allejo\Socrata\SodaClient;" and i instantiate $sc = new SodaClient("http://opendata.socrata.com"); it's give me the error ( ! ) Fatal error: Class 'allejo\Socrata\SodaClient' not found in C:\wamp\www\Socrata\PhpSoda\tests\index.php on line 6
Call Stack
Time Memory Function Location
1 0.0010 131408 {main}( ) ..\index.php:0
how can i resolve it please?
The text was updated successfully, but these errors were encountered: