Skip to content

Commit 6faa87d

Browse files
committed
Travis fixes
1 parent ff53cda commit 6faa87d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4037
-1467
lines changed

.travis.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
language: php
2+
3+
php:
4+
- '5.5'
5+
- '5.6'
6+
- '7.0'
7+
- hhvm
8+
- nightly
9+
10+
install:
11+
- composer install
12+
13+
env:
14+
- DB=mysql
15+
- DB=pgsql POSTGRESQL_VERSION=9.1
16+
- DB=pgsql POSTGRESQL_VERSION=9.2
17+
- DB=pgsql POSTGRESQL_VERSION=9.3
18+
- DB=pgsql POSTGRESQL_VERSION=9.4
19+
20+
before_script:
21+
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database qcubed;'; mysql -u root qcubed < test/db/mysql_innodb.sql; fi"
22+
- sh -c "if [ '$DB' = 'pgsql' ]; then createdb qcubed -U postgres; psql -d qcubed -f test/db/pgsql.sql -U postgres; fi"
23+
24+
script:
25+
- ./vendor/bin/phpunit -c ./test/phpunit.xml --coverage-clover ./build/logs/clover.xml
26+
27+
# code coverage
28+
addons:
29+
code_climate:
30+
repo_token: 814dfe2ee0ae6198e43e566e32ab85f40379b5abe06cd52b1f6a24e92b5de883
31+
32+
# code coverage
33+
after_script:
34+
- vendor/bin/test-reporter
35+
36+
sudo: false
37+
38+
matrix:
39+
exclude:
40+
- php: hhvm
41+
env: DB=pgsql POSTGRESQL_VERSION=9.1 # driver currently unsupported by HHVM
42+
- php: hhvm
43+
env: DB=pgsql POSTGRESQL_VERSION=9.2 # driver currently unsupported by HHVM
44+
- php: hhvm
45+
env: DB=pgsql POSTGRESQL_VERSION=9.3 # driver currently unsupported by HHVM
46+
- php: hhvm
47+
env: DB=pgsql POSTGRESQL_VERSION=9.4 # driver currently unsupported by HHVM
48+

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Shannon
3+
Copyright (c) 2017 Shannon Pekary [email protected]
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# qcubed-orm
1+
# QCubed Orm
22
QCubed Standalone ORM

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2+
"repositories": [
3+
{
4+
"type": "vcs",
5+
"url": "https://github.com/qcubed/common"
6+
}
7+
],
8+
29
"name": "qcubed/orm",
310
"description": "Database drivers, query support, and code generator for the object relational model for QCubed",
411
"keywords": ["php", "database", "orm"],
@@ -12,14 +19,14 @@
1219
},
1320
"require": {
1421
"php": ">=5.5.0",
15-
"qcubed/common": "^4.0"
22+
"qcubed/common": "dev-master"
23+
},
24+
"require-dev" : {
25+
"phpunit/phpunit": "~4.8|~5.0"
1626
},
1727
"autoload": {
1828
"psr-4": {
19-
"QCubed\\Database": "src/Database",
20-
"QCubed\\Query": "src/Query",
21-
"QCubed\\Codegen": "src/Codegen"
22-
29+
"QCubed\\": "src/"
2330
}
2431
}
2532
}

install/project/includes/Codegen.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* QCodeGen
3+
* CodeGen
44
*
55
* Overrides the Codegen\AbstractBase class.
66
*
@@ -29,14 +29,14 @@ public function __construct($objSettingsXml) {
2929
// find a particular template file. Template files found lower down in the order will override the previous ones.
3030
static::$TemplatePaths = array (
3131
__QCUBED_CORE__ . '/codegen/templates/',
32-
__QCUBED__ . '/codegen/templates/'
32+
__INCLUDES__ . '/codegen/templates/'
3333
);
3434
}
3535

