Browse Source

more source removal

Hamilton Turner 10 years ago
parent
commit
4985c86625
72 changed files with 0 additions and 4596 deletions
  1. 0 10
      frameworks/PHP/php-fuel/fuel/packages/oil/.gitignore
  2. 0 27
      frameworks/PHP/php-fuel/fuel/packages/oil/bootstrap.php
  3. 0 254
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/cell.php
  4. 0 262
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/command.php
  5. 0 237
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/console.php
  6. 0 33
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/exception.php
  7. 0 979
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate.php
  8. 0 79
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate/admin.php
  9. 0 279
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate/migration/actions.php
  10. 0 208
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate/scaffold.php
  11. 0 211
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/package.php
  12. 0 184
      frameworks/PHP/php-fuel/fuel/packages/oil/classes/refine.php
  13. 0 50
      frameworks/PHP/php-fuel/fuel/packages/oil/config/oil.php
  14. 0 291
      frameworks/PHP/php-fuel/fuel/packages/oil/tasks/fromdb.php
  15. 0 30
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/create.php
  16. 0 13
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/delete.php
  17. 0 31
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/edit.php
  18. 0 3
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/index.php
  19. 0 4
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/view.php
  20. 0 14
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/controller.php
  21. 0 88
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/controllers/admin.php
  22. 0 16
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/controllers/base.php
  23. 0 34
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/model.php
  24. 0 30
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/_form.php
  25. 0 7
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/create.php
  26. 0 8
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/edit.php
  27. 0 42
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/index.php
  28. 0 11
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/view.php
  29. 0 27
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/dashboard.php
  30. 0 33
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/login.php
  31. 0 32
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/create.php
  32. 0 13
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/delete.php
  33. 0 38
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/edit.php
  34. 0 3
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/index.php
  35. 0 4
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/view.php
  36. 0 14
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/controller.php
  37. 0 88
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/controllers/admin.php
  38. 0 16
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/controllers/base.php
  39. 0 57
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/model.php
  40. 0 30
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/_form.php
  41. 0 7
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/create.php
  42. 0 8
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/edit.php
  43. 0 42
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/index.php
  44. 0 11
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/view.php
  45. 0 89
      frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/template.php
  46. 0 30
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/create.php
  47. 0 13
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/delete.php
  48. 0 33
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/edit.php
  49. 0 3
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/index.php
  50. 0 6
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/view.php
  51. 0 14
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/controller.php
  52. 0 80
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/controllers/admin.php
  53. 0 16
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/controllers/base.php
  54. 0 35
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/model.php
  55. 0 30
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/_form.php
  56. 0 7
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/create.php
  57. 0 8
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/edit.php
  58. 0 42
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/index.php
  59. 0 11
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/view.php
  60. 0 32
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/create.php
  61. 0 15
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/delete.php
  62. 0 45
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/edit.php
  63. 0 3
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/index.php
  64. 0 10
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/view.php
  65. 0 14
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/controller.php
  66. 0 59
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/model.php
  67. 0 30
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/_form.php
  68. 0 7
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/create.php
  69. 0 8
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/edit.php
  70. 0 42
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/index.php
  71. 0 11
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/view.php
  72. 0 45
      frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/template.php

+ 0 - 10
frameworks/PHP/php-fuel/fuel/packages/oil/.gitignore

@@ -1,10 +0,0 @@
-*~
-*.bak
-Thumbs.db
-desktop.ini
-.DS_Store
-.buildpath
-.project
-.settings
-nbproject/
-.idea

+ 0 - 27
frameworks/PHP/php-fuel/fuel/packages/oil/bootstrap.php

@@ -1,27 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-
-Autoloader::add_classes(array(
-	'Oil\\Cell'						 	=> __DIR__.'/classes/cell.php',
-	'Oil\\Command'						=> __DIR__.'/classes/command.php',
-	'Oil\\Console'					   	=> __DIR__.'/classes/console.php',
-	'Oil\\Exception'				   	=> __DIR__.'/classes/exception.php',
-	'Oil\\Generate'						=> __DIR__.'/classes/generate.php',
-	'Oil\\Generate_Migration_Actions'	=> __DIR__.'/classes/generate/migration/actions.php',
-	'Oil\\Generate_Admin'				=> __DIR__.'/classes/generate/admin.php',
-	'Oil\\Generate_Scaffold'			=> __DIR__.'/classes/generate/scaffold.php',
-	'Oil\\Package'					 	=> __DIR__.'/classes/package.php',
-	'Oil\\Refine'					 	=> __DIR__.'/classes/refine.php',
-));
-
-/* End of file bootstrap.php */

+ 0 - 254
frameworks/PHP/php-fuel/fuel/packages/oil/classes/cell.php

@@ -1,254 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Package Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- * @author		Phil Sturgeon
- */
-class Cell
-{
-	protected static $_protected = array('auth', 'email', 'oil', 'orm', 'parser');
-	protected static $_api_url = 'http://cells.fuelphp.com/api/';
-
-	protected static $_git_binary = 'git';
-	protected static $_hg_binary = 'hg';
-
-	public static function install($package = null)
-	{
-		// Make sure something is set
-		if ($package === null)
-		{
-			static::help();
-			return;
-		}
-
-		$version = \Cli::option('version', 'master');
-
-		// Check to see if this package is already installed
-		if (is_dir(PKGPATH . $package))
-		{
-			throw new Exception('Package "' . $package . '" is already installed.');
-			return;
-		}
-
-		$request_url = static::$_api_url.'cells/show.json?name='.urlencode($package);
-		$response = json_decode(@file_get_contents($request_url), true);
-
-		if ( ! $response)
-		{
-			throw new Exception('No response from the API. Perhaps check your internet connection?');
-		}
-
-		if (empty($response['cell']))
-		{
-			throw new Exception('Could not find the cell "' . $package . '".');
-		}
-
-		$cell = $response['cell'];
-
-		// Now, lets get this package
-
-		// If it is git and (they have git installed (TODO) and they havent asked for a zip)
-		if ($cell['repository_type'] == 'git' and ! \Cli::option('via-zip'))
-		{
-			\Cli::write('Downloading package: ' . $package);
-			static::_clone_package_repo($cell['repository_url'], $package, $version);
-		}
-
-		// Fallback to shoving a ZIP file in place
-		else
-		{
-			\Cli::write('Downloading package: ' . $package);
-			static::_download_package_zip($zip_url, $package, $version);
-		}
-	}
-
-	public static function all()
-	{
-		$request_url = static::$_api_url.'cells/list.json';
-		$response = json_decode(@file_get_contents($request_url), true);
-
-		if (empty($response['cells']))
-		{
-			throw new Exception('No cells were found with this name.');
-		}
-
-		foreach ($response['cells'] as $cell)
-		{
-			\Cli::write(\Cli::color($cell['name'], 'yellow').' '.\Cli::color($cell['current_version'], 'white').' - '.$cell['summary']);
-		}
-	}
-
-	public static function search($name)
-	{
-		$request_url = static::$_api_url.'cells/search.json?name='.urlencode($name);
-		$response = json_decode(file_get_contents($request_url), true);
-
-		if (empty($response['cells']))
-		{
-			throw new Exception('No cells were found with this name.');
-		}
-
-		foreach ($response['cells'] as $cell)
-		{
-			\Cli::write(\Cli::color($cell['name'], 'yellow').' '.\Cli::color($cell['current_version'], 'white').' - '.$cell['summary']);
-		}
-	}
-
-
-	public static function uninstall($package)
-	{
-		// Check to see if this package is already installed
-		if ( ! $package_folder = \Package::exists($package))
-		{
-			throw new Exception('Package "' . $package . '" is not installed.');
-			return false;
-		}
-
-		// Check to see if this package is already installed
-		if (in_array($package, static::$_protected))
-		{
-			throw new Exception('Package "' . $package . '" cannot be uninstalled.');
-			return false;
-		}
-
-		\Cli::write('Package "' . $package . '" was uninstalled.', 'yellow');
-
-		\File::delete_dir($package_folder);
-	}
-
-	public static function info($cell = null)
-	{
-		// Make sure something is set
-		if ($cell === null)
-		{
-			static::help();
-			return;
-		}
-
-		$request_url = static::$_api_url.'cells/show.json?name='.urlencode($cell);
-		$response = json_decode(@file_get_contents($request_url), true);
-
-		if ( ! $response)
-		{
-			throw new Exception('No response from the API. Perhaps check your internet connection?');
-		}
-
-		else if (empty($response['cell']))
-		{
-			throw new Exception('Could not find the cell "' . $cell . '".');
-		}
-
-		var_dump($response);
-	}
-
-	public static function help()
-	{
-		$output = <<<HELP
-
-Usage:
-  oil cell <sub-command> <cell-name>
-
-Description:
-  Packages containing extra functionality can be downloaded (or git cloned) simply with
-  the following commands.
-
-Runtime options:
-  --via-zip       # Download a ZIP file instead of using Git or Hg.
-
-Examples:
-  oil cell list
-  oil cell search <keyword>
-  oil cell show <cell-name>
-  oil cell install <cell-name>
-  oil cell uninstall <cell-name>
-
-Documentation:
-  http://docs.fuelphp.com/packages/oil/cell.html
-HELP;
-		\Cli::write($output);
-
-	}
-
-
-	protected static function _use_git()
-	{
-		exec('which git', $output);
-
-		// If this is a valid path to git, use it instead of just "git"
-		if (file_exists($line = trim(current($output))))
-		{
-			static::$git = $line;
-		}
-
-		unset($output);
-
-		// Double check git is installed (windows will fail step 1)
-		exec(static::$git . ' --version', $output);
-
-		preg_match('#^(git version)#', current($output), $matches);
-
-		// If we have a match, use Git!
-		return ! empty($matches[0]);
-	}
-
-	protected static function _download_package_zip($zip_url, $package, $version)
-	{
-		// Make the folder so we can extract the ZIP to it
-		mkdir($tmp_folder = APPPATH . 'tmp/' . $package . '-' . time());
-
-		$zip_file = $tmp_folder . '.zip';
-		@copy($zip_url, $zip_file);
-
-		$unzip = new \Unzip;
-		$files = $unzip->extract($zip_file, $tmp_folder);
-
-		// Grab the first folder out of it (we dont know what it's called)
-		list($tmp_package_folder) = glob($tmp_folder.'/*', GLOB_ONLYDIR);
-
-		$package_folder = PKGPATH . $package;
-
-		// Move that folder into the packages folder
-		rename($tmp_package_folder, $package_folder);
-
-		unlink($zip_file);
-		rmdir($tmp_folder);
-
-		foreach ($files as $file)
-		{
-			$path = str_replace($tmp_package_folder, $package_folder, $file);
-			chmod($path, octdec(755));
-			\Cli::write("\t" . $path);
-		}
-	}
-
-	public static function _clone_package_repo($repo_url, $package, $version)
-	{
-		// TODO Make this magic
-		// $package_folder = str_replace(realpath(__DIR__.'/').'/', '', PKGPATH.$package);
-		$package_folder = 'fuel/packages/'.$package;
-
-		// Clone to the package path
-		passthru(static::$_git_binary.' submodule add '.$repo_url.' '.$package_folder);
-		passthru(static::$_git_binary.' submodule update');
-
-		\Cli::write('');
-	}
-}
-
-/* End of file package.php */

+ 0 - 262
frameworks/PHP/php-fuel/fuel/packages/oil/classes/command.php

@@ -1,262 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Cli Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- */
-class Command
-{
-	public static function init($args)
-	{
-		\Config::load('oil', true);
-
-		// Remove flag options from the main argument list
-		$args = self::_clear_args($args);
-
-		try
-		{
-			if ( ! isset($args[1]))
-			{
-				if (\Cli::option('v', \Cli::option('version')))
-				{
-					\Cli::write('Fuel: '.\Fuel::VERSION.' running in "'.\Fuel::$env.'" mode');
-					return;
-				}
-
-				static::help();
-				return;
-			}
-
-			switch ($args[1])
-			{
-				case 'g':
-				case 'generate':
-
-					$action = isset($args[2]) ? $args[2]: 'help';
-
-					$subfolder = 'orm';
-					if (is_int(strpos($action, '/')))
-					{
-						list($action, $subfolder)=explode('/', $action);
-					}
-
-					switch ($action)
-					{
-						case 'config':
-						case 'controller':
-						case 'model':
-						case 'migration':
-						case 'task':
-							call_user_func('Oil\Generate::'.$action, array_slice($args, 3));
-						break;
-
-						case 'views':
-							call_user_func('Oil\Generate::views', array_slice($args, 3), $subfolder);
-						break;
-
-						case 'admin':
-							call_user_func('Oil\Generate_Admin::forge', array_slice($args, 3), $subfolder);
-						break;
-
-						case 'scaffold':
-							call_user_func('Oil\Generate_Scaffold::forge', array_slice($args, 3), $subfolder);
-						break;
-
-						default:
-							Generate::help();
-					}
-
-				break;
-
-				case 'c':
-				case 'console':
-					new Console;
-
-				case 'p':
-				case 'package':
-
-					$action = isset($args[2]) ? $args[2]: 'help';
-
-					switch ($action)
-					{
-						case 'install':
-						case 'uninstall':
-							call_user_func_array('Oil\Package::'.$action, array_slice($args, 3));
-						break;
-
-						default:
-							Package::help();
-					}
-
-				break;
-
-				case 'r':
-				case 'refine':
-
-					// Developers of third-party tasks may not be displaying PHP errors. Report any error and quit
-					set_error_handler(function($errno, $errstr, $errfile, $errline) {
-						if (!error_reporting()) return; // If the error was supressed with an @ then we ignore it!
-
-						\Cli::error("Error: {$errstr} in $errfile on $errline");
-						\Cli::beep();
-						exit(1);
-					});
-
-					$task = isset($args[2]) ? $args[2] : null;
-
-					call_user_func('Oil\Refine::run', $task, array_slice($args, 3));
-				break;
-
-				case 'cell':
-				case 'cells':
-
-					$action = isset($args[2]) ? $args[2]: 'help';
-
-					switch ($action)
-					{
-						case 'list':
-							call_user_func('Oil\Cell::all');
-						break;
-
-						case 'search':
-						case 'install':
-						case 'upgrade':
-						case 'uninstall':
-							call_user_func_array('Oil\Cell::'.$action, array_slice($args, 3));
-						break;
-
-						case 'info':
-						case 'details':
-							call_user_func_array('Oil\Cell::info', array_slice($args, 3));
-						break;
-
-						default:
-							Cell::help();
-					}
-
-				break;
-
-				case 't':
-				case 'test':
-
-					// Suppressing this because if the file does not exist... well thats a bad thing and we can't really check
-					// I know that supressing errors is bad, but if you're going to complain: shut up. - Phil
-					$phpunit_autoload_path = \Config::get('oil.phpunit.autoload_path', 'PHPUnit/Autoload.php' );
-					@include_once($phpunit_autoload_path);
-
-					// Attempt to load PHUnit.  If it fails, we are done.
-					if ( ! class_exists('PHPUnit_Framework_TestCase'))
-					{
-						throw new Exception('PHPUnit does not appear to be installed.'.PHP_EOL.PHP_EOL."\tPlease visit http://phpunit.de and install.");
-					}
-
-					// Check for a custom phpunit config, but default to the one from core
-					if (file_exists(APPPATH.'phpunit.xml'))
-					{
-						$phpunit_config = APPPATH.'phpunit.xml';
-					}
-					else
-					{
-						$phpunit_config = COREPATH.'phpunit.xml';
-					}
-
-					// CD to the root of Fuel and call up phpunit with the path to our config
-					$phpunit_command = \Config::get('oil.phpunit.binary_path', 'phpunit');
-					$command = 'cd '.DOCROOT.'; '.$phpunit_command.' -c "'.$phpunit_config.'"';
-
-					// Respect the group options
-					\Cli::option('group') and $command .= ' --group '.\Cli::option('group');
-					\Cli::option('exclude-group') and $command .= ' --exclude-group '.\Cli::option('exclude-group');
-
-					// Respect the coverage-html option
-					\Cli::option('coverage-html') and $command .= ' --coverage-html '.\Cli::option('coverage-html');
-					\Cli::option('coverage-clover') and $command .= ' --coverage-clover '.\Cli::option('coverage-clover');
-					\Cli::option('coverage-text') and $command .= ' --coverage-text='.\Cli::option('coverage-text');
-					\Cli::option('coverage-php') and $command .= ' --coverage-php '.\Cli::option('coverage-php');
-
-					\Cli::write('Tests Running...This may take a few moments.', 'green');
-
-					$return_code = 0;
-					foreach(explode(';', $command) as $c)
-					{
-						passthru($c, $return_code_task);
-						// Return failure if any subtask fails
-						$return_code |= $return_code_task;
-					}
-					exit($return_code);
-				break;
-
-				default:
-
-					static::help();
-			}
-		}
-
-		catch (Exception $e)
-		{
-			\Cli::error('Error: '.$e->getMessage());
-			\Cli::beep();
-
-			\Cli::option('speak') and `say --voice="Trinoids" "{$e->getMessage()}"`;
-			exit(1);
-		}
-	}
-
-	public static function help()
-	{
-		echo <<<HELP
-
-Usage:
-  php oil [cell|console|generate|package|refine|help|test]
-
-Runtime options:
-  -f, [--force]    # Overwrite files that already exist
-  -s, [--skip]     # Skip files that already exist
-  -q, [--quiet]    # Supress status output
-  -t, [--speak]    # Speak errors in a robot voice
-
-Description:
-  The 'oil' command can be used in several ways to facilitate quick development, help with
-  testing your application and for running Tasks.
-
-Environment:
-  If you want to specify a specific environment oil has to run in, overload the environment
-  variable on the commandline: FUEL_ENV=staging php oil <commands>
-
-Documentation:
-  http://docs.fuelphp.com/packages/oil/intro.html
-
-HELP;
-
-	}
-
-	private static function _clear_args($actions = array())
-	{
-		foreach ($actions as $key => $action)
-		{
-			if (substr($action, 0, 1) === '-')
-			{
-				unset($actions[$key]);
-			}
-		}
-
-		return $actions;
-	}
-}
-
-/* End of file oil/classes/command.php */

