diff --git a/.gitignore b/.gitignore index 89fc2a8..832a890 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ nbproject .settings # windows thumbnail cache -Thumbs.db \ No newline at end of file +Thumbs.db + +# composer vendor dir +/yii/vendor \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e4b8278 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: php + +php: + - 5.3 + - 5.4 + - 5.5 + +env: + - DB=mysql + +before_script: + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS yiitest;'; fi" + +script: phpunit \ No newline at end of file diff --git a/app/index.php b/app/index.php deleted file mode 100644 index 8f98090..0000000 --- a/app/index.php +++ /dev/null @@ -1,9 +0,0 @@ -run(); diff --git a/app/assets/.gitignore b/apps/bootstrap/assets/.gitignore similarity index 100% rename from app/assets/.gitignore rename to apps/bootstrap/assets/.gitignore diff --git a/app/css/bootstrap-responsive.css b/apps/bootstrap/css/bootstrap-responsive.css similarity index 100% rename from app/css/bootstrap-responsive.css rename to apps/bootstrap/css/bootstrap-responsive.css diff --git a/app/css/bootstrap-responsive.min.css b/apps/bootstrap/css/bootstrap-responsive.min.css similarity index 100% rename from app/css/bootstrap-responsive.min.css rename to apps/bootstrap/css/bootstrap-responsive.min.css diff --git a/app/css/bootstrap.css b/apps/bootstrap/css/bootstrap.css similarity index 100% rename from app/css/bootstrap.css rename to apps/bootstrap/css/bootstrap.css diff --git a/app/css/bootstrap.min.css b/apps/bootstrap/css/bootstrap.min.css similarity index 100% rename from app/css/bootstrap.min.css rename to apps/bootstrap/css/bootstrap.min.css diff --git a/app/css/site.css b/apps/bootstrap/css/site.css similarity index 100% rename from app/css/site.css rename to apps/bootstrap/css/site.css diff --git a/app/img/glyphicons-halflings-white.png b/apps/bootstrap/img/glyphicons-halflings-white.png similarity index 100% rename from app/img/glyphicons-halflings-white.png rename to apps/bootstrap/img/glyphicons-halflings-white.png diff --git a/app/img/glyphicons-halflings.png b/apps/bootstrap/img/glyphicons-halflings.png similarity index 100% rename from app/img/glyphicons-halflings.png rename to apps/bootstrap/img/glyphicons-halflings.png diff --git a/apps/bootstrap/index.php b/apps/bootstrap/index.php new file mode 100644 index 0000000..a0488ca --- /dev/null +++ b/apps/bootstrap/index.php @@ -0,0 +1,14 @@ +run(); diff --git a/app/js/bootstrap.js b/apps/bootstrap/js/bootstrap.js similarity index 100% rename from app/js/bootstrap.js rename to apps/bootstrap/js/bootstrap.js diff --git a/app/js/bootstrap.min.js b/apps/bootstrap/js/bootstrap.min.js similarity index 100% rename from app/js/bootstrap.min.js rename to apps/bootstrap/js/bootstrap.min.js diff --git a/app/protected/.htaccess b/apps/bootstrap/protected/.htaccess similarity index 100% rename from app/protected/.htaccess rename to apps/bootstrap/protected/.htaccess diff --git a/app/protected/config/assets.php b/apps/bootstrap/protected/config/assets.php similarity index 98% rename from app/protected/config/assets.php rename to apps/bootstrap/protected/config/assets.php index 6602a6e..a3ba847 100644 --- a/app/protected/config/assets.php +++ b/apps/bootstrap/protected/config/assets.php @@ -16,4 +16,4 @@ return array( 'yii', ), ), -); \ No newline at end of file +); diff --git a/app/protected/config/main.php b/apps/bootstrap/protected/config/main.php similarity index 56% rename from app/protected/config/main.php rename to apps/bootstrap/protected/config/main.php index b982506..f19dead 100644 --- a/app/protected/config/main.php +++ b/apps/bootstrap/protected/config/main.php @@ -3,6 +3,12 @@ return array( 'id' => 'hello', 'basePath' => dirname(__DIR__), + 'preload' => array('log'), + 'modules' => array( + 'debug' => array( + 'class' => 'yii\debug\Module', + ) + ), 'components' => array( 'cache' => array( 'class' => 'yii\caching\FileCache', @@ -14,8 +20,17 @@ return array( 'assetManager' => array( 'bundles' => require(__DIR__ . '/assets.php'), ), + 'log' => array( + 'class' => 'yii\logging\Router', + 'targets' => array( + 'file' => array( + 'class' => 'yii\logging\FileTarget', + 'levels' => array('error', 'warning'), + ), + ), + ), ), 'params' => array( 'adminEmail' => 'admin@example.com', ), -); \ No newline at end of file +); diff --git a/app/protected/controllers/SiteController.php b/apps/bootstrap/protected/controllers/SiteController.php similarity index 88% rename from app/protected/controllers/SiteController.php rename to apps/bootstrap/protected/controllers/SiteController.php index 7e6bb15..b06ed06 100644 --- a/app/protected/controllers/SiteController.php +++ b/apps/bootstrap/protected/controllers/SiteController.php @@ -6,6 +6,15 @@ use app\models\ContactForm; class SiteController extends Controller { + public function actions() + { + return array( + 'captcha' => array( + 'class' => 'yii\web\CaptchaAction', + ), + ); + } + public function actionIndex() { echo $this->render('index'); @@ -46,4 +55,4 @@ class SiteController extends Controller { echo $this->render('about'); } -} \ No newline at end of file +} diff --git a/app/protected/models/ContactForm.php b/apps/bootstrap/protected/models/ContactForm.php similarity index 94% rename from app/protected/models/ContactForm.php rename to apps/bootstrap/protected/models/ContactForm.php index 8e8f831..7b713a1 100644 --- a/app/protected/models/ContactForm.php +++ b/apps/bootstrap/protected/models/ContactForm.php @@ -26,7 +26,7 @@ class ContactForm extends Model // email has to be a valid email address array('email', 'email'), // verifyCode needs to be entered correctly - //array('verifyCode', 'captcha', 'allowEmpty' => !Captcha::checkRequirements()), + array('verifyCode', 'captcha'), ); } @@ -60,4 +60,4 @@ class ContactForm extends Model return false; } } -} \ No newline at end of file +} diff --git a/app/protected/models/LoginForm.php b/apps/bootstrap/protected/models/LoginForm.php similarity index 99% rename from app/protected/models/LoginForm.php rename to apps/bootstrap/protected/models/LoginForm.php index 23e8c92..5ba1dc6 100644 --- a/app/protected/models/LoginForm.php +++ b/apps/bootstrap/protected/models/LoginForm.php @@ -55,4 +55,4 @@ class LoginForm extends Model return false; } } -} \ No newline at end of file +} diff --git a/app/protected/models/User.php b/apps/bootstrap/protected/models/User.php similarity index 99% rename from app/protected/models/User.php rename to apps/bootstrap/protected/models/User.php index fcbf14a..afbf9f8 100644 --- a/app/protected/models/User.php +++ b/apps/bootstrap/protected/models/User.php @@ -58,4 +58,4 @@ class User extends \yii\base\Object implements \yii\web\Identity { return $this->password === $password; } -} \ No newline at end of file +} diff --git a/app/protected/runtime/.gitignore b/apps/bootstrap/protected/runtime/.gitignore similarity index 100% rename from app/protected/runtime/.gitignore rename to apps/bootstrap/protected/runtime/.gitignore diff --git a/app/protected/views/layouts/main.php b/apps/bootstrap/protected/views/layouts/main.php similarity index 52% rename from app/protected/views/layouts/main.php rename to apps/bootstrap/protected/views/layouts/main.php index a455f20..a81f983 100644 --- a/app/protected/views/layouts/main.php +++ b/apps/bootstrap/protected/views/layouts/main.php @@ -1,9 +1,11 @@ registerAssetBundle('app'); ?> beginPage(); ?> @@ -23,22 +25,26 @@ $this->registerAssetBundle('app');
+ widget('yii\widgets\Breadcrumbs', array( + 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(), + )); ?>