Skip to content

Commit fa5d74b

Browse files
committed
Release 1.0.0
1 parent 8af9717 commit fa5d74b

File tree

13 files changed

+716
-341
lines changed

13 files changed

+716
-341
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = false
5+
6+
[*]
7+
indent_style = tab
8+
indent_size = 2
9+
charset = "utf-8"
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.yml]
15+
indent_style = space
16+
indent_size = 2

.semver

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
:major: 1
3+
:minor: 0
4+
:patch: 0
5+
:special: ''

.travis.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,38 @@ language: php
22

33
php:
44
- 5.3
5+
- 5.4
6+
- 5.5
57

68
env:
7-
- CAKE_VERSION=master DB=mysql
9+
global:
10+
- REPO_NAME=upload
11+
- PLUGIN_NAME=Upload
12+
matrix:
13+
- DB=mysql CAKE_VERSION=master
14+
- DB=mysql CAKE_VERSION=2.5
15+
16+
matrix:
17+
include:
18+
- php: 5.4
19+
env:
20+
- DB=mysql CAKE_VERSION=master COVERALLS=1
21+
- php: 5.4
22+
env:
23+
- DB=mysql CAKE_VERSION=master PHPCS=1
824

925
before_script:
10-
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
11-
- git clone --depth 1 git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
12-
- cp -R ../upload app/Plugin/Upload
13-
- echo "<?php
14-
class DATABASE_CONFIG {
15-
public \$default = array(
16-
'datasource' => 'Database/Mysql',
17-
'persistent' => false,
18-
'host' => '0.0.0.0',
19-
'login' => 'root',
20-
'password' => '',
21-
'database' => 'cakephp_test',
22-
'prefix' => ''
23-
);
24-
public \$test = array(
25-
'datasource' => 'Database/Mysql',
26-
'persistent' => false,
27-
'host' => '0.0.0.0',
28-
'login' => 'root',
29-
'password' => '',
30-
'database' => 'cakephp_test',
31-
'prefix' => '',
32-
'encoding' => 'utf8'
33-
);
34-
}" > ./app/Config/database.php
26+
- cd ..
27+
- git clone git://github.com/cakephp/cakephp.git --branch $CAKE_VERSION --depth 1
28+
- cd cakephp/app
29+
- git clone https://github.com/FriendsOfCake/travis.git
30+
- ./travis/before_script.sh
3531

3632
script:
37-
- ./app/Console/cake test Upload Model/Behavior/Upload
33+
- ./travis/script.sh
34+
35+
after_success:
36+
- ./travis/after_success.sh
37+
38+
notifications:
39+
email: false

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# How to contribute
2+
3+
Upload loves to welcome your contributions. There are several ways to help out:
4+
* Create a ticket in GitHub, if you have found a bug
5+
* Write testcases for open bug tickets
6+
* Write patches for open bug/feature tickets, preferably with testcases included
7+
* Contribute to the [documentation](https://github.com/josegonzalez/upload/tree/gh-pages)
8+
9+
There are a few guidelines that we need contributors to follow so that we have a
10+
chance of keeping on top of things.
11+
12+
## Getting Started
13+
14+
* Make sure you have a [GitHub account](https://github.com/signup/free)
15+
* Submit a ticket for your issue, assuming one does not already exist.
16+
* Clearly describe the issue including steps to reproduce when it is a bug.
17+
* Make sure you fill in the earliest version that you know has the issue.
18+
* Fork the repository on GitHub.
19+
20+
## Making Changes
21+
22+
* Create a topic branch from where you want to base your work.
23+
* This is usually the develop branch
24+
* To quickly create a topic branch based on master; `git branch
25+
master/my_contribution master` then checkout the new branch with `git
26+
checkout master/my_contribution`. Better avoid working directly on the
27+
`master` branch, to avoid conflicts if you pull in updates from origin.
28+
* Make commits of logical units.
29+
* Check for unnecessary whitespace with `git diff --check` before committing.
30+
* Use descriptive commit messages and reference the #ticket number
31+
* Core testcases should continue to pass. You can run tests locally or enable
32+
[travis-ci](https://travis-ci.org/) for your fork, so all tests and codesniffs
33+
will be executed.
34+
* Your work should apply the CakePHP coding standards.
35+
36+
## Which branch to base the work
37+
38+
* Bugfix branches will be based on develop branch.
39+
* New features that are backwards compatible will be based on develop branch
40+
* New features or other non-BC changes will go in the next major release branch.
41+
42+
## Submitting Changes
43+
44+
* Push your changes to a topic branch in your fork of the repository.
45+
* Submit a pull request to the repository with the correct target branch.
46+
47+
## Testcases and codesniffer
48+
49+
Upload tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/installation.html)
50+
3.5 or higher. To run the testcases locally use the following command:
51+
52+
./lib/Cake/Console/cake test Upload AllUpload
53+
54+
To run the sniffs for CakePHP coding standards
55+
56+
phpcs -p --extensions=php --standard=CakePHP ./app/Plugin/Upload
57+
58+
Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer)
59+
repository to setup the CakePHP standard. The README contains installation info
60+
for the sniff and phpcs.
61+
62+
63+
# Additional Resources
64+
65+
* [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html)
66+
* [Bug tracker](https://github.com/josegonzalez/upload/issues)
67+
* [General GitHub documentation](https://help.github.com/)
68+
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
69+
* #cakephp IRC channel on freenode.org

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2010 Jose Diaz-Gonzalez
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
22
App::uses('UploadBehavior', 'Upload.Model/Behavior');
33

4-
class FileGrabberBehavior extends UploadBehavior {}
4+
class FileGrabberBehavior extends UploadBehavior {
5+
6+
}

Model/Behavior/FileImportBehavior.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
App::uses('UploadBehavior', 'Upload.Model/Behavior');
33
class FileImportBehavior extends UploadBehavior {
44

5-
function handleUploadedFile($modelAlias, $field, $tmp, $filePath) {
5+
public function handleUploadedFile($modelAlias, $field, $tmp, $filePath) {
66
return !rename($tmp, $filePath);
77
}
88

9-
}
9+
}

0 commit comments

Comments
 (0)