+ 0 - 237
frameworks/PHP/php-fuel/fuel/packages/oil/classes/console.php

@@ -1,237 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Console Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- * @author		Phil Sturgeon
- */
-
-class Console
-{
-
-	public function __construct()
-	{
-		error_reporting(E_ALL | E_STRICT);
-
-		ini_set("error_log", stderr);
-		ini_set("log_errors", 1);
-		ini_set("html_errors", 0);
-		ini_set("display_errors", 0);
-
-		while (ob_get_level ())
-		{
-			 ob_end_clean();
-		}
-
-		ob_implicit_flush(true);
-
-		// And, go!
-		self::main();
-	}
-
-	private function main()
-	{
-		\Cli::write(sprintf(
-			'Fuel %s - PHP %s (%s) (%s) [%s]',
-			\Fuel::VERSION,
-			phpversion(),
-			php_sapi_name(),
-			self::build_date(),
-			PHP_OS
-		));
-
-		// Loop until they break it
-		while (TRUE)
-		{
-			if (\Cli::$readline_support)
-			{
-				readline_completion_function(array(__CLASS__, 'tab_complete'));
-			}
-
-			if ( ! $__line = rtrim(trim(trim(\Cli::input('>>> ')), PHP_EOL), ';'))
-			{
-				continue;
-			}
-
-			if ($__line == 'quit')
-			{
-				break;
-			}
-
-			// Add this line to history
-			//$this->history[] = array_slice($this->history, 0, -99) + array($line);
-			if (\Cli::$readline_support)
-			{
-				readline_add_history($__line);
-			}
-
-			if (self::is_immediate($__line))
-			{
-				$__line = "return ($__line)";
-			}
-
-			ob_start();
-
-			// Unset the previous line and execute the new one
-			$random_ret = \Str::random();
-			try
-			{
-				$ret = eval("unset(\$__line); $__line;");
-			}
-			catch(\Exception $e)
-			{
-				$ret = $random_ret;
-				$__line = $e->getMessage();
-			}
-
-			// Error was returned
-			if ($ret === $random_ret)
-			{
-				\Cli::error('Parse Error - ' . $__line);
-				\Cli::beep();
-			}
-
-			if (ob_get_length() == 0)
-			{
-				if (is_bool($ret))
-				{
-					echo $ret ? 'true' : 'false';
-				}
-				elseif (is_string($ret))
-				{
-					echo addcslashes($ret, "\0..\37\177..\377");
-				}
-				elseif ( ! is_null($ret))
-				{
-					var_export($ret);
-				}
-			}
-
-			unset($ret);
-			$out = ob_get_contents();
-			ob_end_clean();
-
-			if ((strlen($out) > 0) && (substr($out, -1) != PHP_EOL))
-			{
-				$out .= PHP_EOL;
-			}
-
-			echo $out;
-			unset($out);
-		}
-	}
-
-	private static function is_immediate($line)
-	{
-		$skip = array(
-			'class', 'declare', 'die', 'echo', 'exit', 'for',
-			'foreach', 'function', 'global', 'if', 'include',
-			'include_once', 'print', 'require', 'require_once',
-			'return', 'static', 'switch', 'unset', 'while'
-		);
-
-		$okeq = array('===', '!==', '==', '!=', '<=', '>=');
-
-		$code = '';
-		$sq = false;
-		$dq = false;
-
-		for ($i = 0; $i < strlen($line); $i++)
-		{
-			$c = $line{$i};
-			if ($c == "'")
-			{
-				$sq = !$sq;
-			}
-			elseif ($c == '"')
-			{
-				$dq = !$dq;
-			}
-
-			elseif ( ($sq) || ($dq) && $c == "\\")
-			{
-				++$i;
-			}
-			else
-			{
-				$code .= $c;
-			}
-		}
-
-		$code = str_replace($okeq, '', $code);
-		if (strcspn($code, ';{=') != strlen($code))
-		{
-			return false;
-		}
-
-		$kw = preg_split("[^a-z0-9_]i", $code);
-		foreach ($kw as $i)
-		{
-			if (in_array($i, $skip))
-			{
-				return false;
-			}
-		}
-
-		return true;
-	}
-
-	public static function tab_complete($line, $pos, $cursor)
-	{
-		$const = array_keys(get_defined_constants());
-		$var = array_keys($GLOBALS);
-		$func = get_defined_functions();
-
-		foreach ($func["user"] as $i)
-		{
-				$func["internal"][] = $i;
-		}
-		$func = $func["internal"];
-
-		return array_merge($const, $var, $func);
-	}
-
-	private static function build_date()
-	{
-		ob_start();
-		phpinfo(INFO_GENERAL);
-
-		$x = ob_get_contents();
-		ob_end_clean();
-
-		$x = strip_tags($x);
-		$x = explode("\n", $x);	// PHP_EOL doesn't work on Windows
-		$s = array('Build Date => ', 'Build Date ');
-
-		foreach ($x as $i)
-		{
-			foreach ($s as $j)
-			{
-				if (substr($i, 0, strlen($j)) == $j)
-				{
-					return trim(substr($i, strlen($j)));
-				}
-			}
-		}
-
-		return '???';
-	}
-
-}
-
-/* End of file oil/classes/console.php */

+ 0 - 33
frameworks/PHP/php-fuel/fuel/packages/oil/classes/exception.php

@@ -1,33 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Exception Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- * @author		Phil Sturgeon
- */
-class Exception extends \Exception
-{
-
-//	public function __toString()
-//	{
-//		\Cli::write('Error: ' . $this->message);
-//	}
-
-}
-
-/* End of file oil/classes/exception.php */

+ 0 - 979
frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate.php

@@ -1,979 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Generate Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- * @author		Phil Sturgeon
- */
-class Generate
-{
-	public static $create_folders = array();
-	public static $create_files = array();
-
-	public static $scaffolding = false;
-
-	private static $_default_constraints = array(
-		'varchar' => 255,
-		'char' => 255,
-		'int' => 11
-	);
-
-	public static function config($args)
-	{
-		$file = strtolower(array_shift($args));
-
-		if (empty($file))
-		{
-			throw new Exception('No config filename has been provided.');
-		}
-
-		$config = array();
-
-		// load the config
-		if ($paths = \Finder::search('config', $file, '.php', true))
-		{
-			// Reverse the file list so that we load the core configs first and
-			// the app can override anything.
-			$paths = array_reverse($paths);
-			foreach ($paths as $path)
-			{
-				$config = \Fuel::load($path) + $config;
-			}
-		}
-		unset($path);
-
-		// We always pass in fields to a config, so lets sort them out here.
-		foreach ($args as $conf)
-		{
-			// Each paramater for a config is seperated by the : character
-			$parts = explode(":", $conf);
-
-			// We must have the 'name:value' if nothing else!
-			if (count($parts) >= 2)
-			{
-				$config[$parts[0]] = $parts[1];
-			}
-		}
-
-		$overwrite = (\Cli::option('o') or \Cli::option('overwrite'));
-
-		// strip whitespace and add tab
-		$export = str_replace(array('  ', 'array ('), array("\t", 'array('), var_export($config, true));
-
-		$content = '<?php'.PHP_EOL.PHP_EOL.'return '.$export.';';
-		$content .= <<<CONF
-
-
-/* End of file $file.php */
-CONF;
-
-		$module = \Cli::option('module', \Cli::option('m'));
-
-		// add support for `php oil g config module::file arg1:value1`
-		if (strpos($file, '::') !== false)
-		{
-			list($module, $file) = explode('::', $file);
-		}
-
-		// get the namespace path (if available)
-		if ( ! empty($module) and $path = \Autoloader::namespace_path('\\'.ucfirst($module)))
-		{
-			// strip the classes directory as we need the module root
-			// and construct the filename
-			$path = substr($path,0, -8).'config'.DS.$file.'.php';
-			$path_name = "\\".ucfirst($module).'::';
-		}
-		elseif ( ! empty($module))
-		{
-			throw new Exception("{$module} need to be loaded first, please use config always_load.modules.");
-		}
-		else
-		{
-			$path = APPPATH.'config'.DS.$file.'.php';
-			$path_name = 'APPPATH/';
-		}
-
-		if ( ! $overwrite and is_file($path))
-		{
-			throw new Exception("{$path_name}/config/{$file}.php already exist, please use --overwrite option to force update");
-		}
-
-		$path = pathinfo($path);
-
-		try
-		{
-			\File::update($path['dirname'], $path['basename'], $content);
-			\Cli::write("Created config: {$path_name}config/{$file}.php", 'green');
-		}
-		catch (\InvalidPathException $e)
-		{
-			throw new Exception("Invalid basepath, cannot update at ".$path_name."config".DS."{$file}.php");
-		}
-		catch (\FileAccessException $e)
-		{
-			throw new Exception($path_name."config".DS.$file.".php could not be written.");
-		}
-	}
-
-	public static function controller($args, $build = true)
-	{
-		if ( ! ($name = \Str::lower(array_shift($args))))
-		{
-			throw new Exception('No controller name was provided.');
-		}
-
-		// Do we want a view or a viewmodel?
-		$with_viewmodel = \Cli::option('with-viewmodel');
-
- 		$actions = $args;
-
-		$filename = trim(str_replace(array('_', '-'), DS, $name), DS);
-
-		$filepath = APPPATH.'classes'.DS.'controller'.DS.$filename.'.php';
-
-		// Uppercase each part of the class name and remove hyphens
-		$class_name = \Inflector::classify(str_replace(array('\\', '/'), '_', $name), false);
-
-		// Stick "blog" to the start of the array
-		array_unshift($args, $filename);
-
-		// Create views folder and each view file
-		if (\Cli::option('crud'))
-		{
-			static::views($args, 'scaffolding'.DS.'crud'.DS.'views', false);
-		}
-		else
-		{
-			static::views($args, 'scaffolding'.DS.'orm'.DS.'views', false);
-		}
-
-		$actions or $actions = array('index');
-
-		$action_str = '';
-		foreach ($actions as $action)
-		{
-			$action_str .= '
-	public function action_'.$action.'()
-	{
-		$this->template->title = \'' . \Inflector::humanize($name) .' &raquo; ' . \Inflector::humanize($action) . '\';
-		$this->template->content = View::forge(\''.$filename.'/' . $action .'\');
-	}'.PHP_EOL;
-		}
-
-		$extends = \Cli::option('extends', 'Controller_Template');
-
-		// Build Controller
-		$controller = <<<CONTROLLER
-<?php
-
-class Controller_{$class_name} extends {$extends}
-{
-{$action_str}
-}
-
-CONTROLLER;
-
-		// Write controller
-		static::create($filepath, $controller, 'controller');
-
-
-		// Do you want a viewmodel with that?
-		if ($with_viewmodel)
-		{
-			$viewmodel_filepath = APPPATH.'classes'.DS.'view'.DS.$filename;
-
-			// One ViewModel per action
-			foreach ($actions as $action)
-			{
-				$viewmodel = <<<VIEWMODEL
-<?php
-
-class View_{$class_name}_{$action} extends Viewmodel
-{
-	public function view()
-	{
-		\$this->content = "{$class_name} &raquo; {$action}";
-	}
-}
-VIEWMODEL;
-
-				// Write viewmodel
-				static::create($viewmodel_filepath.DS.$action.'.php', $viewmodel, 'viewmodel');
-			}
-		}
-
-		$build and static::build();
-	}
-
-
-	public static function model($args, $build = true)
-	{
-		$singular = \Inflector::singularize(\Str::lower(array_shift($args)));
-
-		if (empty($singular) or strpos($singular, ':'))
-		{
-			throw new Exception("Command is invalid.".PHP_EOL."\tphp oil g model <modelname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..]");
-		}
-
-		if (empty($args))
-		{
-			throw new Exception('No fields have been provided, the model will not know how to build the table.');
-		}
-
-		$plural = \Cli::option('singular') ? $singular : \Inflector::pluralize($singular);
-
-		$filename = trim(str_replace(array('_', '-'), DS, $singular), DS);
-
-		$filepath = APPPATH.'classes'.DS.'model'.DS.$filename.'.php';
-
-		// Uppercase each part of the class name and remove hyphens
-		$class_name = \Inflector::classify(str_replace(array('\\', '/'), '_', $singular), false);
-
-		// Turn foo:string into "id", "foo",
-		$properties = implode(",\n\t\t", array_map(function($field) {
-
-			// Only take valid fields
-			if (($field = strstr($field, ':', true)))
-			{
-				return "'".$field."'";
-			}
-
-		}, $args));
-
-		// Make sure an id is present
-		strpos($properties, "'id'") === false and $properties = "'id',\n\t\t".$properties.',';
-
-		$contents = '';
-
-		if (\Cli::option('crud'))
-		{
-			if ( ! \Cli::option('no-properties'))
-			{
-				$contents = <<<CONTENTS
-	protected static \$_properties = array(
-		{$properties}
-	);
-
-CONTENTS;
-			}
-
-			if($created_at = \Cli::option('created-at'))
-			{
-				is_string($created_at) or $created_at = 'created_at';
-
-				$contents .= <<<CONTENTS
-
-	protected static \$_created_at = '$created_at';
-
-CONTENTS;
-			}
-
-			if($updated_at = \Cli::option('updated-at'))
-			{
-				is_string($updated_at) or $updated_at = 'updated_at';
-
-				$contents .= <<<CONTENTS
-
-	protected static \$_updated_at = '$updated_at';
-
-CONTENTS;
-			}
-
-			if(\Cli::option('mysql-timestamp'))
-			{
-				$contents .= <<<CONTENTS
-
-	protected static \$_mysql_timestamp = true;
-
-CONTENTS;
-			}
-
-			$contents .= <<<CONTENTS
-
-	protected static \$_table_name = '{$plural}';
-
-CONTENTS;
-			$model = <<<MODEL
-<?php
-
-class Model_{$class_name} extends \Model_Crud
-{
-{$contents}
-}
-
-MODEL;
-		}
-		else
-		{
-			if ( ! \Cli::option('no-timestamp'))
-			{
-				$created_at = \Cli::option('created-at', 'created_at');
-				is_string($created_at) or $created_at = 'created_at';
-				$properties .= "\n\t\t'".$created_at."',";
-
-				$updated_at = \Cli::option('updated-at', 'updated_at');
-				is_string($updated_at) or $updated_at = 'updated_at';
-				$properties .= "\n\t\t'".$updated_at."',";
-
-				$time_type = (\Cli::option('mysql-timestamp')) ? 'timestamp' : 'int';
-
-				$timestamp_properties = array($created_at.':'.$time_type.':null[1]', $updated_at.':'.$time_type.':null[1]');
-				$args = array_merge($args, $timestamp_properties);
-			}
-
-			if ( ! \Cli::option('no-properties'))
-			{
-				$contents = <<<CONTENTS
-	protected static \$_properties = array(
-		{$properties}
-	);
-
-CONTENTS;
-			}
-
-			if ( ! \Cli::option('no-timestamp'))
-			{
-				$mysql_timestamp = (\Cli::option('mysql-timestamp')) ? 'true' : 'false';
-
-				if(($created_at = \Cli::option('created-at')) and is_string($created_at))
-				{
-					$created_at = <<<CONTENTS
-
-			'property' => '$created_at',
-CONTENTS;
-				}
-				else
-				{
-					$created_at = '';
-				}
-
-				if(($updated_at = \Cli::option('updated-at')) and is_string($updated_at))
-				{
-					$updated_at = <<<CONTENTS
-
-			'property' => '$updated_at',
-CONTENTS;
-				}
-				else
-				{
-					$updated_at = '';
-				}
-
-				$contents .= <<<CONTENTS
-
-	protected static \$_observers = array(
-		'Orm\Observer_CreatedAt' => array(
-			'events' => array('before_insert'),
-			'mysql_timestamp' => $mysql_timestamp,$created_at
-		),
-		'Orm\Observer_UpdatedAt' => array(
-			'events' => array('before_save'),
-			'mysql_timestamp' => $mysql_timestamp,$updated_at
-		),
-	);
-CONTENTS;
-			}
-
-			$model = <<<MODEL
-<?php
-
-class Model_{$class_name} extends \Orm\Model
-{
-{$contents}
-}
-
-MODEL;
-		}
-
-		// Build the model
-		static::create($filepath, $model, 'model');
-
-		if ( ! \Cli::option('no-migration'))
-		{
-			if ( ! empty($args))
-			{
-				array_unshift($args, 'create_'.$plural);
-				static::migration($args, false);
-			}
-
-			else
-			{
-				throw new \Exception('Not enough arguments to create this migration.');
-			}
-		}
-
-		$build and static::build();
-	}
-
-
-	public static function views($args, $subfolder, $build = true)
-	{
-		$controller = strtolower(array_shift($args));
-		$controller_title = \Inflector::humanize($controller);
-
-		$view_dir = APPPATH.'views/'.trim(str_replace(array('_', '-'), DS, $controller), DS).DS;
-
-		$args or $args = array('index');
-
-		// Make the directory for these views to be store in
-		is_dir($view_dir) or static::$create_folders[] = $view_dir;
-
-		// Add the default template if it doesnt exist
-		if ( ! file_exists($app_template = APPPATH.'views/template.php'))
-		{
-			static::create($app_template, file_get_contents(\Package::exists('oil').'views/scaffolding/template.php'), 'view');
-		}
-
-		foreach ($args as $action)
-		{
-			$view_title = \Cli::option('with-viewmodel') ? '<?php echo $content; ?>' : \Inflector::humanize($action);
-
-			$view = <<<VIEW
-<p>{$view_title}</p>
-VIEW;
-
-			// Create this view
-			static::create($view_dir.$action.'.php', $view, 'view');
-		}
-
-		$build and static::build();
-	}
-
-
-	public static function migration($args, $build = true)
-	{
-		// Get the migration name
-		$migration_name = \Str::lower(str_replace(array('-', '/'), '_', array_shift($args)));
-
-		if (empty($migration_name) or strpos($migration_name, ':'))
-		{
-			throw new Exception("Command is invalid.".PHP_EOL."\tphp oil g migration <migrationname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..]");
-		}
-
-		// Check if a migration with this name already exists
-		if (($duplicates = glob(APPPATH."migrations/*_{$migration_name}*")) === false)
-		{
-			throw new Exception("Unable to read existing migrations. Do you have an 'open_basedir' defined?");
-		}
-
-		if (count($duplicates) > 0)
-		{
-			// Don't override a file
-			if (\Cli::option('s', \Cli::option('skip')) === true)
-			{
-				return;
-			}
-
-			// Tear up the file path and name to get the last duplicate
-			$file_name = pathinfo(end($duplicates), PATHINFO_FILENAME);
-
-			// Override the (most recent) migration with the same name by using its number
-			if (\Cli::option('f', \Cli::option('force')) === true)
-			{
-				list($number) = explode('_', $file_name);
-			}
-
-			// Name clashes but this is done by hand. Assume they know what they're doing and just increment the file
-			elseif (static::$scaffolding === false)
-			{
-				// Increment the name of this
-				$migration_name = \Str::increment(substr($file_name, 4), 2);
-			}
-		}
-
-		// See if the action exists
-		$methods = get_class_methods(__NAMESPACE__ . '\Generate_Migration_Actions');
-
-		// For empty migrations that dont have actions
-		$migration = array('', '');
-
-		// Loop through the actions and act on a matching action appropriately
-		foreach ($methods as $method_name)
-		{
-			// If the miration name starts with the name of the action method
-			if (substr($migration_name, 0, strlen($method_name)) === $method_name)
-			{
-				/**
-				 *	Create an array of the subject the migration is about
-				 *
-				 *	- In a migration named 'create_users' the subject is 'users' since thats what we want to create
-				 *		So it would be the second object in the array
-				 *			array(false, 'users')
-				 *
-				 *	- In a migration named 'add_name_to_users' the object is 'name' and the subject is 'users'.
-				 *		So again 'users' would be the second object, but 'name' would be the first
-				 *			array('name', 'users')
-				 *
-				 */
-				$subjects = array(false, false);
-				$matches = explode('_', str_replace($method_name . '_', '', $migration_name));
-
-				// create_{table}
-				if (count($matches) == 1)
-				{
-					$subjects = array(false, $matches[0]);
-				}
-
-				// add_{field}_to_{table}
-				else if (count($matches) == 3 && $matches[1] == 'to')
-				{
-					$subjects = array($matches[0], $matches[2]);
-				}
-
-				// delete_{field}_from_{table}
-				else if (count($matches) == 3 && $matches[1] == 'from')
-				{
-					$subjects = array($matches[0], $matches[2]);
-				}
-
-				// rename_field_{field}_to_{field}_in_{table} (with underscores in field names)
-				else if (count($matches) >= 5 && in_array('to', $matches) && in_array('in', $matches))
-				{
-					$subjects = array(
-					 implode('_', array_slice($matches, array_search('in', $matches)+1)),
-					 implode('_', array_slice($matches, 0, array_search('to', $matches))),
-					 implode('_', array_slice($matches, array_search('to', $matches)+1, array_search('in', $matches)-2))
-				  );
-				}
-
-				// rename_table
-				else if ($method_name == 'rename_table')
-				{
-					$subjects = array(
-					 implode('_', array_slice($matches, 0, array_search('to', $matches))),
-					 implode('_', array_slice($matches, array_search('to', $matches)+1))
-				  );
-				}
-
-				// create_{table} or drop_{table} (with underscores in table name)
-				else if (count($matches) !== 0)
-				{
-					$name = str_replace(array('create_', 'add_', '_to_'), array('create-', 'add-', '-to-'), $migration_name);
-
-    				if (preg_match('/^(create|add)\-([a-z0-9\_]*)(\-to\-)?([a-z0-9\_]*)?$/i', $name, $deep_matches))
-    				{
-    					switch ($deep_matches[1])
-    					{
-    						case 'create' :
-    							$subjects = array(false, $deep_matches[2]);
-    						break;
-
-    						case 'add' :
-    							$subjects = array($deep_matches[2], $deep_matches[4]);
-    						break;
-    					}
-    				}
-				}
-
-				// There is no subject here so just carry on with a normal empty migration
-				else
-				{
-					break;
-				}
-
-				// We always pass in fields to a migration, so lets sort them out here.
-				$fields = array();
-				foreach ($args as $field)
-				{
-					$field_array = array();
-
-					// Each paramater for a field is seperated by the : character
-					$parts = explode(":", $field);
-
-					// We must have the 'name:type' if nothing else!
-					if (count($parts) >= 2)
-					{
-						$field_array['name'] = array_shift($parts);
-						foreach ($parts as $part_i => $part)
-						{
-							preg_match('/([a-z0-9_-]+)(?:\[([0-9a-z\,\s]+)\])?/i', $part, $part_matches);
-							array_shift($part_matches);
-
-							if (count($part_matches) < 1)
-							{
-								// Move onto the next part, something is wrong here...
-								continue;
-							}
-
-							$option_name = ''; // This is the name of the option to be passed to the action in a field
-							$option = $part_matches;
-
-							// The first option always has to be the field type
-							if ($part_i == 0)
-							{
-								$option_name = 'type';
-								$type = $option[0];
-								if ($type === 'string')
-								{
-									$type = 'varchar';
-								}
-								else if ($type === 'integer')
-								{
-									$type = 'int';
-								}
-
-								if ( ! in_array($type, array('text', 'blob', 'datetime', 'date', 'timestamp', 'time')))
-								{
-									if ( ! isset($option[1]) || $option[1] == NULL)
-									{
-										if (isset(self::$_default_constraints[$type]))
-										{
-											$field_array['constraint'] = self::$_default_constraints[$type];
-										}
-									}
-									else
-									{
-										// should support field_name:enum[value1,value2]
-										if ($type === 'enum')
-										{
-											$values = explode(',', $option[1]);
-											$option[1] = '"'.implode('","', $values).'"';
-
-											$field_array['constraint'] = $option[1];
-										}
-										// should support field_name:decimal[10,2]
-										elseif (in_array($type, array('decimal', 'float')))
-										{
-											$field_array['constraint'] = $option[1];
-										}
-										else
-										{
-											$field_array['constraint'] = (int) $option[1];
-										}
-
-									}
-								}
-								$option = $type;
-							}
-							else
-							{
-								// This allows you to put any number of :option or :option[val] into your field and these will...
-								// ... always be passed through to the action making it really easy to add extra options for a field
-								$option_name = array_shift($option);
-								if (count($option) > 0)
-								{
-									$option = $option[0];
-								}
-								else
-								{
-									$option = true;
-								}
-							}
-
-							// deal with some special cases
-							switch ($option_name)
-							{
-								case 'auto_increment':
-								case 'null':
-								case 'unsigned':
-									$option = (bool) $option;
-									break;
-							}
-
-							$field_array[$option_name] = $option;
-
-						}
-						$fields[] = $field_array;
-					}
-					else
-					{
-						// Invalid field passed in
-						continue;
-					}
-				}
-
-				// Call the magic action which returns an array($up, $down) for the migration
-				$migration = call_user_func(__NAMESPACE__ . "\Generate_Migration_Actions::{$method_name}", $subjects, $fields);
-			}
-		}
-
-		// Build the migration
-		list($up, $down)=$migration;
-
-		$migration_name = ucfirst(strtolower($migration_name));
-
-		$migration = <<<MIGRATION
-<?php
-
-namespace Fuel\Migrations;
-
-class {$migration_name}
-{
-	public function up()
-	{
-{$up}
-	}
-
-	public function down()
-	{
-{$down}
-	}
-}
-MIGRATION;
-
-		$number = isset($number) ? $number : static::_find_migration_number();
-		$filepath = APPPATH . 'migrations/'.$number.'_' . strtolower($migration_name) . '.php';
-
-		static::create($filepath, $migration, 'migration');
-
-		$build and static::build();
-	}
-
-
-
-	public static function task($args, $build = true)
-	{
-
-		if ( ! ($name = \Str::lower(array_shift($args))))
-		{
-			throw new Exception('No task name was provided.');
-		}
-
-		if (empty($args))
-		{
-			\Cli::write("\tNo tasks actions have been provided, the TASK will only create default task.", 'red');
-		}
-
-		$args or $args = array('index');
-
-		// Uppercase each part of the class name and remove hyphens
-		$class_name = \Inflector::classify($name, false);
-
-		$filename = trim(str_replace(array('_', '-'), DS, $name), DS);
-		$filepath = APPPATH.'tasks'.DS.$filename.'.php';
-
-		$action_str = '';
-
-		foreach ($args as $action)
-		{
-			$task_path = '\\'.\Inflector::humanize($name).'\\'.\Inflector::humanize($action);
-
-			if (!ctype_alpha($action[0])) {
-				throw new Exception('An action does not start with alphabet character.  ABORTING');
-			}
-
-			$action_str .= '
-	/**
-	 * This method gets ran when a valid method name is not used in the command.
-	 *
-	 * Usage (from command line):
-	 *
-	 * php oil r '.$name.':'.$action.' "arguments"
-	 *
-	 * @return string
-	 */
-	public static function '.$action.'($args = NULL)
-	{
-		echo "\n===========================================";
-		echo "\nRunning task ['.\Inflector::humanize($name).':'. \Inflector::humanize($action) . ']";
-		echo "\n-------------------------------------------\n\n";
-
-		/***************************
-		 Put in TASK DETAILS HERE
-		 **************************/
-	}'.PHP_EOL;
-
-			$message = \Cli::color("\t\tPreparing task method [", 'green');
-			$message .= \Cli::color(\Inflector::humanize($action), 'cyan');
-			$message .= \Cli::color("]", 'green');
-			\Cli::write($message);
-		}
-
-		// Default RUN task action
-		$action = 'run';
-		$default_action_str = '
-	/**
-	 * This method gets ran when a valid method name is not used in the command.
-	 *
-	 * Usage (from command line):
-	 *
-	 * php oil r '.$name.'
-	 *
-	 * @return string
-	 */
-	public static function run($args = NULL)
-	{
-		echo "\n===========================================";
-		echo "\nRunning DEFAULT task ['.\Inflector::humanize($name).':'. \Inflector::humanize($action) . ']";
-		echo "\n-------------------------------------------\n\n";
-
-		/***************************
-		 Put in TASK DETAILS HERE
-		 **************************/
-	}'.PHP_EOL;
-
-		// Build Controller
-		$task_class = <<<CONTROLLER
-<?php
-
-namespace Fuel\Tasks;
-
-class {$class_name}
-{
-{$default_action_str}
-
-{$action_str}
-}
-/* End of file tasks/{$name}.php */
-
-CONTROLLER;
-
-		// Write controller
-		static::create($filepath, $task_class, 'tasks');
-
-		$build and static::build();
-	}
-
-
-	public static function help()
-	{
-		$output = <<<HELP
-Usage:
-  php oil [g|generate] [controller|model|migration|scaffold|views] [options]
-
-Runtime options:
-  -f, [--force]    # Overwrite files that already exist
-  -s, [--skip]     # Skip files that already exist
-  -q, [--quiet]    # Supress status output
-  -t, [--speak]    # Speak errors in a robot voice
-
-Description:
-  The 'oil' command can be used to generate MVC components, database migrations
-  and run specific tasks.
-
-Examples:
-  php oil generate controller <controllername> [<action1> |<action2> |..]
-  php oil g model <modelname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..]
-  php oil g migration <migrationname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..]
-  php oil g scaffold <modelname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..]
-  php oil g scaffold/template_subfolder <modelname> [<fieldname1>:<type1> |<fieldname2>:<type2> |..]
-  php oil g config <filename> [<key1>:<value1> |<key2>:<value2> |..]
-
-Note that the next two lines are equivalent:
-  php oil g scaffold <modelname> ...
-  php oil g scaffold/crud <modelname> ...
-
-Documentation:
-  http://docs.fuelphp.com/packages/oil/generate.html
-HELP;
-
-		\Cli::write($output);
-	}
-
-
-	public static function create($filepath, $contents, $type = 'file')
-	{
-		$directory = dirname($filepath);
-		is_dir($directory) or static::$create_folders[] = $directory;
-
-		// Check if a file exists then work out how to react
-		if (file_exists($filepath))
-		{
-			// Don't override a file
-			if (\Cli::option('s', \Cli::option('skip')) === true)
-			{
-				// Don't bother trying to make this, carry on camping
-				return;
-			}
-
-			// If we aren't skipping it, tell em to use -f
-			if (\Cli::option('f', \Cli::option('force')) === null)
-			{
-				throw new Exception($filepath .' already exists, use -f or --force to override.');
-				exit;
-			}
-		}
-
-		static::$create_files[] = array(
-			'path' => $filepath,
-			'contents' => $contents,
-			'type' => $type
-		);
-	}
-
-
-	public static function build()
-	{
-		foreach (static::$create_folders as $folder)
-		{
-			is_dir($folder) or mkdir($folder, 0755, TRUE);
-		}
-
-		foreach (static::$create_files as $file)
-		{
-			\Cli::write("\tCreating {$file['type']}: {$file['path']}", 'green');
-
-			if ( ! $handle = @fopen($file['path'], 'w+'))
-			{
-				throw new Exception('Cannot open file: '. $file['path']);
-			}
-
-			$result = @fwrite($handle, $file['contents']);
-
-			// Write $somecontent to our opened file.
-			if ($result === false)
-			{
-				throw new Exception('Cannot write to file: '. $file['path']);
-			}
-
-			@fclose($handle);
-
-			@chmod($file['path'], 0666);
-		}
-
-		return $result;
-	}
-
-	public static function class_name($name)
-	{
-		return str_replace(array(' ', '-'), '_', ucwords(str_replace('_', ' ', $name)));
-	}
-
-	// Helper methods
-
-	private static function _find_migration_number()
-	{
-		$glob = glob(APPPATH .'migrations/*_*.php');
-		list($last) = explode('_', basename(end($glob)));
-
-		return str_pad($last + 1, 3, '0', STR_PAD_LEFT);
-	}
-
-	private static function _update_current_version($version)
-	{
-		if (file_exists($app_path = APPPATH.'config'.DS.'migrations.php'))
-		{
-			$contents = file_get_contents($app_path);
-		}
-		elseif (file_exists($core_path = COREPATH.'config'.DS.'migrations.php'))
-		{
-			$contents = file_get_contents($core_path);
-		}
-		else
-		{
-			throw new \Exception('Config file core/config/migrations.php');
-			exit;
-		}
-
-		$contents = preg_replace("#('version'[ \t]+=>)[ \t]+([0-9]+),#i", "$1 $version,", $contents);
-
-		static::create($app_path, $contents, 'config');
-	}
-}
-
-/* End of file oil/classes/generate.php */

