-
Notifications
You must be signed in to change notification settings - Fork 10
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
Model Classes, Rooms, etc. not found #17
Comments
Hey, I would rather answer in english because if someone has the same problem that can be solved too. So to see whats really going on there i have to see some more things like the exact error message. Did you check the folder in vendor if all necessary files are there? |
Hey there! It is the error message from the Query-class : "Model $classname not found!"
vendor is, what I could see not there. Where it is hide? I have the TFranek/WebUntis/<src\bin\docs>/Configuration Path for example? It is possible, that I have to load only one time one class?
|
did you install the package via composer? because if you did there should be an vendor folder in your project root directory. |
yes my projectmanager has installed it over composer. composer is installing into an directory named libs. So we don't have any root directory and i don't see any vendor directory. Is there any way to make this directory after the composer has installed the api? |
Okay the libs directory is the vendor directory, but I can't get any models. That' s the problem. The libs directory contains the tfranek/webuntis/<src\bin\docs>/ directories, but it isn't able to load any Model? |
The problem is somehow the YAMLConfiguration Class cannot find the meta data of the Models (.webuntis.yml) which are located at src/Resources/config/. Maybe it is because the glob() function is not working probably on your system. What could also be is that you execute the script outside the root directory (the libs folder is in the hierarchy below the executed script) that could result in not finding the model because it only searches for models in the directory of the executed script and above. |
and which os are you using? on linux there could be a problem with the access rights. |
Hi there, I am the "project manager" / old developer of the software @programerTV is trying to work on. We just resolved the issue! You were absolutely right with your guess. By the way, our script was calling from /core/controllers/somecontroller.php. Composer had it's installation directory in /libs - is that what you meant with
? Any way, we got it working now! Thanks a bunch for your help! |
If I work on the next patch I will maybe include a option to add an additional path for the configuration. |
but if you want you can also add this feature. Just try to code it out and make a commit and i will review it. |
Well, I didn't really dive into the code too deep. I just helped my team to debug what was causing the issue. |
Hello Mr. Franek,
I am using your API for a project in school, but I am getting the error, that every standard-Model (Classes, Teachers, Rooms, Substitutions and so on) can't be found. I am a little bit in struggle, because it have to be finished next week on monday. Here is the Code I have so far:
try {
$config = new WebuntisConfiguration([
'admin' => [
'server' => '',
'school' => '',
'username' => '',
'password' => ''
],
'only_admin' => true,
'disableCache' => true
]);
var_dump($config); //Contains an object of WebuntisConfiguration
error_log("Config ist eingeladen!");
$query = new Query();
var_dump($query); //Contains an object of Query, but array models is 0, but array repository is 2
$aClasses = $query->get('Classes')->findAll();
return $aClasses;
} catch (Exception $oException) {
error_log($oException->getMessage());
}
I have it installed with the composer and the php-version is up to date.
Hope to hear as fast as possible from you. Thanks!
Hab gerade gemerkt, dass du Deutsch sprichst. Kannst somit gerne auf Deutsch antworten!
The text was updated successfully, but these errors were encountered: