Permalink
Browse files

Add compify bin

  • Loading branch information...
1 parent 7f3dbce commit 74f86bdfcfb8e24aa39e566e38cf50083725e2ff Carlos Buenosvinos committed Apr 7, 2013
Showing with 27 additions and 44 deletions.
  1. +0 −9 bin/compify
  2. +0 −35 bin/compile
  3. +27 −0 compify
View
@@ -1,9 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-require __DIR__.'/../src/bootstrap.php';
-
-use CarlosIO\Compify\Console\Application;
-
-$application = new Application();
-$application->run();
View
@@ -1,35 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-require __DIR__.'/../src/bootstrap.php';
-
-use CarlosIO\Compify\Compiler;
-
-if (function_exists('ini_set')) {
- @ini_set('display_errors', 1);
-
- $memoryInBytes = function ($value) {
- $unit = strtolower(substr($value, -1, 1));
- $value = (int) $value;
- switch($unit) {
- case 'g':
- $value *= 1024;
- case 'm':
- $value *= 1024;
- case 'k':
- $value *= 1024;
- }
-
- return $value;
- };
-
- $memoryLimit = trim(ini_get('memory_limit'));
- // Increase memory_limit if it is lower than 512M
- if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 512 * 1024 * 1024) {
- @ini_set('memory_limit', '512M');
- }
- unset($memoryInBytes, $memoryLimit);
-}
-
-$compiler = new Compiler();
-$compiler->compile();
View
27 compify
@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+<?php
+
+/*
+ * This file is part of the Symfony CS utility.
+ *
+ * (c) Carlos Buenosvinos <hi@carlos.io>
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+/**
+ * @author Carlos Buenosvinos <hi@carlos.io>
+ */
+
+// installed via composer?
+if (file_exists($a = __DIR__ . '/../../autoload.php')) {
+ require_once $a;
+} else {
+ require_once __DIR__ . '/vendor/autoload.php';
+}
+
+use CarlosIO\Compify\Console\Application;
+
+$application = new Application();
+$application->run();

0 comments on commit 74f86bd

Please sign in to comment.