+ 0 - 79
frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate/admin.php

@@ -1,79 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Scaffold Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- */
-class Generate_Admin extends Generate_Scaffold
-{
-	public static $view_subdir = 'admin/';
-
-	public static $controller_prefix = 'Admin_';
-	public static $model_prefix = '';
-
-	public static $controller_parent = 'Controller_Admin';
-
-	public static function forge($args, $subfolder)
-	{
-
-		$default_files = array(
-			array(
-				'source' => $subfolder.'/controllers/base.php',
-				'location' => 'classes/controller/base.php',
-				'type' => 'controller',
-			),
-			array(
-				'source' => $subfolder.'/controllers/admin.php',
-				'location' => 'classes/controller/admin.php',
-				'type' => 'controller',
-			),
-			array(
-				'source' => '/template.php',
-				'location' => 'views/admin/template.php',
-				'type' => 'views',
-			),
-			array(
-				'source' => 'dashboard.php',
-				'location' => 'views/admin/dashboard.php',
-				'type' => 'views',
-			),
-			array(
-				'source' => 'login.php',
-				'location' => 'views/admin/login.php',
-				'type' => 'views',
-			),
-		);
-
-		foreach ($default_files as $file)
-		{
-			// check if there's a template in app, and if so, use that
-			if (file_exists(APPPATH.'views/'.static::$view_subdir.$file['source']))
-			{
-				Generate::create(APPPATH.$file['location'], file_get_contents(APPPATH.'views/'.static::$view_subdir.$file['source']), $file['type']);
-			}
-			else
-			{
-				Generate::create(APPPATH.$file['location'], file_get_contents(\Package::exists('oil').'views/'.static::$view_subdir.$file['source']), $file['type']);
-			}
-		}
-
-		parent::forge($args, $subfolder);
-	}
-}
-
-/* End of file oil/classes/generate/admin.php */

+ 0 - 279
frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate/migration/actions.php

@@ -1,279 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Generate_Migration_Actions
- * Handles actions for generating migrations in Oil
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- * @author		Tom Arnfeld
- */
-class Generate_Migration_Actions
-{
-
-	/**
-	 * Each migration action should return an array with two items, 0 being the up and 1 the being down.
-	 */
-
-	// create_{tablename}
-	public static function create($subjects, $fields)
-	{
-		$field_str = '';
-		$defined_columns = array();
-		$have_id = false;
-
-		foreach($fields as $field)
-		{
-			$name = array_shift($field);
-
-			$name === 'id' and $have_id = true;
-
-			$field_opts = array();
-			foreach($field as $option => $val)
-			{
-				if($val === true)
-				{
-					$field_opts[] = "'$option' => true";
-				}
-				else
-				{
-					if(is_int($val))
-					{
-						$field_opts[] = "'$option' => $val";
-					}
-					else
-					{
-						$field_opts[] = "'$option' => '$val'";
-					}
-				}
-			}
-			$field_opts = implode(', ', $field_opts);
-
-			$field_str .= "\t\t\t'$name' => array({$field_opts}),".PHP_EOL;
-			$defined_columns[$name] = true;
-		}
-
-		// ID Field
-		$have_id or $field_str = "\t\t\t'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true),".PHP_EOL . $field_str;
-
-		$up = <<<UP
-		\DBUtil::create_table('{$subjects[1]}', array(
-$field_str
-		), array('id'));
-UP;
-
-		$down = <<<DOWN
-		\DBUtil::drop_table('{$subjects[1]}');
-DOWN;
-
-		return array($up, $down);
-	}
-
-	// add_{thing}_to_{tablename}
-	public static function add($subjects, $fields, $reverse = false)
-	{
-		$field_up_str = '';
-
-		foreach($fields as $field)
-		{
-			$name = array_shift($field);
-
-			$field_opts = array();
-
-			foreach($field as $option => $val)
-			{
-				if($val === true)
-				{
-					$field_opts[] = "'$option' => true";
-				}
-				else
-				{
-					if(is_int($val))
-					{
-						$field_opts[] = "'$option' => $val";
-					}
-					else
-					{
-						$field_opts[] = "'$option' => '$val'";
-					}
-				}
-			}
-
-			$field_opts = implode(', ', $field_opts);
-
-			$field_up_str .= "\t\t\t'$name' => array({$field_opts}),".PHP_EOL;
-			$field_down[] = "\t\t\t'$name'".PHP_EOL;
-		}
-
-		$field_down_str = implode(',', $field_down);
-
-		$up = <<<UP
-		\DBUtil::add_fields('{$subjects[1]}', array(
-$field_up_str
-		));
-UP;
-		$down = <<<DOWN
-		\DBUtil::drop_fields('{$subjects[1]}', array(
-$field_down_str
-		));
-DOWN;
-		return $reverse ? array($down, $up) : array($up, $down);
-	}
-
-	// delete_{thing}_from_{tablename}
-	public static function delete($subjects, $fields, $reverse = false)
-	{
-		return static::add($subjects, $fields, true);
-	}
-
-	// rename_field_{fieldname}_to_{newfieldname}_in_{table}
-	public static function rename_field($subjects, $fields)
-	{
-		$column_list = \DB::list_columns($subjects[0], $subjects[1]);
-		$column = $column_list[$subjects[1]];
-
-		switch ($column['type'])
-		{
-			case 'float':
-				$constraint = '\''.$column['numeric_precision'].', '.$column['numeric_scale'].'\'';
-			break;
-			case 'int':
-				$constraint = $column['display'];
-			break;
-			case 'string':
-				switch ($column['data_type'])
-				{
-					case 'binary':
-					case 'varbinary':
-					case 'char':
-					case 'varchar':
-						$constraint = $column['character_maximum_length'];
-					break;
-
-					case 'enum':
-					case 'set':
-					  $constraint = '"\''.implode('\',\'',$column['options']).'\'"';
-					break;
-				}
-			break;
-		}
-
-		$constraint_str = isset($constraint) ? ", 'constraint' => $constraint" : '';
-
-		$up = <<<UP
-		\DBUtil::modify_fields('{$subjects[0]}', array(
-\t\t\t'{$subjects[1]}' => array('name' => '{$subjects[2]}', 'type' => '{$column['data_type']}'$constraint_str)
-		));
-UP;
-		$down = <<<DOWN
-	\DBUtil::modify_fields('{$subjects[0]}', array(
-\t\t\t'{$subjects[2]}' => array('name' => '{$subjects[1]}', 'type' => '{$column['data_type']}'$constraint_str)
-		));
-DOWN;
-		return array($up, $down);
-	}
-
-	// rename_table_{tablename}_to_{newtablename}
-	public static function rename_table($subjects, $fields)
-	{
-
-		$up = <<<UP
-		\DBUtil::rename_table('{$subjects[0]}', '{$subjects[1]}');
-UP;
-		$down = <<<DOWN
-		\DBUtil::rename_table('{$subjects[1]}', '{$subjects[0]}');
-DOWN;
-
-		return array($up, $down);
-	}
-
-	// drop_{tablename}
-	public static function drop($subjects, $fields)
-	{
-		$up = <<<UP
-		\DBUtil::drop_table('{$subjects[1]}');
-UP;
-		$field_str = '';
-		$column_list = \DB::list_columns($subjects[1]);
-
-		foreach ($column_list as $column)
-		{
-			switch ($column['type'])
-			{
-				case 'float':
-					$constraint = '\''.$column['numeric_precision'].', '.$column['numeric_scale'].'\'';
-				break;
-				case 'int':
-					$constraint = $column['display'];
-				break;
-				case 'string':
-					switch ($column['data_type'])
-					{
-						case 'binary':
-						case 'varbinary':
-						case 'char':
-						case 'varchar':
-							$constraint = $column['character_maximum_length'];
-						break;
-
-						case 'enum':
-						case 'set':
-							$constraint = '"\''.implode('\',\'',$column['options']).'\'"';
-						break;
-					}
-				break;
-			}
-
-			$constraint_str = isset($constraint) ? ", 'constraint' => $constraint" : '';
-			$auto_increment = $column['extra'] == 'auto_increment' ? ", 'auto_increment' => true" : '';
-			$default_str = $column['default'] != null ? ", 'default' => '{$column['default']}'" : ", 'null' => true";
-
-			if ($column['key'] == 'PRI')
-			{
-			  $primary_keys[] = "'{$column['name']}'";
-			}
-			else if ($column['key'] == 'MUL')
-			{
-			  $indexes[] = $column['name'];
-			}
-
-			$field_str .= "\t\t\t'{$column['name']}' => array('type' => '{$column['data_type']}'{$default_str}{$constraint_str}{$auto_increment}),".PHP_EOL;
-			unset($constraint);
-		}
-
-		$primary_keys = implode(',', $primary_keys);
-		$down = <<<DOWN
-		\DBUtil::create_table('{$subjects[1]}', array(
-$field_str
-		), array($primary_keys));
-DOWN;
-		$down .= PHP_EOL;
-
-		$active_db = \Config::get('db.active');
-		$table_prefix = \Config::get('db.'.$active_db.'.table_prefix');
-
-		if (isset($indexes))
-		{
-			foreach ($indexes as $field)
-			{
-				$down .= "\t\t\\DB::query(\"CREATE INDEX {$field}_idx ON {$table_prefix}{$subjects[1]} (`{$field}`)\")->execute();".PHP_EOL;
-			}
-		}
-
-		return array($up, $down);
-	}
-
-}

+ 0 - 208
frameworks/PHP/php-fuel/fuel/packages/oil/classes/generate/scaffold.php

@@ -1,208 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Scaffold Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- */
-class Generate_Scaffold
-{
-	public static $fields_regex = '/([a-z0-9_]+):([a-z0-9_]+)(\[([0-9]+)\])?/i';
-
-	public static $view_subdir = 'scaffolding/';
-
-	public static $controller_prefix = '';
-	public static $model_prefix = '';
-
-	public static $controller_parent = 'Controller_Template';
-
-	public static function _init()
-	{
-		Generate::$scaffolding = true;
-	}
-
-	/**
-	 * Forge
-	 *
-	 * @param   array   Fields mainly
-	 * @param   string  Subfolder (or admin "theme") where views are held
-	 * @return	mixed
-	 */
-	public static function forge($args, $subfolder)
-	{
-		$data = array();
-
-		$subfolder = trim($subfolder, '/');
-
-		if ( ! is_dir(\Package::exists('oil').'views/'.static::$view_subdir.$subfolder))
-		{
-			throw new Exception('The subfolder for admin templates does not exist or is spelled wrong: '.$subfolder.' ');
-		}
-
-		// Go through all arguments after the first and make them into field arrays
-		$data['fields'] = array();
-		foreach (array_slice($args, 1) as $arg)
-		{
-			// Parse the argument for each field in a pattern of name:type[constraint]
-			preg_match(static::$fields_regex, $arg, $matches);
-
-			if ( ! isset($matches[1]))
-			{
-				throw new Exception('One or more fields were badly specified. Ensure they are name:type');
-			}
-
-			$data['fields'][] = array(
-				'name'       => \Str::lower($matches[1]),
-				'type'       => isset($matches[2]) ? $matches[2] : 'string',
-				'constraint' => isset($matches[4]) ? $matches[4] : null
-			);
-		}
-
-		$name = array_shift($args);
-
-		// Replace / with _ and classify the rest. DO NOT singularize
-		$controller_name = \Inflector::classify(static::$controller_prefix.str_replace(DS, '_', $name), false);
-
-		// Replace / with _ and classify the rest. Singularize
-		$model_name = \Inflector::classify(static::$model_prefix.str_replace(DS, '_', $name));
-
-		// Either foo or folder/foo
-		$view_path = $controller_path = str_replace(
-			array('_', '-'),
-			DS,
-			\Str::lower($controller_name)
-		);
-
-		// Models are always singular, tough!
-		$model_path = str_replace(
-			array('_', '-'),
-			DS,
-			\Str::lower($model_name)
-		);
-
-		// uri's have forward slashes, DS is a backslash on Windows
-		$uri = str_replace(DS, '/', $controller_path);
-
-		$data['include_timestamps'] = ( ! \Cli::option('no-timestamp', false));
-
-		// If a folder is used, the entity is the last part
-		$name_parts = explode(DS, $name);
-		$data['singular_name'] = \Inflector::singularize(end($name_parts));
-		$data['plural_name'] = \Cli::option('singular') ? $data['singular_name'] : \Inflector::pluralize($data['singular_name']);
-
-		$data['table'] = \Inflector::tableize($model_name);
-		$data['controller_parent'] = static::$controller_parent;
-
-		/** Generate the Migration **/
-		$migration_args = $args;
-
-		// add timestamps to the table if needded
-		if ($data['include_timestamps'])
-		{
-			if (\Cli::option('mysql-timestamp', false))
-			{
-				$migration_args[] = 'created_at:date:null[1]';
-				$migration_args[] = 'updated_at:date:null[1]';
-			}
-			else
-			{
-				$migration_args[] = 'created_at:int:null[1]';
-				$migration_args[] = 'updated_at:int:null[1]';
-			}
-		}
-		array_unshift($migration_args, 'create_'.\Inflector::pluralize(\Str::lower($name)));
-		Generate::migration($migration_args, false);
-
-		// Merge some other data in
-		$data = array_merge(compact(array('controller_name', 'model_name', 'model_path', 'view_path', 'uri')), $data);
-
-		/** Generate the Model **/
-		$model = \View::forge(static::$view_subdir.$subfolder.'/model', $data);
-
-		Generate::create(
-			APPPATH.'classes/model/'.$model_path.'.php',
-			$model,
-			'model'
-		);
-
-		/** Generate the Controller **/
-		$controller = \View::forge(static::$view_subdir.$subfolder.'/controller', $data);
-
-		$controller->actions = array(
-			array(
-				'name'   => 'index',
-				'params' => '',
-				'code'   => \View::forge(static::$view_subdir.$subfolder.'/actions/index', $data),
-			),
-			array(
-				'name'   => 'view',
-				'params' => '$id = null',
-				'code'   => \View::forge(static::$view_subdir.$subfolder.'/actions/view', $data),
-			),
-			array(
-				'name'   => 'create',
-				'params' => '',
-				'code'   => \View::forge(static::$view_subdir.$subfolder.'/actions/create', $data),
-			),
-			array(
-				'name'   => 'edit',
-				'params' => '$id = null',
-				'code'   => \View::forge(static::$view_subdir.$subfolder.'/actions/edit', $data),
-			),
-			array(
-				'name'   => 'delete',
-				'params' => '$id = null',
-				'code'   => \View::forge(static::$view_subdir.$subfolder.'/actions/delete', $data),
-			),
-		);
-
-		Generate::create(
-			APPPATH.'classes/controller/'.$controller_path.'.php',
-			$controller,
-			'controller'
-		);
-
-		// Create each of the views
-		foreach (array('index', 'view', 'create', 'edit', '_form') as $view)
-		{
-			Generate::create(
-				APPPATH.'views/'.$controller_path.'/'.$view.'.php',
-				\View::forge(static::$view_subdir.$subfolder.'/views/actions/'.$view, $data),
-				'view'
-			);
-		}
-
-		// Add the default template if it doesnt exist
-		if ( ! file_exists($app_template = APPPATH.'views/template.php'))
-		{
-			// check if there's a template in app, and if so, use that
-			if (file_exists(APPPATH.'views/'.static::$view_subdir.$subfolder.'/views/template.php'))
-			{
-				Generate::create($app_template, file_get_contents(APPPATH.'views/'.static::$view_subdir.$subfolder.'/views/template.php'), 'view');
-			}
-			else
-			{
-				Generate::create($app_template, file_get_contents(\Package::exists('oil').'views/'.static::$view_subdir.'template.php'), 'view');
-			}
-		}
-
-		Generate::build();
-	}
-
-}
-
-/* End of file oil/classes/scaffold.php */

+ 0 - 211
frameworks/PHP/php-fuel/fuel/packages/oil/classes/package.php