3636
/**
37-
* QCodeGen::Pluralize()
37+
* Pluralize()
3838
*
39-
* Example: Overriding the Pluralize method
39+
* An example of overriding the Pluralize method to implement custom plural word forms.
4040
*
4141
* @param string $strName
4242
* @return string
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
<?php
22
require(__MODEL_GEN__ . '/QQN.class.php');
3-
require(__MODEL_GEN__ . '/_class_pathis.inc.php');
4-
require(__MODEL_GEN__ . '/_type_class_pathis.inc.php');
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* CodeGen
4+
*
5+
* Overrides the Codegen\AbstractBase class.
6+
*
7+
* Feel free to override any of those methods here to customize your code generation.
8+
*
9+
*/
10+
11+
/**
12+
* Class Codegen
13+
*
14+
* Overrides the default codegen class. Override and implement any functions here to customize the code generation process.
15+
* @package Project
16+
* @was CodeGen
17+
*/
18+
class Codegen extends \QCubed\Codegen\AbstractBase {
19+
20+
/**
21+
* Construct the CodeGen object.
22+
*
23+
* Gives you an opportunity to read your xml file and make codegen changes accordingly.
24+
*/
25+
public function __construct($objSettingsXml) {
26+
// Specify the paths to your template files here. These paths will be searched in the order declared, to
27+
// find a particular template file. Template files found lower down in the order will override the previous ones.
28+
static::$TemplatePaths = array (
29+
__QCUBED_CORE__ . '/../../orm/templates/',
30+
__DIR__ . '/templates/'
31+
);
32+
}
33+
34+
/**
35+
* CodeGen::Pluralize()
36+
*
37+
* Example: Overriding the Pluralize method
38+
*
39+
* @param string $strName
40+
* @return string
41+
*/
42+
protected function Pluralize($strName) {
43+
// Special Rules go Here
44+
switch (true) {
45+
case ($strName == 'person'):
46+
return 'people';
47+
case ($strName == 'Person'):
48+
return 'People';
49+
case ($strName == 'PERSON'):
50+
return 'PEOPLE';
51+
52+
// Trying to be cute here...
53+
case (strtolower($strName) == 'fish'):
54+
return $strName . 'ies';
55+
56+
// Otherwise, call parent
57+
default:
58+
return parent::Pluralize($strName);
59+
}
60+
}
61+
}
62+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# About `codegen` directory
2+
3+
The codegen-related class in this directory allow you to override
4+
the functionality of the codegen operation.
5+
6+
Feel free to make any changes to these customizations as you wish.
7+
8+
NOTE: the templates subdirectory is available for you to place customizations to the templates
9+
and subtemplates themselves. Read the README.md file in templates/ to find out more.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# About `templates` directory
2+
3+
This directory is for customizations and additions of the QCubed Codegen
4+
Templates and Subtemplates. If there are any template files in this directory which have the
5+
same name as a template or subtemplate file in `/includes/qcubed/_core/codegen/templates`, then the
6+
file in this directory will be used *instead* of the one there.
7+
8+
If there are any template files in this directory in *addition* to the ones in
9+
`/includes/qcubed/_core/codegen/templates`, these additional template files will be
10+
processed as well.
11+
12+
Feel free to add as you wish. Just remember the naming structure for CodeGen
13+
template files:
14+
15+
`/includes/qcubed/_core/codegen/templates/[TYPE]/[MODULE]/[FILE]`
16+
17+
Where `[TYPE]` is the object being generated, for example:
18+
* db_orm
19+
* db_type
20+
21+
And `[MODULE]` is the category of file being generated, for example:
22+
* **class_gen** - templates and subtemplates for the Data Class Gen file
23+
* **class_subclass** - templates and subtemplates for the Data Class customizable subclass
24+
* **drafts** - templates and subtemplates for all things with regards to draft forms/panels
25+
* **model_connector** - templates and subtemplates for the ModelConnector
26+
* **datagrid_connector** - templates and subtemplates for the datagrid connector
27+
28+
And `[FILE]` is the filename of the template or subtemplate, itself.
29+
Note that any file with a "_" prefix is considered a template and will
30+
be processed by the code generator. All other files are considered
31+
subtemplates, and are only processed if envoked by a template.

