Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions controllers/Matches.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function create($what = NULL, $name = NULL)
{
if(empty($name))
{
echo $this->_ret.'You didn\'t provide a name for '.$what;
echo $this->_ret.'You didn\'t provide a name for '.$what.$this->_ret;
return FALSE;
}
switch($what)
Expand All @@ -163,7 +163,7 @@ public function create($what = NULL, $name = NULL)
}
else
{
echo $this->_ret.'I can only create: app, controller, model, migration';
echo $this->_ret.'I can only create: app, controller, model, migration'.$this->_ret;
}
}

Expand All @@ -173,7 +173,7 @@ public function create_app($app = NULL)
{
if(file_exists('application/controllers/'.$this->_filename($app).'.php') OR (class_exists(''.$app.'')) OR (class_exists(''.$app.'_model')))
{
echo $app.' Controller or Model already exists in the application/controllers directory.';
echo $app.' Controller or Model already exists in the application/controllers directory.'.$this->_ret;
}
else
{
Expand All @@ -185,7 +185,7 @@ public function create_app($app = NULL)
}
else
{
echo $this->_ret.'You need to provide a name for the app';
echo $this->_ret.'You need to provide a name for the app'.$this->_ret;
}
}
/*
Expand Down Expand Up @@ -217,7 +217,7 @@ public function create_controller()
$directories = $names['directories'];
if(file_exists(APPPATH.'controllers/'.$file_name.'.php'))
{
echo $this->_ret.$class_name.' Controller already exists in the application/controllers'.$directories.' directory.';
echo $this->_ret.$class_name.' Controller already exists in the application/controllers'.$directories.' directory.'.$this->_ret;
}
else
{
Expand All @@ -236,19 +236,19 @@ public function create_controller()
}
if(write_file(APPPATH.'controllers/'.$file_name.'.php',$f))
{
echo $this->_ret.'Controller '.$class_name.' has been created inside '.APPPATH.'controllers/'.$directories.'.';
echo $this->_ret.'Controller '.$class_name.' has been created inside '.APPPATH.'controllers/'.$directories.'.'.$this->_ret;
return TRUE;
}
else
{
echo $this->_ret.'Couldn\'t write Controller.';
echo $this->_ret.'Couldn\'t write Controller.'.$this->_ret;
return FALSE;
}
}
}
else
{
echo $this->_ret.'You need to provide a name for the controller.';
echo $this->_ret.'You need to provide a name for the controller.'.$this->_ret;
}
}
/*
Expand Down Expand Up @@ -280,7 +280,7 @@ public function create_model()
$directories = $names['directories'];
if(file_exists(APPPATH.'models/'.$file_name.'.php'))
{
echo $this->_ret.$class_name.' Model already exists in the application/models'.$directories.' directory.';
echo $this->_ret.$class_name.' Model already exists in the application/models'.$directories.' directory.'.$this->_ret;
}
else
{
Expand All @@ -300,19 +300,19 @@ public function create_model()
}
if(write_file(APPPATH.'models/'.$file_name.'.php',$f))
{
echo $this->_ret.'Model '.$class_name.' has been created inside '.APPPATH.'models/'.$directories.'.';
echo $this->_ret.'Model '.$class_name.' has been created inside '.APPPATH.'models/'.$directories.'.'.$this->_ret;
return TRUE;
}
else
{
echo $this->_ret.'Couldn\'t write Model.';
echo $this->_ret.'Couldn\'t write Model.'.$this->_ret;
return FALSE;
}
}
}
else
{
echo $this->_ret.'You need to provide a name for the model.';
echo $this->_ret.'You need to provide a name for the model.'.$this->_ret;
}
}

Expand Down Expand Up @@ -344,7 +344,7 @@ public function create_view($view = NULL)
$directories = $names['directories'];
if(file_exists(APPPATH.'views/'.$file_name.'.php'))
{
echo $this->_ret.$file_name.' View already exists in the application/views/'.$directories.' directory.';
echo $this->_ret.$file_name.' View already exists in the application/views/'.$directories.' directory.'.$this->_ret;
}
else
{
Expand All @@ -358,7 +358,7 @@ public function create_view($view = NULL)
}
if(write_file(APPPATH.'views/'.$file_name.'.php',$f))
{
echo $this->_ret.'View '.$file_name.' has been created inside '.APPPATH.'views/'.$directories.'.';
echo $this->_ret.'View '.$file_name.' has been created inside '.APPPATH.'views/'.$directories.'.'.$this->_ret;
return TRUE;
}
else
Expand All @@ -370,7 +370,7 @@ public function create_view($view = NULL)
}
else
{
echo $this->_ret.'You need to provide a name for the view file.';
echo $this->_ret.'You need to provide a name for the view file.'.$this->_ret;
}
}

Expand All @@ -387,7 +387,7 @@ public function do_migration($version = NULL)
}
else
{
echo $this->_ret.'The migration has concluded successfully.';
echo $this->_ret.'The migration has concluded successfully.'.$this->_ret;
}
return TRUE;
}
Expand All @@ -403,25 +403,25 @@ public function undo_migration($version = NULL)
}
if(isset($version) && array_key_exists($version,$migrations) && $this->migration->version($version))
{
echo $this->_ret.'The migration was reset to the version: '.$version;
echo $this->_ret.'The migration was reset to the version: '.$version.$this->_ret;
return TRUE;
}
elseif(isset($version) && !array_key_exists($version,$migrations))
{
echo $this->_ret.'The migration with version number '.$version.' doesn\'t exist.';
echo $this->_ret.'The migration with version number '.$version.' doesn\'t exist.'.$this->_ret;
}
else
{
$penultimate = (sizeof($migration_keys)==1) ? 0 : $migration_keys[sizeof($migration_keys) - 2];

if($this->migration->version($penultimate))
{
echo $this->_ret.'The migration has been rolled back successfully.';
echo $this->_ret.'The migration has been rolled back successfully.'.$this->_ret;
return TRUE;
}
else
{
echo $this->_ret.'Couldn\'t roll back the migration.';
echo $this->_ret.'Couldn\'t roll back the migration.'.$this->_ret;
return FALSE;
}
}
Expand All @@ -432,12 +432,12 @@ public function reset_migration()
$this->load->library('migration');
if($this->migration->current()!== FALSE)
{
echo $this->_ret.'The migration was reset to the version set in the config file.';
echo $this->_ret.'The migration was reset to the version set in the config file.'.$this->_ret;
return TRUE;
}
else
{
echo $this->_ret.'Couldn\'t reset migration.';
echo $this->_ret.'Couldn\'t reset migration.'.$this->_ret;
show_error($this->migration->error_string());
return FALSE;
}
Expand All @@ -448,7 +448,7 @@ public function verify_migration_enabled()
$migration_enabled = $this->config->item('migration_enabled');
if($migration_enabled===FALSE)
{
echo $this->_ret.'Your app is not migration enabled. Enable it inside application/config/migration.php';
echo $this->_ret.'Your app is not migration enabled. Enable it inside application/config/migration.php'.$this->_ret;
}
return TRUE;
}
Expand Down Expand Up @@ -479,11 +479,11 @@ public function create_migration()
{
if(mkdir($migration_path,0755))
{
echo $this->_ret.'Folder migrations created.';
echo $this->_ret.'Folder migrations created.'.$this->_ret;
}
else
{
echo $this->_ret.'Couldn\'t create folder migrations.';
echo $this->_ret.'Couldn\'t create folder migrations.'.$this->_ret;
return FALSE;
}
}
Expand Down Expand Up @@ -514,7 +514,7 @@ public function create_migration()
}
if(file_exists($migration_path.$file_name) OR (class_exists($class_name)))
{
echo $this->_ret.$class_name.' Migration already exists.';
echo $this->_ret.$class_name.' Migration already exists.'.$this->_ret;
return FALSE;
}
else
Expand Down Expand Up @@ -547,19 +547,19 @@ public function create_migration()
$f = strtr($f,$this->_find_replace);
if(write_file($migration_path.$file_name.'.php',$f))
{
echo $this->_ret.'Migration '.$class_name.' has been created.';
echo $this->_ret.'Migration '.$class_name.' has been created.'.$this->_ret;
return TRUE;
}
else
{
echo $this->_ret.'Couldn\'t write Migration.';
echo $this->_ret.'Couldn\'t write Migration.'.$this->_ret;
return FALSE;
}
}
}
else
{
echo $this->_ret.'You need to provide a name for the migration.';
echo $this->_ret.'You need to provide a name for the migration.'.$this->_ret;
}
}

Expand All @@ -585,22 +585,22 @@ public function encryption_key($string = NULL)
$f = str_replace($search, $replace, $f);
if(write_file($file,$f))
{
echo $this->_ret.'Encryption key '.$key.' added to '.$file.'.';
echo $this->_ret.'Encryption key '.$key.' added to '.$file.'.'.$this->_ret;
}
else
{
echo $this->_ret.'Couldn\'t write encryption key '.$key.' to '.$file.'.';
echo $this->_ret.'Couldn\'t write encryption key '.$key.' to '.$file.'.'.$this->_ret;
}
}
else
{
echo $this->_ret.'Couldn\t find encryption_key or encryption_key already exists in '.$file.'.';
echo $this->_ret.'Couldn\t find encryption_key or encryption_key already exists in '.$file.'.'.$this->_ret;
}
}
}
else
{
echo $this->_ret.'Couldn\'t find config.php';
echo $this->_ret.'Couldn\'t find config.php'.$this->_ret;
}
}

Expand Down Expand Up @@ -664,7 +664,7 @@ private function _get_template($type)
}
else
{
echo $this->_ret.'Couldn\'t find '.$type.' template.';
echo $this->_ret.'Couldn\'t find '.$type.' template.'.$this->_ret;
return FALSE;
}
}
Expand Down