@@ -1,211 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Package Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- * @author		Phil Sturgeon
- */
-class Package
-{
-	protected static $protected = array('oil');
-
-	protected static $git = 'git';
-
-	public static function install($package = null)
-	{
-		// Make sure something is set
-		if ($package === null)
-		{
-			static::help();
-			return;
-		}
-
-		$config = \Config::load('package');
-
-		$version = \Cli::option('version', 'master');
-
-		// Check to see if this package is already installed
-		if (is_dir(PKGPATH . $package))
-		{
-			throw new Exception('Package "' . $package . '" is already installed.');
-			return;
-		}
-
-		foreach ($config['sources'] as $source)
-		{
-			$packages = array('fuel-'.$package, $package);
-
-			foreach ($packages as $package)
-			{
-				$zip_url = 'http://' . rtrim($source, '/').'/'.$package.'/zipball/'.$version;
-
-				if ($fp = @fopen($zip_url, 'r'))
-				{
-					// We don't actually need this, just checking the file is there
-					fclose($fp);
-
-					// Now, lets get this package
-
-					// If a direct download is requested, or git is unavailable, download it!
-					if (\Cli::option('direct') OR static::_use_git() === false)
-					{
-						static::_download_package_zip($zip_url, $package, $version);
-						exit;
-					}
-
-					// Otherwise, get your clone on baby!
-					else
-					{
-						static::_clone_package_repo($source, $package, $version);
-						exit;
-					}
-				}
-			}
-		}
-
-		throw new Exception('Could not find package "' . $package . '".');
-	}
-
-
-	public static function uninstall($package)
-	{
-		$package_folder = PKGPATH . $package;
-
-		// Check to see if this package is already installed
-		if (in_array($package, static::$protected))
-		{
-			throw new Exception('Package "' . $package . '" cannot be uninstalled.');
-			return false;
-		}
-
-		// Check to see if this package is already installed
-		if ( ! is_dir($package_folder))
-		{
-			throw new Exception('Package "' . $package . '" is not installed.');
-			return false;
-		}
-
-		\Cli::write('Package "' . $package . '" was uninstalled.', 'yellow');
-
-		\File::delete_dir($package_folder);
-	}
-
-	public static function help()
-	{
-		$output = <<<HELP
-
-Usage:
-  php oil [p|package] <packagename>
-
-Description:
-  Packages containing extra functionality can be downloaded (or git cloned) simply with
-  the following commands.
-
-Runtime options:
-  --direct       # Download direct from ZIP even if Git is installed
-
-Examples:
-  php oil package install <packagename>
-  php oil package uninstall <packagename>
-
-Documentation:
-  http://fuelphp.com/docs/packages/oil/package.html
-HELP;
-		\Cli::write($output);
-
-	}
-
-
-	private static function _use_git()
-	{
-		exec('which git', $output);
-
-		// If this is a valid path to git, use it instead of just "git"
-		if (file_exists($line = trim(current($output))))
-		{
-			static::$git = $line;
-		}
-
-		unset($output);
-
-		// Double check git is installed (windows will fail step 1)
-		exec(static::$git . ' --version', $output);
-
-		preg_match('#^(git version)#', current($output), $matches);
-
-		// If we have a match, use Git!
-		return ! empty($matches[0]);
-	}
-
-	private static function _download_package_zip($zip_url, $package, $version)
-	{
-		\Cli::write('Downloading package: ' . $zip_url);
-
-		// Make the folder so we can extract the ZIP to it
-		mkdir($tmp_folder = APPPATH . 'tmp/' . $package . '-' . time());
-
-		$zip_file = $tmp_folder . '.zip';
-		@copy($zip_url, $zip_file);
-
-		if (file_exists($zip_file))
-		{
-			$unzip = new \Unzip;
-			$files = $unzip->extract($zip_file, $tmp_folder);
-
-			// Grab the first folder out of it (we dont know what it's called)
-			list($tmp_package_folder) = glob($tmp_folder.'/*', GLOB_ONLYDIR);
-
-			$package_folder = PKGPATH . $package;
-
-			// Move that folder into the packages folder
-			rename($tmp_package_folder, $package_folder);
-
-			unlink($zip_file);
-			rmdir($tmp_folder);
-
-			foreach ($files as $file)
-			{
-				$path = str_replace($tmp_package_folder, $package_folder, $file);
-				chmod($path, octdec(755));
-				\Cli::write("\t" . $path);
-			}
-		}
-		else
-		{
-			\Cli::write('Package could not be found', 'red');
-		}
-	}
-
-	public static function _clone_package_repo($source, $package, $version)
-	{
-		$repo_url = 'git://' . rtrim($source, '/').'/'.$package . '.git';
-
-		\Cli::write('Downloading package: ' . $repo_url);
-
-		$package_folder = PKGPATH . $package;
-
-		// Clone to the package path
-		passthru(static::$git . ' clone ' . $repo_url . ' ' . $package_folder);
-
-		passthru(static::$git .' add ' . $package_folder . '/');
-
-		\Cli::write('');
-	}
-}
-
-/* End of file package.php */

+ 0 - 184
frameworks/PHP/php-fuel/fuel/packages/oil/classes/refine.php

@@ -1,184 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Oil;
-
-/**
- * Oil\Refine Class
- *
- * @package		Fuel
- * @subpackage	Oil
- * @category	Core
- */
-class Refine
-{
-	public static function run($task, $args)
-	{
-		$task = strtolower($task);
-
-		// Make sure something is set
-		if (empty($task) or $task === 'help')
-		{
-			static::help();
-			return;
-		}
-
-		$module = false;
-		list($module, $task) = array_pad(explode('::', $task), 2, null);
-
-		if ($task === null)
-		{
-			$task = $module;
-			$module = false;
-		}
-
-		if ($module)
-		{
-			try
-			{
-				\Module::load($module);
-				$path = \Module::exists($module);
-				\Finder::instance()->add_path($path);
-			}
-			catch (\FuelException $e)
-			{
-				throw new Exception(sprintf('Module "%s" does not exist.', $module));
-			}
-		}
-
-		// Just call and run() or did they have a specific method in mind?
-		list($task, $method) = array_pad(explode(':', $task), 2, 'run');
-
-		// Find the task
-		if ( ! $file = \Finder::search('tasks', $task))
-		{
-			$files = \Finder::instance()->list_files('tasks');
-			$possibilities = array();
-			foreach($files as $file)
-			{
-				$possible_task = pathinfo($file, \PATHINFO_FILENAME);
-				$difference = levenshtein($possible_task, $task);
-				$possibilities[$difference] = $possible_task;
-			}
-
-			ksort($possibilities);
-
-			if ($possibilities and current($possibilities) <= 5)
-			{
-				throw new Exception(sprintf('Task "%s" does not exist. Did you mean "%s"?', $task, current($possibilities)));
-			}
-			else
-			{
-				throw new Exception(sprintf('Task "%s" does not exist.', $task));
-			}
-
-			return;
-		}
-
-		require_once $file;
-
-		$task = '\\Fuel\\Tasks\\'.ucfirst($task);
-
-		$new_task = new $task;
-
-		// The help option hs been called, so call help instead
-		if (\Cli::option('help') && is_callable(array($new_task, 'help')))
-		{
-			$method = 'help';
-		}
-
-		if ($return = call_user_func_array(array($new_task, $method), $args))
-		{
-			\Cli::write($return);
-		}
-	}
-
-	public static function help()
-	{
-	    // Build a list of possible tasks for the help output
-		$tasks = self::_discover_tasks();
-		if (count($tasks) > 0)
-		{
-			$output_available_tasks = "";
-
-			foreach ($tasks as $task => $options)
-			{
-				foreach ($options as $option)
-				{
-				    $option = ($option == "run") ? "" : ":$option";
-					$output_available_tasks .= "    php oil refine $task$option\n";
-				}
-			}
-		}
-
-		else
-		{
-			$output_available_tasks = "    (none found)";
-		}
-
-		$output = <<<HELP
-
-Usage:
-    php oil [r|refine] <taskname>
-
-Description:
-    Tasks are classes that can be run through the the command line or set up as a cron job.
-
-Available tasks:
-$output_available_tasks
-Documentation:
-    http://docs.fuelphp.com/packages/oil/refine.html
-HELP;
-		\Cli::write($output);
-
-	}
-
-	/**
-	 * Find all of the task classes in the system and use reflection to discover the
-	 * commands we can call.
-	 *
-	 * @return array $taskname => array($taskmethods)
-	 **/
-	protected static function _discover_tasks()
-	{
-		$result = array();
-		$files = \Finder::instance()->list_files('tasks');
-
-		if (count($files) > 0)
-		{
-			foreach ($files as $file)
-			{
-				$task_name = str_replace('.php', '', basename($file));
-				$class_name = '\\Fuel\\Tasks\\'.$task_name;
-
-				require $file;
-
-				$reflect = new \ReflectionClass($class_name);
-
-				// Ensure we only pull out the public methods
-				$methods = $reflect->getMethods(\ReflectionMethod::IS_PUBLIC);
-
-				$result[$task_name] = array();
-
-				if (count($methods) > 0)
-				{
-					foreach ($methods as $method)
-					{
-						strpos($method->name, '_') !== 0 and $result[$task_name][] = $method->name;
-					}
-				}
-			}
-		}
-
-		return $result;
-	}
-}

+ 0 - 50
frameworks/PHP/php-fuel/fuel/packages/oil/config/oil.php

@@ -1,50 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- * 
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-/**
- * NOTICE:
- * 
- * If you need to make modifications to the default configuraion, copy
- * this file to your app/config folder, and make them in there.
- *
- * This will allow you to upgrade fuel without losing your custom config.
- */
-
-return array(
-	'phpunit' => array(
-		
-		/**
-		 * These phpunit settings allow oil to run your project's phpunit
-		 * tests. If you've installed phpunit as a global install via
-		 * pear, then the defaults don't need to be changed. But if you've
-		 * installed phpunit via some other method such as Composer,
-		 * you'll need to update these settings to reflect that.
-		 *
-		 * autoload_path - the path to PHPUnit's Autoload.php file.
-		 * binary_path - the full path you'd type into the command line
-		 *  to run phpunit from an arbitrary directory.
-		 *
-		 * For example, if you've installed phpunit via Composer, your
-		 * autoload_path will probably be something like:
-		 *     'autoload_path' => DOCROOT.'vendor/phpunit/phpunit/PHPUnit/Autoload.php',
-		 * and your binary path will probably be something like:
-		 *     'binary_path' => DOCROOT.'vendor/bin/phpunit',
-		 * 
-		 * At present, there is no support for phpunit.phar.
-		 */
-
-		'autoload_path' => 'PHPUnit/Autoload.php' ,
-		'binary_path' => 'phpunit' ,
-
-	),
-);
-

+ 0 - 291
frameworks/PHP/php-fuel/fuel/packages/oil/tasks/fromdb.php

@@ -1,291 +0,0 @@
-<?php
-/**
- * Fuel is a fast, lightweight, community driven PHP5 framework.
- *
- * @package    Fuel
- * @version    1.5
- * @author     Fuel Development Team
- * @license    MIT License
- * @copyright  2010 - 2013 Fuel Development Team
- * @link       http://fuelphp.com
- */
-
-namespace Fuel\Tasks;
-
-/**
- * Run scaffolding or model generation based an an existing database tables.
- *
- * Based on https://github.com/mp-php/fuel-myapp/blob/master/tasks/scafdb.php
- *
- * @author     Mamoru Otsuka http://madroom-project.blogspot.jp/
- * @copyright  2012 Mamoru Otsuka
- * @license    WTFPL http://sam.zoy.org/wtfpl/COPYING
- */
-class Fromdb
-{
-	/**
-	 * Class initialization
-	 */
-	public function __construct()
-	{
-		// load the migrations config
-		\Config::load('migrations', true);
-	}
-
-	/**
-	 * Show help.
-	 *
-	 * Usage (from command line):
-	 *
-	 * php oil refine fromdb
-	 */
-	public static function run()
-	{
-		static::help();
-	}
-
-	/**
-	 * Show help.
-	 *
-	 * Usage (from command line):
-	 *
-	 * php oil refine fromdb:help
-	 */
-	public static function help()
-	{
-		$output = <<<HELP
-
-Description:
-  Run scaffolding or generate a model from existing database table(s).
-  Database settings must be configured correctly for this to work.
-
-Runtime options:
-  -f, [--force]       # Overwrite files that already exist
-  -s, [--skip]        # Skip generating files that already exist
-  -a, [--admin]       # Generate admin scaffolding code
-  --all               # Generate code for all tables found in the database
-  --db=<database>     # Name of the database to use
-
-Commands:
-  php oil refine fromdb:scaffold <table_name,table_name...>
-  php oil refine fromdb:scaffold --all
-  php oil refine fromdb:model <table_name,table_name...>
-  php oil refine fromdb:model --all
-  php oil refine fromdb:help
-
-HELP;
-		\Cli::write($output);
-	}
-
-	/**
-	 * Generate scaffold for a database table.
-	 *
-	 * Usage (from command line):
-	 *
-	 * php oil refine fromdb:scaffold <table_name,table_name...>
-	 */
-	public static function scaffold($tables = null)
-	{
-		// do we have any tables defined?
-		if (empty($tables))
-		{
-			// do we want to generate for all tables?
-			if ( ! \Cli::option('all', false))
-			{
-				\Cli::write('No table names specified to run scaffolding on.', 'red');
-				exit();
-			}
-
-			// get the list of all available tables
-			try
-			{
-				$list = \DB::list_tables(null, \Cli::option('db', null));
-			}
-			catch (\FuelException $e)
-			{
-				\Cli::write('The database driver configured does not support listing tables. Please specify them manually.', 'red');
-				exit();
-			}
-
-			$prefix = \DB::table_prefix();
-			$migration = \Config::get('migrations.table', 'migration');
-
-			$tables = array();
-
-			// create the table list
-			foreach ($list as $table)
-			{
-				// strip any defined table prefix from the table name
-				if ( ! empty($prefix) and strpos($table, $prefix) === 0)
-				{
-					$table = substr($table, strlen($prefix));
-				}
-
-				// skip the migration table
-				$table == $migration or $tables[] = $table;
-			}
-		}
-
-		// make sure we have an array to work with
-		is_array($tables) or $tables = explode(',', $tables);
-
-		// check what kind of models we need to generate
-		$subfolder = \Cli::option('crud') ? 'crud' : 'orm';
-
-		// generate for each table defined
-		foreach ($tables as $table)
-		{
-			// start with an empty list
-			\Oil\Generate::$create_files = array();
-
-			// and generate
-			if (\Cli::option('admin', \Cli::option('a', false)))
-			{
-				call_user_func('\\Oil\\Generate_Admin::forge', static::arguments($table), $subfolder);
-			}
-			else
-			{
-				call_user_func('\\Oil\\Generate_Scaffold::forge', static::arguments($table), $subfolder);
-			}
-		}
-	}
-
-
-	/**
-	 * Generate model for a database table.
-	 *
-	 * Usage (from command line):
-	 *
-	 * php oil refine fromdb:model <table_name,table_name...>
-	 */
-	public static function model($tables = '')
-	{
-		// do we have any tables defined?
-		if (empty($tables))
-		{
-			// do we want to generate for all tables?
-			if ( ! \Cli::option('all', false))
-			{
-				\Cli::write('No table names specified to generate a model on.', 'red');
-				exit();
-			}
-
-			// get the list of all available tables
-			try
-			{
-				$list = \DB::list_tables(null, \Cli::option('db', null));
-			}
-			catch (\FuelException $e)
-			{
-				\Cli::write('The database driver configured does not support listing tables. Please specify them manually.', 'red');
-				exit();
-			}
-
-			$prefix = \DB::table_prefix();
-			$migration = \Config::get('migrations.table', 'migration');
-
-			$tables = array();
-
-			// create the table list
-			foreach ($list as $table)
-			{
-				// strip any defined table prefix from the table name
-				if ( ! empty($prefix) and strpos($table, $prefix) === 0)
-				{
-					$table = substr($table, strlen($prefix));
-				}
-
-				// skip the migration table
-				$table == $migration or $tables[] = $table;
-			}
-		}
-
-		// make sure we have an array to work with
-		is_array($tables) or $tables = explode(',', $tables);
-
-		// generate for each table defined
-		foreach ($tables as $table)
-		{
-			// start with an empty list
-			\Oil\Generate::$create_files = array();
-
-			// and generate
-			call_user_func('Oil\Generate::model', static::arguments($table));
-		}
-	}
-
-	/**
-	 * Construct the argument list
-	 *
-	 * @param  string  $table  name of the database table we need to create the list for
-	 * @return array
-	 */
-	protected static function arguments($table)
-	{
-		// get the list of columns from the table
-		try
-		{
-			$columns = \DB::list_columns(trim($table), null, \Cli::option('db', null));
-		}
-		catch (\Exception $e)
-		{
-			\Cli::write($e->getMessage(), 'red');
-			exit();
-		}
-
-		// construct the arguments list, starting with the table name
-		$arguments = array($table);
-
-		// set some switches
-		$include_timestamps = false;
-		$timestamp_is_int = true;
-
-		// process the columns found
-		foreach ($columns as $column)
-		{
-			// do we have a data_type defined? If not, use the generic type
-			isset($column['data_type']) or $column['data_type'] = $column['type'];
-
-			// skip the 'id' column, it will be added automatically
-			if ($column['name'] == 'id')
-			{
-				continue;
-			}
-
-			// detect timestamp columns
-			if (in_array($column['name'], array('created_at', 'updated_at')))
-			{
-				$include_timestamps = true;
-				$timestamp_is_int = $column['data_type'] == 'int';
-				continue;
-			}
-
-			// do we need to add constraints?
-			$constraint = '';
-			foreach (array('length', 'character_maximum_length', 'display') as $idx)
-			{
-				// check if we have such a column, and filter out some default values
-				if (isset($column[$idx]) and ! in_array($column[$idx], array('65535', '4294967295')))
-				{
-					$constraint = '['.$column[$idx].']';
-					break;
-				}
-			}
-			// if it's an enum column, list the available options
-			if (in_array($column['data_type'], array('set', 'enum')))
-			{
-					$constraint = '['.implode(',', $column['options']).']';
-			}
-
-			// store the column in the argument list
-			$arguments[] = $column['name'].':'.$column['data_type'].$constraint;
-		}
-
-		// set the switches for the code generation
-		\Cli::set_option('no-timestamp', $include_timestamps === false);
-		\Cli::set_option('mysql-timestamp', $timestamp_is_int === false);
-
-		// return the generated argument list
-		return $arguments;
-	}
-}