install/project/includes/configuration/README.md

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,12 @@ configuration of your application, including any global defines that are particu
1616
See the inline documentation in configuration.sample.inc.php for more information.
1717

1818

19-
20-
### prepend.inc.php
21-
22-
This is the top-level include file for any and all PHP scripts which use
23-
Qcubed. Global, application-wide loaders, settings, etc. are in this file.
24-
25-
Feel free to make modifications/changes/additions to this file as you wish.
26-
Note that the QApplication class is defined in prepend.inc as well. Feel free
27-
to make changes, override methods, or add functionality to QApplication as
28-
needed.
29-
30-
See the inline documentation in prepend.inc.php for more information.
31-
32-
3319
### codegen_settings.xml
3420

3521
This file controls overall settings for parts of the code generation. Feel free
3622
to change these as needed.
3723

3824

39-
### codegen_options.json
40-
41-
This file is created and maintained by the ModelConnectorEditor. It has options for
42-
the individual controls that correspond to fields in your database. There may be times
43-
that you need to directly edit this file, and you should feel free to do so.
44-
4525
## Codegen Notes
4626

4727
QCubed is set up to generate a default set of objects and forms to get you started with your application.
@@ -53,52 +33,9 @@ separate out your hand written code from the generated code, and continue to twe
5333
The codegen process starts at the QCubed start screen by clicking on the codegen link.
5434
PHP is executed to generate the files. Therefore, the target directories for codegen will need to be writable by the web server process.
5535

56-
The codegen process works by instantiating a QCodeGen object. This object then looks in the template directories and begins
36+
The codegen process works by instantiating a CodeGen object. This object then looks in the template directories and begins
5737
to include the php files there that start with an underscore (_). These templates then include other files, which in turn
5838
may include other template files. This combination will eventually generate the forms, model connectors, and data table
5939
interface classes that you will base your application on.
6040

6141

62-
## Model Connectors
63-
Model Connectors are helper classes that have methods which connect form controls to columns in SQLn data tables. Each column
64-
in the data table corresponds to a control that is generated in a model connector class. Your form object calls methods
65-
in the model connector to get copies of the controls and then to place them in the form.
66-
67-
To customize the generated controls, you have the following choices:
68-
- Use the ModelConnectorEditor (see the example on this), to set specific options on each control.
69-
- Create your own code generating templates and place them in your project/includes/codegen/templates directory. Its best
70-
to do this by copying the corresponding file in the qcubed/qcubed/includes/codegen/templates directory and then
71-
editing the file and placing it in the corresponding location in the above project directory. The project directory
72-
files will override the files in the vendor directory.
73-
- Override the generated code by editing the model connectors in your project/includes/connector directory.
74-
75-
76-
### Version 3
77-
78-
QCubed Version 3 introduces the concept of having the controls themselves create the code to interact with the database
79-
for the ModelConnector, rather than the templates. Coupled with this is the ModelConnectorEditDlg dialog, which lets you
80-
right click on a control and edit many of the controls options. These changes get embedded into the generated ModelConnector.
81-
You can see a description of each option by hovering over the item in the dialog.
82-
83-
These new features give the developer the ability to do the following:
84-
- Override the default control type to specify a particular control type
85-
- Allow custom controls and plugins to generate their own model connector code and have that code automatically be used
86-
instead of the default code just by specifying that control in the comments of a column.
87-
- Allow subclasses of standard controls to override the code generation methods to generate different code.
88-
- Specify additional overrides to control many aspects of control creation in the generated model connector.
89-
90-
## Notes for Upgrading from version 2
91-
92-
Many of the problems that caused programmers to create their own templates are now solvable through the new Options
93-
feature available through Comments. However, you are still free to override the templates as needed. In fact, this new
94-
feature is implemented entirely through the templates, so if you want to keep your old templates, simply replace the new
95-
templates with the old ones from version 2.
96-
97-
QLabel no longer accepts a strFormat parameter at create time. You can always set it using the ->Format parameter after
98-
creating the control, or specify this in an override in a Comment option.
99-
100-
101-
102-
103-
104-

0 commit comments

Comments
 (0)