Jump to content

Archived

This topic is now archived and is closed to further replies.

jagguy

install highchartsphp in cakephp windows

Recommended Posts

Hi,
I am having an awful time creating a composer.json file to install highchartsPHP for windows cakephp.
I dont know how exactly to create a file.
The examples I have for cakephp composer is for linux.

I download the highchartsphp and I place it where?
I have composer installed and I do what as version 3 doesnt require composer .
https://github.com/ghunti/HighchartsPHP

 I place the highcharts dir where ?  where I should place files to install?
How do I install this EXACTLY and does this require mean I have dir called ghunti?

I really need some decent how to install as this really isnt good enough . It has been 2 days since I tried to install this highchartsPHP for cakePHP.

{
    
    
    "require": {
        "ghunti/highcharts-php": "~3.0"
    }
    
    
}

Share this post


Link to post
Share on other sites

Composer is the same on Windows as it is on Linux.

 

Just cd into the root of your project and execute:

 

composer require 'ghunti/highcharts-php:~3.0'

Share this post


Link to post
Share on other sites

Hi,

 

No that isnt it. I just get an error as there is no name anywhere on my computer  'ghunti/highcharts-php:~3.0'

 

composer require 'ghunti/highcharts-php:~3.0'  gives an error of 'could not parse version constraint ~3.0, UnexpectedValueException

 

 

I have been to 3 other forums and no one can tell me what to do yet but thanks anyway for trying.

 

1)I have the download called highcharts3 (dir)

2)I have the cakephp project.called cakephp5

 

I place the download 1) where?and how do I install it with composer

Share this post


Link to post
Share on other sites

Ummm...... go into shell.  cd to the project directory.

 

Run: 

 

composer update

Share this post


Link to post
Share on other sites

OK I got the json file to run in cakephp dir and now I have a few dir in a vendor dir. I got no error.

.

what has happened here and I have a whole lot of files I need to place where.

I am am sorry but I really need a bit more explanation because I just get more bits and pieces.

 

I place the highcharts dir in vendor?

 

I still get a an Class 'Highchart' not found in my code so it hast worked

Share this post


Link to post
Share on other sites

You don't need to place anything anywhere. You need to understand what composer is. Start here: https://getcomposer.org/doc/00-intro.md, its not rocket science.

 

composer installs any and all dependencies into the vendor directory. So whatever highcharts thing you have downloaded, you don't need it if you have just installed it via composer.

 

Your tone suggests that it is somehow our fault that you are not understanding any of this, and frankly, I don't like it.

Share this post


Link to post
Share on other sites

Well I am certainly not blaming anyone here for highcharts not working.

 

The issue is that the complete instructions to this setup doesnt exist so i am asking many forums for an answer.

 

I have had posts that this is a simple thing to setup but that doesnt appear to be the case.

 

If I run a cakephp script 'in a controller' with highcharts I just get a "highcharts not found error."

 

 

In vendors I have the highchartsphp dir with src files and I place these files as well in highcharts.

I have the files and they seem in the right dir but I cant get this to work.

 

eg I have the correct names I am referencing

 

App::import('Vendor', 'HighchartsPHP/Highchart');
class ChartsController extends AppController
{

public function index() {        
        $chart = new Highchart(); /////////////error not found

 

 

 

Share this post


Link to post
Share on other sites

Now that you have the library working with composer, whatever instructions they provide for cakephp is the one that you should be following to use the wrapper library. Composer has downloaded the dependencies and generated an autoloader, but how that autoloader is used from cakephp is something I can't speak to.

 

I see no reason that you would need to do this however:

App::import('Vendor', 'HighchartsPHP/Highchart');
The autoloader should already have taken care of that.

 

I found these references that look like they provide the needed information:

 

http://book.cakephp.org/2.0/en/installation/advanced-installation.html

https://learntech.imsu.ox.ac.uk/blog/?p=926

 

 

There are some javascript framework dependencies described here: https://github.com/ghunti/HighchartsPHP -- however, that would be something you would expect to see generate a problem after the page is running ok from the php side.

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the replies.

There are no instructions for cakephp and windows for highcharts.

To be honest I have given up on the project as this is just to complicated. I am a strong believer in KISS .

The documentation isnt there.

Unless someone has actually setup this themselves on windows with cakephp/highcharts we are kind of guessing?

Share this post


Link to post
Share on other sites

BTW thanks for the replies and all the links which I had a good look at.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.