+ 0 - 30
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/create.php

@@ -1,30 +0,0 @@
-		if (Input::method() == 'POST')
-		{
-			$val = Model_<?php echo $model_name; ?>::validate('create');
-
-			if ($val->run())
-			{
-				$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::forge(array(
-<?php foreach ($fields as $field): ?>
-					'<?php echo $field['name']; ?>' => Input::post('<?php echo $field['name']; ?>'),
-<?php endforeach; ?>
-				));
-
-				if ($<?php echo $singular_name; ?> and $<?php echo $singular_name; ?>->save())
-				{
-					Session::set_flash('success', e('Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.'));
-					Response::redirect('<?php echo $uri; ?>');
-				}
-				else
-				{
-					Session::set_flash('error', e('Could not save <?php echo $singular_name; ?>.'));
-				}
-			}
-			else
-			{
-				Session::set_flash('error', $val->error());
-			}
-		}
-
-		$this->template->title = "<?php echo \Str::ucwords($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/create');

+ 0 - 13
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/delete.php

@@ -1,13 +0,0 @@
-		if ($<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find_one_by_id($id))
-		{
-			$<?php echo $singular_name; ?>->delete();
-
-			Session::set_flash('success', e('Deleted <?php echo $singular_name; ?> #'.$id));
-		}
-
-		else
-		{
-			Session::set_flash('error', e('Could not delete <?php echo $singular_name; ?> #'.$id));
-		}
-
-		Response::redirect('<?php echo $uri; ?>');

+ 0 - 31
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/edit.php

@@ -1,31 +0,0 @@
-		$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find_one_by_id($id);
-
-		if (Input::method() == 'POST')
-		{
-			$val = Model_<?php echo $model_name; ?>::validate('edit');
-
-			if ($val->run())
-			{
-<?php foreach ($fields as $field): ?>
-				$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = Input::post('<?php echo $field['name']; ?>');
-<?php endforeach; ?>
-
-				if ($<?php echo $singular_name; ?>->save())
-				{
-					Session::set_flash('success', e('Updated <?php echo $singular_name; ?> #'.$id));
-					Response::redirect('<?php echo $uri; ?>');
-				}
-				else
-				{
-					Session::set_flash('error', 'Nothing updated.');
-				}
-			}
-			else
-			{
-				Session::set_flash('error', $val->error());
-			}
-		}
-
-		$this->template->set_global('<?php echo $singular_name; ?>', $<?php echo $singular_name; ?>, false);
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path; ?>/edit');

+ 0 - 3
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/index.php

@@ -1,3 +0,0 @@
-		$data['<?php echo $plural_name ?>'] = Model_<?php echo $model_name; ?>::find_all();
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/index', $data);

+ 0 - 4
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/actions/view.php

@@ -1,4 +0,0 @@
-		$data['<?php echo $singular_name ?>'] = Model_<?php echo $model_name ?>::find_by_pk($id);
-
-		$this->template->title = "<?php echo ucfirst($singular_name) ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/view', $data);

+ 0 - 14
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/controller.php

@@ -1,14 +0,0 @@
-<?php echo '<?php' ?>
-
-class Controller_<?php echo $controller_name; ?> extends <?php echo \Cli::option('extends', $controller_parent) ?> 
-{
-
-<?php foreach ($actions as $action): ?>
-	public function action_<?php echo $action['name']; ?>(<?php echo $action['params']; ?>)
-	{
-<?php echo $action['code'].PHP_EOL; ?>
-	}
-
-<?php endforeach; ?>
-
-}

+ 0 - 88
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/controllers/admin.php

@@ -1,88 +0,0 @@
-<?php
-
-class Controller_Admin extends Controller_Base {
-
-	public $template = 'admin/template';
-
-	public function before()
-	{
-		parent::before();
-
-		if (Auth::check())
-		{
-			if ( ! Auth::member(100) and ! in_array(Request::active()->action, array('login', 'logout')))
-			{
-				Session::set_flash('error', e('You don\'t have access to the admin panel'));
-				Response::redirect('/');
-			}
-		}
-		else
-		{
-			Response::redirect('admin/login');
-		}
-	}
-
-	public function action_login()
-	{
-		// Already logged in
-		Auth::check() and Response::redirect('admin');
-
-		$val = Validation::forge();
-
-		if (Input::method() == 'POST')
-		{
-			$val->add('email', 'Email or Username')
-			    ->add_rule('required');
-			$val->add('password', 'Password')
-			    ->add_rule('required');
-
-			if ($val->run())
-			{
-				$auth = Auth::instance();
-
-				// check the credentials. This assumes that you have the previous table created
-				if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
-				{
-					// credentials ok, go right in
-					$current_user = Model_User::find_by_username(Auth::get_screen_name());
-					Session::set_flash('success', e('Welcome, '.$current_user->username));
-					Response::redirect('admin');
-				}
-				else
-				{
-					$this->template->set_global('login_error', 'Fail');
-				}
-			}
-		}
-
-		$this->template->title = 'Login';
-		$this->template->content = View::forge('admin/login', array('val' => $val), false);
-	}
-
-	/**
-	 * The logout action.
-	 *
-	 * @access  public
-	 * @return  void
-	 */
-	public function action_logout()
-	{
-		Auth::logout();
-		Response::redirect('admin');
-	}
-
-	/**
-	 * The index action.
-	 *
-	 * @access  public
-	 * @return  void
-	 */
-	public function action_index()
-	{
-		$this->template->title = 'Dashboard';
-		$this->template->content = View::forge('admin/dashboard');
-	}
-
-}
-
-/* End of file app.php */

+ 0 - 16
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/controllers/base.php

@@ -1,16 +0,0 @@
-<?php
-
-class Controller_Base extends Controller_Template {
-
-	public function before()
-	{
-		parent::before();
-		
-		// Assign current_user to the instance so controllers can use it
-		$this->current_user = Auth::check() ? Model_User::find_one_by_username(Auth::get_screen_name()) : null;
-		
-		// Set a global variable so views can use it
-		View::set_global('current_user', $this->current_user);
-	}
-
-}

+ 0 - 34
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/model.php

@@ -1,34 +0,0 @@
-<?php echo '<?php' ?>
-
-class Model_<?php echo $model_name; ?> extends Model_Crud
-{
-	protected static $_table_name = '<?php echo $table; ?>';
-
-	public static function validate($factory)
-	{
-		$val = Validation::forge($factory);
-<?php foreach ($fields as $field): ?>
-<?php
-		$rules = array('required');
-
-		if (in_array($field['type'], array('varchar', 'string', 'char')))
-		{
-			if ($field['name'] === 'email')
-			{
-				$rules[] = 'valid_email';
-			}
-			$rules[] = ! is_null($field['constraint']) ? "max_length[{$field['constraint']}]" : 'max_length[255]';
-		}
-		elseif (in_array($field['type'], array('int', 'intenger')))
-		{
-			$rules[] = 'valid_string[numeric]';
-		}
-		
-		$rules = implode('|', $rules);
-?>
-		$val->add_field('<?php echo $field['name']; ?>', '<?php echo ucwords(str_replace('_', ' ', $field['name'])); ?>', '<?php echo $rules; ?>');
-<?php endforeach; ?>
-
-		return $val;
-	}
-}

+ 0 - 30
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/_form.php

@@ -1,30 +0,0 @@
-<?php echo '<?php echo Form::open(); ?>' ?>
-
-
-	<fieldset>
-<?php foreach ($fields as $field): ?>
-		<div class="clearfix">
-			<?php echo "<?php echo Form::label('". \Inflector::humanize($field['name']) ."', '{$field['name']}'); ?>\n"; ?>
-
-			<div class="input">
-<?php switch($field['type']):
-
-				case 'text':
-					echo "\t\t\t\t<?php echo Form::textarea('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span8', 'rows' => 8)); ?>\n";
-				break;
-
-				default:
-					echo "\t\t\t\t<?php echo Form::input('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span4')); ?>\n";
-
-endswitch; ?>
-
-			</div>
-		</div>
-<?php endforeach; ?>
-		<div class="actions">
-			<?php echo '<?php'; ?> echo Form::submit('submit', 'Save', array('class' => 'btn btn-primary')); <?php echo '?>'; ?>
-
-
-		</div>
-	</fieldset>
-<?php echo '<?php'; ?> echo Form::close(); <?php echo '?>'; ?>

+ 0 - 7
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/create.php

@@ -1,7 +0,0 @@
-<h2>New <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path ?>/_form'); ?>
-
-
-<p><?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?></p>

+ 0 - 8
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/edit.php

@@ -1,8 +0,0 @@
-<h2>Editing <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path; ?>/_form'); ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>', 'Back'); <?php echo '?>'; ?>
-</p>

+ 0 - 42
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/index.php

@@ -1,42 +0,0 @@
-<h2>Listing <?php echo \Str::ucfirst($plural_name); ?></h2>
-<br>
-<?php echo "<?php if (\${$plural_name}): ?>"; ?>
-
-<table class="table table-striped">
-	<thead>
-		<tr>
-<?php foreach ($fields as $field): ?>
-			<th><?php echo \Inflector::humanize($field['name']); ?></th>
-<?php endforeach; ?>
-			<th></th>
-		</tr>
-	</thead>
-	<tbody>
-<?php echo '<?php'; ?> foreach ($<?php echo $plural_name; ?> as $<?php echo $singular_name; ?>): <?php echo '?>'; ?>
-		<tr>
-
-<?php foreach ($fields as $field): ?>
-			<td><?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?></td>
-<?php endforeach; ?>
-			<td>
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/delete/'.$<?php echo $singular_name; ?>->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); <?php echo '?>'; ?>
-
-
-			</td>
-		</tr>
-<?php echo '<?php endforeach; ?>'; ?>
-	</tbody>
-</table>
-
-<?php echo '<?php else: ?>'; ?>
-
-<p>No <?php echo \Str::ucfirst($plural_name); ?>.</p>
-
-<?php echo '<?php endif; ?>'; ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/create', 'Add new <?php echo \Inflector::humanize($singular_name); ?>', array('class' => 'btn btn-success')); <?php echo '?>'; ?>
-
-
-</p>

+ 0 - 11
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/crud/views/actions/view.php

@@ -1,11 +0,0 @@
-<h2>Viewing #<?php echo '<?php'; ?> echo $<?php echo $singular_name; ?>->id; <?php echo '?>'; ?></h2>
-
-<?php foreach ($fields as $field): ?>
-<p>
-	<strong><?php echo \Inflector::humanize($field['name']); ?>:</strong>
-	<?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?>
-</p>
-<?php endforeach; ?>
-
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?>

+ 0 - 27
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/dashboard.php

@@ -1,27 +0,0 @@
-<div class="hero-unit">
-	<h1>Welcome!</h1>
-	<p>This admin panel has been generated by the FuelPHP Framework.</p>
-	<p><a class="btn btn-primary btn-large" href="http://docs.fuelphp.com">Read the Docs</a></p>
-</div>
-<div class="row">
-	<div class="span4">
-		<h2>Get Started</h2>
-		<p>The controller generating this page is found at <code>APPPATH/classes/controller/admin.php</code>.</p>
-		<p>This view can be found at <code>APPPATH/views/admin/dashboard.php</code>.</p>
-		<p>You can modify these files to get your application started quickly.</p>
-	</div>
-	<div class="span4">
-		<h2>Learn</h2>
-		<p>The best way to learn FuelPHP is reading through the <a href="http://docs.fuelphp.com">Documentation</a>.</p>
-		<p>Another good resource is the <a href="http://fuelphp.com/forums">Forums</a>.  They are fairly active, and you can usually get a response quickly.</p>
-	</div>
-	<div class="span4">
-		<h2>Contribute</h2>
-		<p>FuelPHP wouldn't exist without awesome contributions from the community.  Use the links below to get contributing.</p>
-		<ul>
-			<li><a href="http://docs.fuelphp.com/general/coding_standards.html">Coding Standards</a></li>
-			<li><a href="http://github.com/fuel/fuel">GitHub Respository</a></li>
-			<li><a href="http://fuelphp.com/contribute/issue-tracker">Issue Tracker</a></li>
-		</ul>
-	</div>
-</div>

+ 0 - 33
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/login.php

@@ -1,33 +0,0 @@
-<?php echo Form::open(array()); ?>
-
-	<?php if (isset($_GET['destination'])): ?>
-		<?php echo Form::hidden('destination',$_GET['destination']); ?>
-	<?php endif; ?>
-
-	<?php if (isset($login_error)): ?>
-		<div class="error"><?php echo $login_error; ?></div>
-	<?php endif; ?>
-
-	<div class="row">
-		<label for="email">Email or Username:</label>
-		<div class="input"><?php echo Form::input('email', Input::post('email')); ?></div>
-		
-		<?php if ($val->error('email')): ?>
-			<div class="error"><?php echo $val->error('email')->get_message('You must provide a username or email'); ?></div>
-		<?php endif; ?>
-	</div>
-
-	<div class="row">
-		<label for="password">Password:</label>
-		<div class="input"><?php echo Form::password('password'); ?></div>
-		
-		<?php if ($val->error('password')): ?>
-			<div class="error"><?php echo $val->error('password')->get_message(':label cannot be blank'); ?></div>
-		<?php endif; ?>
-	</div>
-
-	<div class="actions">
-		<?php echo Form::submit(array('value'=>'Login', 'name'=>'submit')); ?>
-	</div>
-
-<?php echo Form::close(); ?>

+ 0 - 32
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/create.php

@@ -1,32 +0,0 @@
-		if (Input::method() == 'POST')
-		{
-			$val = Model_<?php echo $model_name; ?>::validate('create');
-
-			if ($val->run())
-			{
-				$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::forge(array(
-<?php foreach ($fields as $field): ?>
-					'<?php echo $field['name']; ?>' => Input::post('<?php echo $field['name']; ?>'),
-<?php endforeach; ?>
-				));
-
-				if ($<?php echo $singular_name; ?> and $<?php echo $singular_name; ?>->save())
-				{
-					Session::set_flash('success', e('Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.'));
-
-					Response::redirect('<?php echo $uri; ?>');
-				}
-
-				else
-				{
-					Session::set_flash('error', e('Could not save <?php echo $singular_name; ?>.'));
-				}
-			}
-			else
-			{
-				Session::set_flash('error', $val->error());
-			}
-		}
-
-		$this->template->title = "<?php echo \Str::ucwords($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/create');

+ 0 - 13
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/delete.php

@@ -1,13 +0,0 @@
-		if ($<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find($id))
-		{
-			$<?php echo $singular_name; ?>->delete();
-
-			Session::set_flash('success', e('Deleted <?php echo $singular_name; ?> #'.$id));
-		}
-
-		else
-		{
-			Session::set_flash('error', e('Could not delete <?php echo $singular_name; ?> #'.$id));
-		}
-
-		Response::redirect('<?php echo $uri; ?>');

+ 0 - 38
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/edit.php

@@ -1,38 +0,0 @@
-		$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find($id);
-		$val = Model_<?php echo $model_name; ?>::validate('edit');
-
-		if ($val->run())
-		{
-<?php foreach ($fields as $field): ?>
-			$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = Input::post('<?php echo $field['name']; ?>');
-<?php endforeach; ?>
-
-			if ($<?php echo $singular_name; ?>->save())
-			{
-				Session::set_flash('success', e('Updated <?php echo $singular_name; ?> #' . $id));
-
-				Response::redirect('<?php echo $uri; ?>');
-			}
-
-			else
-			{
-				Session::set_flash('error', e('Could not update <?php echo $singular_name; ?> #' . $id));
-			}
-		}
-
-		else
-		{
-			if (Input::method() == 'POST')
-			{
-<?php foreach ($fields as $field): ?>
-				$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = $val->validated('<?php echo $field['name']; ?>');
-<?php endforeach; ?>
-
-				Session::set_flash('error', $val->error());
-			}
-
-			$this->template->set_global('<?php echo $singular_name; ?>', $<?php echo $singular_name; ?>, false);
-		}
-
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path; ?>/edit');

+ 0 - 3
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/index.php

