Jump to content

minPHP Issue


Abdy

Recommended Posts

Hi,

I'm using minPHP 1.0 for a project, but when I upload the framework to the server I get three errors, I can't find a solution, I will appreciate any help or advice to find a solution. 

Thanks.

Errors:

  • PHP Warning: include_once(/home/advandz/public_html/Advandz-Framework/vendor/autoload.php): failed to open stream: No such file or directory in .../public_html/Advandz-Framework/src/lib/autoload.php:11
  • PHP Warning: include_once(): Failed opening '/home/advandz/public_html/Advandz-Framework/vendor/autoload.php' for inclusion (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in .../public_html/Advandz-Framework/src/lib/autoload.php:11
  • Fatal error: Class 'Dispatcher' not found in /home/advandz/public_html/Advandz-Framework/src/index.php on line 29

Screen Shot 2016-11-27 at 7.12.05 PM.png

Link to comment
Share on other sites

2 hours ago, Blesta Addons said:

Minphp 1 is not working with the actual files in github ... you need to make a build with composer and edit some files manually .

I suggest using the old minphp as is working now .

I have a complete working build of minphp 1 , i need just time to search it and share it with others .

You can share/sell me the build? 

Link to comment
Share on other sites

If you want to get the current version in master working as of 2016-11-28 against commit ed21031213e395cf38e902d8b4c2b2cbf072dc0c here is what you need to do.

I would be happy to submit PR's to get the code in the repo working but the repo looks fairly dead to me.

git clone https://github.com/phillipsdata/minphp.git

Edit the composer.json file

-        "minphp/html": "dev-master",
+        "minphp/html": "~1.0",

Download/Run composer install

php composer.phar install

Edit src/lib/language.php

-use minphp\Language\Language as FrameworkLanguage;
+use Minphp\Language\Language as FrameworkLanguage;

That should get what is currently in the repo to work. (at least it did for me).

I tested it by running a webserver out of the src directory via php locally on port 8000

cd src
php -S localhost:8000

 

Link to comment
Share on other sites

4 hours ago, mrrsm said:

If you want to get the current version in master working as of 2016-11-28 against commit ed21031213e395cf38e902d8b4c2b2cbf072dc0c here is what you need to do.

I would be happy to submit PR's to get the code in the repo working but the repo looks fairly dead to me.


git clone https://github.com/phillipsdata/minphp.git

Edit the composer.json file


-        "minphp/html": "dev-master",
+        "minphp/html": "~1.0",

Download/Run composer install


php composer.phar install

Edit src/lib/language.php


-use minphp\Language\Language as FrameworkLanguage;
+use Minphp\Language\Language as FrameworkLanguage;

That should get what is currently in the repo to work. (at least it did for me).

I tested it by running a webserver out of the src directory via php locally on port 8000


cd src
php -S localhost:8000

 

:D Thanks <3 Works perfect. :blesta: 

Link to comment
Share on other sites

my own composer file that is working with latest minphp  and all the components needed in the project  .

{
    "require": {
        "php": ">=5.3.0",
        "minphp/cache": "^1.0",
        "minphp/configure": "^2.0",
        "minphp/container": "^2.1",
        "minphp/bridge": "^1.0.0-rc10",
        "minphp/input": "^1.0",
        "minphp/language": "^1.0",
        "minphp/pagination": "^1.0",
		"minphp/xml": "^1.0",
        "minphp/html": "^1.0",		
        "minphp/date": "^1.0",
        "minphp/form": "^1.0",
        "minphp/javascript": "^1.0",
        "minphp/db": "^2.0",
        "minphp/record": "^2.0",
        "minphp/session": "^1.1",
        "minphp/acl": "^1.0",
        "composer/composer": "^1.2",
        "phillipsdata/tcpdf_wrapper": "^1.1",
        "aura/router": "^3.0"
    },
    "autoload": {
        "psr-4": {
            "Core\\ServiceProviders\\": "core/ServiceProviders/"
        }
    }	
}

you can ignore any class that you will not need it

        "minphp/acl": "^1.0",
        "phillipsdata/tcpdf_wrapper": "^1.1",
        "aura/router": "^3.0"

in the lib/init.php file add the fallowing

// include autoloader
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR
    . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';


// Fetch available services
$services = require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'config'
    . DIRECTORY_SEPARATOR . 'services.php';

// Initialize
$container = new Minphp\Container\Container();

// Set services
foreach ($services as $service) {
    $container->register(new $service());
}

// Run bridge
$bridge = Minphp\Bridge\Initializer::get();
$bridge->setContainer($container);
$bridge->run();

// Set the container
Configure::set('container', $container);

return $container;

 

 

Link to comment
Share on other sites

On 28/11/2016 at 3:44 PM, mrrsm said:

Edit src/lib/language.php


-use minphp\Language\Language as FrameworkLanguage;
+use Minphp\Language\Language as FrameworkLanguage;

as i know minphp v1.0 is not using any files in lib directory , take a look here https://github.com/phillipsdata/minphp-bridge

 

Link to comment
Share on other sites

Without that change, if I run what is in the minphp repo directly I get the following error

Fatal error: Class 'minphp\Language\Language' not found in /code/php/minphp/src/lib/language.php on line 7

Fatal error: Uncaught Error: Class 'View' not found in /code/php/minphp/src/lib/controller.php:87 Stack trace: #0 /code/php/minphp/src/lib/dispatcher.php(165): Controller->__construct() #1 /code/php/minphp/src/lib/unknown_exception.php(58): Dispatcher::raiseError(Object(UnknownException)) #2 [internal function]: UnknownException::setFatalErrorHandler() #3 {main} thrown in /code/php/minphp/src/lib/controller.php on line 87

This happens because the View class depends on the Language class which has an invalid use statement. 

15 minutes ago, Blesta Addons said:

as i know minphp v1.0 is not using any files in lib directory , take a look here https://github.com/phillipsdata/minphp-bridge

I am not sure what the bridge has to do with anything if you are creating a new project as you shouldn't need to use it if you just use the new 1.0 code.  I haven't fully looked into the bridge but that is what I got from reading the README.

Link to comment
Share on other sites

8 minutes ago, mrrsm said:

Without that change, if I run what is in the minphp repo directly I get the following error


Fatal error: Class 'minphp\Language\Language' not found in /code/php/minphp/src/lib/language.php on line 7

Fatal error: Uncaught Error: Class 'View' not found in /code/php/minphp/src/lib/controller.php:87 Stack trace: #0 /code/php/minphp/src/lib/dispatcher.php(165): Controller->__construct() #1 /code/php/minphp/src/lib/unknown_exception.php(58): Dispatcher::raiseError(Object(UnknownException)) #2 [internal function]: UnknownException::setFatalErrorHandler() #3 {main} thrown in /code/php/minphp/src/lib/controller.php on line 87

This happens because the View class depends on the Language class which has an invalid use statement. 

I am not sure what the bridge has to do with anything if you are creating a new project as you shouldn't need to use it if you just use the new 1.0 code.  I haven't fully looked into the bridge but that is what I got from reading the README.

the minphp v1 in the github isnot complete or maybe it need something else , as i see it was 2 years old now, blesta v4 use the latest files of minphp 1.0 , so what i have do in my test project server a manual compile of files and i was able to make it running , i have posted the composer file that i have arrived with it to working framework .

is better if one of the blesta team make a look and update the github for us :)

i have so many project done with old minphp for that reason i have used the bridge to prepare my work for updates .

Link to comment
Share on other sites

9 minutes ago, Blesta Addons said:

i have so many project done with old minphp for that reason i have used the bridge to prepare my work for updates .

That makes sense to me.  It sounded like cyandark was starting a new project which means he should not need the bridge.

 

11 minutes ago, Blesta Addons said:

is better if one of the blesta team make a look and update the github for us :)

I hope this will happen.  What is in the github not kind of works but it isn't worth putting in a PR as v4 is using the minphp 1.0 and works so an update to the repo would fix most of the problems most likely.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...