This commit is contained in:
Paminger
2016-03-20 12:53:17 +01:00
parent 0c3c47f848
commit 9689fd5a01
137 changed files with 8480 additions and 405 deletions
+2352
View File
File diff suppressed because it is too large Load Diff
+7 -4
View File
@@ -70,7 +70,7 @@ $config['url_suffix'] = '';
| than english.
|
*/
$config['language'] = 'de_AT';
$config['language'] = 'de-AT';
/*
|--------------------------------------------------------------------------
@@ -509,9 +509,12 @@ $config['proxy_ips'] = '';
|--------------------------------------------------------------------------
|
*/
function __autoload($class) {
if (substr($class,0,3) !== 'CI_' && substr($class,0,4) !== 'FHC_') {
if (file_exists($file = APPPATH . 'core/' . $class . '.php')) {
function __autoload($class)
{
if (substr($class,0,3) !== 'CI_' && substr($class,0,4) !== 'FHC_')
{
if (file_exists($file = APPPATH . 'core/' . $class . '.php'))
{
require_once $file;
}
}
+4 -4
View File
@@ -97,13 +97,13 @@ $db['default'] = array(
'save_queries' => TRUE
);
$db['wawi'] = array(
$db['system'] = array(
'dsn' => '',
'hostname' => DB_HOST,
'username' => DB_USER,
'password' => DB_PASSWORD,
'username' => 'fhcomplete',
'password' => 'fhcomplete',
'database' => DB_NAME,
'dbschema' => 'wawi',
'dbschema' => 'public',
'dbdriver' => 'postgre',
'dbprefix' => '',
'pconnect' => DB_CONNECT_PERSISTENT,
+30 -21
View File
@@ -1,45 +1,54 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Main extends CI_Controller {
function __construct()
class Main extends CI_Controller
{
/**
* Load Database und the url-helper
**/
private function __construct()
{
parent::__construct();
/* Standard Libraries of codeigniter are required */
// Standard Libraries of codeigniter are required
$this->load->database();
$this->load->helper('url');
/* ------------------ */
// Test the grocery CRUD
$this->load->library('grocery_CRUD');
}
/**
* Show the Welcome Page by default
* @return void
**/
public function index()
{
echo "<h1>Welcome to the world of Codeigniter</h1>";//Just an example to ensure that we get into the function
die();
echo "<h1>Welcome to the world of Codeigniter</h1>";
//Just an example to ensure that we get into the function die();
}
public function prestudent()
/**
* Test grocery CRUD for tbl_person
* @return void
**/
public function person()
{
$this->grocery_crud->set_table('tbl_prestudent');
$this->grocery_crud->set_table('tbl_pperson');
$output = $this->grocery_crud->render();
echo "<pre>";
print_r($output);
echo "</pre>";
die();
//die();
$this->_example_output($output);
$this->__exampleOutput($output);
}
function _example_output($output = null)
/**
* example Output
* @param string $output The HTML-Output from grocery.
* @return void
**/
private function __exampleOutput($output = null)
{
$this->load->view('our_template.php',$output);
$this->load->view('our_template.php', $output);
}
}
/* End of file main.php */
/* Location: ./application/controllers/main.php */
+126 -3
View File
@@ -2,15 +2,138 @@
class Migrate extends CI_Controller
{
private $class_version = '1.0';
private $cli = false;
public function index()
public function __construct()
{
$this->load->library('migration');
parent::__construct();
if ($this->migration->current() === FALSE)
if ($this->input->is_cli_request())
{
$cli=true;
}
else
{
//$this->output->set_status_header(403, 'Migrations must be run from the CLI');
//exit;
}
$this->load->database('system'); //Use the system-Connection for DB-Manipulation
$this->load->library('migration');
}
/**
* Migrate to latest or current version
*
* @param string $version One of either "latest" or "current"
*/
public function index($version = 'latest')
{
if ($this->cli && $this->migration->current() === FALSE)
{
show_error($this->migration->error_string());
}
elseif ($version != 'latest' && $version != 'current')
{
$this->_failed('Migration version must be either latest or current');
}
if (!$this->migration->$version())
{
$this->_failed();
}
$this->_succeeded();
}
/**
* Migrate to a specific version
*/
public function version()
{
if ($version == 'latest' || $version == 'current')
{
$this->index($version);
exit;
}
if (!$this->migrate->version($version))
{
$this->_failed();
}
$this->_succeeded();
}
/**
* Roll-back to the last version before current
*
* @param int $version The migration to rollback to, defaults to previous
*/
public function rollback($version = null)
{
if (is_null($version))
{
$version = $this->_get_version() ?: 1;
$version--;
}
// Check it's definitely false, we could be rolling back to v0
if (false === $this->migration->version($version))
{
$this->_failed();
}
$this->_succeeded('rolled back');
}
/**
* ROLLBACK ALL THE THINGS!
*/
public function uninstall()
{
$this->rollback(0);
}
/**
* Yay, it worked! Tell the user.
*
* @param string $task What did we just do? We...
*/
private function _succeeded($task = 'migrated')
{
$version = $this->_get_version();
exit('Successfully '.$task.' to version '.$version);
}
/**
* Output an error message when it all goes tits up
*
* @param string $message Error to output (default to CI's migration error)
*/
private function _failed($message = null)
{
$message = $message ?: $this->migration->error_string();
show_error($message);
}
/**
* Carbon copy of parent::_get_version, but that's protected.
*
* @return int Currently installed migration number
*/
private function _get_version()
{
$row = $this->db->get('ci_migrations')->row();
return $row ? $row->version : 0;
}
public function about()
{
echo "CI-Migrate_CLI v".$this->class_version;
echo "\nCheck http://github.com/dshoreman/ci-migrate_cli/ for updates";
exit;
}
}
+3 -4
View File
@@ -14,15 +14,15 @@
// ------------------------------------------------------------------------
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') || exit('No direct script access allowed');
class Person extends API_Controller
class Person extends REST_Controller
{
//public $session;
/**
* Person API constructor.
*/
function __construct()
private function __construct()
{
parent::__construct();
@@ -64,5 +64,4 @@ class Person extends API_Controller
// Set the response and exit
$this->response($payload, $httpstatus);
}
}
+3 -5
View File
@@ -1,6 +1,6 @@
<?php
class Person extends FHC_Controller {
class Person extends FHC_Controller
{
public function __construct()
{
parent::__construct();
@@ -17,13 +17,11 @@ class Person extends FHC_Controller {
$this->load->view('templates/footer');
}
public function view($slug = NULL)
public function view($slug = null)
{
$data['person_item'] = $this->person_model->getPersonen($slug);
if (empty($data['person_item']))
{
show_404();
}
$data['title'] = $data['person_item']->titelpre;
+43 -35
View File
@@ -1,66 +1,74 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Basic extends CI_Controller {
function __construct()
class Basic extends CI_Controller
{
/**
* Loading the rdf-Library and Form- and Url-Helper
* @return void
*/
private function __construct()
{
parent::__construct();
$this->load->library(array('rdf'));
$this->load->helper(array('form', 'url'));
}
/**
* Load Basic View
* @return void
*/
public function index()
{
$this->load->library('Rdf');
$d['title'] = '';
$d['content']= $this->load->view('rdf/basic',$d,true);
$this->load->view('home',$d);
$d['content'] = $this->load->view('rdf/basic', $d, true);
$this->load->view('home', $d);
}
/**
* Load Sparql-View
* @return void
*/
public function sparql()
{
$this->load->library('Rdf');
$d['title'] = '';
$d['content']= $this->load->view('rdf/basic_sparql',$d,true);
$this->load->view('home',$d);
$d['content'] = $this->load->view('rdf/basic_sparql', $d, true);
$this->load->view('home', $d);
}
/**
* Load foaf-View
* @return void
*/
public function foafinfo()
{
$this->load->library('Rdf');
$d['title'] = '';
$d['content']= $this->load->view('rdf/foafinfo',$d,true);
$this->load->view('home',$d);
$d['content'] = $this->load->view('rdf/foafinfo', $d, true);
$this->load->view('home', $d);
}
/**
* Load foafmaker View
* @return void
*/
public function foafmaker()
{
$d['title'] = '';
$d['content']= $this->load->view('rdf/foafmaker',$d,true);
$this->load->view('home',$d);
$d['content'] = $this->load->view('rdf/foafmaker', $d, true);
$this->load->view('home', $d);
}
/**
* Load converter View
* @return void
*/
public function converter()
{
$d['title'] = '';
$d['content']= $this->load->view('rdf/converter',$d,true);
$this->load->view('home',$d);
$d['content'] = $this->load->view('rdf/converter', $d, true);
$this->load->view('home', $d);
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
defined('BASEPATH') OR exit('No direct script access allowed');
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
require APPPATH . '/libraries/REST_Controller.php';
//require APPPATH . '/libraries/REST_Controller.php';
class API_Controller extends REST_Controller
{
@@ -0,0 +1,17 @@
<?php
/*
* Bulgarian language
*/
$lang['text_rest_invalid_api_key'] = 'Невалиден API ключ %s';
$lang['text_rest_invalid_credentials'] = 'Невалидни данни за достъп';
$lang['text_rest_ip_denied'] = 'Отказан IP адрес';
$lang['text_rest_ip_unauthorized'] = 'Неоторизиран IP адрес';
$lang['text_rest_unauthorized'] = 'Неоторизиран достъп';
$lang['text_rest_ajax_only'] = 'Само AJAX заявки са разрешени';
$lang['text_rest_api_key_unauthorized'] = 'API ключът не е оторизиран зо достъп до заявения контролер';
$lang['text_rest_api_key_permissions'] = 'API ключът няма достатъчно права';
$lang['text_rest_api_key_time_limit'] = 'API ключът е изполван с превишаване на времевия лимит за този метод';
$lang['text_rest_unknown_method'] = 'Неизвестен метод';
$lang['text_rest_unsupported'] = 'Неподдържан протокол';
@@ -0,0 +1,84 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['cal_su'] = 'Su';
$lang['cal_mo'] = 'Mo';
$lang['cal_tu'] = 'Tu';
$lang['cal_we'] = 'We';
$lang['cal_th'] = 'Th';
$lang['cal_fr'] = 'Fr';
$lang['cal_sa'] = 'Sa';
$lang['cal_sun'] = 'Sun';
$lang['cal_mon'] = 'Mon';
$lang['cal_tue'] = 'Tue';
$lang['cal_wed'] = 'Wed';
$lang['cal_thu'] = 'Thu';
$lang['cal_fri'] = 'Fri';
$lang['cal_sat'] = 'Sat';
$lang['cal_sunday'] = 'Sunday';
$lang['cal_monday'] = 'Monday';
$lang['cal_tuesday'] = 'Tuesday';
$lang['cal_wednesday'] = 'Wednesday';
$lang['cal_thursday'] = 'Thursday';
$lang['cal_friday'] = 'Friday';
$lang['cal_saturday'] = 'Saturday';
$lang['cal_jan'] = 'Jan';
$lang['cal_feb'] = 'Feb';
$lang['cal_mar'] = 'Mar';
$lang['cal_apr'] = 'Apr';
$lang['cal_may'] = 'May';
$lang['cal_jun'] = 'Jun';
$lang['cal_jul'] = 'Jul';
$lang['cal_aug'] = 'Aug';
$lang['cal_sep'] = 'Sep';
$lang['cal_oct'] = 'Oct';
$lang['cal_nov'] = 'Nov';
$lang['cal_dec'] = 'Dec';
$lang['cal_january'] = 'January';
$lang['cal_february'] = 'February';
$lang['cal_march'] = 'March';
$lang['cal_april'] = 'April';
$lang['cal_mayl'] = 'May';
$lang['cal_june'] = 'June';
$lang['cal_july'] = 'July';
$lang['cal_august'] = 'August';
$lang['cal_september'] = 'September';
$lang['cal_october'] = 'October';
$lang['cal_november'] = 'November';
$lang['cal_december'] = 'December';
+94
View File
@@ -0,0 +1,94 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['date_year'] = 'Year';
$lang['date_years'] = 'Years';
$lang['date_month'] = 'Month';
$lang['date_months'] = 'Months';
$lang['date_week'] = 'Week';
$lang['date_weeks'] = 'Weeks';
$lang['date_day'] = 'Day';
$lang['date_days'] = 'Days';
$lang['date_hour'] = 'Hour';
$lang['date_hours'] = 'Hours';
$lang['date_minute'] = 'Minute';
$lang['date_minutes'] = 'Minutes';
$lang['date_second'] = 'Second';
$lang['date_seconds'] = 'Seconds';
$lang['UM12'] = '(UTC -12:00) Baker/Howland Island';
$lang['UM11'] = '(UTC -11:00) Niue';
$lang['UM10'] = '(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti';
$lang['UM95'] = '(UTC -9:30) Marquesas Islands';
$lang['UM9'] = '(UTC -9:00) Alaska Standard Time, Gambier Islands';
$lang['UM8'] = '(UTC -8:00) Pacific Standard Time, Clipperton Island';
$lang['UM7'] = '(UTC -7:00) Mountain Standard Time';
$lang['UM6'] = '(UTC -6:00) Central Standard Time';
$lang['UM5'] = '(UTC -5:00) Eastern Standard Time, Western Caribbean Standard Time';
$lang['UM45'] = '(UTC -4:30) Venezuelan Standard Time';
$lang['UM4'] = '(UTC -4:00) Atlantic Standard Time, Eastern Caribbean Standard Time';
$lang['UM35'] = '(UTC -3:30) Newfoundland Standard Time';
$lang['UM3'] = '(UTC -3:00) Argentina, Brazil, French Guiana, Uruguay';
$lang['UM2'] = '(UTC -2:00) South Georgia/South Sandwich Islands';
$lang['UM1'] = '(UTC -1:00) Azores, Cape Verde Islands';
$lang['UTC'] = '(UTC) Greenwich Mean Time, Western European Time';
$lang['UP1'] = '(UTC +1:00) Central European Time, West Africa Time';
$lang['UP2'] = '(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time';
$lang['UP3'] = '(UTC +3:00) Moscow Time, East Africa Time, Arabia Standard Time';
$lang['UP35'] = '(UTC +3:30) Iran Standard Time';
$lang['UP4'] = '(UTC +4:00) Azerbaijan Standard Time, Samara Time';
$lang['UP45'] = '(UTC +4:30) Afghanistan';
$lang['UP5'] = '(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time';
$lang['UP55'] = '(UTC +5:30) Indian Standard Time, Sri Lanka Time';
$lang['UP575'] = '(UTC +5:45) Nepal Time';
$lang['UP6'] = '(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time';
$lang['UP65'] = '(UTC +6:30) Cocos Islands, Myanmar';
$lang['UP7'] = '(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam';
$lang['UP8'] = '(UTC +8:00) Australian Western Standard Time, Beijing Time, Irkutsk Time';
$lang['UP875'] = '(UTC +8:45) Australian Central Western Standard Time';
$lang['UP9'] = '(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk Time';
$lang['UP95'] = '(UTC +9:30) Australian Central Standard Time';
$lang['UP10'] = '(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time';
$lang['UP105'] = '(UTC +10:30) Lord Howe Island';
$lang['UP11'] = '(UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu';
$lang['UP115'] = '(UTC +11:30) Norfolk Island';
$lang['UP12'] = '(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time';
$lang['UP1275'] = '(UTC +12:45) Chatham Islands Standard Time';
$lang['UP13'] = '(UTC +13:00) Samoa Time Zone, Phoenix Islands Time, Tonga';
$lang['UP14'] = '(UTC +14:00) Line Islands';
+63
View File
@@ -0,0 +1,63 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.';
$lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.';
$lang['db_unable_to_select'] = 'Unable to select the specified database: %s';
$lang['db_unable_to_create'] = 'Unable to create the specified database: %s';
$lang['db_invalid_query'] = 'The query you submitted is not valid.';
$lang['db_must_set_table'] = 'You must set the database table to be used with your query.';
$lang['db_must_use_set'] = 'You must use the "set" method to update an entry.';
$lang['db_must_use_index'] = 'You must specify an index to match on for batch updates.';
$lang['db_batch_missing_index'] = 'One or more rows submitted for batch updating is missing the specified index.';
$lang['db_must_use_where'] = 'Updates are not allowed unless they contain a "where" clause.';
$lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" or "like" clause.';
$lang['db_field_param_missing'] = 'To fetch fields requires the name of the table as a parameter.';
$lang['db_unsupported_function'] = 'This feature is not available for the database you are using.';
$lang['db_transaction_failure'] = 'Transaction failure: Rollback performed.';
$lang['db_unable_to_drop'] = 'Unable to drop the specified database.';
$lang['db_unsupported_feature'] = 'Unsupported feature of the database platform you are using.';
$lang['db_unsupported_compression'] = 'The file compression format you chose is not supported by your server.';
$lang['db_filepath_error'] = 'Unable to write data to the file path you have submitted.';
$lang['db_invalid_cache_path'] = 'The cache path you submitted is not valid or writable.';
$lang['db_table_name_required'] = 'A table name is required for that operation.';
$lang['db_column_name_required'] = 'A column name is required for that operation.';
$lang['db_column_definition_required'] = 'A column definition is required for that operation.';
$lang['db_unable_to_set_charset'] = 'Unable to set client connection character set: %s';
$lang['db_error_heading'] = 'A Database Error Occurred';
+58
View File
@@ -0,0 +1,58 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['email_must_be_array'] = 'The email validation method must be passed an array.';
$lang['email_invalid_address'] = 'Invalid email address: %s';
$lang['email_attachment_missing'] = 'Unable to locate the following email attachment: %s';
$lang['email_attachment_unreadable'] = 'Unable to open this attachment: %s';
$lang['email_no_from'] = 'Cannot send mail with no "From" header.';
$lang['email_no_recipients'] = 'You must include recipients: To, Cc, or Bcc';
$lang['email_send_failure_phpmail'] = 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.';
$lang['email_send_failure_sendmail'] = 'Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.';
$lang['email_send_failure_smtp'] = 'Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.';
$lang['email_sent'] = 'Your message has been successfully sent using the following protocol: %s';
$lang['email_no_socket'] = 'Unable to open a socket to Sendmail. Please check settings.';
$lang['email_no_hostname'] = 'You did not specify a SMTP hostname.';
$lang['email_smtp_error'] = 'The following SMTP error was encountered: %s';
$lang['email_no_smtp_unpw'] = 'Error: You must assign a SMTP username and password.';
$lang['email_failed_smtp_login'] = 'Failed to send AUTH LOGIN command. Error: %s';
$lang['email_smtp_auth_un'] = 'Failed to authenticate username. Error: %s';
$lang['email_smtp_auth_pw'] = 'Failed to authenticate password. Error: %s';
$lang['email_smtp_data_failure'] = 'Unable to send data: %s';
$lang['email_exit_status'] = 'Exit status code: %s';
@@ -0,0 +1,68 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['form_validation_required'] = 'The {field} field is required.';
$lang['form_validation_isset'] = 'The {field} field must have a value.';
$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.';
$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.';
$lang['form_validation_valid_url'] = 'The {field} field must contain a valid URL.';
$lang['form_validation_valid_ip'] = 'The {field} field must contain a valid IP.';
$lang['form_validation_min_length'] = 'The {field} field must be at least {param} characters in length.';
$lang['form_validation_max_length'] = 'The {field} field cannot exceed {param} characters in length.';
$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.';
$lang['form_validation_alpha'] = 'The {field} field may only contain alphabetical characters.';
$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.';
$lang['form_validation_alpha_numeric_spaces'] = 'The {field} field may only contain alpha-numeric characters and spaces.';
$lang['form_validation_alpha_dash'] = 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.';
$lang['form_validation_numeric'] = 'The {field} field must contain only numbers.';
$lang['form_validation_is_numeric'] = 'The {field} field must contain only numeric characters.';
$lang['form_validation_integer'] = 'The {field} field must contain an integer.';
$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.';
$lang['form_validation_matches'] = 'The {field} field does not match the {param} field.';
$lang['form_validation_differs'] = 'The {field} field must differ from the {param} field.';
$lang['form_validation_is_unique'] = 'The {field} field must contain a unique value.';
$lang['form_validation_is_natural'] = 'The {field} field must only contain digits.';
$lang['form_validation_is_natural_no_zero'] = 'The {field} field must only contain digits and must be greater than zero.';
$lang['form_validation_decimal'] = 'The {field} field must contain a decimal number.';
$lang['form_validation_less_than'] = 'The {field} field must contain a number less than {param}.';
$lang['form_validation_less_than_equal_to'] = 'The {field} field must contain a number less than or equal to {param}.';
$lang['form_validation_greater_than'] = 'The {field} field must contain a number greater than {param}.';
$lang['form_validation_greater_than_equal_to'] = 'The {field} field must contain a number greater than or equal to {param}.';
$lang['form_validation_error_message_not_set'] = 'Unable to access an error message corresponding to your field name {field}.';
$lang['form_validation_in_list'] = 'The {field} field must be one of: {param}.';
+51
View File
@@ -0,0 +1,51 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['ftp_no_connection'] = 'Unable to locate a valid connection ID. Please make sure you are connected before performing any file routines.';
$lang['ftp_unable_to_connect'] = 'Unable to connect to your FTP server using the supplied hostname.';
$lang['ftp_unable_to_login'] = 'Unable to login to your FTP server. Please check your username and password.';
$lang['ftp_unable_to_mkdir'] = 'Unable to create the directory you have specified.';
$lang['ftp_unable_to_changedir'] = 'Unable to change directories.';
$lang['ftp_unable_to_chmod'] = 'Unable to set file permissions. Please check your path.';
$lang['ftp_unable_to_upload'] = 'Unable to upload the specified file. Please check your path.';
$lang['ftp_unable_to_download'] = 'Unable to download the specified file. Please check your path.';
$lang['ftp_no_source_file'] = 'Unable to locate the source file. Please check your path.';
$lang['ftp_unable_to_rename'] = 'Unable to rename the file.';
$lang['ftp_unable_to_delete'] = 'Unable to delete the file.';
$lang['ftp_unable_to_move'] = 'Unable to move the file. Please make sure the destination directory exists.';
@@ -0,0 +1,56 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['imglib_source_image_required'] = 'You must specify a source image in your preferences.';
$lang['imglib_gd_required'] = 'The GD image library is required for this feature.';
$lang['imglib_gd_required_for_props'] = 'Your server must support the GD image library in order to determine the image properties.';
$lang['imglib_unsupported_imagecreate'] = 'Your server does not support the GD function required to process this type of image.';
$lang['imglib_gif_not_supported'] = 'GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead.';
$lang['imglib_jpg_not_supported'] = 'JPG images are not supported.';
$lang['imglib_png_not_supported'] = 'PNG images are not supported.';
$lang['imglib_jpg_or_png_required'] = 'The image resize protocol specified in your preferences only works with JPEG or PNG image types.';
$lang['imglib_copy_error'] = 'An error was encountered while attempting to replace the file. Please make sure your file directory is writable.';
$lang['imglib_rotate_unsupported'] = 'Image rotation does not appear to be supported by your server.';
$lang['imglib_libpath_invalid'] = 'The path to your image library is not correct. Please set the correct path in your image preferences.';
$lang['imglib_image_process_failed'] = 'Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct.';
$lang['imglib_rotation_angle_required'] = 'An angle of rotation is required to rotate the image.';
$lang['imglib_invalid_path'] = 'The path to the image is not correct.';
$lang['imglib_copy_failed'] = 'The image copy routine failed.';
$lang['imglib_missing_font'] = 'Unable to find a font to use.';
$lang['imglib_save_failed'] = 'Unable to save the image. Please make sure the image and file directory are writable.';
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,17 @@
<?php
/*
* Austrian-German Language
*/
$lang['text_rest_invalid_api_key'] = 'Invalid API key %s'; // %s is the REST API key
$lang['text_rest_invalid_credentials'] = 'Invalid credentials';
$lang['text_rest_ip_denied'] = 'IP denied';
$lang['text_rest_ip_unauthorized'] = 'IP unauthorized';
$lang['text_rest_unauthorized'] = 'Unauthorized';
$lang['text_rest_ajax_only'] = 'Only AJAX requests are allowed';
$lang['text_rest_api_key_unauthorized'] = 'This API key does not have access to the requested controller';
$lang['text_rest_api_key_permissions'] = 'This API key does not have enough permissions';
$lang['text_rest_api_key_time_limit'] = 'This API key has reached the time limit for this method';
$lang['text_rest_unknown_method'] = 'Unknown method';
$lang['text_rest_unsupported'] = 'Unsupported protocol';
@@ -0,0 +1,44 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['terabyte_abbr'] = 'TB';
$lang['gigabyte_abbr'] = 'GB';
$lang['megabyte_abbr'] = 'MB';
$lang['kilobyte_abbr'] = 'KB';
$lang['bytes'] = 'Bytes';
@@ -0,0 +1,43 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['pagination_first_link'] = '&lsaquo; First';
$lang['pagination_next_link'] = '&gt;';
$lang['pagination_prev_link'] = '&lt;';
$lang['pagination_last_link'] = 'Last &rsaquo;';
@@ -0,0 +1,60 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['profiler_database'] = 'DATABASE';
$lang['profiler_controller_info'] = 'CLASS/METHOD';
$lang['profiler_benchmarks'] = 'BENCHMARKS';
$lang['profiler_queries'] = 'QUERIES';
$lang['profiler_get_data'] = 'GET DATA';
$lang['profiler_post_data'] = 'POST DATA';
$lang['profiler_uri_string'] = 'URI STRING';
$lang['profiler_memory_usage'] = 'MEMORY USAGE';
$lang['profiler_config'] = 'CONFIG VARIABLES';
$lang['profiler_session_data'] = 'SESSION DATA';
$lang['profiler_headers'] = 'HTTP HEADERS';
$lang['profiler_no_db'] = 'Database driver is not currently loaded';
$lang['profiler_no_queries'] = 'No queries were run';
$lang['profiler_no_post'] = 'No POST data exists';
$lang['profiler_no_get'] = 'No GET data exists';
$lang['profiler_no_uri'] = 'No URI data exists';
$lang['profiler_no_memory'] = 'Memory Usage Unavailable';
$lang['profiler_no_profiles'] = 'No Profile data - all Profiler sections have been disabled.';
$lang['profiler_section_hide'] = 'Hide';
$lang['profiler_section_show'] = 'Show';
$lang['profiler_seconds'] = 'seconds';
@@ -0,0 +1,58 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['ut_test_name'] = 'Test Name';
$lang['ut_test_datatype'] = 'Test Datatype';
$lang['ut_res_datatype'] = 'Expected Datatype';
$lang['ut_result'] = 'Result';
$lang['ut_undefined'] = 'Undefined Test Name';
$lang['ut_file'] = 'File Name';
$lang['ut_line'] = 'Line Number';
$lang['ut_passed'] = 'Passed';
$lang['ut_failed'] = 'Failed';
$lang['ut_boolean'] = 'Boolean';
$lang['ut_integer'] = 'Integer';
$lang['ut_float'] = 'Float';
$lang['ut_double'] = 'Float'; // can be the same as float
$lang['ut_string'] = 'String';
$lang['ut_array'] = 'Array';
$lang['ut_object'] = 'Object';
$lang['ut_resource'] = 'Resource';
$lang['ut_null'] = 'Null';
$lang['ut_notes'] = 'Notes';
@@ -0,0 +1,55 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['upload_userfile_not_set'] = 'Unable to find a post variable called userfile.';
$lang['upload_file_exceeds_limit'] = 'The uploaded file exceeds the maximum allowed size in your PHP configuration file.';
$lang['upload_file_exceeds_form_limit'] = 'The uploaded file exceeds the maximum size allowed by the submission form.';
$lang['upload_file_partial'] = 'The file was only partially uploaded.';
$lang['upload_no_temp_directory'] = 'The temporary folder is missing.';
$lang['upload_unable_to_write_file'] = 'The file could not be written to disk.';
$lang['upload_stopped_by_extension'] = 'The file upload was stopped by extension.';
$lang['upload_no_file_selected'] = 'You did not select a file to upload.';
$lang['upload_invalid_filetype'] = 'The filetype you are attempting to upload is not allowed.';
$lang['upload_invalid_filesize'] = 'The file you are attempting to upload is larger than the permitted size.';
$lang['upload_invalid_dimensions'] = 'The image you are attempting to upload doesn\'t fit into the allowed dimensions.';
$lang['upload_destination_error'] = 'A problem was encountered while attempting to move the uploaded file to the final destination.';
$lang['upload_no_filepath'] = 'The upload path does not appear to be valid.';
$lang['upload_no_file_types'] = 'You have not specified any allowed file types.';
$lang['upload_bad_filename'] = 'The file name you submitted already exists on the server.';
$lang['upload_not_writable'] = 'The upload destination folder does not appear to be writable.';
@@ -0,0 +1,84 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['cal_su'] = 'Su';
$lang['cal_mo'] = 'Mo';
$lang['cal_tu'] = 'Tu';
$lang['cal_we'] = 'We';
$lang['cal_th'] = 'Th';
$lang['cal_fr'] = 'Fr';
$lang['cal_sa'] = 'Sa';
$lang['cal_sun'] = 'Sun';
$lang['cal_mon'] = 'Mon';
$lang['cal_tue'] = 'Tue';
$lang['cal_wed'] = 'Wed';
$lang['cal_thu'] = 'Thu';
$lang['cal_fri'] = 'Fri';
$lang['cal_sat'] = 'Sat';
$lang['cal_sunday'] = 'Sunday';
$lang['cal_monday'] = 'Monday';
$lang['cal_tuesday'] = 'Tuesday';
$lang['cal_wednesday'] = 'Wednesday';
$lang['cal_thursday'] = 'Thursday';
$lang['cal_friday'] = 'Friday';
$lang['cal_saturday'] = 'Saturday';
$lang['cal_jan'] = 'Jan';
$lang['cal_feb'] = 'Feb';
$lang['cal_mar'] = 'Mar';
$lang['cal_apr'] = 'Apr';
$lang['cal_may'] = 'May';
$lang['cal_jun'] = 'Jun';
$lang['cal_jul'] = 'Jul';
$lang['cal_aug'] = 'Aug';
$lang['cal_sep'] = 'Sep';
$lang['cal_oct'] = 'Oct';
$lang['cal_nov'] = 'Nov';
$lang['cal_dec'] = 'Dec';
$lang['cal_january'] = 'January';
$lang['cal_february'] = 'February';
$lang['cal_march'] = 'March';
$lang['cal_april'] = 'April';
$lang['cal_mayl'] = 'May';
$lang['cal_june'] = 'June';
$lang['cal_july'] = 'July';
$lang['cal_august'] = 'August';
$lang['cal_september'] = 'September';
$lang['cal_october'] = 'October';
$lang['cal_november'] = 'November';
$lang['cal_december'] = 'December';
+94
View File
@@ -0,0 +1,94 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['date_year'] = 'Year';
$lang['date_years'] = 'Years';
$lang['date_month'] = 'Month';
$lang['date_months'] = 'Months';
$lang['date_week'] = 'Week';
$lang['date_weeks'] = 'Weeks';
$lang['date_day'] = 'Day';
$lang['date_days'] = 'Days';
$lang['date_hour'] = 'Hour';
$lang['date_hours'] = 'Hours';
$lang['date_minute'] = 'Minute';
$lang['date_minutes'] = 'Minutes';
$lang['date_second'] = 'Second';
$lang['date_seconds'] = 'Seconds';
$lang['UM12'] = '(UTC -12:00) Baker/Howland Island';
$lang['UM11'] = '(UTC -11:00) Niue';
$lang['UM10'] = '(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti';
$lang['UM95'] = '(UTC -9:30) Marquesas Islands';
$lang['UM9'] = '(UTC -9:00) Alaska Standard Time, Gambier Islands';
$lang['UM8'] = '(UTC -8:00) Pacific Standard Time, Clipperton Island';
$lang['UM7'] = '(UTC -7:00) Mountain Standard Time';
$lang['UM6'] = '(UTC -6:00) Central Standard Time';
$lang['UM5'] = '(UTC -5:00) Eastern Standard Time, Western Caribbean Standard Time';
$lang['UM45'] = '(UTC -4:30) Venezuelan Standard Time';
$lang['UM4'] = '(UTC -4:00) Atlantic Standard Time, Eastern Caribbean Standard Time';
$lang['UM35'] = '(UTC -3:30) Newfoundland Standard Time';
$lang['UM3'] = '(UTC -3:00) Argentina, Brazil, French Guiana, Uruguay';
$lang['UM2'] = '(UTC -2:00) South Georgia/South Sandwich Islands';
$lang['UM1'] = '(UTC -1:00) Azores, Cape Verde Islands';
$lang['UTC'] = '(UTC) Greenwich Mean Time, Western European Time';
$lang['UP1'] = '(UTC +1:00) Central European Time, West Africa Time';
$lang['UP2'] = '(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time';
$lang['UP3'] = '(UTC +3:00) Moscow Time, East Africa Time, Arabia Standard Time';
$lang['UP35'] = '(UTC +3:30) Iran Standard Time';
$lang['UP4'] = '(UTC +4:00) Azerbaijan Standard Time, Samara Time';
$lang['UP45'] = '(UTC +4:30) Afghanistan';
$lang['UP5'] = '(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time';
$lang['UP55'] = '(UTC +5:30) Indian Standard Time, Sri Lanka Time';
$lang['UP575'] = '(UTC +5:45) Nepal Time';
$lang['UP6'] = '(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time';
$lang['UP65'] = '(UTC +6:30) Cocos Islands, Myanmar';
$lang['UP7'] = '(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam';
$lang['UP8'] = '(UTC +8:00) Australian Western Standard Time, Beijing Time, Irkutsk Time';
$lang['UP875'] = '(UTC +8:45) Australian Central Western Standard Time';
$lang['UP9'] = '(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk Time';
$lang['UP95'] = '(UTC +9:30) Australian Central Standard Time';
$lang['UP10'] = '(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time';
$lang['UP105'] = '(UTC +10:30) Lord Howe Island';
$lang['UP11'] = '(UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu';
$lang['UP115'] = '(UTC +11:30) Norfolk Island';
$lang['UP12'] = '(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time';
$lang['UP1275'] = '(UTC +12:45) Chatham Islands Standard Time';
$lang['UP13'] = '(UTC +13:00) Samoa Time Zone, Phoenix Islands Time, Tonga';
$lang['UP14'] = '(UTC +14:00) Line Islands';
+63
View File
@@ -0,0 +1,63 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.';
$lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.';
$lang['db_unable_to_select'] = 'Unable to select the specified database: %s';
$lang['db_unable_to_create'] = 'Unable to create the specified database: %s';
$lang['db_invalid_query'] = 'The query you submitted is not valid.';
$lang['db_must_set_table'] = 'You must set the database table to be used with your query.';
$lang['db_must_use_set'] = 'You must use the "set" method to update an entry.';
$lang['db_must_use_index'] = 'You must specify an index to match on for batch updates.';
$lang['db_batch_missing_index'] = 'One or more rows submitted for batch updating is missing the specified index.';
$lang['db_must_use_where'] = 'Updates are not allowed unless they contain a "where" clause.';
$lang['db_del_must_use_where'] = 'Deletes are not allowed unless they contain a "where" or "like" clause.';
$lang['db_field_param_missing'] = 'To fetch fields requires the name of the table as a parameter.';
$lang['db_unsupported_function'] = 'This feature is not available for the database you are using.';
$lang['db_transaction_failure'] = 'Transaction failure: Rollback performed.';
$lang['db_unable_to_drop'] = 'Unable to drop the specified database.';
$lang['db_unsupported_feature'] = 'Unsupported feature of the database platform you are using.';
$lang['db_unsupported_compression'] = 'The file compression format you chose is not supported by your server.';
$lang['db_filepath_error'] = 'Unable to write data to the file path you have submitted.';
$lang['db_invalid_cache_path'] = 'The cache path you submitted is not valid or writable.';
$lang['db_table_name_required'] = 'A table name is required for that operation.';
$lang['db_column_name_required'] = 'A column name is required for that operation.';
$lang['db_column_definition_required'] = 'A column definition is required for that operation.';
$lang['db_unable_to_set_charset'] = 'Unable to set client connection character set: %s';
$lang['db_error_heading'] = 'A Database Error Occurred';
+58
View File
@@ -0,0 +1,58 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['email_must_be_array'] = 'The email validation method must be passed an array.';
$lang['email_invalid_address'] = 'Invalid email address: %s';
$lang['email_attachment_missing'] = 'Unable to locate the following email attachment: %s';
$lang['email_attachment_unreadable'] = 'Unable to open this attachment: %s';
$lang['email_no_from'] = 'Cannot send mail with no "From" header.';
$lang['email_no_recipients'] = 'You must include recipients: To, Cc, or Bcc';
$lang['email_send_failure_phpmail'] = 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.';
$lang['email_send_failure_sendmail'] = 'Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.';
$lang['email_send_failure_smtp'] = 'Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.';
$lang['email_sent'] = 'Your message has been successfully sent using the following protocol: %s';
$lang['email_no_socket'] = 'Unable to open a socket to Sendmail. Please check settings.';
$lang['email_no_hostname'] = 'You did not specify a SMTP hostname.';
$lang['email_smtp_error'] = 'The following SMTP error was encountered: %s';
$lang['email_no_smtp_unpw'] = 'Error: You must assign a SMTP username and password.';
$lang['email_failed_smtp_login'] = 'Failed to send AUTH LOGIN command. Error: %s';
$lang['email_smtp_auth_un'] = 'Failed to authenticate username. Error: %s';
$lang['email_smtp_auth_pw'] = 'Failed to authenticate password. Error: %s';
$lang['email_smtp_data_failure'] = 'Unable to send data: %s';
$lang['email_exit_status'] = 'Exit status code: %s';
@@ -0,0 +1,68 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['form_validation_required'] = 'The {field} field is required.';
$lang['form_validation_isset'] = 'The {field} field must have a value.';
$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.';
$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.';
$lang['form_validation_valid_url'] = 'The {field} field must contain a valid URL.';
$lang['form_validation_valid_ip'] = 'The {field} field must contain a valid IP.';
$lang['form_validation_min_length'] = 'The {field} field must be at least {param} characters in length.';
$lang['form_validation_max_length'] = 'The {field} field cannot exceed {param} characters in length.';
$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.';
$lang['form_validation_alpha'] = 'The {field} field may only contain alphabetical characters.';
$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.';
$lang['form_validation_alpha_numeric_spaces'] = 'The {field} field may only contain alpha-numeric characters and spaces.';
$lang['form_validation_alpha_dash'] = 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.';
$lang['form_validation_numeric'] = 'The {field} field must contain only numbers.';
$lang['form_validation_is_numeric'] = 'The {field} field must contain only numeric characters.';
$lang['form_validation_integer'] = 'The {field} field must contain an integer.';
$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.';
$lang['form_validation_matches'] = 'The {field} field does not match the {param} field.';
$lang['form_validation_differs'] = 'The {field} field must differ from the {param} field.';
$lang['form_validation_is_unique'] = 'The {field} field must contain a unique value.';
$lang['form_validation_is_natural'] = 'The {field} field must only contain digits.';
$lang['form_validation_is_natural_no_zero'] = 'The {field} field must only contain digits and must be greater than zero.';
$lang['form_validation_decimal'] = 'The {field} field must contain a decimal number.';
$lang['form_validation_less_than'] = 'The {field} field must contain a number less than {param}.';
$lang['form_validation_less_than_equal_to'] = 'The {field} field must contain a number less than or equal to {param}.';
$lang['form_validation_greater_than'] = 'The {field} field must contain a number greater than {param}.';
$lang['form_validation_greater_than_equal_to'] = 'The {field} field must contain a number greater than or equal to {param}.';
$lang['form_validation_error_message_not_set'] = 'Unable to access an error message corresponding to your field name {field}.';
$lang['form_validation_in_list'] = 'The {field} field must be one of: {param}.';
+51
View File
@@ -0,0 +1,51 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['ftp_no_connection'] = 'Unable to locate a valid connection ID. Please make sure you are connected before performing any file routines.';
$lang['ftp_unable_to_connect'] = 'Unable to connect to your FTP server using the supplied hostname.';
$lang['ftp_unable_to_login'] = 'Unable to login to your FTP server. Please check your username and password.';
$lang['ftp_unable_to_mkdir'] = 'Unable to create the directory you have specified.';
$lang['ftp_unable_to_changedir'] = 'Unable to change directories.';
$lang['ftp_unable_to_chmod'] = 'Unable to set file permissions. Please check your path.';
$lang['ftp_unable_to_upload'] = 'Unable to upload the specified file. Please check your path.';
$lang['ftp_unable_to_download'] = 'Unable to download the specified file. Please check your path.';
$lang['ftp_no_source_file'] = 'Unable to locate the source file. Please check your path.';
$lang['ftp_unable_to_rename'] = 'Unable to rename the file.';
$lang['ftp_unable_to_delete'] = 'Unable to delete the file.';
$lang['ftp_unable_to_move'] = 'Unable to move the file. Please make sure the destination directory exists.';
@@ -0,0 +1,56 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['imglib_source_image_required'] = 'You must specify a source image in your preferences.';
$lang['imglib_gd_required'] = 'The GD image library is required for this feature.';
$lang['imglib_gd_required_for_props'] = 'Your server must support the GD image library in order to determine the image properties.';
$lang['imglib_unsupported_imagecreate'] = 'Your server does not support the GD function required to process this type of image.';
$lang['imglib_gif_not_supported'] = 'GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead.';
$lang['imglib_jpg_not_supported'] = 'JPG images are not supported.';
$lang['imglib_png_not_supported'] = 'PNG images are not supported.';
$lang['imglib_jpg_or_png_required'] = 'The image resize protocol specified in your preferences only works with JPEG or PNG image types.';
$lang['imglib_copy_error'] = 'An error was encountered while attempting to replace the file. Please make sure your file directory is writable.';
$lang['imglib_rotate_unsupported'] = 'Image rotation does not appear to be supported by your server.';
$lang['imglib_libpath_invalid'] = 'The path to your image library is not correct. Please set the correct path in your image preferences.';
$lang['imglib_image_process_failed'] = 'Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct.';
$lang['imglib_rotation_angle_required'] = 'An angle of rotation is required to rotate the image.';
$lang['imglib_invalid_path'] = 'The path to the image is not correct.';
$lang['imglib_copy_failed'] = 'The image copy routine failed.';
$lang['imglib_missing_font'] = 'Unable to find a font to use.';
$lang['imglib_save_failed'] = 'Unable to save the image. Please make sure the image and file directory are writable.';
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,47 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['migration_none_found'] = 'No migrations were found.';
$lang['migration_not_found'] = 'No migration could be found with the version number: %s.';
$lang['migration_sequence_gap'] = 'There is a gap in the migration sequence near version number: %s.';
$lang['migration_multiple_version'] = 'There are multiple migrations with the same version number: %s.';
$lang['migration_class_doesnt_exist'] = 'The migration class "%s" could not be found.';
$lang['migration_missing_up_method'] = 'The migration class "%s" is missing an "up" method.';
$lang['migration_missing_down_method'] = 'The migration class "%s" is missing a "down" method.';
$lang['migration_invalid_filename'] = 'Migration "%s" has an invalid filename.';
@@ -0,0 +1,44 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['terabyte_abbr'] = 'TB';
$lang['gigabyte_abbr'] = 'GB';
$lang['megabyte_abbr'] = 'MB';
$lang['kilobyte_abbr'] = 'KB';
$lang['bytes'] = 'Bytes';
@@ -0,0 +1,43 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['pagination_first_link'] = '&lsaquo; First';
$lang['pagination_next_link'] = '&gt;';
$lang['pagination_prev_link'] = '&lt;';
$lang['pagination_last_link'] = 'Last &rsaquo;';
@@ -0,0 +1,60 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['profiler_database'] = 'DATABASE';
$lang['profiler_controller_info'] = 'CLASS/METHOD';
$lang['profiler_benchmarks'] = 'BENCHMARKS';
$lang['profiler_queries'] = 'QUERIES';
$lang['profiler_get_data'] = 'GET DATA';
$lang['profiler_post_data'] = 'POST DATA';
$lang['profiler_uri_string'] = 'URI STRING';
$lang['profiler_memory_usage'] = 'MEMORY USAGE';
$lang['profiler_config'] = 'CONFIG VARIABLES';
$lang['profiler_session_data'] = 'SESSION DATA';
$lang['profiler_headers'] = 'HTTP HEADERS';
$lang['profiler_no_db'] = 'Database driver is not currently loaded';
$lang['profiler_no_queries'] = 'No queries were run';
$lang['profiler_no_post'] = 'No POST data exists';
$lang['profiler_no_get'] = 'No GET data exists';
$lang['profiler_no_uri'] = 'No URI data exists';
$lang['profiler_no_memory'] = 'Memory Usage Unavailable';
$lang['profiler_no_profiles'] = 'No Profile data - all Profiler sections have been disabled.';
$lang['profiler_section_hide'] = 'Hide';
$lang['profiler_section_show'] = 'Show';
$lang['profiler_seconds'] = 'seconds';
@@ -0,0 +1,58 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['ut_test_name'] = 'Test Name';
$lang['ut_test_datatype'] = 'Test Datatype';
$lang['ut_res_datatype'] = 'Expected Datatype';
$lang['ut_result'] = 'Result';
$lang['ut_undefined'] = 'Undefined Test Name';
$lang['ut_file'] = 'File Name';
$lang['ut_line'] = 'Line Number';
$lang['ut_passed'] = 'Passed';
$lang['ut_failed'] = 'Failed';
$lang['ut_boolean'] = 'Boolean';
$lang['ut_integer'] = 'Integer';
$lang['ut_float'] = 'Float';
$lang['ut_double'] = 'Float'; // can be the same as float
$lang['ut_string'] = 'String';
$lang['ut_array'] = 'Array';
$lang['ut_object'] = 'Object';
$lang['ut_resource'] = 'Resource';
$lang['ut_null'] = 'Null';
$lang['ut_notes'] = 'Notes';
@@ -0,0 +1,55 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');
$lang['upload_userfile_not_set'] = 'Unable to find a post variable called userfile.';
$lang['upload_file_exceeds_limit'] = 'The uploaded file exceeds the maximum allowed size in your PHP configuration file.';
$lang['upload_file_exceeds_form_limit'] = 'The uploaded file exceeds the maximum size allowed by the submission form.';
$lang['upload_file_partial'] = 'The file was only partially uploaded.';
$lang['upload_no_temp_directory'] = 'The temporary folder is missing.';
$lang['upload_unable_to_write_file'] = 'The file could not be written to disk.';
$lang['upload_stopped_by_extension'] = 'The file upload was stopped by extension.';
$lang['upload_no_file_selected'] = 'You did not select a file to upload.';
$lang['upload_invalid_filetype'] = 'The filetype you are attempting to upload is not allowed.';
$lang['upload_invalid_filesize'] = 'The file you are attempting to upload is larger than the permitted size.';
$lang['upload_invalid_dimensions'] = 'The image you are attempting to upload doesn\'t fit into the allowed dimensions.';
$lang['upload_destination_error'] = 'A problem was encountered while attempting to move the uploaded file to the final destination.';
$lang['upload_no_filepath'] = 'The upload path does not appear to be valid.';
$lang['upload_no_file_types'] = 'You have not specified any allowed file types.';
$lang['upload_bad_filename'] = 'The file name you submitted already exists on the server.';
$lang['upload_not_writable'] = 'The upload destination folder does not appear to be writable.';
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
@@ -0,0 +1,17 @@
<?php
/*
* Brazilian portuguese language
*/
$lang['text_rest_invalid_api_key'] = 'Chave da API %s inválida'; // %s is the REST API key
$lang['text_rest_invalid_credentials'] = 'Credenciais inválidas';
$lang['text_rest_ip_denied'] = 'IP proibido';
$lang['text_rest_ip_unauthorized'] = 'IP não autorizado';
$lang['text_rest_unauthorized'] = 'Não autorizado';
$lang['text_rest_ajax_only'] = 'Apenas chamadas AJAX são permitidas';
$lang['text_rest_api_key_unauthorized'] = 'Esta chave da API não tem acesso ao controller solicitado';
$lang['text_rest_api_key_permissions'] = 'Esta chave da API não tem permissões suficientes';
$lang['text_rest_api_key_time_limit'] = 'Esta chave da API já atingiu o tempo limite para este método';
$lang['text_rest_unknown_method'] = 'Método desconhecido';
$lang['text_rest_unsupported'] = 'Sem suporte para este protocolo';
@@ -6,6 +6,7 @@ class Migration_Init extends CI_Migration {
public function up()
{
//$this->load->database('system');
// Schemas
//$this->db->query('CREATE SCHEMA IF NOT EXISTS gis;');
@@ -7,6 +7,7 @@ class Migration_Pk_migrations extends CI_Migration {
public function up()
{
//$this->load->database('system');
if ($this->db->table_exists('ci_migrations'))
{
$this->db->query('ALTER TABLE ci_migrations ADD CONSTRAINT pk_migrations PRIMARY KEY(version);');
@@ -6,6 +6,7 @@ class Migration_Add_apikey extends CI_Migration {
public function up()
{
//$this->load->database('system');
$this->dbforge->add_field(array(
'apikey_id' => array(
'type' => 'INT',
@@ -6,6 +6,7 @@ class Migration_Create_basedb extends CI_Migration {
public function up()
{
//$this->load->database('system');
if (!$this->db->table_exists('tbl_person'))
{
$this->load->helper('file');
@@ -20,7 +21,7 @@ class Migration_Create_basedb extends CI_Migration {
public function down()
{
$this->db->simple_query('DROP SCHEMA bis;');
/*$this->db->simple_query('DROP SCHEMA bis;');
$this->db->simple_query('DROP SCHEMA campus;');
$this->db->simple_query('DROP SCHEMA fue;');
$this->db->simple_query('DROP SCHEMA kommune;');
@@ -28,7 +29,7 @@ class Migration_Create_basedb extends CI_Migration {
$this->db->simple_query('DROP SCHEMA sync;');
$this->db->simple_query('DROP SCHEMA system;');
$this->db->simple_query('DROP SCHEMA testtool;');
$this->db->simple_query('DROP SCHEMA wawi;');
$this->db->simple_query('DROP SCHEMA wawi;');*/
}
}
+4
View File
@@ -55,6 +55,10 @@
"zetacomponents/workflow-database-tiein": "1.*",
"zetacomponents/workflow-event-log-tiein": "1.*"
},
"require-dev":
{
"squizlabs/php_codesniffer": "2.*"
},
"config":
{
"bin-dir": "bin"
Generated
+186 -19
View File
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "ea064e414812c16fa7b4e1fc066dc2b3",
"content-hash": "73ee27147eb49e32aef9d975d2a90ffa",
"hash": "b493cb136eac0b78682504c3ecca2e0e",
"content-hash": "49873c248081b898a86919ea22b51e9e",
"packages": [
{
"name": "codeigniter-restserver",
@@ -20,16 +20,16 @@
},
{
"name": "codeigniter/framework",
"version": "3.0.4",
"version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/bcit-ci/CodeIgniter.git",
"reference": "ac067858c21250dd8c60cdc1f9bc12ba2ff82755"
"reference": "4aeab69d8519873c0b20b8a51c910a0674a6c84e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bcit-ci/CodeIgniter/zipball/ac067858c21250dd8c60cdc1f9bc12ba2ff82755",
"reference": "ac067858c21250dd8c60cdc1f9bc12ba2ff82755",
"url": "https://api.github.com/repos/bcit-ci/CodeIgniter/zipball/4aeab69d8519873c0b20b8a51c910a0674a6c84e",
"reference": "4aeab69d8519873c0b20b8a51c910a0674a6c84e",
"shasum": ""
},
"require": {
@@ -38,6 +38,9 @@
"require-dev": {
"mikey179/vfsstream": "1.1.*"
},
"suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
},
"type": "project",
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -45,7 +48,7 @@
],
"description": "The CodeIgniter framework",
"homepage": "https://codeigniter.com",
"time": "2016-01-13 00:09:27"
"time": "2016-03-11 16:29:31"
},
{
"name": "components/angular.js",
@@ -723,16 +726,16 @@
},
{
"name": "rdlowrey/auryn",
"version": "1.2",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/rdlowrey/auryn.git",
"reference": "d6e03a7026a1724965c921f4fbd8351ab8f0a9f1"
"reference": "2e4240791162dfe073d59654d8dc06df0eb0b73f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rdlowrey/auryn/zipball/d6e03a7026a1724965c921f4fbd8351ab8f0a9f1",
"reference": "d6e03a7026a1724965c921f4fbd8351ab8f0a9f1",
"url": "https://api.github.com/repos/rdlowrey/auryn/zipball/2e4240791162dfe073d59654d8dc06df0eb0b73f",
"reference": "2e4240791162dfe073d59654d8dc06df0eb0b73f",
"shasum": ""
},
"require": {
@@ -780,7 +783,7 @@
"dic",
"ioc"
],
"time": "2015-12-09 16:44:14"
"time": "2016-03-14 20:10:19"
},
{
"name": "rougin/blueprint",
@@ -900,16 +903,16 @@
},
{
"name": "rougin/describe",
"version": "v1.2.1",
"version": "v1.2.2",
"source": {
"type": "git",
"url": "https://github.com/rougin/describe.git",
"reference": "e07689e64d03bac231202a96bf5517dac7a21802"
"reference": "bd6b934d3ab2b28ddc936a5eb0cafa2eed02e360"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rougin/describe/zipball/e07689e64d03bac231202a96bf5517dac7a21802",
"reference": "e07689e64d03bac231202a96bf5517dac7a21802",
"url": "https://api.github.com/repos/rougin/describe/zipball/bd6b934d3ab2b28ddc936a5eb0cafa2eed02e360",
"reference": "bd6b934d3ab2b28ddc936a5eb0cafa2eed02e360",
"shasum": ""
},
"require": {
@@ -949,7 +952,7 @@
"describe",
"php"
],
"time": "2015-11-05 03:32:43"
"time": "2016-03-24 18:17:47"
},
{
"name": "rougin/refinery",
@@ -1137,7 +1140,7 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.1.0",
"version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
@@ -1687,7 +1690,171 @@
"time": "2007-12-17 09:04:44"
}
],
"packages-dev": [],
"packages-dev": [
{
"name": "ciricihq/cirici-codesniffer",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/ciricihq/cirici-codesniffer.git",
"reference": "051af93dbdbc317d573dd23d2fdadc05f28a6994"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ciricihq/cirici-codesniffer/zipball/051af93dbdbc317d573dd23d2fdadc05f28a6994",
"reference": "051af93dbdbc317d573dd23d2fdadc05f28a6994",
"shasum": ""
},
"require": {
"squizlabs/php_codesniffer": "2.*"
},
"require-dev": {
"phpunit/phpunit": "4.1.*"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "CakePHP Community",
"homepage": "https://github.com/cakephp/cakephp-codesniffer/graphs/contributors"
},
{
"name": "Òscar Casajuana",
"homepage": "http://racotecnic.com"
},
{
"name": "Cirici Thinking Digital",
"homepage": "http://cirici.com"
}
],
"description": "Cirici CodeSniffer Standards",
"homepage": "http://cirici.com",
"keywords": [
"codesniffer",
"framework"
],
"time": "2015-04-06 20:18:32"
},
{
"name": "squizlabs/php_codesniffer",
"version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8",
"reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"bin": [
"scripts/phpcs",
"scripts/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"classmap": [
"CodeSniffer.php",
"CodeSniffer/CLI.php",
"CodeSniffer/Exception.php",
"CodeSniffer/File.php",
"CodeSniffer/Fixer.php",
"CodeSniffer/Report.php",
"CodeSniffer/Reporting.php",
"CodeSniffer/Sniff.php",
"CodeSniffer/Tokens.php",
"CodeSniffer/Reports/",
"CodeSniffer/Tokenizers/",
"CodeSniffer/DocGenerators/",
"CodeSniffer/Standards/AbstractPatternSniff.php",
"CodeSniffer/Standards/AbstractScopeSniff.php",
"CodeSniffer/Standards/AbstractVariableSniff.php",
"CodeSniffer/Standards/IncorrectPatternException.php",
"CodeSniffer/Standards/Generic/Sniffs/",
"CodeSniffer/Standards/MySource/Sniffs/",
"CodeSniffer/Standards/PEAR/Sniffs/",
"CodeSniffer/Standards/PSR1/Sniffs/",
"CodeSniffer/Standards/PSR2/Sniffs/",
"CodeSniffer/Standards/Squiz/Sniffs/",
"CodeSniffer/Standards/Zend/Sniffs/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "http://www.squizlabs.com/php-codesniffer",
"keywords": [
"phpcs",
"standards"
],
"time": "2016-01-19 23:39:10"
},
{
"name": "toin0u/cakephp-codesniffer",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/toin0u/cakephp-codesniffer.git",
"reference": "149af3ec5525151543892221eb2945bb54fa4069"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/toin0u/cakephp-codesniffer/zipball/149af3ec5525151543892221eb2945bb54fa4069",
"reference": "149af3ec5525151543892221eb2945bb54fa4069",
"shasum": ""
},
"require": {
"squizlabs/php_codesniffer": "2.*"
},
"require-dev": {
"phpunit/phpunit": "4.1.*"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "CakePHP Community",
"homepage": "https://github.com/cakephp/cakephp-codesniffer/graphs/contributors"
}
],
"description": "CakePHP CodeSniffer Standards",
"homepage": "http://cakephp.org",
"keywords": [
"codesniffer",
"framework"
],
"time": "2015-03-17 01:11:58"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
+11 -11
View File
@@ -20,9 +20,9 @@ date_default_timezone_set('Europe/Vienna');
define("DB_SYSTEM","pgsql");
define("DB_HOST","localhost");
define("DB_PORT","5432");
define("DB_NAME","fhcomplete");
define("DB_USER","bla");
define("DB_PASSWORD","bla");
define("DB_NAME","fhctest");
define("DB_USER","web");
define("DB_PASSWORD","web");
define("DB_CONNECT_PERSISTENT",TRUE);
define('CONN_CLIENT_ENCODING','UTF-8' );
@@ -42,14 +42,14 @@ define('IMPORT_PATH','/var/fhcomplete/documents/import/');
define('PAABGABE_PATH','/var/fhcomplete/documents/paabgabe/');
// Pfad zu den Rauminfos
define('RAUMINFO_PATH','/var/www/rauminfos/');
define('RAUMINFO_PATH','/var/www/html/build/rauminfos/');
// URL zu RDF Verzeichnis
define('XML_ROOT','http://www.technikum-wien.at/rdf/');
define('XML_ROOT','http://www.fhcomplete.org/build/rdf/');
// URL zu Application Root
define('APP_ROOT','http://www.technikum-wien.at/');
define('APP_ROOT','http://www.fhcomplete.org/build/');
// Pfad zu Document Root
define('DOC_ROOT','/var/www/');
define('DOC_ROOT','/var/www/html/build/');
// Externe Funktionen - Unterordner im Include-Verzeichnis
define('EXT_FKT_PATH','tw');
@@ -67,9 +67,9 @@ define('URLAUB_TOOLS',true);
// Moegliche Werte:
// auth_mixed - htaccess mit LDAP (Default)
// auth_session - Sessions mit LDAP (Testbetrieb)
define("AUTH_SYSTEM", "auth_mixed");
define("AUTH_SYSTEM", "auth_demo");
// Gibt den Namen fuer die htaccess Authentifizierung an (muss mit dem Attribut AuthName im htaccess uebereinstimmen)
define("AUTH_NAME","FHComplete");
define("AUTH_NAME","FH-Complete");
/*
* LDAP Einstellungen
@@ -200,10 +200,10 @@ define('TABLE_BEGIN','tbl_');
define('VIEW_BEGIN','vw_');
//Gibt an, ob das Studienbuchblatt im CIS gedruckt werden kann
define('CIS_DOKUMENTE_STUDIENBUCHLBATT_DRUCKEN',false);
define('CIS_DOKUMENTE_STUDIENBUCHLBATT_DRUCKEN',true);
//Gibt an, ob die Studienerfolgsbestätigung im CIS gedruckt werden kann
define('CIS_DOKUMENTE_STUDIENERFOLGSBESTAETIGUNG_DRUCKEN',false);
define('CIS_DOKUMENTE_STUDIENERFOLGSBESTAETIGUNG_DRUCKEN',true);
//**** INFOSCREEN ****
//Gibt an, ob der Lageplan im Infoterminal angezeigt werden soll.
+4
View File
@@ -209,4 +209,8 @@ define('BEWERBERTOOL_GTM', '');
// Array mit Usern die nicht Kollidieren
define('KOLLISIONSFREIE_USER',serialize(array('_DummyLektor')));
// Soll der Lageplan am Infoterminal angezeigt werden (true|false)
//define('CIS_INFOSCREEN_LAGEPLAN_ANZEIGEN', true);
?>
+3 -2
View File
@@ -23,10 +23,11 @@
// Authentifizierungsmethode
// Moegliche Werte:
// auth_mixed - htaccess mit LDAP (Default)
// auth_demo - Demo Modus (.htaccess)
// auth_session - Sessions mit LDAP (Testbetrieb)
define("AUTH_SYSTEM", "auth_mixed");
define("AUTH_SYSTEM", "auth_demo");
// Gibt den Namen fuer die htaccess Authentifizierung an (muss mit dem Attribut AuthName im htaccess uebereinstimmen)
define("AUTH_NAME","FHComplete");
define("AUTH_NAME","FH-Complete");
// DatenbankRollen fuer Grants
define('DB_CIS_USER_GROUP','web');
+10 -10
View File
@@ -18,25 +18,25 @@ date_default_timezone_set('Europe/Vienna');
// Connection Strings zur Datenbank
define("DB_SYSTEM","pgsql");
define("DB_HOST","www.technikum-wien.at");
define("DB_HOST","localhost");
define("DB_PORT","5432");
define("DB_NAME","devvilesci");
define("DB_USER","bla");
define("DB_PASSWORD","bla");
define("DB_NAME","fhctest");
define("DB_USER","vilesci");
define("DB_PASSWORD","vilesci");
define("DB_CONNECT_PERSISTENT",TRUE);
define('CONN_CLIENT_ENCODING','UTF-8' );
// Name des Servers (benoetigt fuer Cronjobs
define('SERVER_NAME','vilesci.technikum-wien.at');
define('SERVER_NAME','localhost');
// URL zu FHComplete Root
define('APP_ROOT','http://www.technikum-wien.at/');
define('APP_ROOT','http://www.fhcomlete.org/build/');
// URL zu RDF Verzeichnis
define('XML_ROOT','http://www.technikum-wien.at/rdf/');
define('XML_ROOT','http://www.fhcomlete.org/build/rdf/');
// Pfad zu Document Root
define('DOC_ROOT','/var/www/');
define('DOC_ROOT','/var/www/html/build/');
// URL zu CIS
define('CIS_ROOT','http://www.technikum-wien.at/');
define('CIS_ROOT','http://www.fhcomlete.org/build/cis/');
// Externe Funktionen - Unterordner im Include-Verzeichnis
define('EXT_FKT_PATH','tw');
@@ -52,7 +52,7 @@ define('DMS_PATH','/var/fhcomplete/documents/dms/');
// auth_mixed - htaccess mit LDAP (Default)
// auth_demo - Demo Modus (.htaccess)
// auth_session - Sessions mit LDAP (Testbetrieb)
define("AUTH_SYSTEM", "auth_mixed");
define("AUTH_SYSTEM", "auth_demo");
// Gibt den Namen fuer die htaccess Authentifizierung an (muss mit dem Attribut AuthName im htaccess uebereinstimmen)
define("AUTH_NAME","Technikum-Wien");
+208 -196
View File
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
/* Copyright (C) 2006 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -36,7 +36,7 @@ class person extends Person_model
public $errormsg; // string
public $new; // boolean
public $personen = array(); // person Objekt
public $done=false; // boolean
public $done = false; // boolean
//Tabellenspalten
public $person_id; // integer
@@ -57,56 +57,57 @@ class person extends Person_model
public $ersatzkennzeichen; // char(10)
public $familienstand; // char(1)
public $anzahlkinder; // smalint
public $aktiv=true; // boolean
public $aktiv = true; // boolean
public $insertamum; // timestamp
public $insertvon; // varchar(16)
public $updateamum; // timestamp
public $updatevon; // varchar(16)
public $geschlecht='u'; // varchar(1) - Default: undefined
public $geschlecht = 'u'; // varchar(1) - Default: undefined
public $staatsbuergerschaft;// varchar(3)
public $geburtsnation; // varchar(3);
public $ext_id; // bigint
public $kurzbeschreibung; // text
public $zugangscode = null; // varchar(32)
public $foto_sperre=false; // boolean
public $foto_sperre = false; // boolean
public $matr_nr; //varchar(32)
/**
* Konstruktor - Uebergibt die Connection und laedt optional eine Person
* @param $person_id Person die geladen werden soll (default=null)
* @param int $personId Person die geladen werden soll (default=null).
*/
public function __construct($person_id=null)
public function __construct($personId = null)
{
parent::__construct();
if($person_id != null)
$this->load($person_id);
if ($personId != null)
$this->load($personId);
}
/**
* Laedt Person mit der uebergebenen ID
* @param $person_id ID der Person die geladen werden soll
*/
public function load($person_id)
* @param int $personId ID der Person die geladen werden soll.
* @return bool
**/
public function load($personId)
{
//person_id auf gueltigkeit pruefen
if(is_numeric($person_id) && $person_id!='')
if (is_numeric($personId) && $personId != '')
{
/* Alter Code
$qry = "SELECT person_id, sprache, anrede, titelpost, titelpre, nachname, vorname, vornamen,
gebdatum, gebort, gebzeit, foto, anmerkung, homepage, svnr, ersatzkennzeichen,
familienstand, anzahlkinder, aktiv, insertamum, insertvon, updateamum, updatevon, ext_id,
geschlecht, staatsbuergerschaft, geburtsnation, kurzbeschreibung, zugangscode, foto_sperre, matr_nr
FROM public.tbl_person WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER);
FROM public.tbl_person WHERE person_id=".$this->db_add_param($personId, FHC_INTEGER);
if(!$this->db_query($qry))
if (!$this->db_query($qry))
{
$this->errormsg = "Fehler beim Lesen der Personendaten\n";
return false;
}
if($row = $this->db_fetch_object())*/
if ($row = $this->get_personen($person_id))
if ($row = $this->db_fetch_object())*/
if ($row = $this->get_personen($personId))
{
$this->person_id = $row->person_id;
$this->sprache = $row->sprache;
@@ -145,7 +146,7 @@ class person extends Person_model
$this->errormsg = "Es ist kein Personendatensatz mit dieser ID vorhanden";
return false;
}
$this->new=false;
$this->new = false;
return true;
}
else
@@ -158,13 +159,14 @@ class person extends Person_model
/**
*
* Löscht den Datensatz mit der übergebenen person_id
* @param $person_id
* @param int $personId PK aus tbl_person.
* @return bool
*/
public function delete($person_id)
public function delete($personId)
{
$qry = "DELETE from public.tbl_person where person_id = ".$this->db_add_param($person_id, FHC_INTEGER).";";
$qry = "DELETE from public.tbl_person where person_id = ".$this->db_add_param($personId, FHC_INTEGER).";";
if($this->db_query($qry))
if ($this->db_query($qry))
{
return true;
}
@@ -175,11 +177,11 @@ class person extends Person_model
}
}
// *******************************************
// * Prueft die Variablen vor dem Speichern
// * auf Gueltigkeit.
// * @return true wenn ok, false im Fehlerfall
// *******************************************
/**
* Prueft die Variablen vor dem Speichern
* auf Gueltigkeit.
* @return true wenn ok, false im Fehlerfall
**/
protected function validate()
{
$this->nachname = trim($this->nachname);
@@ -189,110 +191,110 @@ class person extends Person_model
$this->titelpost = trim($this->titelpost);
$this->titelpre = trim($this->titelpre);
if(mb_strlen($this->sprache)>16)
if (mb_strlen($this->sprache) > 16)
{
$this->errormsg = 'Sprache darf nicht laenger als 16 Zeichen sein';
return false;
}
if(mb_strlen($this->anrede)>16)
if (mb_strlen($this->anrede) > 16)
{
$this->errormsg = 'Anrede darf nicht laenger als 16 Zeichen sein';
return false;
}
if(mb_strlen($this->titelpost)>32)
if (mb_strlen($this->titelpost) > 32)
{
$this->errormsg = 'Titelpost darf nicht laenger als 32 Zeichen sein';
return false;
}
if(mb_strlen($this->titelpre)>64)
if (mb_strlen($this->titelpre) > 64)
{
$this->errormsg = 'Titelpre darf nicht laenger als 64 Zeichen sein';
return false;
}
if(mb_strlen($this->nachname)>64)
if (mb_strlen($this->nachname) > 64)
{
$this->errormsg = 'Nachname darf nicht laenger als 64 Zeichen sein';
return false;
}
if($this->nachname=='' || is_null($this->nachname))
if ($this->nachname == '' || is_null($this->nachname))
{
$this->errormsg = 'Nachname muss eingegeben werden';
return false;
}
if(mb_strlen($this->vorname)>32)
if (mb_strlen($this->vorname) > 32)
{
$this->errormsg = 'Vorname darf nicht laenger als 32 Zeichen sein';
return false;
}
if(mb_strlen($this->vornamen)>128)
if (mb_strlen($this->vornamen) > 128)
{
$this->errormsg = 'Vornamen darf nicht laenger als 128 Zeichen sein';
return false;
}
//ToDo Gebdatum pruefen -> laut bis muss student aelter als 10 Jahre sein
/*if(strlen($this->gebdatum)==0 || is_null($this->gebdatum))
/*if (strlen($this->gebdatum) == 0 || is_null($this->gebdatum))
{
$this->errormsg = "Geburtsdatum muss eingegeben werden\n";
return false;
}*/
if(mb_strlen($this->gebort)>128)
if (mb_strlen($this->gebort) > 128)
{
$this->errormsg = 'Geburtsort darf nicht laenger als 128 Zeichen sein';
return false;
}
if(mb_strlen($this->homepage)>256)
if (mb_strlen($this->homepage) > 256)
{
$this->errormsg = 'Homepage darf nicht laenger als 256 Zeichen sein';
return false;
}
if(mb_strlen($this->svnr)>16)
if (mb_strlen($this->svnr) > 16)
{
$this->errormsg = 'SVNR darf nicht laenger als 16 Zeichen sein';
return false;
}
if(mb_strlen($this->matr_nr)>32)
if (mb_strlen($this->matr_nr) > 32)
{
$this->errormsg = 'Matrikelnummer darf nicht laenger als 32 Zeichen sein';
return false;
}
if($this->svnr!='' && mb_strlen($this->svnr) != 16 && mb_strlen($this->svnr) != 10)
if ($this->svnr != '' && mb_strlen($this->svnr) != 16 && mb_strlen($this->svnr) != 10)
{
$this->errormsg = 'SVNR muss 10 oder 16 Zeichen lang sein';
return false;
}
if($this->svnr!='' && mb_strlen($this->svnr)==10)
if ($this->svnr != '' && mb_strlen($this->svnr) == 10)
{
//SVNR mit Pruefziffer pruefen
//Die 4. Stelle in der SVNR ist die Pruefziffer
//(Summe von (gewichtung[i]*svnr[i])) modulo 11 ergibt diese Pruefziffer
//Falls nicht, ist die SVNR ungueltig
$gewichtung = array(3,7,9,0,5,8,4,2,1,6);
$erg=0;
$gewichtung = array(3, 7, 9, 0, 5, 8, 4, 2, 1, 6);
$erg = 0;
//Quersumme bilden
for($i=0;$i<10;$i++)
for($i = 0; $i < 10; $i++)
$erg += $gewichtung[$i] * $this->svnr{$i};
if($this->svnr{3}!=($erg%11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11
if ($this->svnr{3} != ($erg % 11)) //Vergleichen der Pruefziffer mit Quersumme Modulo 11
{
$this->errormsg = 'SVNR ist ungueltig';
return false;
}
}
if($this->svnr!='')
if ($this->svnr != '')
{
//Pruefen ob bereits ein Eintrag mit dieser SVNR vorhanden ist
$qry = "SELECT person_id FROM public.tbl_person WHERE svnr=".$this->db_add_param($this->svnr);
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if ($row = $this->db_fetch_object())
{
if($row->person_id!=$this->person_id)
if ($row->person_id != $this->person_id)
{
$this->errormsg = 'Es existiert bereits eine Person mit dieser SVNR! Daten wurden NICHT gepeichert.';
return false;
@@ -301,72 +303,72 @@ class person extends Person_model
}
}
if(mb_strlen($this->ersatzkennzeichen)>10)
if (mb_strlen($this->ersatzkennzeichen) > 10)
{
$this->errormsg = 'Ersatzkennzeichen darf nicht laenger als 10 Zeichen sein';
return false;
}
if(mb_strlen($this->familienstand)>1)
if (mb_strlen($this->familienstand) > 1)
{
$this->errormsg = 'Familienstand ist ungueltig';
return false;
}
if($this->anzahlkinder!='' && !is_numeric($this->anzahlkinder))
if ($this->anzahlkinder != '' && !is_numeric($this->anzahlkinder))
{
$this->errormsg = 'Anzahl der Kinder ist ungueltig';
return false;
}
if(!is_bool($this->aktiv))
if (!is_bool($this->aktiv))
{
$this->errormsg = 'Aktiv ist ungueltig';
return false;
}
if(mb_strlen($this->insertvon)>32)
if (mb_strlen($this->insertvon) > 32)
{
$this->errormsg = 'Insertvon darf nicht laenger als 32 Zeichen sein';
return false;
}
if(mb_strlen($this->updatevon)>32)
if (mb_strlen($this->updatevon) > 32)
{
$this->errormsg = 'Updatevon darf nicht laenger als 32 Zeichen sein';
return false;
}
if($this->ext_id!='' && !is_numeric($this->ext_id))
if ($this->ext_id != '' && !is_numeric($this->ext_id))
{
$this->errormsg = 'Ext_ID ist keine gueltige Zahl';
return false;
}
if(mb_strlen($this->geschlecht)>1)
if (mb_strlen($this->geschlecht) > 1)
{
$this->errormsg = 'Geschlecht darf nicht laenger als 1 Zeichen sein';
return false;
}
if(mb_strlen($this->geburtsnation)>3)
if (mb_strlen($this->geburtsnation) > 3)
{
$this->errormsg = 'Geburtsnation darf nicht laenger als 3 Zeichen sein';
return false;
}
if(mb_strlen($this->staatsbuergerschaft)>3)
if (mb_strlen($this->staatsbuergerschaft) > 3)
{
$this->errormsg = 'Staatsbuergerschaft darf nicht laenger als 3 Zeichen sein';
return false;
}
if($this->geschlecht!='m' && $this->geschlecht!='w' && $this->geschlecht!='u')
if ($this->geschlecht != 'm' && $this->geschlecht != 'w' && $this->geschlecht != 'u')
{
$this->errormsg = 'Geschlecht muss w, m oder u sein!';
return false;
}
//Pruefen ob das Geburtsdatum mit der SVNR uebereinstimmt.
if($this->svnr!='' && $this->gebdatum!='')
if ($this->svnr != '' && $this->gebdatum != '')
{
if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$this->gebdatum, $regs))
if (mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $this->gebdatum, $regs))
{
//$day = sprintf('%02s',$regs[1]);
//$month = sprintf('%02s',$regs[2]);
//$year = mb_substr($regs[3],2,2);
}
elseif(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$this->gebdatum, $regs))
elseif (mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $this->gebdatum, $regs))
{
//$day = sprintf('%02s',$regs[3]);
//$month = sprintf('%02s',$regs[2]);
@@ -383,7 +385,7 @@ class person extends Person_model
$month_svnr = mb_substr($this->svnr, 6, 2);
$year_svnr = mb_substr($this->svnr, 8, 2);
if($day_svnr!=$day || $month_svnr!=$month || $year_svnr!=$year)
if ($day_svnr!=$day || $month_svnr!=$month || $year_svnr!=$year)
{
$this->errormsg = 'SVNR und Geburtsdatum passen nicht zusammen';
return false;
@@ -397,16 +399,16 @@ class person extends Person_model
/**
* Speichert die Personendaten in die Datenbank
* Wenn $new auf true gesetzt ist wird ein neuer Datensatz
* angelegt, ansonsten der Datensatz mit $person_id upgedated
* angelegt, ansonsten der Datensatz mit $personId upgedated
* @return true wenn erfolgreich, false im Fehlerfall
*/
public function save()
{
//Variablen auf Gueltigkeit pruefen
if(!person::validate())
if (!person::validate())
return false;
if($this->new) //Wenn new true ist dann ein INSERT absetzen ansonsten ein UPDATE
if ($this->new) //Wenn new true ist dann ein INSERT absetzen ansonsten ein UPDATE
{
$qry = 'INSERT INTO public.tbl_person (sprache, anrede, titelpost, titelpre, nachname, vorname, vornamen,
gebdatum, gebort, gebzeit, foto, anmerkung, homepage, svnr, ersatzkennzeichen,
@@ -445,7 +447,7 @@ class person extends Person_model
else
{
//person_id auf gueltigkeit pruefen
if(!is_numeric($this->person_id))
if (!is_numeric($this->person_id))
{
$this->errormsg = "person_id muss eine gueltige Zahl sein";
return false;
@@ -482,15 +484,15 @@ class person extends Person_model
' WHERE person_id='.$this->person_id.';';
}
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($this->new)
if ($this->new)
{
$qry = "SELECT currval('public.tbl_person_person_id_seq') AS id;";
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row=$this->db_fetch_object())
$this->person_id=$row->id;
if ($row = $this->db_fetch_object())
$this->person_id = $row->id;
else
{
$this->errormsg = "Sequence konnte nicht ausgelesen werden";
@@ -515,13 +517,13 @@ class person extends Person_model
/**
* Liefert die Tabellenelemente die den Kriterien der Parameter entsprechen
* @param $filter String mit Vorname oder Nachname
* @param $order Sortierkriterium
* @param string $filter String mit Vorname oder Nachname.
* @param string $order Sortierkriterium.
* @return array mit LPersonen oder false=fehler
*/
public function getTab($filter, $order='person_id')
public function getTab($filter, $order = 'person_id')
{
$sql_query = "
$sqlQuery = "
SELECT
distinct on (person_id) *
FROM
@@ -529,22 +531,22 @@ class person extends Person_model
LEFT JOIN public.tbl_benutzer USING(person_id)
WHERE true ";
if($filter!='')
if ($filter != '')
{
$sql_query.=" AND nachname ~* '".$this->db_escape($filter)."' OR
$sqlQuery .= " AND nachname ~* '".$this->db_escape($filter)."' OR
vorname ~* '".$this->db_escape($filter)."' OR
(nachname || ' ' || vorname) ~* '".$this->db_escape($filter)."' OR
(vorname || ' ' || nachname) ~* '".$this->db_escape($filter)."' OR
uid=".$this->db_add_param($filter);
}
$sql_query .= " ORDER BY $order";
if($filter=='')
$sql_query .= " LIMIT 30";
$sqlQuery .= " ORDER BY $order";
if ($filter == '')
$sqlQuery .= " LIMIT 30";
if($this->db_query($sql_query))
if ($this->db_query($sqlQuery))
{
while($row = $this->db_fetch_object())
while ($row = $this->db_fetch_object())
{
$l = new person();
$l->person_id = $row->person_id;
@@ -577,7 +579,7 @@ class person extends Person_model
$l->kurzbeschreibung = $row->kurzbeschreibung;
$l->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$l->matr_nr = $row->matr_nr;
$this->personen[]=$l;
$this->personen[] = $l;
}
}
else
@@ -589,103 +591,106 @@ class person extends Person_model
}
/**
* Laedt alle standorte zu einer Person die dem Standort zugeordnet sind
* @param $standort_id ID des Standortes
* @param $person_id ID der Person die Zugeordnet ist
* @param $firma_id ID der Firma zu der die standortn geladen werden sollen
* @return true wenn ok, false im Fehlerfall
* @param int $standortId ID des Standortes.
* @param int $personId ID der Person die Zugeordnet ist.
* @param int $firmaId ID der Firma zu der die standortn geladen werden sollen.
* @param string $funktionKurzbz Funktion der Person.
* @param int $personfunktionstandortId ID des Standorts zur Personfunktion.
* @return bool true wenn ok, false im Fehlerfall
*/
public function load_personfunktion($standort_id='',$person_id='',$firma_id='',$funktion_kurzbz='',$personfunktionstandort_id='')
public function load_personfunktion($standortId = '', $personId = '', $firmaId = '', $funktionKurzbz = '', $personfunktionstandortId = '')
{
$this->result=array();
$this->result = array();
$this->errormsg = '';
//Lesen der Daten aus der Datenbank
$qry=" SELECT tbl_person.*
,tbl_personfunktionstandort.personfunktionstandort_id,tbl_personfunktionstandort.person_id ,tbl_personfunktionstandort.funktion_kurzbz ,tbl_personfunktionstandort.standort_id
,tbl_personfunktionstandort.position,tbl_personfunktionstandort.anrede
,tbl_standort.adresse_id,tbl_standort.kurzbz,tbl_standort.bezeichnung,tbl_standort.firma_id
,tbl_funktion.beschreibung as funktion_beschreibung , tbl_funktion.aktiv as funktion_aktiv,tbl_funktion.fachbereich as funktion_fachbereich,tbl_funktion.semester as funktion_semester
";
$qry.=" FROM public.tbl_person,public.tbl_personfunktionstandort
$qry = " SELECT tbl_person.*,
tbl_personfunktionstandort.personfunktionstandort_id,
tbl_personfunktionstandort.person_id,
tbl_personfunktionstandort.funktion_kurzbz,
tbl_personfunktionstandort.standort_id,
tbl_personfunktionstandort.position,
tbl_personfunktionstandort.anrede, tbl_standort.adresse_id,
tbl_standort.kurzbz, tbl_standort.bezeichnung,
tbl_standort.firma_id, tbl_funktion.beschreibung as funktion_beschreibung,
tbl_funktion.aktiv as funktion_aktiv, tbl_funktion.fachbereich as funktion_fachbereich, tbl_funktion.semester as funktion_semester";
$qry .= " FROM public.tbl_person,public.tbl_personfunktionstandort
LEFT JOIN public.tbl_standort USING(standort_id)
LEFT JOIN public.tbl_funktion USING(funktion_kurzbz)
";
$qry.=" WHERE tbl_person.person_id=tbl_personfunktionstandort.person_id";
$qry .= " WHERE tbl_person.person_id=tbl_personfunktionstandort.person_id";
if($personfunktionstandort_id!='')
$qry.=" and tbl_personfunktionstandort.personfunktionstandort_id=".$this->db_add_param($personfunktionstandort_id, FHC_INTEGER);
if(is_numeric($standort_id))
$qry.=" and tbl_personfunktionstandort.standort_id=".$this->db_add_param($standort_id, FHC_INTEGER);
if(is_numeric($person_id))
$qry.=" and tbl_personfunktionstandort.person_id=".$this->db_add_param($person_id, FHC_INTEGER);
if(is_numeric($firma_id))
$qry.=" and public.tbl_standort.firma_id=".$this->db_add_param($firma_id, FHC_INTEGER);
if($funktion_kurzbz!='')
$qry.=" and tbl_personfunktionstandort.funktion_kurzbz=".$this->db_add_param($funktion_kurzbz);
if ($personfunktionstandortId != '')
$qry .= " and tbl_personfunktionstandort.personfunktionstandort_id=".$this->db_add_param($personfunktionstandortId, FHC_INTEGER);
if (is_numeric($standortId))
$qry .= " and tbl_personfunktionstandort.standort_id=".$this->db_add_param($standortId, FHC_INTEGER);
if (is_numeric($personId))
$qry .= " and tbl_personfunktionstandort.person_id=".$this->db_add_param($personId, FHC_INTEGER);
if (is_numeric($firmaId))
$qry .= " and public.tbl_standort.firma_id=".$this->db_add_param($firmaId, FHC_INTEGER);
if ($funktionKurzbz != '')
$qry .= " and tbl_personfunktionstandort.funktion_kurzbz=".$this->db_add_param($funktionKurzbz);
if(!$this->db_query($qry))
if (!$this->db_query($qry))
{
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
return false;
}
while($row = $this->db_fetch_object())
while ($row = $this->db_fetch_object())
{
$adr_obj = new person();
$adr_obj->person_id = $row->person_id;
$adr_obj->staatsbuergerschaft = $row->staatsbuergerschaft;
$adr_obj->geburtsnation = $row->geburtsnation;
$adr_obj->sprache = $row->sprache;
$adr_obj->anrede = $row->anrede;
$adr_obj->titelpost = $row->titelpost;
$adr_obj->titelpre = $row->titelpre;
$adr_obj->nachname = $row->nachname;
$adr_obj->vorname = $row->vorname;
$adr_obj->vornamen = $row->vornamen;
$adr_obj->gebdatum = $row->gebdatum;
$adr_obj->gebort = $row->gebort;
$adr_obj->gebzeit = $row->gebzeit;
$adr_obj->foto = $row->foto;
$adr_obj->anmerkungen = $row->anmerkung;
$adr_obj->homepage = $row->homepage;
$adr_obj->svnr = $row->svnr;
$adr_obj->ersatzkennzeichen = $row->ersatzkennzeichen;
$adr_obj->familienstand = $row->familienstand;
$adr_obj->geschlecht = $row->geschlecht;
$adr_obj->anzahlkinder = $row->anzahlkinder;
$adr_obj->aktiv = $this->db_parse_bool($row->aktiv);
$adr_obj->updateamum = $row->updateamum;
$adr_obj->updatevon = $row->updatevon;
$adr_obj->insertamum = $row->insertamum;
$adr_obj->insertvon = $row->insertvon;
$adr_obj->ext_id = $row->ext_id;
$adr_obj->kurzbeschreibung = $row->kurzbeschreibung;
$adr_obj->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$adrObj = new person();
$adrObj->person_id = $row->person_id;
$adrObj->staatsbuergerschaft = $row->staatsbuergerschaft;
$adrObj->geburtsnation = $row->geburtsnation;
$adrObj->sprache = $row->sprache;
$adrObj->anrede = $row->anrede;
$adrObj->titelpost = $row->titelpost;
$adrObj->titelpre = $row->titelpre;
$adrObj->nachname = $row->nachname;
$adrObj->vorname = $row->vorname;
$adrObj->vornamen = $row->vornamen;
$adrObj->gebdatum = $row->gebdatum;
$adrObj->gebort = $row->gebort;
$adrObj->gebzeit = $row->gebzeit;
$adrObj->foto = $row->foto;
$adrObj->anmerkungen = $row->anmerkung;
$adrObj->homepage = $row->homepage;
$adrObj->svnr = $row->svnr;
$adrObj->ersatzkennzeichen = $row->ersatzkennzeichen;
$adrObj->familienstand = $row->familienstand;
$adrObj->geschlecht = $row->geschlecht;
$adrObj->anzahlkinder = $row->anzahlkinder;
$adrObj->aktiv = $this->db_parse_bool($row->aktiv);
$adrObj->updateamum = $row->updateamum;
$adrObj->updatevon = $row->updatevon;
$adrObj->insertamum = $row->insertamum;
$adrObj->insertvon = $row->insertvon;
$adrObj->ext_id = $row->ext_id;
$adrObj->kurzbeschreibung = $row->kurzbeschreibung;
$adrObj->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$adr_obj->standort_id = $row->standort_id;
$adr_obj->adresse_id = $row->adresse_id;
$adr_obj->kurzbz = $row->kurzbz;
$adr_obj->bezeichnung = $row->bezeichnung;
$adr_obj->firma_id = $row->firma_id;
$adrObj->standort_id = $row->standort_id;
$adrObj->adresse_id = $row->adresse_id;
$adrObj->kurzbz = $row->kurzbz;
$adrObj->bezeichnung = $row->bezeichnung;
$adrObj->firma_id = $row->firma_id;
$adr_obj->personfunktionstandort_id = $row->personfunktionstandort_id;
$adrObj->personfunktionstandort_id = $row->personfunktionstandort_id;
$adr_obj->funktion_kurzbz = $row->funktion_kurzbz;
$adrObj->funktion_kurzbz = $row->funktion_kurzbz;
$adr_obj->position = $row->position;
$adr_obj->anrede = $row->anrede;
$adrObj->position = $row->position;
$adrObj->anrede = $row->anrede;
$adr_obj->funktion_beschreibung = $row->funktion_beschreibung;
$adr_obj->funktion_aktiv = $this->db_parse_bool($row->funktion_aktiv);
$adr_obj->funktion_fachbereich = $row->funktion_fachbereich;
$adr_obj->funktion_semester = $row->funktion_semester;
$adrObj->funktion_beschreibung = $row->funktion_beschreibung;
$adrObj->funktion_aktiv = $this->db_parse_bool($row->funktion_aktiv);
$adrObj->funktion_fachbereich = $row->funktion_fachbereich;
$adrObj->funktion_semester = $row->funktion_semester;
$this->result[] = $adr_obj;
$this->result[] = $adrObj;
}
return true;
}
@@ -694,8 +699,8 @@ class person extends Person_model
*
* Überprüfut ob der übergebene Zugangscode einer Person zugeordnet ist und
* retuniert im Erfolgsfall dessen person_id
* @param type $zugangscode
* @return boolean
* @param string $zugangscode Zugangscode aus tbl_person.
* @return bool
*/
public function checkZugangscode($zugangscode)
{
@@ -703,9 +708,9 @@ class person extends Person_model
FROM public.tbl_person
WHERE zugangscode=".$this->db_add_param($zugangscode, FHC_STRING);
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if ($row = $this->db_fetch_object())
{
return $row->person_id;
}
@@ -722,22 +727,24 @@ class person extends Person_model
/**
*
* Überprüft den übergebenen Zugangscode und retuniert die aktuelle incoming_id
* @param $zugangscode
* @param string $zugangscode Zugangscode aus tbl_person.
* @return bool
*/
public function checkZugangscodeIncoming($zugangscode)
{
$qry ="
$qry = "
SELECT
preincoming_id
FROM
public.tbl_preincoming
WHERE
person_id = (SELECT person_id FROM public.tbl_person WHERE zugangscode=".$this->db_add_param($zugangscode).")
person_id = (SELECT person_id FROM public.tbl_person
WHERE zugangscode=".$this->db_add_param($zugangscode).")
ORDER BY insertamum DESC;";
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if ($row = $this->db_fetch_object())
{
return $row->preincoming_id;
}
@@ -754,11 +761,12 @@ class person extends Person_model
/**
*
* Überprüft den übergebenen Zugangscode und retuniert die aktuelle incoming_id
* @param $zugangscode
* @param string $zugangscode Zugangscode aus tbl_person.
* @return bool
*/
public function checkZugangscodePerson($zugangscode)
{
$qry ="
$qry = "
SELECT
person_id
FROM
@@ -766,9 +774,9 @@ class person extends Person_model
WHERE
zugangscode=".$this->db_add_param($zugangscode).';';
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if ($row = $this->db_fetch_object())
{
return $row->person_id;
}
@@ -785,15 +793,16 @@ class person extends Person_model
/**
*
* Lädt eine Person zum übergebenen Zugangscode
* @param $zugangscode
* @param string $zugangscode Zugangscode aus tbl_person.
* @return bool
*/
public function getPersonFromZugangscode($zugangscode)
{
$qry ="SELECT * FROM public.tbl_person WHERE zugangscode=".$this->db_add_param($zugangscode).";";
$qry = "SELECT * FROM public.tbl_person WHERE zugangscode=".$this->db_add_param($zugangscode).";";
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if ($row = $this->db_fetch_object())
{
$this->person_id = $row->person_id;
$this->staatsbuergerschaft = $row->staatsbuergerschaft;
@@ -844,40 +853,44 @@ class person extends Person_model
/**
* Prueft ob eine SVNR bereits vergeben ist, Optional kann eine Person übergeben werden die nicht
* beruecksichtigt werden soll
* @param $svnr
* @param $person_id
* @return true wenn bereits vorhanden sonst false
* @param int $svnr SVNR aus tbl_person.
* @param int $personId PK aus tbl_person.
* @return bool True wenn bereits vorhanden sonst false.
*/
public function checkSvnr($svnr, $person_id=null)
public function checkSvnr($svnr, $personId = null)
{
$qry = "Select 1 from public.tbl_person where svnr =".$this->db_add_param($svnr);
if(!is_null($person_id))
$qry.=" AND person_id!=".$this->db_add_param($person_id);
if (!is_null($personId))
$qry .= " AND person_id!=".$this->db_add_param($personId);
if($result = $this->db_query($qry))
if ($result = $this->db_query($qry))
{
if($this->db_num_rows($result)>0)
if ($this->db_num_rows($result) > 0)
return true;
else
return false;
}
}
public function getFullName($allFirstnames=FALSE)
/**
* Generiert den vollen Namen einer Person
* @param bool $allFirstnames TRUE wenn alle Vornamen eingebunden werden sollen.
* @return bool
*/
public function getFullName($allFirstnames = false)
{
$fullname = "";
if((!is_null($this->titelpre)) && ($this->titelpre!=""))
if ((!is_null($this->titelpre)) && ($this->titelpre != ""))
$fullname .= $this->titelpre." ";
$fullname .= $this->vorname." ";
if(($allFirstnames) && ($this->vornamen != "") && (!is_null($this->vornamen)))
if (($allFirstnames) && ($this->vornamen != "") && (!is_null($this->vornamen)))
$fullname .= $this->vornamen." ";
$fullname .= $this->nachname;
if((!is_null($this->titelpost)) && ($this->titelpost!=""))
if ((!is_null($this->titelpost)) && ($this->titelpost != ""))
$fullname .= " ".$this->titelpost;
return $fullname;
@@ -885,9 +898,10 @@ class person extends Person_model
/**
* Laedt Personendaten eines Benutzers
* @param $uid
* @param string $uid DB-Attr: tbl_benutzer.uid .
* @return bool
*/
function getPersonFromBenutzer($uid)
public function getPersonFromBenutzer($uid)
{
$qry = "SELECT
*
@@ -897,9 +911,9 @@ class person extends Person_model
WHERE
uid=".$this->db_add_param($uid, FHC_STRING);
if($this->db_query($qry))
if ($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if ($row = $this->db_fetch_object())
{
$this->person_id = $row->person_id;
$this->staatsbuergerschaft = $row->staatsbuergerschaft;
@@ -933,7 +947,7 @@ class person extends Person_model
$this->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$this->matr_nr = $row->matr_nr;
$this->uid = $row->uid;
$this->aktiv = $this->db_parse_bool($row->aktiv);;
$this->aktiv = $this->db_parse_bool($row->aktiv);
$this->alias = $row->alias;
$this->updateaktivvon = $row->updateaktivvon;
$this->updateaktivam = $row->updateaktivam;
@@ -952,6 +966,4 @@ class person extends Person_model
return false;
}
}
}
?>
+1 -3
View File
@@ -301,10 +301,8 @@ switch (ENVIRONMENT)
// First load the FHC-Config-Files
require_once 'config/global.config.inc.php';
require_once 'config/system.config.inc.php';
require_once 'config/vilesci.config.inc.php';
// Now the bootstrap file
require_once BASEPATH.'core/CodeIgniter.php';
/* End of file index.php */
/* Location: ./index.php */
Executable
+67
View File
@@ -0,0 +1,67 @@
#!/bin/bash
#
# This archive is part of the FH-Complete source code.
#
# The source code of this software - FH-Complete - is under the terms of one of
# two licenses: Apache v2 and GPL v2
#
# ABOUT:
# =====
# This script will install some FH-Complete dependencies and configure default
# files
#
# WARNING:
# Of course that Apache and PostgreSQL should already be running
# because it is not responsability of FH-Complete to install other software
# Anyway, the following steps are an example to help install a full system:
#
# ------------------------------------------------------------------------------
# sudo apt-get update
# apt-get install phppgadmin postgresql apache
# apt-get install php5-pgsql php5-gd php5-curl
# a2enmod rewrite
# service apache2 restart
# sudo apt-get install -y git
# cd /var/www/html
# git clone https://github.com/FH-Complete/FH-Complete.git fhcomplete
# sudo chown www-data /var/www/html/fhcomplete
# -----------------------------------------------------------------------------
# CREATE DATABASE USERS fhcomplete, web, vilesci
# Running:
# =======
# ./install.sh
#
# =============================================================================
# Install script for FH-Complete
# =============================================================================
echo "==============================================================="
echo "Installing FH-Complete (install.sh)"
echo "==============================================================="
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo "Starting..."
cwd=$(pwd)
echo "Database ..."
sudo -u postgres createdb -O fhcomplete fhctest
echo "Installing FH-Complete..."
# cp index.ci.php index.php # Maybe somtimes
cp config/global.config-default.inc.php config/global.config.inc.php
cp config/cis.config-default.inc.php config/cis.config.inc.php
cp config/vilesci.config-default.inc.php config/vilesci.config.inc.php
cp config/system.config-default.inc.php config/system.config.inc.php
# mkdir documents
#chown www-data data/cache
#./composer.phar update
php index.php Migrate
echo "Done!"
echo "Now make #composer update"
echo "and #php bin/fhcomplete update"
exit 0
+61 -9
View File
@@ -1,22 +1,74 @@
build_settings:
verbose: false
prefer_symlink: false
ignore:
- "vendor"
- "tests"
- "frontend"
- "designs"
pgsql:
host: 'localhost;dbname=template1'
user: 'fhcomplete'
pass: 'fhcomplete'
setup:
composer:
directory: ""
action: "install"
pgsql:
- "DROP DATABASE IF EXISTS fhctest;"
shell:
- "cd %BUILD_PATH% && chmod u+x install.sh && ./install.sh fhctest" # Install Database
- "rm -f /var/www/html/build" # SymLink löschen falls vorhanden
- "ln -s %BUILD_PATH% /var/www/html/build" # SymLink to the actual build
- "php index.ci.php Migrate" # DB-Migration
test:
codeception:
config: "tests"
lint:
directories:
- "application/"
recursive: true
php_loc:
php_docblock_checker:
allowed_warnings: -1
# phing:
# build_file: 'build.xml'
# targets:
# - "deploy"
path: "application/controllers/"
allowed_warnings: 100
skip_classes: false
php_code_sniffer:
path: "application/controllers"
# ignore:
# - "backend/application/views"
standard: "tests/codesniffer/FHComplete"
allowed_errors: 100
allowed_warnings: 200
codeception:
config: "tests"
# php_unit:
# directory: "tests/phpunit/"
# args: "--bootstrap 'test/phpunit/bootstrap.php' --configuration 'tests/phpunit/phpunit.xml'"
complete:
xmpp:
username: "fhcomplete"
password: "fhcomplete1q2w3blah.im"
recipients:
- "fhcomplete@darkness.su"
- "nk@jabber.at"
- "tschux@jabber.org"
- "lexdesign@blah.im"
- "tschux@jabber.at"
server: "jabber.blah.im"
tls: 1
alias: "jabber.blah.im"
date_format: "%d.%m.%Y"
clean_build:
remove:
- index.php
- config/global.config.inc.php
- config/cis.config.inc.php
- config/vilesci.config.inc.php
- config/system.config.inc.php
success:
# shell:
# - "cd %BUILD_PATH% && chmod u+x copyBuild.sh && ./copyBuild.sh" # Copy Build
# - "curl 'http://localhost/backend/Migrate/'" # DB-Installation
# - "cd /var/www/html/ && sudo -u wsp doxygen Doxyfile" # Doxygen
+1 -1
View File
@@ -13,7 +13,7 @@ SET escape_string_warning = off;
-- Name: fhcomplete30; Type: COMMENT; Schema: -; Owner: oesi
--
COMMENT ON DATABASE fhcomplete IS 'FH-Complete 3.0';
-- COMMENT ON DATABASE fhcomplete IS 'FH-Complete 3.0';
-- Rollen im System
-- CREATE ROLE wawi LOGIN PASSWORD 'admin';
@@ -0,0 +1,59 @@
<?php
/**
* FHComplete
*/
/**
* Ensures doc block alignments.
*/
class FHComplete_Sniffs_Commenting_DocBlockAlignmentSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_DOC_COMMENT_OPEN_TAG);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$leftWall = array(
T_CLASS,
T_NAMESPACE,
T_INTERFACE,
T_TRAIT,
T_USE
);
$oneIndentation = array(
T_FUNCTION,
T_VARIABLE,
T_CONST
);
$allTokens = array_merge($leftWall, $oneIndentation);
$notFlatFile = $phpcsFile->findNext(T_NAMESPACE, 0);
$next = $phpcsFile->findNext($allTokens, $stackPtr + 1);
if ($next && $notFlatFile) {
$notWalled = (in_array($tokens[$next]['code'], $leftWall) && $tokens[$stackPtr]['column'] !== 1);
$notIndented = (in_array($tokens[$next]['code'], $oneIndentation) && $tokens[$stackPtr]['column'] !== 5);
if ($notWalled || $notIndented) {
$phpcsFile->addError('Expected docblock to be aligned with code.', $stackPtr, 'NotAllowed');
}
}
return;
}
}
@@ -0,0 +1,487 @@
<?php
/**
* Parses and verifies the doc comments for functions.
*
* PHP version 5
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
if (class_exists('PEAR_Sniffs_Commenting_FunctionCommentSniff', true) === false) {
throw new PHP_CodeSniffer_Exception('Class PEAR_Sniffs_Commenting_FunctionCommentSniff not found');
}
/**
* Parses and verifies the doc comments for functions.
*
* Verifies that :
* <ul>
* <li>A comment exists</li>
* <li>There is a blank newline after the short description</li>
* <li>There is a blank newline between the long and short description</li>
* <li>There is a blank newline between the long description and tags</li>
* <li>Parameter names represent those in the method</li>
* <li>Parameter comments are in the correct order</li>
* <li>Parameter comments are complete</li>
* <li>A type hint is provided for array and custom class</li>
* <li>Type hint matches the actual variable/class type</li>
* <li>A blank line is present before the first and after the last parameter</li>
* <li>A return type exists</li>
* <li>Any throw tag must have a comment</li>
* <li>The tag order and indentation are correct</li>
* </ul>
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class FHComplete_Sniffs_Commenting_FunctionCommentSniff extends PEAR_Sniffs_Commenting_FunctionCommentSniff
{
/**
* Is the comment an inheritdoc?
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return boolean True if the comment is an inheritdoc
*/
protected function isInheritDoc(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$start = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $stackPtr - 1);
$end = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, $start);
$content = $phpcsFile->getTokensAsString($start, ($end - $start));
return preg_match('#{@inheritDoc}#', $content) === 1;
} // end isInheritDoc()
/**
* Process the return comment of this function comment.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param int $commentStart The position in the stack where the comment started.
*
* @return void
*/
protected function processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart)
{
if ($this->isInheritDoc($phpcsFile, $stackPtr)) {
return;
}
$tokens = $phpcsFile->getTokens();
// Skip constructor and destructor.
$className = '';
foreach ($tokens[$stackPtr]['conditions'] as $condPtr => $condition) {
if ($condition === T_CLASS || $condition === T_INTERFACE) {
$className = $phpcsFile->getDeclarationName($condPtr);
$className = strtolower(ltrim($className, '_'));
}
}
$methodName = $phpcsFile->getDeclarationName($stackPtr);
$isSpecialMethod = ($methodName === '__construct' || $methodName === '__destruct');
if ($methodName !== '_') {
$methodName = strtolower(ltrim($methodName, '_'));
}
$return = null;
foreach ($tokens[$commentStart]['comment_tags'] as $tag) {
if ($tokens[$tag]['content'] === '@return') {
if ($return !== null) {
$error = 'Only 1 @return tag is allowed in a function comment';
$phpcsFile->addError($error, $tag, 'DuplicateReturn');
return;
}
$return = $tag;
}
}
if ($isSpecialMethod === true) {
return;
}
if ($return !== null) {
$content = $tokens[($return + 2)]['content'];
if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) {
$error = 'Return type missing for @return tag in function comment';
$phpcsFile->addError($error, $return, 'MissingReturnType');
} else {
// Check return type (can be multiple, separated by '|').
$typeNames = explode('|', $content);
$suggestedNames = array();
foreach ($typeNames as $i => $typeName) {
if ($typeName === 'integer') {
$suggestedName = 'int';
} elseif ($typeName === 'boolean') {
$suggestedName = 'bool';
} elseif (in_array($typeName, array('int', 'bool'))) {
$suggestedName = $typeName;
} else {
$suggestedName = PHP_CodeSniffer::suggestType($typeName);
}
if (in_array($suggestedName, $suggestedNames) === false) {
$suggestedNames[] = $suggestedName;
}
}
$suggestedType = implode('|', $suggestedNames);
if ($content !== $suggestedType) {
$error = 'Function return type "%s" is invalid';
$error = 'Expected "%s" but found "%s" for function return type';
$data = array(
$suggestedType,
$content,
);
$phpcsFile->addError($error, $return, 'InvalidReturn', $data);
}
// If the return type is void, make sure there is
// no return statement in the function.
if ($content === 'void') {
if (isset($tokens[$stackPtr]['scope_closer']) === true) {
$endToken = $tokens[$stackPtr]['scope_closer'];
for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) {
if ($tokens[$returnToken]['code'] === T_CLOSURE) {
$returnToken = $tokens[$returnToken]['scope_closer'];
continue;
}
if ($tokens[$returnToken]['code'] === T_RETURN) {
break;
}
}
if ($returnToken !== $endToken) {
// If the function is not returning anything, just
// exiting, then there is no problem.
$semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true);
if ($tokens[$semicolon]['code'] !== T_SEMICOLON) {
$error = 'Function return type is void, but function contains return statement';
$phpcsFile->addWarning($error, $return, 'InvalidReturnVoid');
}
}
}//end if
} elseif (!preg_match('/^mixed/', $content)) {
// If return type is not void, there needs to be a return statement
// somewhere in the function that returns something.
if (isset($tokens[$stackPtr]['scope_closer']) === true) {
$endToken = $tokens[$stackPtr]['scope_closer'];
$returnToken = $phpcsFile->findNext(T_RETURN, $stackPtr, $endToken);
if ($returnToken === false) {
$error = 'Function return type is not void, but function has no return statement';
$phpcsFile->addWarning($error, $return, 'InvalidNoReturn');
} elseif (!preg_match('/void/', $content)) {
$semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true);
if ($tokens[$semicolon]['code'] === T_SEMICOLON) {
$error = 'Function return type is not void, but function is returning void here';
$phpcsFile->addWarning($error, $returnToken, 'InvalidReturnNotVoid');
}
}
}
}//end if
}//end if
} else {
$error = 'Missing @return tag in function comment';
$phpcsFile->addWarning($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn');
}//end if
}//end processReturn()
/**
* Process any throw tags that this function comment has.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param int $commentStart The position in the stack where the comment started.
*
* @return void
*/
protected function processThrows(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart)
{
$tokens = $phpcsFile->getTokens();
$throws = array();
foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) {
if ($tokens[$tag]['content'] !== '@throws') {
continue;
}
$exception = null;
$comment = null;
if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) {
$matches = array();
preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches);
$exception = $matches[1];
if (isset($matches[2]) === true) {
$comment = $matches[2];
}
}
if ($exception === null) {
$error = 'Exception type and comment missing for @throws tag in function comment';
$phpcsFile->addWarning($error, $tag, 'InvalidThrows');
} elseif ($comment === null) {
$error = 'Comment missing for @throws tag in function comment';
$phpcsFile->addWarning($error, $tag, 'EmptyThrows');
} else {
// Any strings until the next tag belong to this comment.
if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) {
$end = $tokens[$commentStart]['comment_tags'][($pos + 1)];
} else {
$end = $tokens[$commentStart]['comment_closer'];
}
for ($i = ($tag + 3); $i < $end; $i++) {
if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) {
$comment .= ' '.$tokens[$i]['content'];
}
}
// Starts with a capital letter and ends with a fullstop.
$firstChar = $comment{0};
if (strtoupper($firstChar) !== $firstChar) {
$error = '@throws tag comment must start with a capital letter';
$phpcsFile->addWarning($error, ($tag + 2), 'ThrowsNotCapital');
}
$lastChar = substr($comment, -1);
if ($lastChar !== '.') {
$error = '@throws tag comment must end with a full stop';
$phpcsFile->addWarning($error, ($tag + 2), 'ThrowsNoFullStop');
}
}//end if
}//end foreach
}//end processThrows()
/**
* Process the function parameter comments.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param int $commentStart The position in the stack where the comment started.
*
* @return void
*/
protected function processParams(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart)
{
if ($this->isInheritDoc($phpcsFile, $stackPtr)) {
return;
}
$tokens = $phpcsFile->getTokens();
$params = array();
$maxType = 0;
$maxVar = 0;
foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) {
if ($tokens[$tag]['content'] !== '@param') {
continue;
}
$type = '';
$typeSpace = 0;
$var = '';
$varSpace = 0;
$comment = '';
$commentLines = array();
if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) {
$matches = array();
preg_match('/([^$&]+)(?:((?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches);
$typeLen = strlen($matches[1]);
$type = trim($matches[1]);
$typeSpace = ($typeLen - strlen($type));
$typeLen = strlen($type);
if ($typeLen > $maxType) {
$maxType = $typeLen;
}
if (isset($matches[2]) === true) {
$var = $matches[2];
$varLen = strlen($var);
if ($varLen > $maxVar) {
$maxVar = $varLen;
}
if (isset($matches[4]) === true) {
$varSpace = strlen($matches[3]);
$comment = $matches[4];
$commentLines[] = array(
'comment' => $comment,
'token' => ($tag + 2),
'indent' => $varSpace,
);
// Any strings until the next tag belong to this comment.
if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) {
$end = $tokens[$commentStart]['comment_tags'][($pos + 1)];
} else {
$end = $tokens[$commentStart]['comment_closer'];
}
for ($i = ($tag + 3); $i < $end; $i++) {
if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) {
$indent = 0;
if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) {
$indent = strlen($tokens[($i - 1)]['content']);
}
$comment .= ' '.$tokens[$i]['content'];
$commentLines[] = array(
'comment' => $tokens[$i]['content'],
'token' => $i,
'indent' => $indent,
);
}
}
} else {
$error = 'Missing parameter comment';
$phpcsFile->addError($error, $tag, 'MissingParamComment');
$commentLines[] = array('comment' => '');
}//end if
} else {
$error = 'Missing parameter name';
$phpcsFile->addError($error, $tag, 'MissingParamName');
}//end if
} else {
$error = 'Missing parameter type';
$phpcsFile->addError($error, $tag, 'MissingParamType');
}//end if
$params[] = array(
'tag' => $tag,
'type' => $type,
'var' => $var,
'comment' => $comment,
'commentLines' => $commentLines,
'type_space' => $typeSpace,
'var_space' => $varSpace,
);
}//end foreach
$realParams = $phpcsFile->getMethodParameters($stackPtr);
$foundParams = array();
foreach ($params as $pos => $param) {
// If the type is empty, the whole line is empty.
if ($param['type'] === '') {
continue;
}
// Check the param type value.
$typeNames = explode('|', $param['type']);
foreach ($typeNames as $typeName) {
if ($typeName === 'integer') {
$suggestedName = 'int';
} elseif ($typeName === 'boolean') {
$suggestedName = 'bool';
} elseif (in_array($typeName, array('int', 'bool'))) {
$suggestedName = $typeName;
} else {
$suggestedName = PHP_CodeSniffer::suggestType($typeName);
}
if ($typeName !== $suggestedName) {
$error = 'Expected "%s" but found "%s" for parameter type';
$data = array(
$suggestedName,
$typeName,
);
$fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data);
if ($fix === true) {
$content = $suggestedName;
$content .= str_repeat(' ', $param['type_space']);
$content .= $param['var'];
$content .= str_repeat(' ', $param['var_space']);
$content .= $param['commentLines'][0]['comment'];
$phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
}
}
}//end foreach
if ($param['var'] === '') {
continue;
}
$foundParams[] = $param['var'];
// Make sure the param name is correct.
if (isset($realParams[$pos]) === true) {
$realName = $realParams[$pos]['name'];
if ($realName !== $param['var']) {
$code = 'ParamNameNoMatch';
$data = array(
$param['var'],
$realName,
);
$error = 'Doc comment for parameter %s does not match ';
if (strtolower($param['var']) === strtolower($realName)) {
$error .= 'case of ';
$code = 'ParamNameNoCaseMatch';
}
$error .= 'actual variable name %s';
$phpcsFile->addWarning($error, $param['tag'], $code, $data);
}
} elseif (substr($param['var'], -4) !== ',...') {
// We must have an extra parameter comment.
$error = 'Superfluous parameter comment';
$phpcsFile->addError($error, $param['tag'], 'ExtraParamComment');
}//end if
if ($param['comment'] === '') {
continue;
}
// Param comments must start with a capital letter and end with the full stop.
$firstChar = $param['comment']{0};
if (preg_match('|\p{Lu}|u', $firstChar) === 0) {
$error = 'Parameter comment must start with a capital letter';
$phpcsFile->addWarning($error, $param['tag'], 'ParamCommentNotCapital');
}
$lastChar = substr($param['comment'], -1);
if ($lastChar !== '.') {
$error = 'Parameter comment must end with a full stop';
$phpcsFile->addWarning($error, $param['tag'], 'ParamCommentFullStop');
}
}//end foreach
$realNames = array();
foreach ($realParams as $realParam) {
$realNames[] = $realParam['name'];
}
// Report missing comments.
$diff = array_diff($realNames, $foundParams);
foreach ($diff as $neededParam) {
$error = 'Doc comment for parameter "%s" missing';
$data = array($neededParam);
$phpcsFile->addWarning($error, $commentStart, 'MissingParamTag', $data);
}
}//end processParams()
}//end class
@@ -0,0 +1,87 @@
<?php
/**
* FHComplete
*/
/**
* Asserts that function comments use the short form for types:
* - bool instead of boolean
* - int instead of integer
*/
class FHComplete_Sniffs_Commenting_FunctionCommentTypeSniff implements PHP_CodeSniffer_Sniff {
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_DOC_COMMENT);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// We are only interested in function/class/interface doc block comments.
$nextToken = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);
$ignore = array(
T_CLASS,
T_INTERFACE,
T_FUNCTION,
T_PUBLIC,
T_PRIVATE,
T_PROTECTED,
T_STATIC,
T_ABSTRACT,
);
if (in_array($tokens[$nextToken]['code'], $ignore) === false) {
// Could be a file comment.
$prevToken = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true);
if ($tokens[$prevToken]['code'] !== T_OPEN_TAG) {
return;
}
}
$types = array(
'boolean' => 'bool',
'integer' => 'int',
);
foreach ($types as $from => $to) {
$this->_check($phpcsFile, $stackPtr, $from, $to);
}
}
/**
* MyFHComplete_Sniffs_Commenting_DocBlockTypeSniff::_check()
*
* @param int $stackPtr
* @param string $from
* @param string $to
* @return void
*/
protected function _check(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $from, $to)
{
$tokens = $phpcsFile->getTokens();
$content = $tokens[$stackPtr]['content'];
$matches = array();
if (preg_match('/\@(\w+)\s+([\w\\|\\\\]*?)' . $from . '\b/i', $content, $matches) === 0) {
return;
}
$error = 'Please use "' . $to . '" instead of "' . $from . '" for types in doc blocks.';
$phpcsFile->addWarning($error, $stackPtr, 'WrongType');
}
}
@@ -0,0 +1,58 @@
<?php
/**
* Verifies that control statements conform to their coding standards.
*
* PHP version 5
*/
if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) {
throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found');
}
/**
* Verifies that control statements conform to their coding standards.
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class FHComplete_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff
{
/**
* If true, comments will be ignored if they are found in the code.
*
* @var boolean
*/
public $ignoreComments = true;
/**
* Returns the patterns that this test wishes to verify.
*
* @return string[]
*/
protected function getPatterns()
{
return array(
'try {EOL...}\s+catch (...)EOL...{EOL...EOL...}',
'do+EOL...{EOL...EOL...} while (...);EOL',
'while (...)EOL...{EOL',
'for (...) {EOL',
'if (...)EOL...{EOL',
'foreach (...)EOL...{EOL',
'}EOL...\s+else if (...)EOL...{EOL',
'}EOL...\s+elseif (...)EOL...{EOL',
'}EOL...\s+else+EOL...{EOL',
'do+EOL...{EOL',
);
}//end getPatterns()
}//end class
@@ -0,0 +1,48 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures that elseif is used instead of else if
*
*/
class FHComplete_Sniffs_ControlStructures_ElseIfDeclarationSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_ELSE);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* Checks that ELSEIF is used instead of ELSE IF.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if ($tokens[$nextToken]['code'] !== T_IF) {
return;
}
$error = 'Usage of ELSE IF not allowed; use ELSEIF instead';
$phpcsFile->addError($error, $stackPtr, 'NotAllowed');
}
}
@@ -0,0 +1,56 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures that while and do-while use curly brackets
*
*/
class FHComplete_Sniffs_ControlStructures_WhileStructuresSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_DO, T_WHILE);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* Checks that while and do-while use curly brackets
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS) {
$closer = $tokens[$nextToken]['parenthesis_closer'];
$diff = $closer - $stackPtr;
$nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + $diff + 1), null, true);
}
if ($tokens[$stackPtr]['code'] === T_WHILE && $tokens[$nextToken]['code'] === T_SEMICOLON) {
/* This while is probably part of a do-while construction, skip it .. */
return;
}
if ($tokens[$nextToken]['code'] !== T_OPEN_CURLY_BRACKET && $tokens[$nextToken]['code'] !== T_COLON) {
$error = 'Curly brackets required in a do-while or while loop';
$phpcsFile->addError($error, $stackPtr, 'NotAllowed');
}
}
}
@@ -0,0 +1,48 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures the use contains only one class.
*
*/
class FHComplete_Sniffs_Formatting_OneClassPerUseSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_USE);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$i = 2; // Ignore use word and whitespace
$filename = $phpcsFile->getFilename();
while (in_array($tokens[$stackPtr + $i]['code'], array(T_STRING, T_NS_SEPARATOR, T_WHITESPACE, T_AS))) {
$i++;
}
if ($tokens[$stackPtr + $i]['code'] === T_COMMA) {
$error = 'Only one class is allowed per use';
$phpcsFile->addError($error, $stackPtr, 'OneClassPerUse', array());
}
}
}
@@ -0,0 +1,142 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures all the use are in alphabetical order.
*
*/
class FHComplete_Sniffs_Formatting_UseInAlphabeticalOrderSniff implements PHP_CodeSniffer_Sniff
{
/**
* Processed files
*
* @var array
*/
protected $_processed = array();
/**
* The list of use statements, their content and scope.
*
* @var array
*/
protected $_uses = array();
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_USE);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
if (isset($this->_processed[$phpcsFile->getFilename()])) {
return;
}
$filename = $phpcsFile->getFilename();
$this->_uses = array();
$next = $stackPtr;
while ($next !== false) {
$this->_checkUseToken($phpcsFile, $next);
$next = $phpcsFile->findNext(T_USE, $next + 1);
}
// Prevent multiple uses in the same file from entering
$this->_processed[$phpcsFile->getFilename()] = true;
foreach ($this->_uses as $scope => $used) {
$defined = $sorted = array_keys($used);
natcasesort($sorted);
$sorted = array_values($sorted);
if ($sorted === $defined) {
continue;
}
foreach ($defined as $i => $name) {
if ($name !== $sorted[$i]) {
$error = 'Use classes must be in alphabetical order. Was expecting ' . $sorted[$i];
$phpcsFile->addError($error, $used[$name], 'UseInAlphabeticalOrder', array());
}
}
}
}
/**
* Check all the use tokens in a file.
*
* @param PHP_CodeSniffer_File $phpcsFile The file to check.
* @param integer $stackPtr The index of the first use token.
* @return void
*/
protected function _checkUseToken($phpcsFile, $stackPtr) {
// If the use token is for a closure we want to ignore it.
$isClosure = $this->_isClosure($phpcsFile, $stackPtr);
if ($isClosure) {
return;
}
$tokens = $phpcsFile->getTokens();
// Only one USE declaration allowed per statement.
$next = $phpcsFile->findNext(array(T_COMMA, T_SEMICOLON), ($stackPtr + 1));
if ($tokens[$next]['code'] === T_COMMA) {
$error = 'There must be one USE keyword per declaration';
$phpcsFile->addError($error, $stackPtr, 'MultipleDeclarations');
}
$content = '';
$end = $phpcsFile->findNext(array(T_SEMICOLON, T_OPEN_CURLY_BRACKET), $stackPtr);
$useTokens = array_slice($tokens, $stackPtr, $end - $stackPtr, true);
foreach ($useTokens as $index => $token) {
if ($token['code'] === T_STRING || $token['code'] === T_NS_SEPARATOR) {
$content .= $token['content'];
}
}
// Check for class scoping on use. Traits should be
// ordered independently.
$scope = 0;
if (!empty($token['conditions'])) {
$scope = key($token['conditions']);
}
$this->_uses[$scope][$content] = $stackPtr;
}
/**
* Check if the current stackPtr is a use token that is for a closure.
*
* @param PHP_CodeSniffer_File $phpcsFile
* @param integer $stackPtr
* @return boolean
*/
protected function _isClosure($phpcsFile, $stackPtr) {
return $phpcsFile->findPrevious(
array(T_CLOSURE),
($stackPtr - 1),
null,
false,
null,
true
);
}
}
@@ -0,0 +1,35 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures there is a space after the function keyword for closures.
*
*/
class FHComplete_Sniffs_Functions_ClosureDeclarationSniff implements PHP_CodeSniffer_Sniff {
public function register()
{
return array(T_CLOSURE);
}
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$spaces = 0;
if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) {
$spaces = strlen($tokens[($stackPtr + 1)]['content']);
}
if ($spaces !== 1) {
$error = 'Expected 1 space after closure\'s function keyword; %s found';
$data = array($spaces);
$phpcsFile->addError($error, $stackPtr, 'SpaceAfterFunction', $data);
}
}
}
@@ -0,0 +1,26 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
if (class_exists('Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff', true) === false) {
$error = 'Class Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff not found';
throw new PHP_CodeSniffer_Exception($error);
}
/**
* Ensures the spacing of function declaration arguments is correct.
*
*/
class FHComplete_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff extends
Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff {
/**
* How many spaces should surround the equals signs.
*
* @var int
*/
public $equalsSpacing = 1;
}
@@ -0,0 +1,98 @@
<?php
/**
* PSR1_Sniffs_Methods_CamelCapsMethodNameSniff.
*
* PHP version 5
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
if (class_exists('Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff', true) === false) {
throw new PHP_CodeSniffer_Exception('Class Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff not found');
}
/**
* PSR1_Sniffs_Methods_CamelCapsMethodNameSniff.
*
* Ensures method names are defined using camel case.
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class FHComplete_Sniffs_NamingConventions_CamelCapsMethodNameSniff extends Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff
{
/**
* Processes the tokens within the scope.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being processed.
* @param int $stackPtr The position where this token was
* found.
* @param int $currScope The position of the current scope.
*
* @return void
*/
protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $currScope)
{
$methodName = $phpcsFile->getDeclarationName($stackPtr);
if ($methodName === null
|| substr($methodName,-4) === '_get'
|| substr($methodName,-5) === '_post'
|| substr($methodName,-4) === '_put'
|| substr($methodName,-6) === '_patch'
|| substr($methodName,-7) === '_delete'
)
// Ignore closures.
return;
// Ignore magic methods.
if (preg_match('|^__|', $methodName) !== 0) {
$magicPart = strtolower(substr($methodName, 2));
if (isset($this->magicMethods[$magicPart]) === true
|| isset($this->methodsDoubleUnderscore[$magicPart]) === true
) {
return;
}
}
$testName = ltrim($methodName, '_');
if ($testName !== '' && PHP_CodeSniffer::isCamelCaps($testName, false, true, false) === false) {
$error = 'Method name "%s" is not in camel caps format';
$className = $phpcsFile->getDeclarationName($currScope);
$errorData = array($className.'::'.$methodName);
$phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $errorData);
$phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'no');
} else {
$phpcsFile->recordMetric($stackPtr, 'CamelCase method name', 'yes');
}
}//end processTokenWithinScope()
/**
* Processes the tokens outside the scope.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being processed.
* @param int $stackPtr The position where this token was
* found.
*
* @return void
*/
protected function processTokenOutsideScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
}//end processTokenOutsideScope()
}//end class
@@ -0,0 +1,223 @@
<?php
/**
* FHComplete_Sniffs_NamingConventions_UpperCaseConstantNameSniff.
*
* PHP version 5
*
* Ensures that constant names are all uppercase.
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @version Release: 1.5.0RC3
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class FHComplete_Sniffs_NamingConventions_UpperCaseConstantNameSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_STRING);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$constName = $tokens[$stackPtr]['content'];
// If this token is in a heredoc, ignore it.
if ($phpcsFile->hasCondition($stackPtr, T_START_HEREDOC) === true) {
return;
}
// Special case for PHPUnit.
if ($constName === 'PHPUnit_MAIN_METHOD') {
return;
}
// If the next non-whitespace token after this token
// is not an opening parenthesis then it is not a function call.
$openBracket = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {
$functionKeyword = $phpcsFile->findPrevious(
array(
T_WHITESPACE,
T_COMMA,
T_COMMENT,
T_STRING,
T_NS_SEPARATOR,
),
($stackPtr - 1),
null,
true
);
$declarations = array(
T_FUNCTION,
T_CLASS,
T_INTERFACE,
T_TRAIT,
T_IMPLEMENTS,
T_EXTENDS,
T_INSTANCEOF,
T_NEW,
T_NAMESPACE,
T_USE,
T_AS,
T_GOTO,
T_INSTEADOF,
T_PROTECTED,
T_PRIVATE,
T_PUBLIC
);
if (in_array($tokens[$functionKeyword]['code'], $declarations) === true) {
// This is just a declaration; no constants here.
return;
}
if ($tokens[$functionKeyword]['code'] === T_CONST) {
// This is a class constant.
if (strtoupper($constName) !== $constName) {
$error = 'Class constants must be uppercase; expected %s but found %s';
$data = array(
strtoupper($constName),
$constName,
);
$phpcsFile->addError($error, $stackPtr, 'ClassConstantNotUpperCase', $data);
}
return;
}
// Is this a class name?
$nextPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if ($tokens[$nextPtr]['code'] === T_DOUBLE_COLON) {
return;
}
// Is this a namespace name?
if ($tokens[$nextPtr]['code'] === T_NS_SEPARATOR) {
return;
}
// Is this an insteadof name?
if ($tokens[$nextPtr]['code'] === T_INSTEADOF) {
return;
}
// Is this an as name?
if ($tokens[$nextPtr]['code'] === T_AS) {
return;
}
// Is this a type hint?
if ($tokens[$nextPtr]['code'] === T_VARIABLE
|| $phpcsFile->isReference($nextPtr) === true
) {
return;
}
// Is this a member var name?
$prevPtr = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
if ($tokens[$prevPtr]['code'] === T_OBJECT_OPERATOR) {
return;
}
// Is this a variable name, in the form ${varname} ?
if ($tokens[$prevPtr]['code'] === T_OPEN_CURLY_BRACKET) {
$nextPtr = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if ($tokens[$nextPtr]['code'] === T_CLOSE_CURLY_BRACKET) {
return;
}
}
// Is this a namespace name?
if ($tokens[$prevPtr]['code'] === T_NS_SEPARATOR) {
return;
}
// Is this an instance of declare()
$prevPtrDeclare = $phpcsFile->findPrevious(
array(T_WHITESPACE, T_OPEN_PARENTHESIS),
($stackPtr - 1),
null,
true
);
if ($tokens[$prevPtrDeclare]['code'] === T_DECLARE) {
return;
}
// Is this a goto label target?
if ($tokens[$nextPtr]['code'] === T_COLON) {
if (in_array($tokens[$prevPtr]['code'], array(T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_COLON), true)) {
return;
}
}
// This is a real constant.
if (strtoupper($constName) !== $constName) {
$error = 'Constants must be uppercase; expected %s but found %s';
$data = array(
strtoupper($constName),
$constName,
);
$phpcsFile->addError($error, $stackPtr, 'ConstantNotUpperCase', $data);
}
} elseif (strtolower($constName) === 'define' || strtolower($constName) === 'constant') {
/*
This may be a "define" or "constant" function call.
*/
// Make sure this is not a method call.
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
if ($tokens[$prev]['code'] === T_OBJECT_OPERATOR
|| $tokens[$prev]['code'] === T_DOUBLE_COLON
) {
return;
}
// The next non-whitespace token must be the constant name.
$constPtr = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true);
if ($tokens[$constPtr]['code'] !== T_CONSTANT_ENCAPSED_STRING) {
return;
}
$constName = $tokens[$constPtr]['content'];
// Check for constants like self::CONSTANT.
$prefix = '';
$splitPos = strpos($constName, '::');
if ($splitPos !== false) {
$prefix = substr($constName, 0, ($splitPos + 2));
$constName = substr($constName, ($splitPos + 2));
}
if (strtoupper($constName) !== $constName) {
$error = 'Constants must be uppercase; expected %s but found %s';
$data = array(
$prefix . strtoupper($constName),
$prefix . $constName,
);
$phpcsFile->addError($error, $stackPtr, 'ConstantNotUpperCase', $data);
}
}
}
}
@@ -0,0 +1,47 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures curly brackets are on the same line as the Class declaration
*
*/
class FHComplete_Sniffs_NamingConventions_ValidClassBracketsSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_CLASS);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$found = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, $stackPtr);
if ($tokens[$found - 1]['code'] != T_WHITESPACE) {
$error = 'Expected 1 space after class declaration, found 0';
$phpcsFile->addError($error, $found - 1, 'InvalidSpacing', array());
return;
}
if (strlen($tokens[$found - 1]['content']) > 1 || $tokens[$found - 2]['code'] == T_WHITESPACE) {
$error = 'Expected 1 space after class declaration, found ' . strlen($tokens[$found - 1]['content']);
$phpcsFile->addError($error, $found - 1, 'InvalidSpacing', array());
}
}
}
@@ -0,0 +1,138 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures method names are correct depending on whether they are public
* or private, and that functions are named correctly.
*
*/
class FHComplete_Sniffs_NamingConventions_ValidFunctionNameSniff extends PHP_CodeSniffer_Standards_AbstractScopeSniff {
/**
* A list of all PHP magic methods.
*
* @var array
*/
protected $_magicMethods = array(
'construct',
'destruct',
'call',
'callStatic',
'debugInfo',
'get',
'set',
'isset',
'unset',
'sleep',
'wakeup',
'toString',
'set_state',
'clone',
'invoke',
);
/**
* Constructs a PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff.
*/
public function __construct() {
parent::__construct(array(T_CLASS, T_INTERFACE), array(T_FUNCTION), true);
}
/**
* Processes the tokens within the scope.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being processed.
* @param integer $stackPtr The position where this token was found.
* @param integer $currScope The position of the current scope.
* @return void
*/
protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $currScope) {
$methodName = $phpcsFile->getDeclarationName($stackPtr);
if ($methodName === null) {
// Ignore closures.
return;
}
$className = $phpcsFile->getDeclarationName($currScope);
$errorData = array($className . '::' . $methodName);
// PHP4 constructors are allowed to break our rules.
if ($methodName === $className) {
return;
}
// PHP4 destructors are allowed to break our rules.
if ($methodName === '_' . $className) {
return;
}
// Ignore magic methods
if (preg_match('/^__(' . implode('|', $this->_magicMethods) . ')$/', $methodName)) {
return;
}
$methodProps = $phpcsFile->getMethodProperties($stackPtr);
if ($methodProps['scope_specified'] === false) {
// Let another sniffer take care of that
return;
}
$isPublic = $methodProps['scope'] === 'public';
$isProtected = $methodProps['scope'] === 'protected';
$isPrivate = $methodProps['scope'] === 'private';
$scope = $methodProps['scope'];
if ($isPublic === true) {
if ($methodName[0] === '_') {
$error = 'Public method name "%s" must not be prefixed with underscore';
$phpcsFile->addError($error, $stackPtr, 'PublicWithUnderscore', $errorData);
return;
}
// Underscored public methods in controller are allowed to break our rules.
if (substr($className, -10) === 'Controller') {
return;
}
// Underscored public methods in shells are allowed to break our rules.
if (substr($className, -5) === 'Shell') {
return;
}
// Underscored public methods in tasks are allowed to break our rules.
if (substr($className, -4) === 'Task') {
return;
}
} elseif ($isPrivate === true) {
if (substr($methodName, 0, 2) !== '__') {
$error = 'Private method name "%s" must be prefixed with 2 underscores';
$phpcsFile->addError($error, $stackPtr, 'PrivateNoUnderscore', $errorData);
return;
} else {
$filename = $phpcsFile->getFilename();
if (strpos($filename, '/lib/Cake/') === true) {
$warning = 'Private method name "%s" in FHComplete core is discouraged';
$phpcsFile->addWarning($warning, $stackPtr, 'PrivateMethodInCore', $errorData);
}
}
} else {
if ($methodName[0] !== '_' || substr($methodName, 0, 2) === '__') {
$error = 'Protected method name "%s" must be prefixed with one underscore';
$phpcsFile->addError($error, $stackPtr, 'ProtectedNoUnderscore', $errorData);
return;
}
}
}
/**
* Processes the tokens outside the scope.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being processed.
* @param integer $stackPtr The position where this token was found.
* @return void
*/
protected function processTokenOutsideScope(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
}
}
@@ -0,0 +1,48 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures trait names are correct depending on the folder of the file.
*
*/
class FHComplete_Sniffs_NamingConventions_ValidTraitNameSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* If the constant is not defined, ignore because probably the PHP version
* is under 5.4.0 and don't have traits in use
*
* @return array
*/
public function register()
{
if (!defined('T_TRAIT')) {
return array();
}
return array(T_TRAIT);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$traitName = $tokens[$stackPtr + 2]['content'];
if (substr($traitName, -5) !== 'Trait') {
$error = 'Traits must have a "Trait" suffix.';
$phpcsFile->addError($error, $stackPtr, 'InvalidTraitName', array());
}
}
}
@@ -0,0 +1,171 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
if (class_exists('PHP_CodeSniffer_Standards_AbstractVariableSniff', true) === false) {
throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractVariableSniff not found');
}
/**
* Checks the naming of variables and member variables.
*
*/
class FHComplete_Sniffs_NamingConventions_ValidVariableNameSniff extends PHP_CodeSniffer_Standards_AbstractVariableSniff {
/**
* Processes this test, when one of its tokens is encountered.
*
* Processes variables, we skip processing object properties because
* they could come from things like PDO which doesn't follow the normal
* conventions and causes additional failures.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
protected function processVariable(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
$tokens = $phpcsFile->getTokens();
$varName = ltrim($tokens[$stackPtr]['content'], '$');
$phpReservedVars = array(
'_SERVER',
'_GET',
'_POST',
'_REQUEST',
'_SESSION',
'_ENV',
'_COOKIE',
'_FILES',
'GLOBALS',
);
// If it's a php reserved var, then its ok.
if (in_array($varName, $phpReservedVars) === true) {
return;
}
// There is no way for us to know if the var is public or private,
// so we have to ignore a leading underscore if there is one and just
// check the main part of the variable name.
$originalVarName = $varName;
if (substr($varName, 0, 1) === '_') {
$objOperator = $phpcsFile->findPrevious(array(T_WHITESPACE), ($stackPtr - 1), null, true);
if ($tokens[$objOperator]['code'] === T_DOUBLE_COLON) {
// The variable lives within a class, and is referenced like
// this: MyClass::$_variable, so we don't know its scope.
$inClass = true;
} else {
$inClass = $phpcsFile->hasCondition($stackPtr, array(T_TRAIT, T_CLASS, T_INTERFACE));
}
if ($inClass === true) {
$varName = ltrim($varName, '_');
}
}
// $title_for_layout is allowed on controllers
$fileName = basename($phpcsFile->getFilename(), '.php');
if ((substr($fileName, -10) === 'Controller') && ($varName == 'title_for_layout')) {
return;
}
if ($this->_isValidVar($varName) === false) {
$error = 'Variable "%s" is not in valid camel caps format';
$data = array($originalVarName);
$phpcsFile->addError($error, $stackPtr, 'NotCamelCaps', $data);
}
}
/**
* Processes class member variables.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
}
/**
* Processes the variable found within a double quoted string.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the double quoted string.
* @return void
*/
protected function processVariableInString(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
$tokens = $phpcsFile->getTokens();
$phpReservedVars = array(
'_SERVER',
'_GET',
'_POST',
'_REQUEST',
'_SESSION',
'_ENV',
'_COOKIE',
'_FILES',
'GLOBALS',
);
if (preg_match_all('|[^\\\]\$([a-zA-Z0-9_]+)|', $tokens[$stackPtr]['content'], $matches) !== 0) {
foreach ($matches[1] as $varName) {
// If it's a php reserved var, then its ok.
if (in_array($varName, $phpReservedVars) === true) {
continue;
}
// There is no way for us to know if the var is public or private,
// so we have to ignore a leading underscore if there is one and just
// check the main part of the variable name.
$originalVarName = $varName;
if (substr($varName, 0, 1) === '_') {
if ($phpcsFile->hasCondition($stackPtr, array(T_CLASS, T_INTERFACE)) === true) {
$varName = substr($varName, 1);
}
}
if ($this->_isValidVar($varName) === false) {
$error = 'Variable "%s" is not in valid camel caps format';
$data = array($originalVarName);
$phpcsFile->addError($error, $stackPtr, 'StringVarNotCamelCaps', $data);
}
}
}
}
/**
* Check that a variable is a valid shape.
*
* Variables in FHComplete can either be $fooBar, $FooBar, $_fooBar, or $_FooBar.
*
* @param string $string The variable to check.
* @param boolea $public Whether or not the variable is public.
* @return boolean
*/
protected function _isValidVar($string, $public = true) {
$firstChar = '[a-zA-Z]';
if (!$public) {
$firstChar = '[_]{1,2}' . $firstChar;
}
if (preg_match("|^$firstChar|", $string) === 0) {
return false;
}
$firstStringCount = 1;
if (preg_match("|^__|", $string)) {
$firstStringCount = 2;
}
// Check that the name only contains legal characters.
$legalChars = 'a-zA-Z0-9';
if (preg_match("|[^$legalChars]|", substr($string, $firstStringCount)) > 0) {
return false;
}
return true;
}
}
@@ -0,0 +1,53 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Disallow short open tags
*
* But permit short-open echo tags (<?=) [T_OPEN_TAG_WITH_ECHO] as they are part of PHP 5.4+
*
*/
class FHComplete_Sniffs_PHP_DisallowShortOpenTagSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* If short open tags are NOT enabled, <? is not considered a T_OPEN_TAG
* So include T_INLINE_HTML which is what "<?" is detected as
*
* @return array
*/
public function register()
{
return array(
T_OPEN_TAG,
T_INLINE_HTML
);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$openTag = $tokens[$stackPtr];
if (trim($openTag['content']) === '<?') {
$error = 'Short PHP opening tag used; expected "<?php" but found "%s"';
$data = array(trim($openTag['content']));
$phpcsFile->addError($error, $stackPtr, 'Found', $data);
}
}
}
@@ -0,0 +1,74 @@
<?php
/**
* FHComplete
*/
/**
* Asserts that type casts are in the short form:
* - bool instead of boolean
* - int instead of integer
*/
class FHComplete_Sniffs_PHP_TypeCastingSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* Note, that this sniff only checks the value and casing of a cast.
* It does not check for whitespace issues regarding casts, as
* - Squiz.WhiteSpace.CastSpacing.ContainsWhiteSpace checks for whitespace in the cast
* - Generic.Formatting.NoSpaceAfterCast.SpaceFound checks for whitespace after the cast
*
* @return array
*/
public function register()
{
return array_merge(PHP_CodeSniffer_Tokens::$castTokens, array(T_BOOLEAN_NOT));
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// Process !! casts
if ($tokens[$stackPtr]['code'] == T_BOOLEAN_NOT) {
$nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if (!$nextToken) {
return;
}
if ($tokens[$nextToken]['code'] != T_BOOLEAN_NOT) {
return;
}
$error = 'Usage of !! cast is not allowed. Please use (bool) to cast.';
$phpcsFile->addError($error, $stackPtr, 'NotAllowed');
return;
}
// Only allow short forms if both short and long forms are possible
$matching = array(
'(boolean)' => '(bool)',
'(integer)' => '(int)',
);
$content = $tokens[$stackPtr]['content'];
$key = strtolower($content);
if (isset($matching[$key])) {
$error = 'Please use ' . $matching[$key] . ' instead of ' . $content . '.';
$phpcsFile->addError($error, $stackPtr, 'NotAllowed');
return;
}
if ($content !== $key) {
$error = 'Please use ' . $key . ' instead of ' . $content . '.';
$phpcsFile->addError($error, $stackPtr, 'NotAllowed');
return;
}
}
}
@@ -0,0 +1,48 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Makes sure there are spaces between the concatenation operator (.) and
* the strings being concatenated.
*
*/
class FHComplete_Sniffs_Strings_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_STRING_CONCAT);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if ($tokens[($stackPtr - 1)]['code'] == T_WHITESPACE) {
$message = 'Expected 0 spaces before ., but 1 found';
$phpcsFile->addError($message, $stackPtr, 'FoundBefore');
}
if ($tokens[($stackPtr + 1)]['code'] == ' ')
{
$message = 'Expected 0 spaces after ., but 1 found';
$phpcsFile->addError($message, $stackPtr, 'FoundAfter');
}
}
}
@@ -0,0 +1,54 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensures no whitespaces and one whitespace is placed around each comma
*
*/
class FHComplete_Sniffs_WhiteSpace_CommaSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_COMMA);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document.
* @param integer $stackPtr The position of the current token
* in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
if ($tokens[$next]['code'] !== T_WHITESPACE && ($next !== $stackPtr + 2)) {
// Last character in a line is ok.
if ($tokens[$next]['line'] === $tokens[$stackPtr]['line']) {
$error = 'Missing space after comma';
$phpcsFile->addError($error, $next);
}
}
$previous = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
if ($tokens[$previous]['code'] !== T_WHITESPACE && ($previous !== $stackPtr - 1)) {
$error = 'Space before comma, expected none, though';
$phpcsFile->addError($error, $next);
}
}
}
@@ -0,0 +1,53 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Checks the separation between methods in a class or interface.
*
*/
class FHComplete_Sniffs_WhiteSpace_FunctionCallSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(
T_ISSET,
T_EMPTY,
T_STRING,
);
}
/**
* Processes this sniff, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// Find the next non-empty token.
$openBracket = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);
if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {
// Not a function call.
return;
}
// Look for funcName (
if (($stackPtr + 1) !== $openBracket) {
$error = 'Space before opening parenthesis of function call not allowed';
$phpcsFile->addError($error, $stackPtr, 'SpaceBeforeOpenBracket');
}
}
}
@@ -0,0 +1,69 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Checks that there is one empty line before the closing brace of a function.
*
*/
class FHComplete_Sniffs_WhiteSpace_FunctionClosingBraceSpaceSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_FUNCTION);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token
* in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (isset($tokens[$stackPtr]['scope_closer']) === false) {
// Probably an interface method.
return;
}
$closeBrace = $tokens[$stackPtr]['scope_closer'];
$prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true);
$braceLine = $tokens[$closeBrace]['line'];
$prevLine = $tokens[$prevContent]['line'];
$found = ($braceLine - $prevLine - 1);
if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true
|| isset($tokens[$stackPtr]['nested_parenthesis']) === true
) {
// Nested function.
if ($found < 0) {
$error = 'Closing brace of nested function must be on a new line';
$phpcsFile->addError($error, $closeBrace, 'ContentBeforeClose');
} elseif ($found > 0) {
$error = 'Expected 0 blank lines before closing brace of nested function; %s found';
$data = array($found);
$phpcsFile->addError($error, $closeBrace, 'SpacingBeforeNestedClose', $data);
}
} else {
if ($found !== 0) {
$error = 'Expected 0 blank lines before closing function brace; %s found';
$data = array($found);
$phpcsFile->addError($error, $closeBrace, 'SpacingBeforeClose', $data);
}
}
}
}
@@ -0,0 +1,62 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Checks that there is no empty line after the opening brace of a function.
*
*/
class FHComplete_Sniffs_WhiteSpace_FunctionOpeningBraceSpaceSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_FUNCTION);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token
* in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (isset($tokens[$stackPtr]['scope_opener']) === false) {
// Probably an interface method.
return;
}
$openBrace = $tokens[$stackPtr]['scope_opener'];
$nextContent = $phpcsFile->findNext(T_WHITESPACE, ($openBrace + 1), null, true);
if ($nextContent === $tokens[$stackPtr]['scope_closer']) {
// The next bit of content is the closing brace, so this
// is an empty function and should have a blank line
// between the opening and closing braces.
return;
}
$braceLine = $tokens[$openBrace]['line'];
$nextLine = $tokens[$nextContent]['line'];
$found = ($nextLine - $braceLine - 1);
if ($found > 0) {
$error = 'Expected 0 blank lines after opening function brace; %s found';
$data = array($found);
$phpcsFile->addError($error, $openBrace, 'SpacingAfter', $data);
}
}
}
@@ -0,0 +1,129 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Checks the separation between methods in a class or interface.
*
*/
class FHComplete_Sniffs_WhiteSpace_FunctionSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_FUNCTION);
}
/**
* Processes this sniff, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
/*
Check the number of blank lines
after the function.
*/
if (isset($tokens[$stackPtr]['scope_closer']) === false) {
// Must be an interface method, so the closer is the semi-colon.
$closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr);
} else {
$closer = $tokens[$stackPtr]['scope_closer'];
}
// There needs to be 1 blank lines after the closer.
$nextLineToken = null;
for ($i = $closer; $i < $phpcsFile->numTokens; $i++) {
if (strpos($tokens[$i]['content'], $phpcsFile->eolChar) === false) {
continue;
} else {
$nextLineToken = ($i + 1);
break;
}
}
if ($nextLineToken === null) {
// Never found the next line, which means
// there are 0 blank lines after the function.
$foundLines = 0;
} else {
$nextContent = $phpcsFile->findNext(array(T_WHITESPACE), ($nextLineToken + 1), null, true);
if ($nextContent === false) {
// We are at the end of the file. That is acceptable as well.
$foundLines = 1;
} else {
$foundLines = ($tokens[$nextContent]['line'] - $tokens[$nextLineToken]['line']);
}
}
/*
Check the number of blank lines
before the function.
*/
$prevLineToken = null;
for ($i = $stackPtr; $i > 0; $i--) {
if (strpos($tokens[$i]['content'], $phpcsFile->eolChar) === false) {
continue;
} else {
$prevLineToken = $i;
break;
}
}
if ($prevLineToken === null) {
// Never found the previous line, which means
// there are 0 blank lines before the function.
$foundLines = 0;
} else {
$prevContent = $phpcsFile->findPrevious(array(T_WHITESPACE, T_DOC_COMMENT), $prevLineToken, null, true);
// Before we throw an error, check that we are not throwing an error
// for another function. We don't want to error for no blank lines after
// the previous function and no blank lines before this one as well.
$currentLine = $tokens[$stackPtr]['line'];
$prevLine = ($tokens[$prevContent]['line'] - 1);
$i = ($stackPtr - 1);
$foundLines = 0;
while ($currentLine !== $prevLine && $currentLine > 1 && $i > 0) {
if (isset($tokens[$i]['scope_condition']) === true) {
$scopeCondition = $tokens[$i]['scope_condition'];
if ($tokens[$scopeCondition]['code'] === T_FUNCTION) {
// Found a previous function.
return;
}
} elseif ($tokens[$i]['code'] === T_FUNCTION) {
// Found another interface function.
return;
}
$currentLine = $tokens[$i]['line'];
if ($currentLine === $prevLine) {
break;
}
if ($tokens[($i - 1)]['line'] < $currentLine && $tokens[($i + 1)]['line'] > $currentLine) {
// This token is on a line by itself. If it is whitespace, the line is empty.
if ($tokens[$i]['code'] === T_WHITESPACE) {
$foundLines++;
}
}
$i--;
}
}
}
}
@@ -0,0 +1,42 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Ensure there is no whitespace before a semicolon.
*
*/
class FHComplete_Sniffs_WhiteSpace_ObjectOperatorSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_OBJECT_OPERATOR);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param integer $stackPtr The position of the current token in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$nextType = $tokens[($stackPtr + 1)]['code'];
if (in_array($nextType, PHP_CodeSniffer_Tokens::$emptyTokens) === true) {
$error = 'Space found after object operator';
$phpcsFile->addError($error, $stackPtr, 'After');
}
}
}
@@ -0,0 +1,185 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Verifies that operators have valid spacing surrounding them.
*
*/
class FHComplete_Sniffs_WhiteSpace_OperatorSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
'JS',
);
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
$comparison = PHP_CodeSniffer_Tokens::$comparisonTokens;
$operators = PHP_CodeSniffer_Tokens::$operators;
$assignment = PHP_CodeSniffer_Tokens::$assignmentTokens;
return array_unique(array_merge($comparison, $operators, $assignment));
}
/**
* Processes this sniff, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The current file being checked.
* @param integer $stackPtr The position of the current token in the
* stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// Skip default values in function declarations.
if ($tokens[$stackPtr]['code'] === T_EQUAL
|| $tokens[$stackPtr]['code'] === T_MINUS
) {
if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
$parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']);
$bracket = array_pop($parenthesis);
if (isset($tokens[$bracket]['parenthesis_owner']) === true) {
$function = $tokens[$bracket]['parenthesis_owner'];
if ($tokens[$function]['code'] === T_FUNCTION) {
return;
}
}
}
}
if ($tokens[$stackPtr]['code'] === T_EQUAL) {
// Skip for '=&' case.
if (isset($tokens[($stackPtr + 1)]) === true && $tokens[($stackPtr + 1)]['code'] === T_BITWISE_AND) {
return;
}
}
if ($tokens[$stackPtr]['code'] === T_BITWISE_AND) {
// If its not a reference, then we expect one space either side of the
// bitwise operator.
if (!$phpcsFile->isReference($stackPtr) && !$this->isVariable($stackPtr, $tokens, $phpcsFile)) {
// Check there is one space before the & operator.
if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) {
$error = 'Expected 1 space before "&" operator; 0 found';
$phpcsFile->addError($error, $stackPtr, 'NoSpaceBeforeAmp');
}
// Check there is one space after the & operator.
if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
$error = 'Expected 1 space after "&" operator; 0 found';
$phpcsFile->addError($error, $stackPtr, 'NoSpaceAfterAmp');
}
}
} else {
if ($tokens[$stackPtr]['code'] === T_MINUS) {
// Skip declaration of negative value in new array format; eg. $arr = [-1].
if ($tokens[($stackPtr - 1)]['code'] === T_OPEN_SHORT_ARRAY) {
return;
}
// Check minus spacing, but make sure we aren't just assigning
// a minus value or returning one.
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
if ($tokens[$prev]['code'] === T_RETURN) {
// Just returning a negative value; eg. return -1.
return;
}
if (in_array($tokens[$prev]['code'], PHP_CodeSniffer_Tokens::$operators) === true) {
// Just trying to operate on a negative value; eg. ($var * -1).
return;
}
if (in_array($tokens[$prev]['code'], PHP_CodeSniffer_Tokens::$comparisonTokens) === true) {
// Just trying to compare a negative value; eg. ($var === -1).
return;
}
// A list of tokens that indicate that the token is not
// part of an arithmetic operation.
$invalidTokens = array(
T_COMMA,
T_OPEN_PARENTHESIS,
T_OPEN_SQUARE_BRACKET,
T_DOUBLE_ARROW,
T_COLON,
T_INLINE_THEN,
T_INLINE_ELSE,
T_CASE,
);
if (in_array($tokens[$prev]['code'], $invalidTokens) === true) {
// Just trying to use a negative value; eg. myFunction($var, -2).
return;
}
if (in_array($tokens[$prev]['code'], PHP_CodeSniffer_Tokens::$assignmentTokens) === true) {
// Just trying to assign a negative value; eg. ($var = -1).
return;
}
}
$operator = $tokens[$stackPtr]['content'];
if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) {
$error = "Expected 1 space before \"$operator\"; 0 found";
$phpcsFile->addError($error, $stackPtr, 'NoSpaceBefore');
}
if ($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) {
$error = "Expected 1 space after \"$operator\"; 0 found";
$phpcsFile->addError($error, $stackPtr, 'NoSpaceAfter');
}
}
}
/**
* Check if the current token is inside an array.
*
* @param int $stackPtr The current token offset.
* @param array $phpcsFile The current token list.
* @return bool
*/
protected function isVariable($stackPtr, $tokens, $phpcsFile)
{
$tokenAfter = $phpcsFile->findNext(
PHP_CodeSniffer_Tokens::$emptyTokens,
($stackPtr + 1),
null,
true
);
$tokenBefore = $phpcsFile->findNext(
PHP_CodeSniffer_Tokens::$emptyTokens,
($stackPtr - 1),
null,
true
);
if ($tokens[$tokenAfter]['code'] === T_VARIABLE &&
(
$tokens[$tokenBefore]['code'] === T_OPEN_PARENTHESIS ||
$tokens[$tokenBefore]['code'] === T_COMMA ||
$tokens[$tokenBefore]['code'] === T_OPEN_SHORT_ARRAY
)
) {
return true;
}
return false;
}
}
@@ -0,0 +1,280 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Checks that control structures are structured correctly, and their content
* is indented correctly. This sniff will throw errors if tabs are used
* for indentation rather than spaces.
*
*/
class FHComplete_Sniffs_WhiteSpace_ScopeIndentSniff implements PHP_CodeSniffer_Sniff
{
/**
* The number of spaces code should be indented.
*
* @var int
*/
public $indent = 1;
/**
* Does the indent need to be exactly right.
*
* If TRUE, indent needs to be exactly $ident spaces. If FALSE,
* indent needs to be at least $ident spaces (but can be more).
*
* @var bool
*/
public $exact = false;
/**
* Any scope openers that should not cause an indent.
*
* @var array(int)
*/
protected $nonIndentingScopes = array();
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return PHP_CodeSniffer_Tokens::$scopeOpeners;
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
// If this is an inline condition (ie. there is no scope opener), then
// return, as this is not a new scope.
if (isset($tokens[$stackPtr]['scope_opener']) === false) {
return;
}
if ($tokens[$stackPtr]['code'] === T_ELSE) {
$next = $phpcsFile->findNext(
PHP_CodeSniffer_Tokens::$emptyTokens,
($stackPtr + 1),
null,
true
);
// We will handle the T_IF token in another call to process.
if ($tokens[$next]['code'] === T_IF) {
return;
}
}
// Find the first token on this line.
$firstToken = $stackPtr;
for ($i = $stackPtr; $i >= 0; $i--) {
// Record the first code token on the line.
if (in_array($tokens[$i]['code'], PHP_CodeSniffer_Tokens::$emptyTokens) === false) {
$firstToken = $i;
}
// It's the start of the line, so we've found our first php token.
if ($tokens[$i]['column'] === 1) {
break;
}
}
// Based on the conditions that surround this token, determine the
// indent that we expect this current content to be.
$expectedIndent = $this->calculateExpectedIndent($tokens, $firstToken);
$scopeOpener = $tokens[$stackPtr]['scope_opener'];
$scopeCloser = $tokens[$stackPtr]['scope_closer'];
// Some scopes are expected not to have indents.
if (in_array($tokens[$firstToken]['code'], $this->nonIndentingScopes) === false) {
$indent = ($expectedIndent + $this->indent);
} else {
$indent = $expectedIndent;
}
$newline = false;
$commentOpen = false;
$inHereDoc = false;
// Only loop over the content beween the opening and closing brace, not
// the braces themselves.
for ($i = ($scopeOpener + 1); $i < $scopeCloser; $i++) {
// If this token is another scope, skip it as it will be handled by
// another call to this sniff.
if (in_array($tokens[$i]['code'], PHP_CodeSniffer_Tokens::$scopeOpeners) === true) {
if (isset($tokens[$i]['scope_opener']) === true) {
$i = $tokens[$i]['scope_closer'];
// If the scope closer is followed by a semi-colon, the semi-colon is part
// of the closer and should also be ignored. This most commonly happens with
// CASE statements that end with "break;", where we don't want to stop
// ignoring at the break, but rather at the semi-colon.
$nextToken = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($i + 1), null, true);
if ($tokens[$nextToken]['code'] === T_SEMICOLON) {
$i = $nextToken;
}
} else {
// If this token does not have a scope_opener indice, then
// it's probably an inline scope, so let's skip to the next
// semicolon. Inline scopes include inline if's, abstract
// methods etc.
$nextToken = $phpcsFile->findNext(T_SEMICOLON, $i, $scopeCloser);
if ($nextToken !== false) {
$i = $nextToken;
}
}
continue;
}
// If this is a HEREDOC then we need to ignore it as the
// whitespace before the contents within the HEREDOC are
// considered part of the content.
if ($tokens[$i]['code'] === T_START_HEREDOC) {
$inHereDoc = true;
continue;
} elseif ($inHereDoc === true) {
if ($tokens[$i]['code'] === T_END_HEREDOC) {
$inHereDoc = false;
}
continue;
}
if ($tokens[$i]['column'] === 1) {
// We started a newline.
$newline = true;
}
if ($newline === true && $tokens[$i]['code'] !== T_WHITESPACE) {
// If we started a newline and we find a token that is not
// whitespace, then this must be the first token on the line that
// must be indented.
$newline = false;
$firstToken = $i;
$column = $tokens[$firstToken]['column'];
// Special case for non-PHP code.
if ($tokens[$firstToken]['code'] === T_INLINE_HTML) {
$trimmedContentLength = strlen(ltrim($tokens[$firstToken]['content']));
if ($trimmedContentLength === 0) {
continue;
}
$contentLength = strlen($tokens[$firstToken]['content']);
$column = ($contentLength - $trimmedContentLength + 1);
}
// If we're starting a new PHP block that has the scope closer
// as the next token we'll skip the remaining checks as the scope is closed.
if ($tokens[$firstToken]['code'] === T_OPEN_TAG &&
$scopeCloser == $firstToken + 1
) {
continue;
}
// Check to see if this constant string spans multiple lines.
// If so, then make sure that the strings on lines other than the
// first line are indented appropriately, based on their whitespace.
if (in_array($tokens[$firstToken]['code'], PHP_CodeSniffer_Tokens::$stringTokens) === true) {
if (in_array($tokens[($firstToken - 1)]['code'], PHP_CodeSniffer_Tokens::$stringTokens) === true) {
// If we find a string that directly follows another string
// then its just a string that spans multiple lines, so we
// don't need to check for indenting.
continue;
}
}
// This is a special condition for T_DOC_COMMENT and C-style
// comments, which contain whitespace between each line.
$comments = array(
T_COMMENT,
T_DOC_COMMENT
);
$isDocComment = false;
if (in_array($tokens[$firstToken]['code'], $comments) === true) {
$content = trim($tokens[$firstToken]['content']);
if (preg_match('|^/\*|', $content) !== 0) {
// Check to see if the end of the comment is on the same line
// as the start of the comment. If it is, then we don't
// have to worry about opening a comment.
if (preg_match('|\*/$|', $content) === 0) {
// We don't have to calculate the column for the
// start of the comment as there is a whitespace
// token before it.
$commentOpen = true;
$isDocComment = (substr($content, 0, 3) === '/**');
}
} elseif ($commentOpen === true) {
if ($content === '') {
// We are in a comment, but this line has nothing on it
// so let's skip it.
continue;
}
$contentLength = strlen($tokens[$firstToken]['content']);
$trimmedContentLength = strlen(ltrim($tokens[$firstToken]['content']));
$column = ($contentLength - $trimmedContentLength + 1);
if (preg_match('|\*/$|', $content) !== 0) {
$commentOpen = false;
}
}
}
}
}
}
/**
* Calculates the expected indent of a token.
*
* @param array $tokens The stack of tokens for this file.
* @param int $stackPtr The position of the token to get indent for.
* @return int
*/
protected function calculateExpectedIndent(array $tokens, $stackPtr)
{
$conditionStack = array();
// Empty conditions array (top level structure).
if (empty($tokens[$stackPtr]['conditions']) === true) {
if (isset($tokens[$stackPtr]['nested_parenthesis']) === true
&& empty($tokens[$stackPtr]['nested_parenthesis']) === false
) {
// Wrapped in parenthesis means it is probably in a
// function call (like a closure) so we have to assume indent
// is correct here and someone else will check it more
// carefully in another sniff.
return $tokens[$stackPtr]['column'];
} else {
return 1;
}
}
$tokenConditions = $tokens[$stackPtr]['conditions'];
foreach ($tokenConditions as $id => $condition) {
// If it's an indenting scope ie. it's not in our array of
// scopes that don't indent, add it to our condition stack.
if (in_array($condition, $this->nonIndentingScopes) === false) {
$conditionStack[$id] = $condition;
}
}
return ((count($conditionStack) * $this->indent) + 1);
}
}
@@ -0,0 +1,63 @@
<?php
/**
* PHP Version 5
*
* FHComplete
*/
/**
* Check for any line starting with 2 spaces - which would indicate space indenting
* Also check for "\t " - a tab followed by a space, which is a common similar mistake
*
*/
class FHComplete_Sniffs_WhiteSpace_TabAndSpaceSniff implements PHP_CodeSniffer_Sniff
{
/**
* A list of tokenizers this sniff supports.
*
* @var array
*/
public $supportedTokenizers = array(
'PHP',
'JS',
'CSS'
);
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_WHITESPACE);
}
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$line = $tokens[$stackPtr]['line'];
if ($stackPtr > 0 && $tokens[($stackPtr - 1)]['line'] !== $line) {
return;
}
if (strpos($tokens[$stackPtr]['content'], " \t") !== false) {
$error = 'Space and tab found';
$phpcsFile->addError($error, $stackPtr);
}
if (strpos($tokens[$stackPtr]['content'], "\t ") !== false) {
$error = 'Tab and space found';
$phpcsFile->addError($error, $stackPtr);
}
}
}
+92
View File
@@ -0,0 +1,92 @@
<?xml version="1.0"?>
<ruleset name="FHComplete">
<description>FHComplete's coding standard</description>
<exclude-pattern>\.git</exclude-pattern>
<exclude-pattern>*/Config/*.ini.php</exclude-pattern>
<exclude-pattern>/*/tmp/</exclude-pattern>
<rule ref="PSR2">
<exclude name="PSR1.Classes.ClassDeclaration" />
<exclude name="PSR1.Methods.CamelCapsMethodName" />
<exclude name="PSR1.Files.SideEffects" />
<exclude name="Generic.WhiteSpace.DisallowTabIndent" />
<exclude name="Squiz.ControlStructures.ControlSignature" />
<exclude name="Generic.ControlStructures.InlineControlStructure" />
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="150"/>
</properties>
</rule>
<!--
Temporarily ignore until API docblock formatting and line length issues in core code are fixed.
<rule ref="FHComplete.Commenting.FunctionComment.ParamCommentNotCapital">
<severity>0</severity>
</rule>
<rule ref="FHComplete.Commenting.FunctionComment.ParamCommentFullStop">
<severity>0</severity>
</rule>
<rule ref="FHComplete.Commenting.FunctionComment.ThrowsNotCapital">
<severity>0</severity>
</rule>
<rule ref="FHComplete.Commenting.FunctionComment.ThrowsNoFullStop">
<severity>0</severity>
</rule>
<rule ref="FHComplete.Commenting.FunctionComment.EmptyThrows">
<severity>0</severity>
</rule>
-->
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
<rule ref="Generic.Commenting.Todo"/>
<!--
We allow EOL after closing braces
-->
<rule ref="FHComplete.ControlStructures.ControlSignature"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<!-- Relax some src/* and tests/* rules -->
<rule ref="Squiz.Classes.ValidClassName">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="FHComplete.Commenting.FunctionComment">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- All rules in ./Sniffs are included automatically -->
</ruleset>
@@ -0,0 +1,67 @@
<?php
/**
* FHCompleteStandardTest
*/
class FHCompleteStandardTest extends PHPUnit_Framework_TestCase {
public function setUp() {
parent::setUp();
if (empty($this->helper)) {
$this->helper = new TestHelper();
}
}
/**
* testFiles
*
* Run simple syntax checks, if the filename ends with pass.php - expect it to pass
*/
public static function testProvider() {
$tests = array();
$standard = dirname(dirname(__FILE__));
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/files'));
foreach ($iterator as $dir) {
if ($dir->isDir()) {
continue;
}
$file = $dir->getPathname();
$expectPass = (substr($file, -8) === 'pass.php');
$tests[] = array(
$file,
$standard,
$expectPass
);
}
return $tests;
}
/**
* _testFile
*
* @dataProvider testProvider
*
* @param string $file
* @param string $standard
* @param boolean $expectPass
*/
public function testFile($file, $standard, $expectPass) {
$outputStr = $this->helper->runPhpCs($file);
if ($expectPass) {
$this->assertNotRegExp(
"/FOUND \d+ ERROR/",
$outputStr,
basename($file) . ' - expected to pass with no errors, some were reported. '
);
} else {
$this->assertRegExp(
"/FOUND \d+ ERROR/",
$outputStr,
basename($file) . ' - expected failures, none reported. '
);
}
}
}
@@ -0,0 +1,54 @@
<?php
if (!class_exists('PHP_CodeSniffer_CLI')) {
$composerInstall = dirname(dirname(dirname(__FILE__))) . '/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php';
if (file_exists($composerInstall)) {
require_once $composerInstall;
} else {
require_once 'PHP/CodeSniffer/CLI.php';
}
}
class TestHelper {
protected $_phpcs;
public function __construct() {
$this->_phpcs = new PHP_CodeSniffer_CLI();
}
/**
* Run PHPCS on a file.
*
* @param string $file to run.
* @return string The output from phpcs.
*/
public function runPhpCs($file) {
$defaults = $this->_phpcs->getDefaults();
$standard = dirname(__FILE__) . '/ruleset.xml';
if (
defined('PHP_CodeSniffer::VERSION') &&
version_compare(PHP_CodeSniffer::VERSION, '1.5.0') != -1
) {
$standard = array($standard);
}
$options = array(
'encoding' => 'utf-8',
'files' => array($file),
'standard' => $standard,
'showSources' => true,
) + $defaults;
// New PHPCS has a strange issue where the method arguments
// are not stored on the instance causing weird errors.
$reflection = new ReflectionProperty($this->_phpcs, 'values');
$reflection->setAccessible(true);
$reflection->setValue($this->_phpcs, $options);
ob_start();
$this->_phpcs->process($options);
$result = ob_get_contents();
ob_end_clean();
return $result;
}
}
@@ -0,0 +1,2 @@
<?php
require_once dirname(__FILE__) . '/TestHelper.php';
@@ -0,0 +1,36 @@
<?php
namespace FHComplete;
use Other\Crap;
use Other\Error as OtherError;
class Throws
{
/**
* Test throws
*
* @throws Exception An expection happened.
* @throws FHComplete\Boom A boom went off.
* @throws FHComplete\Error\Boom Oh, shucks, another boom.
* @throws Other\Crap Oh boy.
* @throws Other\Error\Issue A missing tissue for your PSR-2 issues.
* @return void
*/
public function test()
{
switch ($a) {
case 1:
throw new Boom();
case 2:
throw new Error\Boom();
case 3:
throw new OtherError\Issue();
case 4:
throw new Crap();
default:
throw new \Exception();
}
}
}
@@ -0,0 +1,4 @@
<?php
trait Foo {
}
@@ -0,0 +1,4 @@
<?php
class NiceClass1 extends Object{
}
@@ -0,0 +1,4 @@
<?php
class NiceClass1 extends Object {
}
@@ -0,0 +1,5 @@
<?php
class NiceClass3 implements Object, Object2
{
}
@@ -0,0 +1,18 @@
<?php
namespace FHC;
class ClassWithUndercore extends Object
{
protected $_someProp;
/**
* [_someFunc description]
*
* @return void
*/
protected function _someFunc()
{
// code here
}
}
@@ -0,0 +1,19 @@
<?php
for ($i = 0; $i < 10; $i++) {
echo 'hello';
}
if ($i < 10) {
echo 'hello2';
} elseif ($i > 100) {
echo 'i > 100';
}
while (false) {
echo 'false';
}
do {
echo 'dowhile test';
} while (false);
@@ -0,0 +1,6 @@
<?php
do
echo 'dowhile test';
while (false);
@@ -0,0 +1,6 @@
<?php
if (isset($a)) {
echo 'a isset';
} else if (isset($b)) {
echo 'b isset';
}

Some files were not shown because too many files have changed in this diff Show More