Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Sep 20, 2013
1 parent 8af9717 commit fa5d74b
Show file tree
Hide file tree
Showing 13 changed files with 716 additions and 341 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = false

[*]
indent_style = tab
indent_size = 2
charset = "utf-8"
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
indent_style = space
indent_size = 2
5 changes: 5 additions & 0 deletions .semver
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
:major: 1
:minor: 0
:patch: 0
:special: ''
56 changes: 29 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@ language: php

php:
- 5.3
- 5.4
- 5.5

env:
- CAKE_VERSION=master DB=mysql
global:
- REPO_NAME=upload
- PLUGIN_NAME=Upload
matrix:
- DB=mysql CAKE_VERSION=master
- DB=mysql CAKE_VERSION=2.5

matrix:
include:
- php: 5.4
env:
- DB=mysql CAKE_VERSION=master COVERALLS=1
- php: 5.4
env:
- DB=mysql CAKE_VERSION=master PHPCS=1

before_script:
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
- git clone --depth 1 git://github.com/cakephp/cakephp ../cakephp && cd ../cakephp && git checkout $CAKE_VERSION
- cp -R ../upload app/Plugin/Upload
- echo "<?php
class DATABASE_CONFIG {
public \$default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '0.0.0.0',
'login' => 'root',
'password' => '',
'database' => 'cakephp_test',
'prefix' => ''
);
public \$test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '0.0.0.0',
'login' => 'root',
'password' => '',
'database' => 'cakephp_test',
'prefix' => '',
'encoding' => 'utf8'
);
}" > ./app/Config/database.php
- cd ..
- git clone git://github.com/cakephp/cakephp.git --branch $CAKE_VERSION --depth 1
- cd cakephp/app
- git clone https://github.com/FriendsOfCake/travis.git
- ./travis/before_script.sh

script:
- ./app/Console/cake test Upload Model/Behavior/Upload
- ./travis/script.sh

after_success:
- ./travis/after_success.sh

notifications:
email: false
69 changes: 69 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# How to contribute

Upload loves to welcome your contributions. There are several ways to help out:
* Create a ticket in GitHub, if you have found a bug
* Write testcases for open bug tickets
* Write patches for open bug/feature tickets, preferably with testcases included
* Contribute to the [documentation](https://github.com/josegonzalez/upload/tree/gh-pages)

There are a few guidelines that we need contributors to follow so that we have a
chance of keeping on top of things.

## Getting Started

* Make sure you have a [GitHub account](https://github.com/signup/free)
* Submit a ticket for your issue, assuming one does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Make sure you fill in the earliest version that you know has the issue.
* Fork the repository on GitHub.

## Making Changes

* Create a topic branch from where you want to base your work.
* This is usually the develop branch
* To quickly create a topic branch based on master; `git branch
master/my_contribution master` then checkout the new branch with `git
checkout master/my_contribution`. Better avoid working directly on the
`master` branch, to avoid conflicts if you pull in updates from origin.
* Make commits of logical units.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Use descriptive commit messages and reference the #ticket number
* Core testcases should continue to pass. You can run tests locally or enable
[travis-ci](https://travis-ci.org/) for your fork, so all tests and codesniffs
will be executed.
* Your work should apply the CakePHP coding standards.

## Which branch to base the work

* Bugfix branches will be based on develop branch.
* New features that are backwards compatible will be based on develop branch
* New features or other non-BC changes will go in the next major release branch.

## Submitting Changes

* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the repository with the correct target branch.

## Testcases and codesniffer

Upload tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/installation.html)
3.5 or higher. To run the testcases locally use the following command:

./lib/Cake/Console/cake test Upload AllUpload

To run the sniffs for CakePHP coding standards

phpcs -p --extensions=php --standard=CakePHP ./app/Plugin/Upload

Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer)
repository to setup the CakePHP standard. The README contains installation info
for the sniff and phpcs.


# Additional Resources

* [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html)
* [Bug tracker](https://github.com/josegonzalez/upload/issues)
* [General GitHub documentation](https://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
* #cakephp IRC channel on freenode.org
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2010 Jose Diaz-Gonzalez

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.
4 changes: 3 additions & 1 deletion Model/Behavior/FileGrabberBehavior.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
App::uses('UploadBehavior', 'Upload.Model/Behavior');

class FileGrabberBehavior extends UploadBehavior {}
class FileGrabberBehavior extends UploadBehavior {

}
4 changes: 2 additions & 2 deletions Model/Behavior/FileImportBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
App::uses('UploadBehavior', 'Upload.Model/Behavior');
class FileImportBehavior extends UploadBehavior {

function handleUploadedFile($modelAlias, $field, $tmp, $filePath) {
public function handleUploadedFile($modelAlias, $field, $tmp, $filePath) {
return !rename($tmp, $filePath);
}

}
}
Loading

0 comments on commit fa5d74b

Please sign in to comment.