Browse Source

Download ActiveRecord ORM from composer

Hamilton Turner 10 years ago
parent
commit
fdb81acfc6

+ 1 - 0
frameworks/PHP/php/.gitignore

@@ -1 +1,2 @@
 deploy/php-fpm.pid
 deploy/php-fpm.pid
+vendor/

+ 0 - 7
frameworks/PHP/php/bash_profile.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-export PHP_HOME=${IROOT}/php-5.5.17
-
-export PHP_FPM=$PHP_HOME/sbin/php-fpm
-
-export PATH="$PHP_HOME/bin:$PHP_HOME/sbin:$PATH"

+ 5 - 0
frameworks/PHP/php/composer.json

@@ -0,0 +1,5 @@
+{
+	"require": {
+    "php-activerecord/php-activerecord": "1.1.1"
+	}
+}

+ 53 - 0
frameworks/PHP/php/composer.lock

@@ -0,0 +1,53 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "This file is @generated automatically"
+    ],
+    "hash": "76d22610a94dd72e2107bdf32b346cb0",
+    "packages": [
+        {
+            "name": "php-activerecord/php-activerecord",
+            "version": "v1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/jpfuentes2/php-activerecord.git",
+                "reference": "d6c4b929769d2d49f7af6d16ed9b68f94af9fed0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/jpfuentes2/php-activerecord/zipball/d6c4b929769d2d49f7af6d16ed9b68f94af9fed0",
+                "reference": "d6c4b929769d2d49f7af6d16ed9b68f94af9fed0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "ActiveRecord.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "description": "php-activerecord is an open source ORM library based on the ActiveRecord pattern.",
+            "homepage": "http://www.phpactiverecord.org/",
+            "keywords": [
+                "activerecord",
+                "orm"
+            ],
+            "time": "2013-02-28 02:47:58"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": []
+}

+ 1 - 1
frameworks/PHP/php/dborm.php

@@ -11,7 +11,7 @@ header("Content-type: application/json");
 // $pdo = new PDO('mysql:host=localhost;dbname=hello_world', 'benchmarkdbuser', 'benchmarkdbpass');
 // $pdo = new PDO('mysql:host=localhost;dbname=hello_world', 'benchmarkdbuser', 'benchmarkdbpass');
 
 
 # inclue the ActiveRecord library
 # inclue the ActiveRecord library
-require_once 'php-activerecord/ActiveRecord.php';
+require_once 'vendor/php-activerecord/php-activerecord/ActiveRecord.php';
 
 
 ActiveRecord\Config::initialize(function($cfg)
 ActiveRecord\Config::initialize(function($cfg)
 {
 {

+ 9 - 1
frameworks/PHP/php/install.sh

@@ -1,3 +1,11 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends php nginx
+fw_depends php nginx composer
+
+export PHP_HOME=${IROOT}/php-5.5.17
+export PHP_FPM=$PHP_HOME/sbin/php-fpm
+export NGINX_HOME=${IROOT}/nginx
+
+${PHP_HOME}/bin/php $IROOT/composer.phar install \
+  --no-interaction --working-dir $TROOT \
+  --no-progress --optimize-autoloader 

+ 0 - 2
frameworks/PHP/php/setup.sh

@@ -1,6 +1,5 @@
 #!/bin/bash
 #!/bin/bash
 
 
-
 sed -i "s|localhost|${DBHOST}|g" dborm.php
 sed -i "s|localhost|${DBHOST}|g" dborm.php
 sed -i "s|localhost|${DBHOST}|g" dbraw.php
 sed -i "s|localhost|${DBHOST}|g" dbraw.php
 sed -i "s|localhost|${DBHOST}|g" updateraw.php
 sed -i "s|localhost|${DBHOST}|g" updateraw.php
@@ -11,7 +10,6 @@ sed -i "s|TEST_ROOT|${TROOT}|g" deploy/nginx.conf
 
 
 sed -i "s|/usr/local/nginx/|${IROOT}/nginx/|g" deploy/nginx.conf
 sed -i "s|/usr/local/nginx/|${IROOT}/nginx/|g" deploy/nginx.conf
 
 
-
 export PHP_HOME=${IROOT}/php-5.5.17
 export PHP_HOME=${IROOT}/php-5.5.17
 export PHP_FPM=$PHP_HOME/sbin/php-fpm
 export PHP_FPM=$PHP_HOME/sbin/php-fpm
 export NGINX_HOME=${IROOT}/nginx
 export NGINX_HOME=${IROOT}/nginx