@@ -1,3 +0,0 @@
-		$data['<?php echo $plural_name ?>'] = Model_<?php echo $model_name; ?>::find('all');
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/index', $data);

+ 0 - 4
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/actions/view.php

@@ -1,4 +0,0 @@
-		$data['<?php echo $singular_name ?>'] = Model_<?php echo $model_name ?>::find($id);
-
-		$this->template->title = "<?php echo ucfirst($singular_name) ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/view', $data);

+ 0 - 14
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/controller.php

@@ -1,14 +0,0 @@
-<?php echo '<?php' ?>
-
-class Controller_<?php echo $controller_name; ?> extends <?php echo \Cli::option('extends', $controller_parent) ?> 
-{
-
-<?php foreach ($actions as $action): ?>
-	public function action_<?php echo $action['name']; ?>(<?php echo $action['params']; ?>)
-	{
-<?php echo $action['code'].PHP_EOL; ?>
-	}
-
-<?php endforeach; ?>
-
-}

+ 0 - 88
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/controllers/admin.php

@@ -1,88 +0,0 @@
-<?php
-
-class Controller_Admin extends Controller_Base {
-
-	public $template = 'admin/template';
-
-	public function before()
-	{
-		parent::before();
-
-		if (Auth::check())
-		{
-			if ( ! Auth::member(100) and ! in_array(Request::active()->action, array('login', 'logout')))
-			{
-				Session::set_flash('error', e('You don\'t have access to the admin panel'));
-				Response::redirect('/');
-			}
-		}
-		else
-		{
-			Response::redirect('admin/login');
-		}
-	}
-
-	public function action_login()
-	{
-		// Already logged in
-		Auth::check() and Response::redirect('admin');
-
-		$val = Validation::forge();
-
-		if (Input::method() == 'POST')
-		{
-			$val->add('email', 'Email or Username')
-			    ->add_rule('required');
-			$val->add('password', 'Password')
-			    ->add_rule('required');
-
-			if ($val->run())
-			{
-				$auth = Auth::instance();
-
-				// check the credentials. This assumes that you have the previous table created
-				if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
-				{
-					// credentials ok, go right in
-					$current_user = Model_User::find_by_username(Auth::get_screen_name());
-					Session::set_flash('success', e('Welcome, '.$current_user->username));
-					Response::redirect('admin');
-				}
-				else
-				{
-					$this->template->set_global('login_error', 'Fail');
-				}
-			}
-		}
-
-		$this->template->title = 'Login';
-		$this->template->content = View::forge('admin/login', array('val' => $val), false);
-	}
-
-	/**
-	 * The logout action.
-	 *
-	 * @access  public
-	 * @return  void
-	 */
-	public function action_logout()
-	{
-		Auth::logout();
-		Response::redirect('admin');
-	}
-
-	/**
-	 * The index action.
-	 *
-	 * @access  public
-	 * @return  void
-	 */
-	public function action_index()
-	{
-		$this->template->title = 'Dashboard';
-		$this->template->content = View::forge('admin/dashboard');
-	}
-
-}
-
-/* End of file admin.php */

+ 0 - 16
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/controllers/base.php

@@ -1,16 +0,0 @@
-<?php
-
-class Controller_Base extends Controller_Template {
-
-	public function before()
-	{
-		parent::before();
-		
-		// Assign current_user to the instance so controllers can use it
-		$this->current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null;
-		
-		// Set a global variable so views can use it
-		View::set_global('current_user', $this->current_user);
-	}
-
-}

+ 0 - 57
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/model.php

@@ -1,57 +0,0 @@
-<?php echo '<?php' ?>
-
-class Model_<?php echo $model_name; ?> extends \Orm\Model
-{
-	protected static $_properties = array(
-		'id',
-<?php foreach ($fields as $field): ?>
-		'<?php echo $field['name']; ?>',
-<?php endforeach; ?>
-<?php if ($include_timestamps): ?>
-		'created_at',
-		'updated_at',
-<?php endif; ?>
-	);
-
-<?php if ($include_timestamps): ?>
-	protected static $_observers = array(
-		'Orm\Observer_CreatedAt' => array(
-			'events' => array('before_insert'),
-			'mysql_timestamp' => false,
-		),
-		'Orm\Observer_UpdatedAt' => array(
-			'events' => array('before_save'),
-			'mysql_timestamp' => false,
-		),
-	);
-<?php endif; ?>
-
-	public static function validate($factory)
-	{
-		$val = Validation::forge($factory);
-<?php foreach ($fields as $field): ?>
-<?php
-		$rules = array('required');
-
-		if (in_array($field['type'], array('varchar', 'string', 'char')))
-		{
-			if ($field['name'] === 'email')
-			{
-				$rules[] = 'valid_email';
-			}
-			$rules[] = ! is_null($field['constraint']) ? "max_length[{$field['constraint']}]" : 'max_length[255]';
-		}
-		elseif (in_array($field['type'], array('int', 'intenger')))
-		{
-			$rules[] = 'valid_string[numeric]';
-		}
-		
-		$rules = implode('|', $rules);
-?>
-		$val->add_field('<?php echo $field['name']; ?>', '<?php echo ucwords(str_replace('_', ' ', $field['name'])); ?>', '<?php echo $rules; ?>');
-<?php endforeach; ?>
-
-		return $val;
-	}
-
-}

+ 0 - 30
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/_form.php

@@ -1,30 +0,0 @@
-<?php echo '<?php echo Form::open(); ?>' ?>
-
-
-	<fieldset>
-<?php foreach ($fields as $field): ?>
-		<div class="clearfix">
-			<?php echo "<?php echo Form::label('". \Inflector::humanize($field['name']) ."', '{$field['name']}'); ?>\n"; ?>
-
-			<div class="input">
-<?php switch($field['type']):
-
-				case 'text':
-					echo "\t\t\t\t<?php echo Form::textarea('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span8', 'rows' => 8)); ?>\n";
-				break;
-
-				default:
-					echo "\t\t\t\t<?php echo Form::input('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span4')); ?>\n";
-
-endswitch; ?>
-
-			</div>
-		</div>
-<?php endforeach; ?>
-		<div class="actions">
-			<?php echo '<?php'; ?> echo Form::submit('submit', 'Save', array('class' => 'btn btn-primary')); <?php echo '?>'; ?>
-
-
-		</div>
-	</fieldset>
-<?php echo '<?php'; ?> echo Form::close(); <?php echo '?>'; ?>

+ 0 - 7
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/create.php

@@ -1,7 +0,0 @@
-<h2>New <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path ?>/_form'); ?>
-
-
-<p><?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?></p>

+ 0 - 8
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/edit.php

@@ -1,8 +0,0 @@
-<h2>Editing <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path; ?>/_form'); ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>', 'Back'); <?php echo '?>'; ?>
-</p>

+ 0 - 42
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/index.php

@@ -1,42 +0,0 @@
-<h2>Listing <?php echo \Str::ucfirst($plural_name); ?></h2>
-<br>
-<?php echo "<?php if (\${$plural_name}): ?>"; ?>
-
-<table class="table table-striped">
-	<thead>
-		<tr>
-<?php foreach ($fields as $field): ?>
-			<th><?php echo \Inflector::humanize($field['name']); ?></th>
-<?php endforeach; ?>
-			<th></th>
-		</tr>
-	</thead>
-	<tbody>
-<?php echo '<?php'; ?> foreach ($<?php echo $plural_name; ?> as $<?php echo $singular_name; ?>): <?php echo '?>'; ?>
-		<tr>
-
-<?php foreach ($fields as $field): ?>
-			<td><?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?></td>
-<?php endforeach; ?>
-			<td>
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/delete/'.$<?php echo $singular_name; ?>->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); <?php echo '?>'; ?>
-
-
-			</td>
-		</tr>
-<?php echo '<?php endforeach; ?>'; ?>
-	</tbody>
-</table>
-
-<?php echo '<?php else: ?>'; ?>
-
-<p>No <?php echo \Str::ucfirst($plural_name); ?>.</p>
-
-<?php echo '<?php endif; ?>'; ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/create', 'Add new <?php echo \Inflector::humanize($singular_name); ?>', array('class' => 'btn btn-success')); <?php echo '?>'; ?>
-
-
-</p>

+ 0 - 11
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/orm/views/actions/view.php

@@ -1,11 +0,0 @@
-<h2>Viewing #<?php echo '<?php'; ?> echo $<?php echo $singular_name; ?>->id; <?php echo '?>'; ?></h2>
-
-<?php foreach ($fields as $field): ?>
-<p>
-	<strong><?php echo \Inflector::humanize($field['name']); ?>:</strong>
-	<?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?>
-</p>
-<?php endforeach; ?>
-
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?>

+ 0 - 89
frameworks/PHP/php-fuel/fuel/packages/oil/views/admin/template.php

@@ -1,89 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<meta charset="utf-8">
-	<title><?php echo $title; ?></title>
-	<?php echo Asset::css('bootstrap.css'); ?>
-	<style>
-		body { margin: 50px; }
-	</style>
-	<?php echo Asset::js(array(
-		'http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js',
-		'bootstrap.js'
-	)); ?>
-	<script>
-		$(function(){ $('.topbar').dropdown(); });
-	</script>
-</head>
-<body>
-
-	<?php if ($current_user): ?>
-	<div class="navbar navbar-fixed-top">
-	    <div class="navbar-inner">
-	        <div class="container">
-	            <a href="#" class="brand">My Site</a>
-	            <ul class="nav">
-	                <li class="<?php echo Uri::segment(2) == '' ? 'active' : '' ?>">
-						<?php echo Html::anchor('admin', 'Dashboard') ?>
-					</li>
-
-					<?php foreach (glob(APPPATH.'classes/controller/admin/*.php') as $controller): ?>
-
-						<?php
-						$section_segment = basename($controller, '.php');
-						$section_title = Inflector::humanize($section_segment);
-						?>
-
-	                <li class="<?php echo Uri::segment(2) == $section_segment ? 'active' : '' ?>">
-						<?php echo Html::anchor('admin/'.$section_segment, $section_title) ?>
-					</li>
-					<?php endforeach; ?>
-	          </ul>
-
-	          <ul class="nav pull-right">
-
-	            <li class="dropdown">
-	              <a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php echo $current_user->username ?> <b class="caret"></b></a>
-	              <ul class="dropdown-menu">
-	               <li><?php echo Html::anchor('admin/logout', 'Logout') ?></li>
-	              </ul>
-	            </li>
-	          </ul>
-	        </div>
-	    </div>
-	</div>
-	<?php endif; ?>
-
-	<div class="container">
-		<div class="row">
-			<div class="span12">
-				<h1><?php echo $title; ?></h1>
-				<hr>
-<?php if (Session::get_flash('success')): ?>
-				<div class="alert alert-success">
-					<button class="close" data-dismiss="alert">×</button>
-					<p><?php echo implode('</p><p>', (array) Session::get_flash('success')); ?></p>
-				</div>
-<?php endif; ?>
-<?php if (Session::get_flash('error')): ?>
-				<div class="alert alert-error">
-					<button class="close" data-dismiss="alert">×</button>
-					<p><?php echo implode('</p><p>', (array) Session::get_flash('error')); ?></p>
-				</div>
-<?php endif; ?>
-			</div>
-			<div class="span12">
-<?php echo $content; ?>
-			</div>
-		</div>
-		<hr/>
-		<footer>
-			<p class="pull-right">Page rendered in {exec_time}s using {mem_usage}mb of memory.</p>
-			<p>
-				<a href="http://fuelphp.com">FuelPHP</a> is released under the MIT license.<br>
-				<small>Version: <?php echo e(Fuel::VERSION); ?></small>
-			</p>
-		</footer>
-	</div>
-</body>
-</html>

+ 0 - 30
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/create.php

@@ -1,30 +0,0 @@
-		if (Input::method() == 'POST')
-		{
-			$val = Model_<?php echo $model_name; ?>::validate('create');
-			
-			if ($val->run())
-			{
-				$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::forge(array(
-<?php foreach ($fields as $field): ?>
-					'<?php echo $field['name']; ?>' => Input::post('<?php echo $field['name']; ?>'),
-<?php endforeach; ?>
-				));
-
-				if ($<?php echo $singular_name; ?> and $<?php echo $singular_name; ?>->save())
-				{
-					Session::set_flash('success', 'Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.');
-					Response::redirect('<?php echo $uri; ?>');
-				}
-				else
-				{
-					Session::set_flash('error', 'Could not save <?php echo $singular_name; ?>.');
-				}
-			}
-			else
-			{
-				Session::set_flash('error', $val->error());
-			}
-		}
-
-		$this->template->title = "<?php echo \Str::ucwords($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/create');

+ 0 - 13
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/delete.php

@@ -1,13 +0,0 @@
-		if ($<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find_one_by_id($id))
-		{
-			$<?php echo $singular_name; ?>->delete();
-
-			Session::set_flash('success', 'Deleted <?php echo $singular_name; ?> #'.$id);
-		}
-
-		else
-		{
-			Session::set_flash('error', 'Could not delete <?php echo $singular_name; ?> #'.$id);
-		}
-
-		Response::redirect('<?php echo $uri; ?>');

+ 0 - 33
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/edit.php

@@ -1,33 +0,0 @@
-		is_null($id) and Response::redirect('<?php echo $controller_name ?>');
-
-		$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find_one_by_id($id);
-
-		if (Input::method() == 'POST')
-		{
-			$val = Model_<?php echo $model_name; ?>::validate('edit');
-
-			if ($val->run())
-			{
-<?php foreach ($fields as $field): ?>
-				$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = Input::post('<?php echo $field['name']; ?>');
-<?php endforeach; ?>
-
-				if ($<?php echo $singular_name; ?>->save())
-				{
-					Session::set_flash('success', 'Updated <?php echo $singular_name; ?> #'.$id);
-					Response::redirect('<?php echo $uri; ?>');
-				}
-				else
-				{
-					Session::set_flash('error', 'Nothing updated.');
-				}
-			}
-			else
-			{
-				Session::set_flash('error', $val->error());
-			}
-		}
-
-		$this->template->set_global('<?php echo $singular_name; ?>', $<?php echo $singular_name; ?>, false);
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path; ?>/edit');

+ 0 - 3
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/index.php

@@ -1,3 +0,0 @@
-		$data['<?php echo $plural_name ?>'] = Model_<?php echo $model_name; ?>::find_all();
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/index', $data);

+ 0 - 6
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/actions/view.php

@@ -1,6 +0,0 @@
-		is_null($id) and Response::redirect('<?php echo $controller_name ?>');
-
-		$data['<?php echo $singular_name ?>'] = Model_<?php echo $model_name ?>::find_by_pk($id);
-
-		$this->template->title = "<?php echo ucfirst($singular_name) ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/view', $data);

+ 0 - 14
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/controller.php

@@ -1,14 +0,0 @@
-<?php echo '<?php' ?>
-
-class Controller_<?php echo $controller_name; ?> extends <?php echo \Cli::option('extends', $controller_parent) ?> 
-{
-
-<?php foreach ($actions as $action): ?>
-	public function action_<?php echo $action['name']; ?>(<?php echo $action['params']; ?>)
-	{
-<?php echo $action['code'].PHP_EOL; ?>
-	}
-
-<?php endforeach; ?>
-
-}

+ 0 - 80
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/controllers/admin.php

@@ -1,80 +0,0 @@
-<?php
-
-class Controller_Admin extends Controller_Base {
-
-	public $template = 'admin/template';
-
-	public function before()
-	{
-		parent::before();
-
-		if ( ! Auth::member(100) and Request::active()->action != 'login')
-		{
-			Response::redirect('admin/login');
-		}
-	}
-	
-	public function action_login()
-	{
-		// Already logged in
-		Auth::check() and Response::redirect('admin');
-
-		$val = Validation::forge();
-
-		if (Input::method() == 'POST')
-		{
-			$val->add('email', 'Email or Username')
-			    ->add_rule('required');
-			$val->add('password', 'Password')
-			    ->add_rule('required');
-
-			if ($val->run())
-			{
-				$auth = Auth::instance();
-				
-				// check the credentials. This assumes that you have the previous table created
-				if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
-				{
-					// credentials ok, go right in
-					Session::set_flash('notice', 'Welcome, '.$current_user->username);
-					Response::redirect('admin');
-				}
-				else
-				{
-					$this->template->set_global('login_error', 'Fail');
-				}
-
-			}
-		}
-
-		$this->template->title = 'Login';
-		$this->template->content = View::forge('admin/login', array('val' => $val));
-	}
-	
-	/**
-	 * The logout action.
-	 * 
-	 * @access  public
-	 * @return  void
-	 */
-	public function action_logout()
-	{		
-		Auth::logout();
-		Response::redirect('admin');
-	}
-
-	/**
-	 * The index action.
-	 * 
-	 * @access  public
-	 * @return  void
-	 */
-	public function action_index()
-	{		
-		$this->template->title = 'Dashboard';
-		$this->template->content = View::forge('admin/dashboard');
-	}
-
-}
-
-/* End of file app.php */

+ 0 - 16
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/controllers/base.php

@@ -1,16 +0,0 @@
-<?php
-
-class Controller_Base extends Controller_Template {
-
-	public function before()
-	{
-		parent::before();
-		
-		// Assign current_user to the instance so controllers can use it
-		$this->current_user = Auth::check() ? Model_User::find_one_by_username(Auth::get_screen_name()) : null;
-		
-		// Set a global variable so views can use it
-		View::set_global('current_user', $this->current_user);
-	}
-
-}

+ 0 - 35
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/model.php

@@ -1,35 +0,0 @@
-<?php echo '<?php' ?>
-
-class Model_<?php echo $model_name; ?> extends Model_Crud
-{
-	protected static $_table_name = '<?php echo $table; ?>';
-	
-	public static function validate($factory)
-	{
-		$val = Validation::forge($factory);
-<?php foreach ($fields as $field): ?>
-<?php
-		$rules = array('required');
-
-		if (in_array($field['type'], array('varchar', 'string', 'char')))
-		{
-			if ($field['name'] === 'email')
-			{
-				$rules[] = 'valid_email';
-			}
-			$rules[] = ! is_null($field['constraint']) ? "max_length[{$field['constraint']}]" : 'max_length[255]';
-		}
-		elseif (in_array($field['type'], array('int', 'integer')))
-		{
-			$rules[] = 'valid_string[numeric]';
-		}
-		
-		$rules = implode('|', $rules);
-?>
-		$val->add_field('<?php echo $field['name']; ?>', '<?php echo ucwords(str_replace('_', ' ', $field['name'])); ?>', '<?php echo $rules; ?>');
-<?php endforeach; ?>
-
-		return $val;
-	}
-
-}

+ 0 - 30
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/_form.php

@@ -1,30 +0,0 @@
-<?php echo '<?php echo Form::open(); ?>' ?>
-
-
-	<fieldset>
-<?php foreach ($fields as $field): ?>
-		<div class="clearfix">
-			<?php echo "<?php echo Form::label('". \Inflector::humanize($field['name']) ."', '{$field['name']}'); ?>\n"; ?>
-
-			<div class="input">
-<?php switch($field['type']):
-
-				case 'text':
-					echo "\t\t\t\t<?php echo Form::textarea('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span8', 'rows' => 8)); ?>\n";
-				break;
-
-				default:
-					echo "\t\t\t\t<?php echo Form::input('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span4')); ?>\n";
-
-endswitch; ?>
-
-			</div>
-		</div>
-<?php endforeach; ?>
-		<div class="actions">
-			<?php echo '<?php'; ?> echo Form::submit('submit', 'Save', array('class' => 'btn btn-primary')); <?php echo '?>'; ?>
-
-
-		</div>
-	</fieldset>
-<?php echo '<?php'; ?> echo Form::close(); <?php echo '?>'; ?>

+ 0 - 7
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/create.php

@@ -1,7 +0,0 @@
-<h2>New <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path ?>/_form'); ?>
-
-
-<p><?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?></p>

+ 0 - 8
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/edit.php

@@ -1,8 +0,0 @@
-<h2>Editing <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path; ?>/_form'); ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>', 'Back'); <?php echo '?>'; ?>
-</p>

+ 0 - 42
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/index.php

@@ -1,42 +0,0 @@
-<h2>Listing <?php echo \Str::ucfirst($plural_name); ?></h2>
-<br>
-<?php echo "<?php if (\${$plural_name}): ?>"; ?>
-
-<table class="table table-striped">
-	<thead>
-		<tr>
-<?php foreach ($fields as $field): ?>
-			<th><?php echo \Inflector::humanize($field['name']); ?></th>
-<?php endforeach; ?>
-			<th></th>
-		</tr>
-	</thead>
-	<tbody>
-<?php echo '<?php'; ?> foreach ($<?php echo $plural_name; ?> as $<?php echo $singular_name; ?>): <?php echo '?>'; ?>
-		<tr>
-
-<?php foreach ($fields as $field): ?>
-			<td><?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?></td>
-<?php endforeach; ?>
-			<td>
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/delete/'.$<?php echo $singular_name; ?>->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); <?php echo '?>'; ?>
-
-
-			</td>
-		</tr>
-<?php echo '<?php endforeach; ?>'; ?>
-	</tbody>
-</table>
-
-<?php echo '<?php else: ?>'; ?>
-
-<p>No <?php echo \Str::ucfirst($plural_name); ?>.</p>
-
-<?php echo '<?php endif; ?>'; ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/create', 'Add new <?php echo \Inflector::humanize($singular_name); ?>', array('class' => 'btn btn-success')); <?php echo '?>'; ?>
-
-
-</p>

+ 0 - 11
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/crud/views/actions/view.php

@@ -1,11 +0,0 @@
-<h2>Viewing #<?php echo '<?php'; ?> echo $<?php echo $singular_name; ?>->id; <?php echo '?>'; ?></h2>
-
-<?php foreach ($fields as $field): ?>
-<p>
-	<strong><?php echo \Inflector::humanize($field['name']); ?>:</strong>
-	<?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?>
-</p>
-<?php endforeach; ?>
-
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?>

+ 0 - 32
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/create.php

@@ -1,32 +0,0 @@
-		if (Input::method() == 'POST')
-		{
-			$val = Model_<?php echo $model_name; ?>::validate('create');
-			
-			if ($val->run())
-			{
-				$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::forge(array(
-<?php foreach ($fields as $field): ?>
-					'<?php echo $field['name']; ?>' => Input::post('<?php echo $field['name']; ?>'),
-<?php endforeach; ?>
-				));
-
-				if ($<?php echo $singular_name; ?> and $<?php echo $singular_name; ?>->save())
-				{
-					Session::set_flash('success', 'Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.');
-
-					Response::redirect('<?php echo $uri; ?>');
-				}
-
-				else
-				{
-					Session::set_flash('error', 'Could not save <?php echo $singular_name; ?>.');
-				}
-			}
-			else
-			{
-				Session::set_flash('error', $val->error());
-			}
-		}
-
-		$this->template->title = "<?php echo \Str::ucwords($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/create');

+ 0 - 15
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/delete.php

@@ -1,15 +0,0 @@
-		is_null($id) and Response::redirect('<?php echo $controller_name ?>');
-
-		if ($<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find($id))
-		{
-			$<?php echo $singular_name; ?>->delete();
-
-			Session::set_flash('success', 'Deleted <?php echo $singular_name; ?> #'.$id);
-		}
-
-		else
-		{
-			Session::set_flash('error', 'Could not delete <?php echo $singular_name; ?> #'.$id);
-		}
-
-		Response::redirect('<?php echo $uri; ?>');

+ 0 - 45
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/edit.php

@@ -1,45 +0,0 @@
-		is_null($id) and Response::redirect('<?php echo $controller_name ?>');
-
-		if ( ! $<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::find($id))
-		{
-			Session::set_flash('error', 'Could not find <?php echo $singular_name; ?> #'.$id);
-			Response::redirect('<?php echo $controller_name ?>');
-		}
-
-		$val = Model_<?php echo $model_name; ?>::validate('edit');
-
-		if ($val->run())
-		{
-<?php foreach ($fields as $field): ?>
-			$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = Input::post('<?php echo $field['name']; ?>');
-<?php endforeach; ?>
-
-			if ($<?php echo $singular_name; ?>->save())
-			{
-				Session::set_flash('success', 'Updated <?php echo $singular_name; ?> #' . $id);
-
-				Response::redirect('<?php echo $uri; ?>');
-			}
-
-			else
-			{
-				Session::set_flash('error', 'Could not update <?php echo $singular_name; ?> #' . $id);
-			}
-		}
-
-		else
-		{
-			if (Input::method() == 'POST')
-			{
-<?php foreach ($fields as $field): ?>
-				$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = $val->validated('<?php echo $field['name']; ?>');
-<?php endforeach; ?>
-
-				Session::set_flash('error', $val->error());
-			}
-
-			$this->template->set_global('<?php echo $singular_name; ?>', $<?php echo $singular_name; ?>, false);
-		}
-
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path; ?>/edit');

+ 0 - 3
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/index.php

@@ -1,3 +0,0 @@
-		$data['<?php echo $plural_name ?>'] = Model_<?php echo $model_name; ?>::find('all');
-		$this->template->title = "<?php echo ucfirst($plural_name); ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/index', $data);

+ 0 - 10
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/actions/view.php

@@ -1,10 +0,0 @@
-		is_null($id) and Response::redirect('<?php echo $controller_name ?>');
-
-		if ( ! $data['<?php echo $singular_name ?>'] = Model_<?php echo $model_name ?>::find($id))
-		{
-			Session::set_flash('error', 'Could not find <?php echo $singular_name; ?> #'.$id);
-			Response::redirect('<?php echo $controller_name ?>');
-		}
-
-		$this->template->title = "<?php echo ucfirst($singular_name) ?>";
-		$this->template->content = View::forge('<?php echo $view_path ?>/view', $data);

+ 0 - 14
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/controller.php

@@ -1,14 +0,0 @@
-<?php echo '<?php' ?>
-
-class Controller_<?php echo $controller_name; ?> extends <?php echo \Cli::option('extends', $controller_parent) ?> 
-{
-
-<?php foreach ($actions as $action): ?>
-	public function action_<?php echo $action['name']; ?>(<?php echo $action['params']; ?>)
-	{
-<?php echo $action['code'].PHP_EOL; ?>
-	}
-
-<?php endforeach; ?>
-
-}

+ 0 - 59
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/model.php

@@ -1,59 +0,0 @@
-<?php echo '<?php' ?>
-
-use Orm\Model;
-
-class Model_<?php echo $model_name; ?> extends Model
-{
-	protected static $_properties = array(
-		'id',
-<?php foreach ($fields as $field): ?>
-		'<?php echo $field['name']; ?>',
-<?php endforeach; ?>
-<?php if ($include_timestamps): ?>
-		'created_at',
-		'updated_at',
-<?php endif; ?>
-	);
-
-<?php if ($include_timestamps): ?>
-	protected static $_observers = array(
-		'Orm\Observer_CreatedAt' => array(
-			'events' => array('before_insert'),
-			'mysql_timestamp' => false,
-		),
-		'Orm\Observer_UpdatedAt' => array(
-			'events' => array('before_save'),
-			'mysql_timestamp' => false,
-		),
-	);
-<?php endif; ?>
-
-	public static function validate($factory)
-	{
-		$val = Validation::forge($factory);
-<?php foreach ($fields as $field): ?>
-<?php
-		$rules = array('required');
-
-		if (in_array($field['type'], array('varchar', 'string', 'char')))
-		{
-			if ($field['name'] === 'email')
-			{
-				$rules[] = 'valid_email';
-			}
-			$rules[] = ! is_null($field['constraint']) ? "max_length[{$field['constraint']}]" : 'max_length[255]';
-		}
-		elseif (in_array($field['type'], array('int', 'intenger')))
-		{
-			$rules[] = 'valid_string[numeric]';
-		}
-		
-		$rules = implode('|', $rules);
-?>
-		$val->add_field('<?php echo $field['name']; ?>', '<?php echo ucwords(str_replace('_', ' ', $field['name'])); ?>', '<?php echo $rules; ?>');
-<?php endforeach; ?>
-
-		return $val;
-	}
-
-}

+ 0 - 30
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/_form.php

@@ -1,30 +0,0 @@
-<?php echo '<?php echo Form::open(); ?>' ?>
-
-
-	<fieldset>
-<?php foreach ($fields as $field): ?>
-		<div class="clearfix">
-			<?php echo "<?php echo Form::label('". \Inflector::humanize($field['name']) ."', '{$field['name']}'); ?>\n"; ?>
-
-			<div class="input">
-<?php switch($field['type']):
-
-				case 'text':
-					echo "\t\t\t\t<?php echo Form::textarea('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span8', 'rows' => 8)); ?>\n";
-				break;
-
-				default:
-					echo "\t\t\t\t<?php echo Form::input('{$field['name']}', Input::post('{$field['name']}', isset(\${$singular_name}) ? \${$singular_name}->{$field['name']} : ''), array('class' => 'span4')); ?>\n";
-
-endswitch; ?>
-
-			</div>
-		</div>
-<?php endforeach; ?>
-		<div class="actions">
-			<?php echo '<?php'; ?> echo Form::submit('submit', 'Save', array('class' => 'btn btn-primary')); <?php echo '?>'; ?>
-
-
-		</div>
-	</fieldset>
-<?php echo '<?php'; ?> echo Form::close(); <?php echo '?>'; ?>

+ 0 - 7
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/create.php

@@ -1,7 +0,0 @@
-<h2>New <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path ?>/_form'); ?>
-
-
-<p><?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?></p>

+ 0 - 8
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/edit.php

@@ -1,8 +0,0 @@
-<h2>Editing <?php echo \Str::ucfirst($singular_name); ?></h2>
-<br>
-
-<?php echo '<?php'; ?> echo render('<?php echo $view_path; ?>/_form'); ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>', 'Back'); <?php echo '?>'; ?>
-</p>

+ 0 - 42
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/index.php

@@ -1,42 +0,0 @@
-<h2>Listing <?php echo \Str::ucfirst($plural_name); ?></h2>
-<br>
-<?php echo "<?php if (\${$plural_name}): ?>"; ?>
-
-<table class="table table-striped">
-	<thead>
-		<tr>
-<?php foreach ($fields as $field): ?>
-			<th><?php echo \Inflector::humanize($field['name']); ?></th>
-<?php endforeach; ?>
-			<th></th>
-		</tr>
-	</thead>
-	<tbody>
-<?php echo '<?php'; ?> foreach ($<?php echo $plural_name; ?> as $<?php echo $singular_name; ?>): <?php echo '?>'; ?>
-		<tr>
-
-<?php foreach ($fields as $field): ?>
-			<td><?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?></td>
-<?php endforeach; ?>
-			<td>
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/view/'.$<?php echo $singular_name; ?>->id, 'View'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-				<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/delete/'.$<?php echo $singular_name; ?>->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); <?php echo '?>'; ?>
-
-
-			</td>
-		</tr>
-<?php echo '<?php endforeach; ?>'; ?>
-	</tbody>
-</table>
-
-<?php echo '<?php else: ?>'; ?>
-
-<p>No <?php echo \Str::ucfirst($plural_name); ?>.</p>
-
-<?php echo '<?php endif; ?>'; ?>
-<p>
-	<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri; ?>/create', 'Add new <?php echo \Inflector::humanize($singular_name); ?>', array('class' => 'btn btn-success')); <?php echo '?>'; ?>
-
-
-</p>

+ 0 - 11
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/orm/views/actions/view.php

@@ -1,11 +0,0 @@
-<h2>Viewing #<?php echo '<?php'; ?> echo $<?php echo $singular_name; ?>->id; <?php echo '?>'; ?></h2>
-
-<?php foreach ($fields as $field): ?>
-<p>
-	<strong><?php echo \Inflector::humanize($field['name']); ?>:</strong>
-	<?php echo '<?php'; ?> echo $<?php echo $singular_name.'->'.$field['name']; ?>; <?php echo '?>'; ?>
-</p>
-<?php endforeach; ?>
-
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>/edit/'.$<?php echo $singular_name; ?>->id, 'Edit'); <?php echo '?>'; ?> |
-<?php echo '<?php'; ?> echo Html::anchor('<?php echo $uri ?>', 'Back'); <?php echo '?>'; ?>

+ 0 - 45
frameworks/PHP/php-fuel/fuel/packages/oil/views/scaffolding/template.php

@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<meta charset="utf-8">
-	<title><?php echo $title; ?></title>
-	<?php echo Asset::css('bootstrap.css'); ?>
-	<style>
-		body { margin: 40px; }
-	</style>
-</head>
-<body>
-	<div class="container">
-		<div class="row">
-			<div class="span16">
-				<h1><?php echo $title; ?></h1>
-				<hr>
-<?php if (Session::get_flash('success')): ?>
-				<div class="alert-message success">
-					<p>
-					<?php echo implode('</p><p>', e((array) Session::get_flash('success'))); ?>
-					</p>
-				</div>
-<?php endif; ?>
-<?php if (Session::get_flash('error')): ?>
-				<div class="alert-message error">
-					<p>
-					<?php echo implode('</p><p>', e((array) Session::get_flash('error'))); ?>
-					</p>
-				</div>
-<?php endif; ?>
-			</div>
-			<div class="span16">
-<?php echo $content; ?>
-			</div>
-		</div>
-		<footer>
-			<p class="pull-right">Page rendered in {exec_time}s using {mem_usage}mb of memory.</p>
-			<p>
-				<a href="http://fuelphp.com">FuelPHP</a> is released under the MIT license.<br>
-				<small>Version: <?php echo e(Fuel::VERSION); ?></small>
-			</p>
-		</footer>
-	</div>
-</body>
-</html>