<commit_before><?php defined('SYSPATH') or die('No direct script access.');

class Controller_Project extends Controller_Template_Kocode
{
	public function action_list()
	{
		$this->template->content = View::factory('project/list')
			->bind('projects', $projects);

		$projects = ORM::factory('project')->find_all();
	}

	public function action_details()
	{
		$this->template->content = View::factory('project/details')
			->bind('project', $project);

		$name = $this->request->param('name');
		$project = ORM::factory('project')
			->where('name', '=', $name)
			->find();

		if ( ! $project->loaded())
		{
			$this->request->redirect(Route::get('kocode-main')->uri(array
				(
					'controller' => 'project',
				)));
		}
	}

	public function action_create()
	{
		$this->template->content = View::factory('projects/edit')
			->bind('project', $project)
			->bind('errors', $errors);

		$project = ORM::factory('project');

		if ($_POST)
		{
			try
			{
				$project->values($_POST, array('name', 'title', 'description'));
				$project->create();

				$this->request->redirect(Route::get('kocode-main')
					->uri(array
					(
						'controller' => 'project',
						'action'     => 'details',
						'id'         => $project->name
					)));
			}
			catch (ORM_Validation_Exception $e)
			{
				$errors = $e->object->errors('project/edit');
			}
		}
	}

	public function action_update()
	{
		$this->template->content = View::factory('projects/edit')
			->bind('project', $project)
			->bind('errors', $errors);

#		$project = Sprig::factory('project', array('name' => $this->request->param('name')))
#			->load();

		if ( ! $project->loaded())
		{
			$this->request->redirect($this->request->uri(array('action' => 'create')));
		}

		if ($_POST)
		{
			try
			{
				$project->values($_POST)->update();

				$this->request->redirect(Route::get('project')->uri(array('name' => $project->name)));
			}
			catch (Validate_Exception $e)
			{
				$errors = $e->array->errors('project/edit');
			}
		}
	}

} // End Projects
<commit_msg>pushing everything readying up for cleanup<commit_after><?php defined('SYSPATH') or die('No direct script access.');

class Controller_Project extends Controller_Template_Kocode
{
	public function action_list()
	{
		$this->template->content = View::factory('project/list')
			->bind('projects', $projects);

		$projects = ORM::factory('project')->find_all();
	}

	public function action_details()
	{
		$this->template->content = View::factory('project/details')
			->bind('project', $project);

		$name = $this->request->param('name');
		$project = ORM::factory('project')
			->where('name', '=', $name)
			->find();

		if ( ! $project->loaded())
		{
			$this->request->redirect(Route::get('kocode-main')->uri(array
				(
					'controller' => 'project',
				)));
		}
	}

	public function action_create()
	{
		$this->template->content = View::factory('project/create')
			->bind('project', $project)
			->bind('errors', $errors);

		$project = ORM::factory('project');

		if ($_POST)
		{
			try
			{
				$project->values($_POST, array('name', 'title', 'description'));
				$project->create();

				$this->request->redirect(Route::get('kocode-main')
					->uri(array
					(
						'controller' => 'project',
						'action'     => 'details',
						'id'         => $project->name
					)));
			}
			catch (ORM_Validation_Exception $e)
			{
				$errors = $e->object->errors('project/edit');
			}
		}
	}

	public function action_update()
	{
		$this->template->content = View::factory('projects/edit')
			->bind('project', $project)
			->bind('errors', $errors);

#		$project = Sprig::factory('project', array('name' => $this->request->param('name')))
#			->load();

		if ( ! $project->loaded())
		{
			$this->request->redirect($this->request->uri(array('action' => 'create')));
		}

		if ($_POST)
		{
			try
			{
				$project->values($_POST)->update();

				$this->request->redirect(Route::get('project')->uri(array('name' => $project->name)));
			}
			catch (Validate_Exception $e)
			{
				$errors = $e->array->errors('project/edit');
			}
		}
	}

} // End Projects

{'fraction_non_alphanumeric': 0.22200488997555012, 'fraction_numerical': 0.0, 'mean_word_length': 3.6383219954648527, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1211691', 'n_tokens_mistral': 1614, 'n_tokens_neox': 1347, 'n_words': 209}