Skip to content
This repository was archived by the owner on Feb 6, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
JpGraph from http://jpgraph.net/
======
This is a port for Symfony2 to put JpGraph as a Vendor library
This is a port for Composer users to use JpGraph as a Vendor library

use JpGraph\JpGraph::load(); and JpGraph\JpGraph::module('moduleName'); to load required modules
use JpGraph\JpGraph::load(); and JpGraph\JpGraph::module('moduleName'); to load required modules
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
],
"require": {},
"autoload": {
"psr-0" : {
"JpGraph" : "lib/"
}
"classmap": ["lib/JpGraph.php"]
}
}
27 changes: 27 additions & 0 deletions lib/JpGraph.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
namespace JpGraph;

class JpGraph
{
static public $loaded = false ;
static public $modules = array();

static public function load(){
if(self::$loaded !== true){
include_once __DIR__.'/JpGraph/src/jpgraph.php';
self::$loaded = true ;
}
}

static public function module($moduleName){
self::load();
if(!in_array($moduleName,self::$modules)){
$path = __DIR__.'/JpGraph/src/jpgraph_'.$moduleName.'.php' ;
if(file_exists($path)){
include_once $path ;
} else {
throw new \InvalidArgumentException('The JpGraphs\'s module "'.$moduleName.'" does not exist');
}
}
}
}
28 changes: 0 additions & 28 deletions lib/JpGraph/JpGraph.php

This file was deleted.

6 changes: 0 additions & 6 deletions lib/JpGraph/ModuleNotFoundException.php

This file was deleted.

1 change: 0 additions & 1 deletion lib/JpGraph/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion lib/JpGraph/src/Examples/jpgraph

This file was deleted.

Loading