Comments (6)
To narrow down the issue, I'd need a bit more information.
- Are you using Composer in your project?
- Are you using an autoloader (e.g. Autoload) in your project to automatically include all of the PhpSoda files in your project so you may access its classes?
- Are you manually
include
'ing the necessary PhpSoda classes so you may access its classes?
from phpsoda.
Excuse me.
I don't know how to use the php libray!!
How to use sodaclient?
Is there a concret example?
Best regards.
Le 11 juil. 2015 17:26, "Vladimir Jimenez" [email protected] a
écrit :
To narrow down the issue, I'd need a bit more information.
- Are you using Composer https://getcomposer.org/ in your project?
- Are you using an autoloader (e.g. Autoload
https://github.com/theseer/Autoload) in your project to
automatically include all of the PhpSoda files in your project so you may
access its classes?- Are you manually include'ing the necessary PhpSoda classes so you
may access its classes?—
Reply to this email directly or view it on GitHub
#1 (comment).
from phpsoda.
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 autoload.php
file below and you need to put this file inside of the src
folder inside of PhpSoda
.
Your file structure would look like this:
|- Socrata
|- PhpSoda
|- src
- autoload.php
- index.php
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
file you will need to include the autoload file and then you'll be able to use the namespace.
index.php
<?php
include("PhpSoda/src/autoload.php");
use allejo\Socrata\SodaClient;
$sc = new SodaClient("http://opendata.socrata.com");
from phpsoda.
Hi Sir
Thats work very gooood
Thanks a lot :)
ᐧ
2015-07-11 22:36 GMT+00:00 Vladimir Jimenez [email protected]:
It seems you're trying to use the library without Composer handling the
autoloading of classes nor are you using an autoloader. To solve this,
you're gonna need have an autoloader to handle files. I've generated an
autoload.php file below and you need to put this file inside of the src
folder inside of PhpSoda.Your file structure would look like this:
|- Socrata
|- PhpSoda
|- src
- autoload.php
- index.phpPhpSoda/src/autoload.php
'/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 file you will need to include the autoload file and then you'll be able to use the namespace. _index.php_KELLA BENNANI Mohamed El-Mekki
Ingénieur d’état Système d'Information Géographique (SIG)
E.H.T.P
Tel : (00212) 655-252-062
from phpsoda.
No problem!
from phpsoda.
PhpSoda is now also distributed as a Phar file which can be used as a simple include
or require
in a PHP script.
Take a look at the wiki article which also contains an example.
from phpsoda.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpsoda.