PRS-4 - Why does Class 'App\TgHelpers\TelegramCommandsProcess' not found?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















The structure of my project is as follows:



enter image description here



Handler.php is input script. Here is its beginning:



require "vendor/autoload.php";
use AppTgHelpersTelegramCommandsProcess;
$tgProcessor = new TelegramCommandsProcess();


All scripts are in the same namespace - App. An error is displayed in the logs:



PHP Fatal error:  Uncaught Error: Class 'App\TgHelpers\TelegramCommandsProcess' not found


What am I doing wrong?



Here is the autoload field in composer.json:



"autoload": {
"psr-4": {
"App\": "testVersionTelegramForecast//"
}
}









share|improve this question

























  • Can you try with use AppTgHelpersTelegramCommandsProcess; instead of use AppTgHelpersTelegramCommandsProcess;

    – Web Artisan
    Nov 16 '18 at 12:07













  • @WebArtisan, already tried. Result is the same

    – Racoon
    Nov 16 '18 at 12:08


















1















The structure of my project is as follows:



enter image description here



Handler.php is input script. Here is its beginning:



require "vendor/autoload.php";
use AppTgHelpersTelegramCommandsProcess;
$tgProcessor = new TelegramCommandsProcess();


All scripts are in the same namespace - App. An error is displayed in the logs:



PHP Fatal error:  Uncaught Error: Class 'App\TgHelpers\TelegramCommandsProcess' not found


What am I doing wrong?



Here is the autoload field in composer.json:



"autoload": {
"psr-4": {
"App\": "testVersionTelegramForecast//"
}
}









share|improve this question

























  • Can you try with use AppTgHelpersTelegramCommandsProcess; instead of use AppTgHelpersTelegramCommandsProcess;

    – Web Artisan
    Nov 16 '18 at 12:07













  • @WebArtisan, already tried. Result is the same

    – Racoon
    Nov 16 '18 at 12:08














1












1








1








The structure of my project is as follows:



enter image description here



Handler.php is input script. Here is its beginning:



require "vendor/autoload.php";
use AppTgHelpersTelegramCommandsProcess;
$tgProcessor = new TelegramCommandsProcess();


All scripts are in the same namespace - App. An error is displayed in the logs:



PHP Fatal error:  Uncaught Error: Class 'App\TgHelpers\TelegramCommandsProcess' not found


What am I doing wrong?



Here is the autoload field in composer.json:



"autoload": {
"psr-4": {
"App\": "testVersionTelegramForecast//"
}
}









share|improve this question
















The structure of my project is as follows:



enter image description here



Handler.php is input script. Here is its beginning:



require "vendor/autoload.php";
use AppTgHelpersTelegramCommandsProcess;
$tgProcessor = new TelegramCommandsProcess();


All scripts are in the same namespace - App. An error is displayed in the logs:



PHP Fatal error:  Uncaught Error: Class 'App\TgHelpers\TelegramCommandsProcess' not found


What am I doing wrong?



Here is the autoload field in composer.json:



"autoload": {
"psr-4": {
"App\": "testVersionTelegramForecast//"
}
}






php composer-php psr-4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 12:30







Racoon

















asked Nov 16 '18 at 11:59









RacoonRacoon

248




248













  • Can you try with use AppTgHelpersTelegramCommandsProcess; instead of use AppTgHelpersTelegramCommandsProcess;

    – Web Artisan
    Nov 16 '18 at 12:07













  • @WebArtisan, already tried. Result is the same

    – Racoon
    Nov 16 '18 at 12:08



















  • Can you try with use AppTgHelpersTelegramCommandsProcess; instead of use AppTgHelpersTelegramCommandsProcess;

    – Web Artisan
    Nov 16 '18 at 12:07













  • @WebArtisan, already tried. Result is the same

    – Racoon
    Nov 16 '18 at 12:08

















Can you try with use AppTgHelpersTelegramCommandsProcess; instead of use AppTgHelpersTelegramCommandsProcess;

– Web Artisan
Nov 16 '18 at 12:07







Can you try with use AppTgHelpersTelegramCommandsProcess; instead of use AppTgHelpersTelegramCommandsProcess;

– Web Artisan
Nov 16 '18 at 12:07















@WebArtisan, already tried. Result is the same

– Racoon
Nov 16 '18 at 12:08





@WebArtisan, already tried. Result is the same

– Racoon
Nov 16 '18 at 12:08












1 Answer
1






active

oldest

votes


















3














the register must match AppTgHelpers => project/TgHelpers,



composer.json should be at the root of your project



project/
tgHelpers/
TelegramCommandsProcess.php
Handler.php
composer.json
vendor/
autoload.php


In Handler.php



require __DIR__ . '/../vendor/autoload.php';





share|improve this answer


























  • but it's already at the root of project

    – Racoon
    Nov 16 '18 at 12:08











  • edited question.

    – Racoon
    Nov 16 '18 at 12:14











  • you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

    – Yaroslaw
    Nov 16 '18 at 12:16











  • not sure that completely understood you question, but, i suppose, yes

    – Racoon
    Nov 16 '18 at 12:18






  • 1





    The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

    – Yaroslaw
    Nov 16 '18 at 12:24












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337484%2fprs-4-why-does-class-app-tghelpers-telegramcommandsprocess-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














the register must match AppTgHelpers => project/TgHelpers,



composer.json should be at the root of your project



project/
tgHelpers/
TelegramCommandsProcess.php
Handler.php
composer.json
vendor/
autoload.php


In Handler.php



require __DIR__ . '/../vendor/autoload.php';





share|improve this answer


























  • but it's already at the root of project

    – Racoon
    Nov 16 '18 at 12:08











  • edited question.

    – Racoon
    Nov 16 '18 at 12:14











  • you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

    – Yaroslaw
    Nov 16 '18 at 12:16











  • not sure that completely understood you question, but, i suppose, yes

    – Racoon
    Nov 16 '18 at 12:18






  • 1





    The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

    – Yaroslaw
    Nov 16 '18 at 12:24
















3














the register must match AppTgHelpers => project/TgHelpers,



composer.json should be at the root of your project



project/
tgHelpers/
TelegramCommandsProcess.php
Handler.php
composer.json
vendor/
autoload.php


In Handler.php



require __DIR__ . '/../vendor/autoload.php';





share|improve this answer


























  • but it's already at the root of project

    – Racoon
    Nov 16 '18 at 12:08











  • edited question.

    – Racoon
    Nov 16 '18 at 12:14











  • you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

    – Yaroslaw
    Nov 16 '18 at 12:16











  • not sure that completely understood you question, but, i suppose, yes

    – Racoon
    Nov 16 '18 at 12:18






  • 1





    The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

    – Yaroslaw
    Nov 16 '18 at 12:24














3












3








3







the register must match AppTgHelpers => project/TgHelpers,



composer.json should be at the root of your project



project/
tgHelpers/
TelegramCommandsProcess.php
Handler.php
composer.json
vendor/
autoload.php


In Handler.php



require __DIR__ . '/../vendor/autoload.php';





share|improve this answer















the register must match AppTgHelpers => project/TgHelpers,



composer.json should be at the root of your project



project/
tgHelpers/
TelegramCommandsProcess.php
Handler.php
composer.json
vendor/
autoload.php


In Handler.php



require __DIR__ . '/../vendor/autoload.php';






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 16 '18 at 12:10

























answered Nov 16 '18 at 12:07









YaroslawYaroslaw

834




834













  • but it's already at the root of project

    – Racoon
    Nov 16 '18 at 12:08











  • edited question.

    – Racoon
    Nov 16 '18 at 12:14











  • you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

    – Yaroslaw
    Nov 16 '18 at 12:16











  • not sure that completely understood you question, but, i suppose, yes

    – Racoon
    Nov 16 '18 at 12:18






  • 1





    The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

    – Yaroslaw
    Nov 16 '18 at 12:24



















  • but it's already at the root of project

    – Racoon
    Nov 16 '18 at 12:08











  • edited question.

    – Racoon
    Nov 16 '18 at 12:14











  • you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

    – Yaroslaw
    Nov 16 '18 at 12:16











  • not sure that completely understood you question, but, i suppose, yes

    – Racoon
    Nov 16 '18 at 12:18






  • 1





    The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

    – Yaroslaw
    Nov 16 '18 at 12:24

















but it's already at the root of project

– Racoon
Nov 16 '18 at 12:08





but it's already at the root of project

– Racoon
Nov 16 '18 at 12:08













edited question.

– Racoon
Nov 16 '18 at 12:14





edited question.

– Racoon
Nov 16 '18 at 12:14













you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

– Yaroslaw
Nov 16 '18 at 12:16





you took it into account "the register must match AppTgHelpers => project/TgHelpers" ?

– Yaroslaw
Nov 16 '18 at 12:16













not sure that completely understood you question, but, i suppose, yes

– Racoon
Nov 16 '18 at 12:18





not sure that completely understood you question, but, i suppose, yes

– Racoon
Nov 16 '18 at 12:18




1




1





The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

– Yaroslaw
Nov 16 '18 at 12:24





The tgHelpers folder should be called TgHelpers if the namespace is TgHelpers

– Yaroslaw
Nov 16 '18 at 12:24




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337484%2fprs-4-why-does-class-app-tghelpers-telegramcommandsprocess-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Lugert, Oklahoma