├── fuel
├── app
│ ├── cache
│ │ └── .gitkeep
│ ├── logs
│ │ └── .gitkeep
│ ├── tmp
│ │ └── .gitkeep
│ ├── views
│ │ ├── .gitkeep
│ │ ├── user
│ │ │ ├── list.php
│ │ │ └── login.php
│ │ └── template.php
│ ├── lang
│ │ └── en
│ │ │ └── .gitkeep
│ ├── migrations
│ │ └── .gitkeep
│ ├── modules
│ │ └── .gitkeep
│ ├── tests
│ │ ├── view
│ │ │ └── .gitkeep
│ │ ├── model
│ │ │ └── .gitkeep
│ │ └── controller
│ │ │ └── .gitkeep
│ ├── vendor
│ │ └── .gitkeep
│ ├── classes
│ │ ├── model
│ │ │ ├── .gitkeep
│ │ │ └── user.php
│ │ ├── controller
│ │ │ └── .gitkeep
│ │ └── view
│ │ │ └── welcome
│ │ │ ├── hello.php
│ │ │ └── 404.php
│ ├── config
│ │ ├── routes.php
│ │ ├── crypt.php
│ │ ├── development
│ │ │ └── db.php
│ │ ├── production
│ │ │ └── db.php
│ │ └── db.php
│ └── bootstrap.php
├── core
│ ├── lang
│ │ ├── .gitkeep
│ │ └── en
│ │ │ ├── .gitkeep
│ │ │ ├── pagination.php
│ │ │ ├── test.php
│ │ │ ├── date.php
│ │ │ ├── byte_units.php
│ │ │ ├── validation.php
│ │ │ └── upload.php
│ ├── config
│ │ ├── index.html
│ │ ├── format.php
│ │ ├── package.php
│ │ ├── ftp.php
│ │ ├── num.php
│ │ ├── date.php
│ │ ├── migrations.php
│ │ ├── theme.php
│ │ ├── doctypes.php
│ │ ├── rest.php
│ │ ├── form.php
│ │ └── file.php
│ ├── views
│ │ ├── errors
│ │ │ ├── php_short.php
│ │ │ ├── production.php
│ │ │ └── php_error.php
│ │ ├── 500.php
│ │ └── 404.php
│ ├── classes
│ │ ├── lang
│ │ │ ├── interface.php
│ │ │ ├── ini.php
│ │ │ ├── json.php
│ │ │ ├── yml.php
│ │ │ └── php.php
│ │ ├── config
│ │ │ ├── interface.php
│ │ │ ├── ini.php
│ │ │ ├── json.php
│ │ │ ├── yml.php
│ │ │ └── php.php
│ │ ├── database
│ │ │ ├── exception.php
│ │ │ ├── result
│ │ │ │ └── cached.php
│ │ │ ├── expression.php
│ │ │ ├── mysql
│ │ │ │ └── result.php
│ │ │ └── mysqli
│ │ │ │ └── result.php
│ │ ├── model.php
│ │ ├── session
│ │ │ └── exception.php
│ │ ├── cache
│ │ │ ├── notfound.php
│ │ │ └── handler
│ │ │ │ ├── string.php
│ │ │ │ ├── serialized.php
│ │ │ │ ├── driver.php
│ │ │ │ └── json.php
│ │ ├── testcase.php
│ │ ├── httpexceptions.php
│ │ ├── httpexception.php
│ │ ├── markdown.php
│ │ ├── controller
│ │ │ └── template.php
│ │ ├── controller.php
│ │ └── profiler.php
│ ├── .gitignore
│ ├── tests
│ │ ├── db.php
│ │ ├── ftp.php
│ │ ├── file.php
│ │ ├── fuel.php
│ │ ├── view.php
│ │ ├── asset.php
│ │ ├── cache.php
│ │ ├── cli.php
│ │ ├── crypt.php
│ │ ├── debug.php
│ │ ├── email.php
│ │ ├── image.php
│ │ ├── input.php
│ │ ├── model.php
│ │ ├── redis.php
│ │ ├── route.php
│ │ ├── unzip.php
│ │ ├── config.php
│ │ ├── cookie.php
│ │ ├── dbutil.php
│ │ ├── router.php
│ │ ├── upload.php
│ │ ├── fieldset.php
│ │ ├── file
│ │ │ ├── area.php
│ │ │ ├── exception.php
│ │ │ └── driver
│ │ │ │ ├── file.php
│ │ │ │ └── directory.php
│ │ ├── image
│ │ │ ├── gd.php
│ │ │ ├── driver.php
│ │ │ └── imagemagick.php
│ │ ├── migrate.php
│ │ ├── profiler.php
│ │ ├── request.php
│ │ ├── response.php
│ │ ├── session.php
│ │ ├── testcase.php
│ │ ├── email
│ │ │ ├── mail.php
│ │ │ ├── smtp.php
│ │ │ ├── driver.php
│ │ │ └── sendmail.php
│ │ ├── session
│ │ │ ├── db.php
│ │ │ ├── file.php
│ │ │ ├── redis.php
│ │ │ ├── cookie.php
│ │ │ ├── driver.php
│ │ │ ├── exception.php
│ │ │ └── memcached.php
│ │ ├── viewmodel.php
│ │ ├── autoloader.php
│ │ ├── controller.php
│ │ ├── fuel
│ │ │ └── exception.php
│ │ ├── view
│ │ │ └── exception.php
│ │ ├── cache
│ │ │ ├── exception.php
│ │ │ ├── handler
│ │ │ │ ├── json.php
│ │ │ │ ├── driver.php
│ │ │ │ ├── string.php
│ │ │ │ └── serialized.php
│ │ │ └── storage
│ │ │ │ ├── file.php
│ │ │ │ ├── redis.php
│ │ │ │ ├── driver.php
│ │ │ │ └── memcached.php
│ │ ├── database
│ │ │ ├── query.php
│ │ │ ├── result.php
│ │ │ ├── exception.php
│ │ │ ├── connection.php
│ │ │ ├── expression.php
│ │ │ ├── mysql
│ │ │ │ ├── result.php
│ │ │ │ └── connection.php
│ │ │ ├── transaction.php
│ │ │ ├── mysqli
│ │ │ │ ├── result.php
│ │ │ │ └── connection.php
│ │ │ ├── pdo
│ │ │ │ └── connection.php
│ │ │ ├── query
│ │ │ │ ├── builder.php
│ │ │ │ └── builder
│ │ │ │ │ ├── join.php
│ │ │ │ │ ├── where.php
│ │ │ │ │ ├── delete.php
│ │ │ │ │ ├── insert.php
│ │ │ │ │ ├── select.php
│ │ │ │ │ └── update.php
│ │ │ └── result
│ │ │ │ └── cached.php
│ │ ├── fieldset
│ │ │ └── field.php
│ │ ├── redis
│ │ │ └── exception.php
│ │ ├── controller
│ │ │ ├── rest.php
│ │ │ └── template.php
│ │ ├── validation
│ │ │ └── error.php
│ │ ├── error.php
│ │ ├── lang.php
│ │ └── event.php
│ ├── phpunit.xml
│ ├── tasks
│ │ └── install.php
│ ├── bootstrap_phpunit.php
│ └── vendor
│ │ └── markdown
│ │ └── License.text
├── packages
│ ├── .gitkeep
│ ├── auth
│ │ ├── .gitignore
│ │ ├── config
│ │ │ └── auth.php
│ │ └── bootstrap.php
│ ├── oil
│ │ ├── .gitignore
│ │ ├── views
│ │ │ ├── admin
│ │ │ │ ├── crud
│ │ │ │ │ ├── actions
│ │ │ │ │ │ ├── index.php
│ │ │ │ │ │ ├── view.php
│ │ │ │ │ │ ├── delete.php
│ │ │ │ │ │ ├── create.php
│ │ │ │ │ │ └── edit.php
│ │ │ │ │ ├── views
│ │ │ │ │ │ └── actions
│ │ │ │ │ │ │ ├── create.php
│ │ │ │ │ │ │ ├── edit.php
│ │ │ │ │ │ │ ├── view.php
│ │ │ │ │ │ │ ├── _form.php
│ │ │ │ │ │ │ └── index.php
│ │ │ │ │ ├── controller.php
│ │ │ │ │ ├── controllers
│ │ │ │ │ │ ├── base.php
│ │ │ │ │ │ └── admin.php
│ │ │ │ │ └── model.php
│ │ │ │ ├── orm
│ │ │ │ │ ├── actions
│ │ │ │ │ │ ├── index.php
│ │ │ │ │ │ ├── view.php
│ │ │ │ │ │ ├── delete.php
│ │ │ │ │ │ ├── create.php
│ │ │ │ │ │ └── edit.php
│ │ │ │ │ ├── views
│ │ │ │ │ │ └── actions
│ │ │ │ │ │ │ ├── create.php
│ │ │ │ │ │ │ ├── edit.php
│ │ │ │ │ │ │ ├── view.php
│ │ │ │ │ │ │ ├── _form.php
│ │ │ │ │ │ │ └── index.php
│ │ │ │ │ ├── controller.php
│ │ │ │ │ ├── controllers
│ │ │ │ │ │ ├── base.php
│ │ │ │ │ │ └── admin.php
│ │ │ │ │ └── model.php
│ │ │ │ ├── login.php
│ │ │ │ └── dashboard.php
│ │ │ └── scaffolding
│ │ │ │ ├── crud
│ │ │ │ ├── actions
│ │ │ │ │ ├── index.php
│ │ │ │ │ ├── view.php
│ │ │ │ │ ├── delete.php
│ │ │ │ │ ├── create.php
│ │ │ │ │ └── edit.php
│ │ │ │ ├── views
│ │ │ │ │ └── actions
│ │ │ │ │ │ ├── create.php
│ │ │ │ │ │ ├── edit.php
│ │ │ │ │ │ ├── view.php
│ │ │ │ │ │ ├── _form.php
│ │ │ │ │ │ └── index.php
│ │ │ │ ├── controller.php
│ │ │ │ ├── controllers
│ │ │ │ │ ├── base.php
│ │ │ │ │ └── admin.php
│ │ │ │ └── model.php
│ │ │ │ ├── orm
│ │ │ │ ├── actions
│ │ │ │ │ ├── index.php
│ │ │ │ │ ├── view.php
│ │ │ │ │ ├── delete.php
│ │ │ │ │ ├── create.php
│ │ │ │ │ └── edit.php
│ │ │ │ ├── views
│ │ │ │ │ └── actions
│ │ │ │ │ │ ├── create.php
│ │ │ │ │ │ ├── edit.php
│ │ │ │ │ │ ├── view.php
│ │ │ │ │ │ ├── _form.php
│ │ │ │ │ │ └── index.php
│ │ │ │ ├── controller.php
│ │ │ │ └── model.php
│ │ │ │ └── template.php
│ │ ├── classes
│ │ │ └── exception.php
│ │ └── bootstrap.php
│ ├── orm
│ │ ├── .gitignore
│ │ ├── classes
│ │ │ ├── observer
│ │ │ │ ├── self.php
│ │ │ │ ├── createdat.php
│ │ │ │ ├── updatedat.php
│ │ │ │ └── slug.php
│ │ │ └── observer.php
│ │ └── bootstrap.php
│ ├── parser
│ │ ├── .gitignore
│ │ ├── vendor
│ │ │ ├── Mustache
│ │ │ │ └── LICENSE
│ │ │ └── markdown
│ │ │ │ └── License.text
│ │ ├── bootstrap.php
│ │ └── classes
│ │ │ └── view
│ │ │ ├── mustache.php
│ │ │ ├── haml.php
│ │ │ └── phptal.php
│ └── email
│ │ ├── classes
│ │ └── email
│ │ │ └── driver
│ │ │ ├── mail.php
│ │ │ ├── noop.php
│ │ │ └── sendmail.php
│ │ └── bootstrap.php
├── .htaccess
└── LICENSE
├── public
├── assets
│ ├── css
│ │ └── index.html
│ ├── img
│ │ ├── index.html
│ │ ├── glyphicons-halflings.png
│ │ └── glyphicons-halflings-white.png
│ └── js
│ │ └── index.html
└── .htaccess
├── .gitignore
├── README.md
├── fuel-auth-sys.sql
└── oil
/fuel/app/cache/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/logs/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/tmp/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/views/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/core/lang/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/packages/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/fuel/app/lang/en/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/modules/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/tests/view/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/vendor/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/views/user/list.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/core/config/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/core/lang/en/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/css/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/img/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/js/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/classes/model/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/tests/model/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/classes/controller/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/fuel/app/tests/controller/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | fuel/app/logs/*/*/*
2 | fuel/app/cache/*/*
3 |
--------------------------------------------------------------------------------
/fuel/app/config/routes.php:
--------------------------------------------------------------------------------
1 | 'user/login', // The default route
4 | );
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | FuelPHP Authentication Sample
2 | =============================
3 |
4 | Sample Code for User Authentication in FuelPHP
--------------------------------------------------------------------------------
/fuel/core/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | 'Previous',
5 | 'next' => 'Next',
6 | );
7 |
8 |
--------------------------------------------------------------------------------
/public/assets/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gmx/fuelphp-auth-sample/master/public/assets/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/fuel/core/views/errors/php_short.php:
--------------------------------------------------------------------------------
1 | : in
--------------------------------------------------------------------------------
/public/assets/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gmx/fuelphp-auth-sample/master/public/assets/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/fuel/packages/auth/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.bak
3 | Thumbs.db
4 | desktop.ini
5 | .DS_Store
6 | .buildpath
7 | .project
8 | .settings
9 | nbproject/
10 | .idea
--------------------------------------------------------------------------------
/fuel/packages/oil/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.bak
3 | Thumbs.db
4 | desktop.ini
5 | .DS_Store
6 | .buildpath
7 | .project
8 | .settings
9 | nbproject/
10 | .idea
--------------------------------------------------------------------------------
/fuel/app/config/crypt.php:
--------------------------------------------------------------------------------
1 | 'KSgwa0B4g418iQg21Q970vsM',
4 | 'crypto_iv' => '2aIwGMUgkb3E4UMh_MDcQLFQ',
5 | 'crypto_hmac' => 'p-olro9Gsw3wIAQmUcD30s-4',
6 | );
7 |
--------------------------------------------------------------------------------
/fuel/packages/orm/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.bak
3 | Thumbs.db
4 | desktop.ini
5 | .DS_Store
6 | .buildpath
7 | .project
8 | .settings
9 | fuel/app/logs/*/*/*
10 | fuel/app/cache/*/*
11 | nbproject/
12 | .idea
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | RewriteEngine on
3 |
4 | RewriteCond %{REQUEST_FILENAME} !-f
5 | RewriteCond %{REQUEST_FILENAME} !-d
6 |
7 | RewriteRule ^(.*)$ index.php/$1 [L]
8 |
--------------------------------------------------------------------------------
/fuel-auth-sys.sql:
--------------------------------------------------------------------------------
1 | #user table
2 |
3 | create table users (
4 | id int(255) unsigned not null auto_increment primary key,
5 | username varchar(255),
6 | password varchar(255),
7 | created_at int,
8 | updated_at int
9 | );
--------------------------------------------------------------------------------
/fuel/core/classes/lang/interface.php:
--------------------------------------------------------------------------------
1 | '] = Model_::find_all();
2 | $this->template->title = "";
3 | $this->template->content = View::forge('/index', $data);
4 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/actions/index.php:
--------------------------------------------------------------------------------
1 | $data[''] = Model_::find('all');
2 | $this->template->title = "";
3 | $this->template->content = View::forge('/index', $data);
4 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/actions/view.php:
--------------------------------------------------------------------------------
1 | $data[''] = Model_::find($id);
2 |
3 | $this->template->title = "";
4 | $this->template->content = View::forge('/view', $data);
5 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/actions/index.php:
--------------------------------------------------------------------------------
1 | $data[''] = Model_::find_all();
2 | $this->template->title = "";
3 | $this->template->content = View::forge('/index', $data);
4 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/actions/index.php:
--------------------------------------------------------------------------------
1 | $data[''] = Model_::find('all');
2 | $this->template->title = "";
3 | $this->template->content = View::forge('/index', $data);
4 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/actions/view.php:
--------------------------------------------------------------------------------
1 | $data[''] = Model_::find_by_pk($id);
2 |
3 | $this->template->title = "";
4 | $this->template->content = View::forge('/view', $data);
5 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/views/actions/create.php:
--------------------------------------------------------------------------------
1 |
New
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/views/actions/create.php:
--------------------------------------------------------------------------------
1 | New
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/views/actions/create.php:
--------------------------------------------------------------------------------
1 | New
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/views/actions/create.php:
--------------------------------------------------------------------------------
1 | New
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
--------------------------------------------------------------------------------
/fuel/app/config/development/db.php:
--------------------------------------------------------------------------------
1 | array(
8 | 'connection' => array(
9 | 'dsn' => 'mysql:host=localhost;dbname=fuel_dev',
10 | 'username' => 'root',
11 | 'password' => 'root',
12 | ),
13 | ),
14 | );
15 |
--------------------------------------------------------------------------------
/fuel/app/config/production/db.php:
--------------------------------------------------------------------------------
1 | array(
8 | 'connection' => array(
9 | 'dsn' => 'mysql:host=localhost;dbname=fuel_prod',
10 | 'username' => 'fuel_app',
11 | 'password' => 'super_secret_password',
12 | ),
13 | ),
14 | );
15 |
--------------------------------------------------------------------------------
/fuel/core/lang/en/test.php:
--------------------------------------------------------------------------------
1 |
8 | * @license MIT License
9 | * @copyright 2010 - 2011 Fuel Development Team
10 | */
11 |
12 |
13 |
14 | return array(
15 | 'hello' => 'Hello there :name!'
16 | );
17 |
18 |
--------------------------------------------------------------------------------
/fuel/core/classes/database/exception.php:
--------------------------------------------------------------------------------
1 | '] = Model_::find($id);
2 |
3 | is_null($id) and Response::redirect('');
4 |
5 | $this->template->title = "";
6 | $this->template->content = View::forge('/view', $data);
7 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/actions/view.php:
--------------------------------------------------------------------------------
1 | is_null($id) and Response::redirect('');
2 |
3 | $data[''] = Model_::find_by_pk($id);
4 |
5 | $this->template->title = "";
6 | $this->template->content = View::forge('/view', $data);
7 |
--------------------------------------------------------------------------------
/fuel/core/classes/session/exception.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Controller_ extends
4 | {
5 |
6 |
7 | public function action_()
8 | {
9 |
10 | }
11 |
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/controller.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Controller_ extends
4 | {
5 |
6 |
7 | public function action_()
8 | {
9 |
10 | }
11 |
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/controller.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Controller_ extends
4 | {
5 |
6 |
7 | public function action_()
8 | {
9 |
10 | }
11 |
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/controller.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Controller_ extends
4 | {
5 |
6 |
7 | public function action_()
8 | {
9 |
10 | }
11 |
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/views/actions/edit.php:
--------------------------------------------------------------------------------
1 | Editing
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
9 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/views/actions/edit.php:
--------------------------------------------------------------------------------
1 | Editing
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
9 |
--------------------------------------------------------------------------------
/fuel/app/views/template.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/fuel/core/classes/cache/notfound.php:
--------------------------------------------------------------------------------
1 | Editing
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
9 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/views/actions/edit.php:
--------------------------------------------------------------------------------
1 | Editing
2 |
3 |
4 | echo render('/_form'); ?>
5 |
6 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
7 | echo Html::anchor('', 'Back'); '; ?>
8 |
9 |
--------------------------------------------------------------------------------
/fuel/app/classes/view/welcome/hello.php:
--------------------------------------------------------------------------------
1 | name = $this->request()->param('name', 'World');
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/actions/delete.php:
--------------------------------------------------------------------------------
1 | if ($ = Model_::find($id))
2 | {
3 | $->delete();
4 |
5 | Session::set_flash('success', e('Deleted #'.$id));
6 | }
7 |
8 | else
9 | {
10 | Session::set_flash('error', e('Could not delete #'.$id));
11 | }
12 |
13 | Response::redirect('');
14 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/actions/delete.php:
--------------------------------------------------------------------------------
1 | if ($ = Model_::find($id))
2 | {
3 | $->delete();
4 |
5 | Session::set_flash('success', 'Deleted #'.$id);
6 | }
7 |
8 | else
9 | {
10 | Session::set_flash('error', 'Could not delete #'.$id);
11 | }
12 |
13 | Response::redirect('');
14 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/actions/delete.php:
--------------------------------------------------------------------------------
1 | if ($ = Model_::find_one_by_id($id))
2 | {
3 | $->delete();
4 |
5 | Session::set_flash('success', e('Deleted #'.$id));
6 | }
7 |
8 | else
9 | {
10 | Session::set_flash('error', e('Could not delete #'.$id));
11 | }
12 |
13 | Response::redirect('');
14 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/actions/delete.php:
--------------------------------------------------------------------------------
1 | if ($ = Model_::find_one_by_id($id))
2 | {
3 | $->delete();
4 |
5 | Session::set_flash('success', 'Deleted #'.$id);
6 | }
7 |
8 | else
9 | {
10 | Session::set_flash('error', 'Could not delete #'.$id);
11 | }
12 |
13 | Response::redirect('');
14 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/controllers/base.php:
--------------------------------------------------------------------------------
1 | current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null;
11 |
12 | // Set a global variable so views can use it
13 | View::set_global('current_user', $this->current_user);
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/fuel/core/tests/db.php:
--------------------------------------------------------------------------------
1 | current_user = Auth::check() ? Model_User::find_one_by_username(Auth::get_screen_name()) : null;
11 |
12 | // Set a global variable so views can use it
13 | View::set_global('current_user', $this->current_user);
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/fuel/core/tests/file.php:
--------------------------------------------------------------------------------
1 | current_user = Auth::check() ? Model_User::find_one_by_username(Auth::get_screen_name()) : null;
11 |
12 | // Set a global variable so views can use it
13 | View::set_global('current_user', $this->current_user);
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/fuel/core/tests/config.php:
--------------------------------------------------------------------------------
1 | title = $messages[array_rand($messages)];
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/fuel/core/tests/cache/exception.php:
--------------------------------------------------------------------------------
1 | ':time ago',
5 |
6 | 'second' => ':t second',
7 | 'seconds' => ':t seconds',
8 |
9 | 'minute' => ':t minute',
10 | 'minutes' => ':t minutes',
11 |
12 | 'hour' => ':t hour',
13 | 'hours' => ':t hours',
14 |
15 | 'day' => ':t day',
16 | 'days' => ':t days',
17 |
18 | 'week' => ':t week',
19 | 'weeks' => ':t weeks',
20 |
21 | 'month' => ':t month',
22 | 'months' => ':t months',
23 |
24 | 'year' => ':t year',
25 | 'years' => ':t years',
26 |
27 | 'decade' => ':t decade',
28 | 'decades' => ':t decades',
29 | );
--------------------------------------------------------------------------------
/fuel/app/classes/model/user.php:
--------------------------------------------------------------------------------
1 | array(
19 | 'events' => array('before_insert'),
20 | 'mysql_timestamp' => true,
21 | ),
22 | 'Orm\Observer_UpdatedAt' => array(
23 | 'events' => array('before_save'),
24 | 'mysql_timestamp' => false,
25 | ),
26 | );
27 |
28 |
29 | }
--------------------------------------------------------------------------------
/fuel/packages/orm/classes/observer/self.php:
--------------------------------------------------------------------------------
1 | Viewing # echo $->id; '; ?>
2 |
3 |
4 |
5 | :
6 | echo $'.$field['name']; ?>; '; ?>
7 |
8 |
9 |
10 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
11 | echo Html::anchor('', 'Back'); '; ?>
12 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/views/actions/view.php:
--------------------------------------------------------------------------------
1 | Viewing # echo $->id; '; ?>
2 |
3 |
4 |
5 | :
6 | echo $'.$field['name']; ?>; '; ?>
7 |
8 |
9 |
10 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
11 | echo Html::anchor('', 'Back'); '; ?>
12 |
--------------------------------------------------------------------------------
/fuel/core/classes/cache/handler/serialized.php:
--------------------------------------------------------------------------------
1 | Viewing # echo $->id; '; ?>
2 |
3 |
4 |
5 | :
6 | echo $'.$field['name']; ?>; '; ?>
7 |
8 |
9 |
10 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
11 | echo Html::anchor('', 'Back'); '; ?>
12 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/views/actions/view.php:
--------------------------------------------------------------------------------
1 | Viewing # echo $->id; '; ?>
2 |
3 |
4 |
5 | :
6 | echo $'.$field['name']; ?>; '; ?>
7 |
8 |
9 |
10 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
11 | echo Html::anchor('', 'Back'); '; ?>
12 |
--------------------------------------------------------------------------------
/fuel/core/classes/httpexceptions.php:
--------------------------------------------------------------------------------
1 | message);
29 | // }
30 |
31 | }
32 |
33 | /* End of file oil/classes/exception.php */
--------------------------------------------------------------------------------
/fuel/core/classes/cache/handler/driver.php:
--------------------------------------------------------------------------------
1 | 'SimpleAuth',
24 | 'verify_multiple_logins' => false,
25 | 'salt' => 'put_your_salt_here',
26 | );
27 |
--------------------------------------------------------------------------------
/fuel/core/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ../core/tests
13 |
14 |
15 | ../packages/*/tests
16 |
17 |
18 | ../app/tests
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/fuel/core/config/format.php:
--------------------------------------------------------------------------------
1 | array(
24 | 'delimiter' => ',',
25 | 'enclosure' => '"',
26 | 'newline' => "\n",
27 | 'regex_newline' => '\n',
28 | 'escape' => '\\',
29 | ),
30 | );
--------------------------------------------------------------------------------
/fuel/core/lang/en/byte_units.php:
--------------------------------------------------------------------------------
1 | power of 2 that defines the unit's size
5 | *
6 | * @var array
7 | */
8 | return array(
9 | 'B' => 0,
10 | 'K' => 10,
11 | 'Ki' => 10,
12 | 'KB' => 10,
13 | 'KiB' => 10,
14 | 'M' => 20,
15 | 'Mi' => 20,
16 | 'MB' => 20,
17 | 'MiB' => 20,
18 | 'G' => 30,
19 | 'Gi' => 30,
20 | 'GB' => 30,
21 | 'GiB' => 30,
22 | 'T' => 40,
23 | 'Ti' => 40,
24 | 'TB' => 40,
25 | 'TiB' => 40,
26 | 'P' => 50,
27 | 'Pi' => 50,
28 | 'PB' => 50,
29 | 'PiB' => 50,
30 | 'E' => 60,
31 | 'Ei' => 60,
32 | 'EB' => 60,
33 | 'EiB' => 60,
34 | 'Z' => 70,
35 | 'Zi' => 70,
36 | 'ZB' => 70,
37 | 'ZiB' => 70,
38 | 'Y' => 80,
39 | 'Yi' => 80,
40 | 'YB' => 80,
41 | 'YiB' => 80,
42 | );
43 |
44 | /* End of file lang/en/byte_units.php */
--------------------------------------------------------------------------------
/fuel/core/config/package.php:
--------------------------------------------------------------------------------
1 | array(
31 | 'github.com/fuel-packages',
32 | ),
33 |
34 | );
35 |
36 |
37 |
--------------------------------------------------------------------------------
/fuel/core/classes/lang/ini.php:
--------------------------------------------------------------------------------
1 | parse_vars(file_get_contents($file));
21 | return parse_ini_string($contents, true);
22 | }
23 |
24 | /**
25 | * Returns the formatted language file contents.
26 | *
27 | * @param array $content language array
28 | * @return string formatted language file contents
29 | */
30 | protected function export_format($contents)
31 | {
32 | throw new \LangException('Saving lang to ini is not supported at this time');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/fuel/core/config/ftp.php:
--------------------------------------------------------------------------------
1 | array(
26 | 'hostname' => 'localhost',
27 | 'username' => '',
28 | 'password' => '',
29 | 'port' => 21,
30 | 'passive' => true,
31 | 'ssl_mode' => false,
32 | 'debug' => false
33 | )
34 | );
35 |
36 |
37 |
--------------------------------------------------------------------------------
/fuel/core/views/errors/production.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | FuelPHP Framework
6 |
14 |
15 |
16 |
17 |
Oops!
18 |
An unexpected error has occurred.
19 |
20 |
21 |
--------------------------------------------------------------------------------
/fuel/app/bootstrap.php:
--------------------------------------------------------------------------------
1 | APPPATH.'classes/view.php',
14 | ));
15 |
16 | // Register the autoloader
17 | Autoloader::register();
18 |
19 | /**
20 | * Your environment. Can be set to any of the following:
21 | *
22 | * Fuel::DEVELOPMENT
23 | * Fuel::TEST
24 | * Fuel::STAGE
25 | * Fuel::PRODUCTION
26 | */
27 | Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : Fuel::DEVELOPMENT);
28 |
29 | // Initialize the framework with the config file.
30 | Fuel::init('config.php');
31 |
--------------------------------------------------------------------------------
/fuel/core/classes/config/ini.php:
--------------------------------------------------------------------------------
1 | parse_vars(file_get_contents($file));
21 | return parse_ini_string($contents, true);
22 | }
23 |
24 | /**
25 | * Returns the formatted config file contents.
26 | *
27 | * @param array $content config array
28 | * @return string formatted config file contents
29 | */
30 | protected function export_format($contents)
31 | {
32 | throw new \ConfigException('Saving config to ini is not supported at this time');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/fuel/core/classes/lang/json.php:
--------------------------------------------------------------------------------
1 | parse_vars(file_get_contents($file));
21 | return json_decode($contents, true);
22 | }
23 |
24 | /**
25 | * Returns the formatted language file contents.
26 | *
27 | * @param array $content config array
28 | * @return string formatted config file contents
29 | */
30 | protected function export_format($contents)
31 | {
32 | $this->prep_vars($contents);
33 | return \Format::forge()->to_json($contents, true);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/fuel/core/classes/config/json.php:
--------------------------------------------------------------------------------
1 | parse_vars(file_get_contents($file));
21 | return json_decode($contents, true);
22 | }
23 |
24 | /**
25 | * Returns the formatted config file contents.
26 | *
27 | * @param array $content config array
28 | * @return string formatted config file contents
29 | */
30 | protected function export_format($contents)
31 | {
32 | $this->prep_vars($contents);
33 | return \Format::forge()->to_json($contents, true);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/fuel/core/classes/httpexception.php:
--------------------------------------------------------------------------------
1 | response();
32 | \Event::shutdown();
33 | $response->send(true);
34 | }
35 | }
--------------------------------------------------------------------------------
/fuel/core/config/num.php:
--------------------------------------------------------------------------------
1 | array(
21 | // Num::format_phone()
22 | 'phone' => '(000) 000-0000',
23 | // Num::smart_format_phone()
24 | 'smart_phone' => array(
25 | 7 => '000-0000',
26 | 10 => '(000) 000-0000',
27 | 11 => '0 (000) 000-0000',
28 | ),
29 | // Num::format_exp()
30 | 'exp' => '00-00',
31 | // Num::mask_credit_card()
32 | 'credit_card' => '**** **** **** 0000',
33 | ),
34 |
35 | );
36 |
37 | /* End of file config/num.php */
38 |
--------------------------------------------------------------------------------
/fuel/core/views/errors/php_error.php:
--------------------------------------------------------------------------------
1 |
2 |
!
3 |
[ ]:
4 |
@ line :
5 |
{$error_line}:\t".e(trim($debug_lines[$error_line]))."\n";
9 | echo ($error_line + 1).":\t".e(trim($debug_lines[$error_line + 1]))."\n";
10 | endif;
11 | ?>
12 |
--------------------------------------------------------------------------------
/fuel/core/classes/cache/handler/json.php:
--------------------------------------------------------------------------------
1 | build_message();
26 | if ( ! @mail(static::format_addresses($this->to), $this->subject, $message['body'], $message['header'], '-oi -f '.$this->config['from']['email']))
27 | {
28 | throw new \EmailSendingFailedException('Failed sending email');
29 | }
30 | return true;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/fuel/core/classes/lang/yml.php:
--------------------------------------------------------------------------------
1 | parse_vars(file_get_contents($file));
21 | return \Format::forge($contents, 'yaml')->to_array();
22 | }
23 |
24 | /**
25 | * Returns the formatted language file contents.
26 | *
27 | * @param array $content config array
28 | * @return string formatted config file contents
29 | */
30 | protected function export_format($contents)
31 | {
32 | if ( ! function_exists('spyc_load'))
33 | {
34 | import('spyc/spyc', 'vendor');
35 | }
36 |
37 | $this->prep_vars($contents);
38 | return \Spyc::YAMLDump($contents);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/fuel/core/classes/config/yml.php:
--------------------------------------------------------------------------------
1 | parse_vars(file_get_contents($file));
21 | return \Format::forge($contents, 'yaml')->to_array();
22 | }
23 |
24 | /**
25 | * Returns the formatted config file contents.
26 | *
27 | * @param array $content config array
28 | * @return string formatted config file contents
29 | */
30 | protected function export_format($contents)
31 | {
32 | if ( ! function_exists('spyc_load'))
33 | {
34 | import('spyc/spyc', 'vendor');
35 | }
36 |
37 | $this->prep_vars($contents);
38 | return \Spyc::YAMLDump($contents);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/fuel/core/classes/lang/php.php:
--------------------------------------------------------------------------------
1 | build_message();
26 |
27 | logger(\Fuel::L_INFO, 'To: '.static::format_addresses($this->to), 'Email NoOp driver');
28 | logger(\Fuel::L_INFO, 'Subject: '.$this->subject, 'Email NoOp driver');
29 | logger(\Fuel::L_INFO, 'Header: '.$message['header'], 'Email NoOp driver');
30 | logger(\Fuel::L_INFO, 'Body: '.$message['body'], 'Email NoOp driver');
31 |
32 | return true;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/fuel/packages/orm/classes/observer.php:
--------------------------------------------------------------------------------
1 | {$event}($instance);
25 | }
26 | }
27 |
28 | public static function instance($model_class)
29 | {
30 | $observer = get_called_class();
31 | if (empty(static::$_instances[$observer][$model_class]))
32 | {
33 | static::$_instances[$observer][$model_class] = new static($model_class);
34 | }
35 |
36 | return static::$_instances[$observer][$model_class];
37 | }
38 | }
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/model.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Model_ extends Model_Crud
4 | {
5 | protected static $_table_name = '';
6 |
7 | public static function validate($factory)
8 | {
9 | $val = Validation::forge($factory);
10 |
11 |
29 | $val->add_field('', '', '');
30 |
31 |
32 | return $val;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/model.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Model_ extends Model_Crud
4 | {
5 | protected static $_table_name = '';
6 |
7 | public static function validate($factory)
8 | {
9 | $val = Validation::forge($factory);
10 |
11 |
29 | $val->add_field('', '', '');
30 |
31 |
32 | return $val;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/fuel/packages/oil/bootstrap.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/classes/cell.php',
16 | 'Oil\\Command' => __DIR__.'/classes/command.php',
17 | 'Oil\\Console' => __DIR__.'/classes/console.php',
18 | 'Oil\\Exception' => __DIR__.'/classes/exception.php',
19 | 'Oil\\Generate' => __DIR__.'/classes/generate.php',
20 | 'Oil\\Generate_Migration_Actions' => __DIR__.'/classes/generate/migration/actions.php',
21 | 'Oil\\Generate_Admin' => __DIR__.'/classes/generate/admin.php',
22 | 'Oil\\Generate_Scaffold' => __DIR__.'/classes/generate/scaffold.php',
23 | 'Oil\\Package' => __DIR__.'/classes/package.php',
24 | 'Oil\\Refine' => __DIR__.'/classes/refine.php',
25 | ));
26 |
27 | /* End of file bootstrap.php */
--------------------------------------------------------------------------------
/fuel/core/tasks/install.php:
--------------------------------------------------------------------------------
1 | ::validate('create');
4 |
5 | if ($val->run())
6 | {
7 | $ = Model_::forge(array(
8 |
9 | '' => Input::post(''),
10 |
11 | ));
12 |
13 | if ($ and $->save())
14 | {
15 | Session::set_flash('success', e('Added #'.$->id.'.'));
16 | Response::redirect('');
17 | }
18 | else
19 | {
20 | Session::set_flash('error', e('Could not save .'));
21 | }
22 | }
23 | else
24 | {
25 | Session::set_flash('error', $val->error());
26 | }
27 | }
28 |
29 | $this->template->title = "";
30 | $this->template->content = View::forge('/create');
31 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/actions/create.php:
--------------------------------------------------------------------------------
1 | if (Input::method() == 'POST')
2 | {
3 | $val = Model_::validate('create');
4 |
5 | if ($val->run())
6 | {
7 | $ = Model_::forge(array(
8 |
9 | '' => Input::post(''),
10 |
11 | ));
12 |
13 | if ($ and $->save())
14 | {
15 | Session::set_flash('success', 'Added #'.$->id.'.');
16 | Response::redirect('');
17 | }
18 | else
19 | {
20 | Session::set_flash('error', 'Could not save .');
21 | }
22 | }
23 | else
24 | {
25 | Session::set_flash('error', $val->error());
26 | }
27 | }
28 |
29 | $this->template->title = "";
30 | $this->template->content = View::forge('/create');
31 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/actions/create.php:
--------------------------------------------------------------------------------
1 | if (Input::method() == 'POST')
2 | {
3 | $val = Model_::validate('create');
4 |
5 | if ($val->run())
6 | {
7 | $ = Model_::forge(array(
8 |
9 | '' => Input::post(''),
10 |
11 | ));
12 |
13 | if ($ and $->save())
14 | {
15 | Session::set_flash('success', e('Added #'.$->id.'.'));
16 |
17 | Response::redirect('');
18 | }
19 |
20 | else
21 | {
22 | Session::set_flash('error', e('Could not save .'));
23 | }
24 | }
25 | else
26 | {
27 | Session::set_flash('error', $val->error());
28 | }
29 | }
30 |
31 | $this->template->title = "";
32 | $this->template->content = View::forge('/create');
33 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/actions/create.php:
--------------------------------------------------------------------------------
1 | if (Input::method() == 'POST')
2 | {
3 | $val = Model_::validate('create');
4 |
5 | if ($val->run())
6 | {
7 | $ = Model_::forge(array(
8 |
9 | '' => Input::post(''),
10 |
11 | ));
12 |
13 | if ($ and $->save())
14 | {
15 | Session::set_flash('success', 'Added #'.$->id.'.');
16 |
17 | Response::redirect('');
18 | }
19 |
20 | else
21 | {
22 | Session::set_flash('error', 'Could not save .');
23 | }
24 | }
25 | else
26 | {
27 | Session::set_flash('error', $val->error());
28 | }
29 | }
30 |
31 | $this->template->title = "";
32 | $this->template->content = View::forge('/create');
33 |
--------------------------------------------------------------------------------
/fuel/core/classes/database/result/cached.php:
--------------------------------------------------------------------------------
1 | _total_rows = count($result);
23 | }
24 |
25 | public function __destruct()
26 | {
27 | // Cached results do not use resources
28 | }
29 |
30 | public function cached()
31 | {
32 | return $this;
33 | }
34 |
35 | public function seek($offset)
36 | {
37 | if ( ! $this->offsetExists($offset))
38 | {
39 | return false;
40 | }
41 |
42 | $this->_current_row = $offset;
43 | return true;
44 | }
45 |
46 | public function current()
47 | {
48 | return $this->valid() ? $this->_result[$this->_current_row] : null;
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/actions/edit.php:
--------------------------------------------------------------------------------
1 | $ = Model_::find_one_by_id($id);
2 |
3 | if (Input::method() == 'POST')
4 | {
5 | $val = Model_::validate('edit');
6 |
7 | if ($val->run())
8 | {
9 |
10 | $-> = Input::post('');
11 |
12 |
13 | if ($->save())
14 | {
15 | Session::set_flash('success', e('Updated #'.$id));
16 | Response::redirect('');
17 | }
18 | else
19 | {
20 | Session::set_flash('error', 'Nothing updated.');
21 | }
22 | }
23 | else
24 | {
25 | Session::set_flash('error', $val->error());
26 | }
27 | }
28 |
29 | $this->template->set_global('', $, false);
30 | $this->template->title = "";
31 | $this->template->content = View::forge('/edit');
32 |
--------------------------------------------------------------------------------
/fuel/core/config/date.php:
--------------------------------------------------------------------------------
1 | array(
29 | 'local' => '%c',
30 |
31 | 'mysql' => '%Y-%m-%d %H:%M:%S',
32 | 'mysql_date' => '%Y-%m-%d',
33 |
34 | 'us' => '%m/%d/%Y',
35 | 'us_short' => '%m/%d',
36 | 'us_named' => '%B %d %Y',
37 | 'us_full' => '%I:%M %p, %B %d %Y',
38 | 'eu' => '%d/%m/%Y',
39 | 'eu_short' => '%d/%m',
40 | 'eu_named' => '%d %B %Y',
41 | 'eu_full' => '%H:%M, %d %B %Y',
42 |
43 | '24h' => '%H:%M',
44 | '12h' => '%I:%M %p'
45 | )
46 | );
--------------------------------------------------------------------------------
/fuel/core/config/migrations.php:
--------------------------------------------------------------------------------
1 | array(
31 | 'app' => array(
32 | 'default' => 0,
33 | ),
34 | 'module' => array(),
35 | 'package' => array()
36 | ),
37 |
38 | /*
39 | | Folder name where migrations are stored relative to App, Module and Package Paths?
40 | |
41 | | Default: 'migrations/'
42 | |
43 | */
44 | 'folder' => 'migrations/',
45 |
46 | /*
47 | | Table name
48 | |
49 | | Default: 'migration'
50 | |
51 | */
52 | 'table' => 'migration',
53 |
54 | );
55 |
56 |
--------------------------------------------------------------------------------
/fuel/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2010 - 2011 Fuel Development Team
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.
--------------------------------------------------------------------------------
/fuel/core/config/theme.php:
--------------------------------------------------------------------------------
1 | 'default',
8 |
9 | /**
10 | * The fallback theme to use. If a view is not found in the active theme, this theme
11 | * is used as a fallback. This can also be set in code using Theme::fallback('foo');
12 | */
13 | 'fallback' => 'default',
14 |
15 | /**
16 | * The theme search paths. They are searched in the order given. You can add paths
17 | * on the fly via Theme::add_path($path) or Theme::add_paths(array($path1, $path2));
18 | */
19 | 'paths' => array(
20 | DOCROOT.'themes',
21 | ),
22 |
23 | /**
24 | * The folder inside the theme to be used to store assets. This is relative to the
25 | * theme's path.
26 | */
27 | 'assets_folder' => 'assets',
28 |
29 | /**
30 | * The extension for theme view files.
31 | */
32 | 'view_ext' => '.html',
33 |
34 | /**
35 | * Whether to require a theme info file
36 | */
37 | 'require_info_file' => false,
38 |
39 | /**
40 | * The theme info file name
41 | */
42 | 'info_file_name' => 'themeinfo.php',
43 | );
44 |
--------------------------------------------------------------------------------
/fuel/packages/parser/vendor/Mustache/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010 Justin Hileman
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated documentation
5 | files (the "Software"), to deal in the Software without
6 | restriction, including without limitation the rights to use,
7 | copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the
9 | Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be
13 | included in all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/views/actions/_form.php:
--------------------------------------------------------------------------------
1 | ' ?>
2 |
3 |
4 |
30 | echo Form::close(); '; ?>
31 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/views/actions/_form.php:
--------------------------------------------------------------------------------
1 | ' ?>
2 |
3 |
4 |
30 | echo Form::close(); '; ?>
31 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/login.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | error('email')): ?>
16 |
error('email')->get_message('You must provide a username or email'); ?>
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | error('password')): ?>
25 |
error('password')->get_message(':label cannot be blank'); ?>
26 |
27 |
28 |
29 |
30 | 'Login', 'name'=>'submit')); ?>
31 |
32 |
33 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/views/actions/_form.php:
--------------------------------------------------------------------------------
1 | ' ?>
2 |
3 |
4 |
30 | echo Form::close(); '; ?>
31 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/views/actions/_form.php:
--------------------------------------------------------------------------------
1 | ' ?>
2 |
3 |
4 |
30 | echo Form::close(); '; ?>
31 |
--------------------------------------------------------------------------------
/fuel/core/views/500.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 500 - Internal Server Error
6 |
38 |
39 |
40 |
41 |
44 |
45 |
Something has gone horribly wrong.
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/fuel/core/views/404.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 404 - Page Not Found
6 |
38 |
39 |
40 |
41 |
44 |
45 |
You can see this page because the URL you are accessing cannot be found.
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/actions/edit.php:
--------------------------------------------------------------------------------
1 | is_null($id) and Response::redirect('');
2 |
3 | $ = Model_::find_one_by_id($id);
4 |
5 | if (Input::method() == 'POST')
6 | {
7 | $val = Model_::validate('edit');
8 |
9 | if ($val->run())
10 | {
11 |
12 | $-> = Input::post('');
13 |
14 |
15 | if ($->save())
16 | {
17 | Session::set_flash('success', 'Updated #'.$id);
18 | Response::redirect('');
19 | }
20 | else
21 | {
22 | Session::set_flash('error', 'Nothing updated.');
23 | }
24 | }
25 | else
26 | {
27 | Session::set_flash('error', $val->error());
28 | }
29 | }
30 |
31 | $this->template->set_global('', $, false);
32 | $this->template->title = "";
33 | $this->template->content = View::forge('/edit');
34 |
--------------------------------------------------------------------------------
/fuel/core/classes/markdown.php:
--------------------------------------------------------------------------------
1 | transform($text);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/fuel/packages/orm/classes/observer/createdat.php:
--------------------------------------------------------------------------------
1 | _mysql_timestamp = isset($props['mysql_timestamp']) ? $props['mysql_timestamp'] : static::$mysql_timestamp;
34 | $this->_property = isset($props['property']) ? $props['property'] : static::$property;
35 | }
36 |
37 | public function before_insert(Model $obj)
38 | {
39 | $obj->{$this->_property} = $this->_mysql_timestamp ? \Date::time()->format('mysql') : \Date::time()->get_timestamp();
40 | }
41 | }
--------------------------------------------------------------------------------
/fuel/packages/parser/bootstrap.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/classes/view.php',
19 | 'Parser\\View_Dwoo' => __DIR__.'/classes/view/dwoo.php',
20 | 'Parser\\View_Mustache' => __DIR__.'/classes/view/mustache.php',
21 | 'Parser\\View_Markdown' => __DIR__.'/classes/view/markdown.php',
22 | 'Parser\\View_SimpleTags' => __DIR__.'/classes/view/simpletags.php',
23 | 'Parser\\View_Twig' => __DIR__.'/classes/view/twig.php',
24 | 'Parser\\Twig_Fuel_Extension' => __DIR__.'/classes/twig/fuel/extension.php',
25 | 'Parser\\View_Jade' => __DIR__.'/classes/view/jade.php',
26 | 'Parser\\View_Haml' => __DIR__.'/classes/view/haml.php',
27 | 'Parser\\View_Smarty' => __DIR__.'/classes/view/smarty.php',
28 | 'Parser\\View_Phptal' => __DIR__.'/classes/view/phptal.php',
29 | ));
30 |
31 |
32 | /* End of file bootstrap.php */
33 |
--------------------------------------------------------------------------------
/fuel/app/config/db.php:
--------------------------------------------------------------------------------
1 | 'development',
10 |
11 | /**
12 | * Base config, just need to set the DSN, username and password in env. config.
13 | */
14 | 'default' => array(
15 | 'type' => 'pdo',
16 | 'connection' => array(
17 | 'persistent' => false,
18 | ),
19 | 'identifier' => '`',
20 | 'table_prefix' => '',
21 | 'charset' => 'utf8',
22 | 'enable_cache' => true,
23 | 'profiling' => false,
24 | ),
25 |
26 | 'development' => array(
27 | 'type' => 'mysqli',
28 | 'connection' => array(
29 | 'hostname' => 'localhost',
30 | 'port' => '3306',
31 | 'database' => 'fuel-auth-sys',
32 | 'username' => 'root',
33 | 'password' => '',
34 | 'persistent' => true,
35 | ),
36 | 'identifier' => '`',
37 | 'table_prefix' => '',
38 | 'charset' => 'utf8',
39 | 'enable_cache' => true,
40 | 'profiling' => false,
41 | ),
42 |
43 | 'redis' => array(
44 | 'default' => array(
45 | 'hostname' => '127.0.0.1',
46 | 'port' => 6379,
47 | 'timeout' => null,
48 | )
49 | ),
50 |
51 | );
52 |
--------------------------------------------------------------------------------
/fuel/core/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The field :label is required and must contain a value.',
5 | 'min_length' => 'The field :label has to contain at least :param:1 characters.',
6 | 'max_length' => 'The field :label may not contain more than :param:1 characters.',
7 | 'exact_length' => 'The field :label must contain exactly :param:1 characters.',
8 | 'match_value' => 'The field :label must contain the value :param:1.',
9 | 'match_pattern' => 'The field :label must match the pattern :param:1.',
10 | 'match_field' => 'The field :label must match the field :param:1.',
11 | 'valid_email' => 'The field :label must contain a valid email address.',
12 | 'valid_emails' => 'The field :label must contain a list of valid email addresses.',
13 | 'valid_url' => 'The field :label must contain a valid URL.',
14 | 'valid_ip' => 'The field :label must contain a valid IP address.',
15 | 'numeric_min' => 'The minimum numeric value of :label must be :param:1',
16 | 'numeric_max' => 'The maximum numeric value of :label must be :param:1',
17 | 'valid_string' => 'The valid string rule :rule(:param:1) failed for field :label',
18 | 'required_with' => 'The field :label must contain a value if :param:1 contains a value.',
19 | );
20 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/template.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
', e((array) Session::get_flash('success'))); ?>
21 |
22 |
23 |
24 |
25 |
26 |
27 |
', e((array) Session::get_flash('error'))); ?>
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/fuel/packages/orm/classes/observer/updatedat.php:
--------------------------------------------------------------------------------
1 | _mysql_timestamp = isset($props['mysql_timestamp']) ? $props['mysql_timestamp'] : static::$mysql_timestamp;
34 | $this->_property = isset($props['property']) ? $props['property'] : static::$property;
35 | }
36 |
37 | public function before_save(Model $obj)
38 | {
39 | if ($obj->is_new() or $obj->is_changed())
40 | {
41 | $obj->{$this->_property} = $this->_mysql_timestamp ? \Date::time()->format('mysql') : \Date::time()->get_timestamp();
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/fuel/packages/auth/bootstrap.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/classes/auth.php',
18 | 'Auth\\AuthException' => __DIR__.'/classes/auth.php',
19 |
20 | 'Auth\\Auth_Driver' => __DIR__.'/classes/auth/driver.php',
21 |
22 | 'Auth\\Auth_Acl_Driver' => __DIR__.'/classes/auth/acl/driver.php',
23 | 'Auth\\Auth_Acl_SimpleAcl' => __DIR__.'/classes/auth/acl/simpleacl.php',
24 |
25 | 'Auth\\Auth_Group_Driver' => __DIR__.'/classes/auth/group/driver.php',
26 | 'Auth\\Auth_Group_SimpleGroup' => __DIR__.'/classes/auth/group/simplegroup.php',
27 |
28 | 'Auth\\Auth_Login_Driver' => __DIR__.'/classes/auth/login/driver.php',
29 | 'Auth\\Auth_Login_SimpleAuth' => __DIR__.'/classes/auth/login/simpleauth.php',
30 | 'Auth\\SimpleUserUpdateException' => __DIR__.'/classes/auth/login/simpleauth.php',
31 | 'Auth\\SimpleUserWrongPassword' => __DIR__.'/classes/auth/login/simpleauth.php',
32 | ));
33 |
34 |
35 | /* End of file bootstrap.php */
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/actions/edit.php:
--------------------------------------------------------------------------------
1 | $ = Model_::find($id);
2 | $val = Model_::validate('edit');
3 |
4 | if ($val->run())
5 | {
6 |
7 | $-> = Input::post('');
8 |
9 |
10 | if ($->save())
11 | {
12 | Session::set_flash('success', e('Updated #' . $id));
13 |
14 | Response::redirect('');
15 | }
16 |
17 | else
18 | {
19 | Session::set_flash('error', e('Could not update #' . $id));
20 | }
21 | }
22 |
23 | else
24 | {
25 | if (Input::method() == 'POST')
26 | {
27 |
28 | $-> = $val->validated('');
29 |
30 |
31 | Session::set_flash('error', $val->error());
32 | }
33 |
34 | $this->template->set_global('', $, false);
35 | }
36 |
37 | $this->template->title = "";
38 | $this->template->content = View::forge('/edit');
39 |
--------------------------------------------------------------------------------
/oil:
--------------------------------------------------------------------------------
1 | template object
34 | */
35 | public function before()
36 | {
37 | if ( ! empty($this->template) and is_string($this->template))
38 | {
39 | // Load the template
40 | $this->template = \View::forge($this->template);
41 | }
42 |
43 | return parent::before();
44 | }
45 |
46 | /**
47 | * After controller method has run output the template
48 | *
49 | * @param Response $response
50 | */
51 | public function after($response)
52 | {
53 | // If nothing was returned default to the template
54 | if (empty($response))
55 | {
56 | $response = $this->template;
57 | }
58 |
59 | return parent::after($response);
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/dashboard.php:
--------------------------------------------------------------------------------
1 |
2 |
Welcome!
3 |
This admin panel has been generated by the FuelPHP Framework.
4 |
Read the Docs
5 |
6 |
7 |
8 |
Get Started
9 |
The controller generating this page is found at APPPATH/classes/controller/admin.php.
10 |
This view can be found at APPPATH/views/admin/dashboard.php.
11 |
You can modify these files to get your application started quickly.
12 |
13 |
14 |
Learn
15 |
The best way to learn FuelPHP is reading through the Documentation.
16 |
Another good resource is the Forums. They are fairly active, and you can usually get a response quickly.
17 |
18 |
19 |
Contribute
20 |
FuelPHP wouldn't exist without awesome contributions from the community. Use the links below to get contributing.
21 |
26 |
27 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/actions/edit.php:
--------------------------------------------------------------------------------
1 | is_null($id) and Response::redirect('');
2 |
3 | $ = Model_::find($id);
4 |
5 | $val = Model_::validate('edit');
6 |
7 | if ($val->run())
8 | {
9 |
10 | $-> = Input::post('');
11 |
12 |
13 | if ($->save())
14 | {
15 | Session::set_flash('success', 'Updated #' . $id);
16 |
17 | Response::redirect('');
18 | }
19 |
20 | else
21 | {
22 | Session::set_flash('error', 'Could not update #' . $id);
23 | }
24 | }
25 |
26 | else
27 | {
28 | if (Input::method() == 'POST')
29 | {
30 |
31 | $-> = $val->validated('');
32 |
33 |
34 | Session::set_flash('error', $val->error());
35 | }
36 |
37 | $this->template->set_global('', $, false);
38 | }
39 |
40 | $this->template->title = "";
41 | $this->template->content = View::forge('/edit');
42 |
--------------------------------------------------------------------------------
/fuel/packages/email/classes/email/driver/sendmail.php:
--------------------------------------------------------------------------------
1 | build_message();
31 |
32 | // Open a connection
33 | $handle = @popen($this->config['sendmail_path'] . " -oi -f ".$this->config['from']['email']." -t", 'w');
34 |
35 | // No connection?
36 | if(! is_resource($handle))
37 | {
38 | throw new \SendmailConnectionException('Could not open a sendmail connection at: '.$this->config['sendmail_path']);
39 | }
40 |
41 | // Send the headers
42 | fputs($handle, $message['header']);
43 |
44 | // Send the body
45 | fputs($handle, $message['body']);
46 |
47 | if(pclose($handle) === -1)
48 | {
49 | throw new \SendmailFailedException('Failed sending email through sendmail.');
50 | }
51 |
52 | return true;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/fuel/core/config/doctypes.php:
--------------------------------------------------------------------------------
1 | '',
25 | 'xhtml1-strict'=>'',
26 | 'xhtml1-trans'=>'',
27 | 'xhtml1-frame'=>'',
28 | 'html5'=>'',
29 | 'html4-strict'=>'',
30 | 'html4-trans'=>'',
31 | 'html4-frame'=>''
32 | );
33 | /*end of file: core/config/doctype.php*/
34 |
--------------------------------------------------------------------------------
/fuel/core/config/rest.php:
--------------------------------------------------------------------------------
1 | 'xml',
32 |
33 | /*
34 | | Name for the password protected REST API displayed on login dialogs
35 | |
36 | | E.g: My Secret REST API
37 | |
38 | */
39 | 'realm' => 'REST API',
40 |
41 | /*
42 | | Is login required and if so, which type of login?
43 | |
44 | | '' = no login required, 'basic' = unsecure login, 'digest' = more secure login
45 | |
46 | */
47 | 'auth' => '',
48 |
49 | /*
50 | | array of usernames and passwords for login
51 | |
52 | | array('admin' => '1234')
53 | |
54 | */
55 | 'valid_logins' => array('admin' => '1234'),
56 |
57 | /*
58 | | Ignore HTTP_ACCEPT
59 | |
60 | | A lot of work can go into detecting incoming data,
61 | | disabling this will speed up your requests if you do not use a ACCEPT header.
62 | |
63 | */
64 | 'ignore_http_accept' => false,
65 |
66 | );
67 |
68 |
69 |
--------------------------------------------------------------------------------
/fuel/core/classes/database/expression.php:
--------------------------------------------------------------------------------
1 | _value = $value;
39 | }
40 |
41 | /**
42 | * Get the expression value as a string.
43 | *
44 | * $sql = $expression->value();
45 | *
46 | * @return string
47 | */
48 | public function value()
49 | {
50 | return (string) $this->_value;
51 | }
52 |
53 | /**
54 | * Return the value of the expression as a string.
55 | *
56 | * echo $expression;
57 | *
58 | * @return string
59 | * @uses Database_Expression::value
60 | */
61 | public function __toString()
62 | {
63 | return $this->value();
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/fuel/packages/email/bootstrap.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/classes/email.php',
10 | 'Email\\Email_Driver' => __DIR__.'/classes/email/driver.php',
11 | 'Email\\Email_Driver_Mail' => __DIR__.'/classes/email/driver/mail.php',
12 | 'Email\\Email_Driver_Smtp' => __DIR__.'/classes/email/driver/smtp.php',
13 | 'Email\\Email_Driver_Sendmail' => __DIR__.'/classes/email/driver/sendmail.php',
14 |
15 | /**
16 | * Email exceptions.
17 | */
18 | 'Email\\AttachmentNotFoundException' => __DIR__.'/classes/email.php',
19 | 'Email\\InvalidAttachmentsException' => __DIR__.'/classes/email.php',
20 | 'Email\\InvalidEmailStringEncoding' => __DIR__.'/classes/email.php',
21 | 'Email\\EmailSendingFailedException' => __DIR__.'/classes/email.php',
22 | 'Email\\EmailValidationFailedException' => __DIR__.'/classes/email.php',
23 |
24 | /**
25 | * Smtp exceptions
26 | */
27 | 'Email\\SmtpTimeoutException' => __DIR__.'/classes/email/driver/smtp.php',
28 | 'Email\\SmtpConnectionException' => __DIR__.'/classes/email/driver/smtp.php',
29 | 'Email\\SmtpCommandFailureException' => __DIR__.'/classes/email/driver/smtp.php',
30 | 'Email\\SmtpAuthenticationFailedException' => __DIR__.'/classes/email/driver/smtp.php',
31 |
32 | /**
33 | * Sendmail exceptions
34 | */
35 | 'Email\\SendmailFailedException' => __DIR__.'/classes/email/driver/sendmail.php',
36 | 'Email\\SendmailConnectionException' => __DIR__.'/classes/email/driver/sendmail.php',
37 | ));
--------------------------------------------------------------------------------
/fuel/core/config/form.php:
--------------------------------------------------------------------------------
1 | true,
25 | 'auto_id' => true,
26 | 'auto_id_prefix' => 'form_',
27 | 'form_method' => 'post',
28 | 'form_template' => "\n\t\t{open}\n\t\t\n\t\t{close}\n",
29 | 'fieldset_template' => "\n\t\t| {open} |
\n\t\t{close}\n",
30 | 'field_template' => "\t\t\n\t\t\t| {label}{required} | \n\t\t\t{field} {description} {error_msg} | \n\t\t
\n",
31 | 'multi_field_template' => "\t\t\n\t\t\t| {group_label}{required} | \n\t\t\t{fields}\n\t\t\t\t{field} {label} \n{fields}{description}\t\t\t{error_msg}\n\t\t\t | \n\t\t
\n",
32 | 'error_template' => '{error_msg}',
33 | 'required_mark' => '*',
34 | 'inline_errors' => false,
35 | 'error_class' => 'validation_error',
36 | );
37 |
--------------------------------------------------------------------------------
/fuel/packages/orm/bootstrap.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/classes/model.php',
15 | 'Orm\\Query' => __DIR__.'/classes/query.php',
16 | 'Orm\\BelongsTo' => __DIR__.'/classes/belongsto.php',
17 | 'Orm\\HasMany' => __DIR__.'/classes/hasmany.php',
18 | 'Orm\\HasOne' => __DIR__.'/classes/hasone.php',
19 | 'Orm\\ManyMany' => __DIR__.'/classes/manymany.php',
20 | 'Orm\\Relation' => __DIR__.'/classes/relation.php',
21 |
22 | // Observers
23 | 'Orm\\Observer' => __DIR__.'/classes/observer.php',
24 | 'Orm\\Observer_CreatedAt' => __DIR__.'/classes/observer/createdat.php',
25 | 'Orm\\Observer_Typing' => __DIR__.'/classes/observer/typing.php',
26 | 'Orm\\Observer_UpdatedAt' => __DIR__.'/classes/observer/updatedat.php',
27 | 'Orm\\Observer_Validation' => __DIR__.'/classes/observer/validation.php',
28 | 'Orm\\Observer_Self' => __DIR__.'/classes/observer/self.php',
29 | 'Orm\\Observer_Slug' => __DIR__.'/classes/observer/slug.php',
30 |
31 | // Exceptions
32 | 'Orm\\RecordNotFound' => __DIR__.'/classes/model.php',
33 | 'Orm\\FrozenObject' => __DIR__.'/classes/model.php',
34 | 'Orm\\InvalidContentType' => __DIR__.'/classes/observer/typing.php',
35 | 'Orm\\ValidationFailed' => __DIR__.'/classes/observer/validation.php',
36 | ));
--------------------------------------------------------------------------------
/fuel/core/tests/lang.php:
--------------------------------------------------------------------------------
1 | 'Bob'));
33 | $expected = 'Hello there Bob!';
34 | $this->assertEquals($expected, $output);
35 | }
36 |
37 | /**
38 | * Test for Lang::get()
39 | *
40 | * @test
41 | */
42 | public function test_line_invalid()
43 | {
44 | Lang::load('test');
45 | $output = Lang::get('non_existant_hello', array('name' => 'Bob'));
46 | $expected = false;
47 | $this->assertEquals($expected, $output);
48 | }
49 |
50 | /**
51 | * Test for Lang::set()
52 | *
53 | * @test
54 | */
55 | public function test_set_return_true()
56 | {
57 | $output = Lang::set('testing_set_valid', 'Ahoy :name!');
58 | $this->assertNull($output);
59 | }
60 |
61 | /**
62 | * Test for Lang::set()
63 | *
64 | * @test
65 | */
66 | public function test_set()
67 | {
68 | Lang::set('testing_set_valid', 'Ahoy :name!');
69 | $output = Lang::get('testing_set_valid', array('name' => 'Bob'));
70 | $expected = 'Ahoy Bob!';
71 | $this->assertEquals($expected, $output);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/model.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | class Model_ extends \Orm\Model
4 | {
5 | protected static $_properties = array(
6 | 'id',
7 |
8 | '',
9 |
10 |
11 | 'created_at',
12 | 'updated_at',
13 |
14 | );
15 |
16 |
17 | protected static $_observers = array(
18 | 'Orm\Observer_CreatedAt' => array(
19 | 'events' => array('before_insert'),
20 | 'mysql_timestamp' => false,
21 | ),
22 | 'Orm\Observer_UpdatedAt' => array(
23 | 'events' => array('before_save'),
24 | 'mysql_timestamp' => false,
25 | ),
26 | );
27 |
28 |
29 | public static function validate($factory)
30 | {
31 | $val = Validation::forge($factory);
32 |
33 |
51 | $val->add_field('', '', '');
52 |
53 |
54 | return $val;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/fuel/packages/parser/classes/view/mustache.php:
--------------------------------------------------------------------------------
1 | file_name;
26 | $data = $this->get_data();
27 |
28 | try
29 | {
30 | return static::parser()->render(file_get_contents($file), $data);
31 | }
32 | catch (\Exception $e)
33 | {
34 | // Delete the output buffer & re-throw the exception
35 | ob_end_clean();
36 | throw $e;
37 | }
38 | }
39 |
40 | public $extension = 'mustache';
41 |
42 | /**
43 | * Returns the Parser lib object
44 | *
45 | * @return Mustache
46 | */
47 | public static function parser()
48 | {
49 | if ( ! empty(static::$_parser))
50 | {
51 | return static::$_parser;
52 | }
53 |
54 | $options = array(
55 | 'delimiters' => array_values(\Config::get('parser.View_Mustache.delimiters', array('{{','}}'))),
56 | 'charset' => \Config::get('parser.View_Mustache.environment.charset', 'UTF-8'),
57 | 'pragmas' => \Config::get('parser.View_Mustache.environment.pragmas', array()),
58 | );
59 |
60 | static::$_parser = new Mustache(null, null, null, $options);
61 |
62 | return static::$_parser;
63 | }
64 | }
65 |
66 | // end of file mustache.php
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/model.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | use Orm\Model;
4 |
5 | class Model_ extends Model
6 | {
7 | protected static $_properties = array(
8 | 'id',
9 |
10 | '',
11 |
12 |
13 | 'created_at',
14 | 'updated_at',
15 |
16 | );
17 |
18 |
19 | protected static $_observers = array(
20 | 'Orm\Observer_CreatedAt' => array(
21 | 'events' => array('before_insert'),
22 | 'mysql_timestamp' => false,
23 | ),
24 | 'Orm\Observer_UpdatedAt' => array(
25 | 'events' => array('before_save'),
26 | 'mysql_timestamp' => false,
27 | ),
28 | );
29 |
30 |
31 | public static function validate($factory)
32 | {
33 | $val = Validation::forge($factory);
34 |
35 |
53 | $val->add_field('', '', '');
54 |
55 |
56 | return $val;
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/fuel/core/bootstrap_phpunit.php:
--------------------------------------------------------------------------------
1 | Listing
2 |
3 | "; ?>
4 |
5 |
6 |
7 |
8 |
9 | |
10 |
11 | |
12 |
13 |
14 |
15 | foreach ($ as $): '; ?>
16 |
17 |
18 |
19 | | echo $'.$field['name']; ?>; '; ?> |
20 |
21 |
22 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
23 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
24 | echo Html::anchor('/delete/'.$->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); '; ?>
25 |
26 |
27 | |
28 |
29 | '; ?>
30 |
31 |
32 |
33 | '; ?>
34 |
35 | No .
36 |
37 | '; ?>
38 |
39 | echo Html::anchor('/create', 'Add new ', array('class' => 'btn btn-success')); '; ?>
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/views/actions/index.php:
--------------------------------------------------------------------------------
1 | Listing
2 |
3 | "; ?>
4 |
5 |
6 |
7 |
8 |
9 | |
10 |
11 | |
12 |
13 |
14 |
15 | foreach ($ as $): '; ?>
16 |
17 |
18 |
19 | | echo $'.$field['name']; ?>; '; ?> |
20 |
21 |
22 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
23 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
24 | echo Html::anchor('/delete/'.$->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); '; ?>
25 |
26 |
27 | |
28 |
29 | '; ?>
30 |
31 |
32 |
33 | '; ?>
34 |
35 | No .
36 |
37 | '; ?>
38 |
39 | echo Html::anchor('/create', 'Add new ', array('class' => 'btn btn-success')); '; ?>
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/views/actions/index.php:
--------------------------------------------------------------------------------
1 | Listing
2 |
3 | "; ?>
4 |
5 |
6 |
7 |
8 |
9 | |
10 |
11 | |
12 |
13 |
14 |
15 | foreach ($ as $): '; ?>
16 |
17 |
18 |
19 | | echo $'.$field['name']; ?>; '; ?> |
20 |
21 |
22 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
23 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
24 | echo Html::anchor('/delete/'.$->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); '; ?>
25 |
26 |
27 | |
28 |
29 | '; ?>
30 |
31 |
32 |
33 | '; ?>
34 |
35 | No .
36 |
37 | '; ?>
38 |
39 | echo Html::anchor('/create', 'Add new ', array('class' => 'btn btn-success')); '; ?>
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/orm/views/actions/index.php:
--------------------------------------------------------------------------------
1 | Listing
2 |
3 | "; ?>
4 |
5 |
6 |
7 |
8 |
9 | |
10 |
11 | |
12 |
13 |
14 |
15 | foreach ($ as $): '; ?>
16 |
17 |
18 |
19 | | echo $'.$field['name']; ?>; '; ?> |
20 |
21 |
22 | echo Html::anchor('/view/'.$->id, 'View'); '; ?> |
23 | echo Html::anchor('/edit/'.$->id, 'Edit'); '; ?> |
24 | echo Html::anchor('/delete/'.$->id, 'Delete', array('onclick' => "return confirm('Are you sure?')")); '; ?>
25 |
26 |
27 | |
28 |
29 | '; ?>
30 |
31 |
32 |
33 | '; ?>
34 |
35 | No .
36 |
37 | '; ?>
38 |
39 | echo Html::anchor('/create', 'Add new ', array('class' => 'btn btn-success')); '; ?>
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/fuel/core/classes/controller.php:
--------------------------------------------------------------------------------
1 | request = $request;
31 | }
32 |
33 | /**
34 | * This method gets called before the action is called
35 | */
36 | public function before() {}
37 |
38 | /**
39 | * This method gets called after the action is called
40 | */
41 | public function after($response)
42 | {
43 | // Make sure the $response is a Response object
44 | if ( ! $response instanceof \Response)
45 | {
46 | $response = \Response::forge($response);
47 | }
48 |
49 | return $response;
50 | }
51 |
52 | /**
53 | * This method returns the named parameter requested, or all of them
54 | * if no parameter is given.
55 | *
56 | * @param string $param The name of the parameter
57 | * @param mixed $default Default value
58 | * @return mixed
59 | */
60 | public function param($param, $default = null)
61 | {
62 | return $this->request->param($param, $default);
63 | }
64 |
65 | /**
66 | * This method returns all of the named parameters.
67 | *
68 | * @return array
69 | */
70 | public function params()
71 | {
72 | return $this->request->params();
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/fuel/core/vendor/markdown/License.text:
--------------------------------------------------------------------------------
1 | PHP Markdown & Extra
2 | Copyright (c) 2004-2009 Michel Fortin
3 |
4 | All rights reserved.
5 |
6 | Based on Markdown
7 | Copyright (c) 2003-2006 John Gruber
8 |
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are
13 | met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name "Markdown" nor the names of its contributors may
23 | be used to endorse or promote products derived from this software
24 | without specific prior written permission.
25 |
26 | This software is provided by the copyright holders and contributors "as
27 | is" and any express or implied warranties, including, but not limited
28 | to, the implied warranties of merchantability and fitness for a
29 | particular purpose are disclaimed. In no event shall the copyright owner
30 | or contributors be liable for any direct, indirect, incidental, special,
31 | exemplary, or consequential damages (including, but not limited to,
32 | procurement of substitute goods or services; loss of use, data, or
33 | profits; or business interruption) however caused and on any theory of
34 | liability, whether in contract, strict liability, or tort (including
35 | negligence or otherwise) arising in any way out of the use of this
36 | software, even if advised of the possibility of such damage.
37 |
--------------------------------------------------------------------------------
/fuel/app/views/user/login.php:
--------------------------------------------------------------------------------
1 |
53 |
--------------------------------------------------------------------------------
/fuel/packages/parser/vendor/markdown/License.text:
--------------------------------------------------------------------------------
1 | PHP Markdown & Extra
2 | Copyright (c) 2004-2009 Michel Fortin
3 |
4 | All rights reserved.
5 |
6 | Based on Markdown
7 | Copyright (c) 2003-2006 John Gruber
8 |
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are
13 | met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name "Markdown" nor the names of its contributors may
23 | be used to endorse or promote products derived from this software
24 | without specific prior written permission.
25 |
26 | This software is provided by the copyright holders and contributors "as
27 | is" and any express or implied warranties, including, but not limited
28 | to, the implied warranties of merchantability and fitness for a
29 | particular purpose are disclaimed. In no event shall the copyright owner
30 | or contributors be liable for any direct, indirect, incidental, special,
31 | exemplary, or consequential damages (including, but not limited to,
32 | procurement of substitute goods or services; loss of use, data, or
33 | profits; or business interruption) however caused and on any theory of
34 | liability, whether in contract, strict liability, or tort (including
35 | negligence or otherwise) arising in any way out of the use of this
36 | software, even if advised of the possibility of such damage.
37 |
--------------------------------------------------------------------------------
/fuel/core/classes/database/mysql/result.php:
--------------------------------------------------------------------------------
1 | _total_rows = mysql_num_rows($result);
25 | }
26 |
27 | public function __destruct()
28 | {
29 | if (is_resource($this->_result))
30 | {
31 | mysql_free_result($this->_result);
32 | }
33 | }
34 |
35 | public function seek($offset)
36 | {
37 | if ($this->offsetExists($offset) and mysql_data_seek($this->_result, $offset))
38 | {
39 | // Set the current row to the offset
40 | $this->_current_row = $this->_internal_row = $offset;
41 |
42 | return true;
43 | }
44 | else
45 | {
46 | return false;
47 | }
48 | }
49 |
50 | public function current()
51 | {
52 | if ($this->_current_row !== $this->_internal_row and ! $this->seek($this->_current_row))
53 | return false;
54 |
55 | // Increment internal row for optimization assuming rows are fetched in order
56 | $this->_internal_row++;
57 |
58 | if ($this->_as_object === true)
59 | {
60 | // Return an stdClass
61 | return mysql_fetch_object($this->_result);
62 | }
63 | elseif (is_string($this->_as_object))
64 | {
65 | // Return an object of given class name
66 | return mysql_fetch_object($this->_result, $this->_as_object);
67 | }
68 | else
69 | {
70 | // Return an array of the row
71 | return mysql_fetch_assoc($this->_result);
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/fuel/packages/parser/classes/view/haml.php:
--------------------------------------------------------------------------------
1 | file_name;
28 |
29 | static::cache_init($file);
30 | $file = static::parser()->parse($file, static::$_cache);
31 |
32 | return parent::process_file($file);
33 | }
34 |
35 | public $extension = 'haml';
36 |
37 | /**
38 | * Returns the Parser lib object
39 | *
40 | * @return HamlParser
41 | */
42 | public static function parser()
43 | {
44 | if ( ! empty(static::$_parser))
45 | {
46 | return static::$_parser;
47 | }
48 |
49 | static::$_parser = new HamlParser();
50 |
51 | return static::$_parser;
52 | }
53 |
54 | // Jade stores cached templates as the filename in plain text,
55 | // so there is a high chance of name collisions (ex: index.jade).
56 | // This function attempts to create a unique directory for each
57 | // compiled template.
58 | // TODO: Extend Jade's caching class?
59 | public function cache_init($file_path)
60 | {
61 | $cache_key = md5($file_path);
62 | $cache_path = \Config::get('parser.View_Haml.cache_dir', null)
63 | .substr($cache_key, 0, 2).DS.substr($cache_key, 2, 2);
64 |
65 | if ($cache_path !== null AND ! is_dir($cache_path))
66 | {
67 | mkdir($cache_path, 0777, true);
68 | }
69 |
70 | static::$_cache = $cache_path;
71 | }
72 |
73 | }
74 |
75 | /* end of file haml.php */
--------------------------------------------------------------------------------
/fuel/core/config/file.php:
--------------------------------------------------------------------------------
1 | array(
27 |
28 | /**
29 | * Path to basedir restriction, null for no restriction
30 | */
31 | 'basedir' => null,
32 |
33 | /**
34 | * array of allowed extensions, null for all
35 | */
36 | 'extensions' => null,
37 |
38 | /**
39 | * Base url for files, null for not available
40 | */
41 | 'url' => null,
42 |
43 | /**
44 | * Whether or not to use file locks when doing file operations
45 | */
46 | 'use_locks' => null,
47 |
48 | /**
49 | * array containing file driver per file extension
50 | */
51 | 'file_handlers' => array(),
52 | ),
53 |
54 | // Pre configure some areas
55 | 'areas' => array(
56 | /* 'area_name' => array(
57 | 'basedir' => null,
58 | 'extensions' => null,
59 | 'url' => null,
60 | 'use_locks' => null,
61 | 'file_handlers' => array(),
62 | ), */
63 | ),
64 |
65 | // fileinfo() magic filename
66 | 'magic_file' => null,
67 |
68 | // default file and directory permissions
69 | 'chmod' => array(
70 |
71 | /**
72 | * Permissions for newly created files
73 | */
74 | 'files' => 0666,
75 |
76 | /**
77 | * Permissions for newly created directories
78 | */
79 | 'folders' => 0777,
80 | ),
81 |
82 | );
83 |
84 |
85 |
--------------------------------------------------------------------------------
/fuel/core/classes/database/mysqli/result.php:
--------------------------------------------------------------------------------
1 | _total_rows = $result->num_rows;
25 | }
26 |
27 | public function __destruct()
28 | {
29 | if ($this->_result instanceof \MySQLi_Result)
30 | {
31 | $this->_result->free();
32 | }
33 | }
34 |
35 | public function seek($offset)
36 | {
37 | if ($this->offsetExists($offset) and $this->_result->data_seek($offset))
38 | {
39 | // Set the current row to the offset
40 | $this->_current_row = $this->_internal_row = $offset;
41 |
42 | return true;
43 | }
44 | else
45 | {
46 | return false;
47 | }
48 | }
49 |
50 | public function current()
51 | {
52 | if ($this->_current_row !== $this->_internal_row and ! $this->seek($this->_current_row))
53 | return false;
54 |
55 | // Increment internal row for optimization assuming rows are fetched in order
56 | $this->_internal_row++;
57 |
58 | if ($this->_as_object === true)
59 | {
60 | // Return an stdClass
61 | return $this->_result->fetch_object();
62 | }
63 | elseif (is_string($this->_as_object))
64 | {
65 | // Return an object of given class name
66 | //! TODO: add the $params parameter
67 | return $this->_result->fetch_object($this->_as_object);
68 | }
69 | else
70 | {
71 | // Return an array of the row
72 | return $this->_result->fetch_assoc();
73 | }
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/fuel/packages/parser/classes/view/phptal.php:
--------------------------------------------------------------------------------
1 | file_name;
25 |
26 | try
27 | {
28 | $parser = static::parser();
29 | foreach($this->get_data() as $key => $value)
30 | {
31 | $parser->set($key,$value);
32 | }
33 | $parser->setTemplate($file);
34 | return $parser->execute();
35 | }
36 | catch (\Exception $e)
37 | {
38 | // Delete the output buffer & re-throw the exception
39 | ob_end_clean();
40 | throw $e;
41 | }
42 | }
43 |
44 | public $extension = 'phptal';
45 |
46 | public static function parser()
47 | {
48 | if ( ! empty(static::$_parser))
49 | {
50 | return static::$_parser;
51 | }
52 |
53 | static::$_parser = new \PHPTAL();
54 | static::$_parser->setEncoding(\Config::get('parser.View_Phptal.encoding', 'UTF-8'));
55 | static::$_parser->setOutputMode(constant('\\'.\Config::get('parser.View_Phptal.output_mode', 'PHPTAL::XHTML')));
56 | static::$_parser->setTemplateRepository(\Config::get('parser.View_Phptal.template_repository', ''));
57 | static::$_parser->setPhpCodeDestination(\Config::get('parser.View_Phptal.cache_dir', APPPATH.'cache'.DS.'PHPTAL'.DS));
58 | static::$_parser->setCacheLifetime(\Config::get('parser.View_Phptal.cache_lifetime', 0));
59 | static::$_parser->setForceReparse(\Config::get('parser.View_Phptal.force_reparse', false));
60 |
61 | return static::$_parser;
62 | }
63 | }
64 |
65 | // end of file phptal.php
66 |
--------------------------------------------------------------------------------
/fuel/core/tests/event.php:
--------------------------------------------------------------------------------
1 | assertTrue($output);
33 | }
34 |
35 | /**
36 | * Test for Event::has_events()
37 | *
38 | * @test
39 | */
40 | public function test_hasevents_valid()
41 | {
42 | $output = Event::has_events('test_register_valid');
43 | $this->assertTrue($output);
44 | }
45 |
46 | /**
47 | * Test for Event::trigger()
48 | *
49 | * @test
50 | */
51 | public function test_trigger_valid()
52 | {
53 | $output = Event::trigger('test_register_valid', 'text to upper');
54 | $this->assertEquals('TEXT TO UPPER', $output);
55 | }
56 |
57 | /**
58 | * Test for Event::register()
59 | *
60 | * @test
61 | */
62 | public function test_register_invalid()
63 | {
64 | $output = Event::register('test_register_invalid', 'Imaginary::callback');
65 | $this->assertFalse($output);
66 | }
67 |
68 | /**
69 | * Test for Event::has_events()
70 | *
71 | * @test
72 | */
73 | public function test_hasevents_invalid()
74 | {
75 | $output = Event::has_events('test_register_invalid');
76 | $this->assertFalse($output);
77 | }
78 |
79 | /**
80 | * Test for Event::trigger()
81 | *
82 | * @test
83 | */
84 | public function test_trigger_invalid()
85 | {
86 | $output = Event::trigger('test_register_invalid', 'text to upper');
87 | $this->assertEquals('', $output);
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/scaffolding/crud/controllers/admin.php:
--------------------------------------------------------------------------------
1 | action != 'login')
12 | {
13 | Response::redirect('admin/login');
14 | }
15 | }
16 |
17 | public function action_login()
18 | {
19 | // Already logged in
20 | Auth::check() and Response::redirect('admin');
21 |
22 | $val = Validation::forge();
23 |
24 | if (Input::method() == 'POST')
25 | {
26 | $val->add('email', 'Email or Username')
27 | ->add_rule('required');
28 | $val->add('password', 'Password')
29 | ->add_rule('required');
30 |
31 | if ($val->run())
32 | {
33 | $auth = Auth::instance();
34 |
35 | // check the credentials. This assumes that you have the previous table created
36 | if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
37 | {
38 | // credentials ok, go right in
39 | Session::set_flash('notice', 'Welcome, '.$current_user->username);
40 | Response::redirect('admin');
41 | }
42 | else
43 | {
44 | $this->template->set_global('login_error', 'Fail');
45 | }
46 |
47 | }
48 | }
49 |
50 | $this->template->title = 'Login';
51 | $this->template->content = View::forge('admin/login', array('val' => $val));
52 | }
53 |
54 | /**
55 | * The logout action.
56 | *
57 | * @access public
58 | * @return void
59 | */
60 | public function action_logout()
61 | {
62 | Auth::logout();
63 | Response::redirect('admin');
64 | }
65 |
66 | /**
67 | * The index action.
68 | *
69 | * @access public
70 | * @return void
71 | */
72 | public function action_index()
73 | {
74 | $this->template->title = 'Dashboard';
75 | $this->template->content = View::forge('admin/dashboard');
76 | }
77 |
78 | }
79 |
80 | /* End of file app.php */
--------------------------------------------------------------------------------
/fuel/packages/orm/classes/observer/slug.php:
--------------------------------------------------------------------------------
1 | _source = isset($props['source']) ? $props['source'] : static::$source;
34 | $this->_property = isset($props['property']) ? $props['property'] : static::$property;
35 | }
36 |
37 | /**
38 | * Creates a unique slug and adds it to the object
39 | *
40 | * @param Model The object
41 | * @return void
42 | */
43 | public function before_insert(Model $obj)
44 | {
45 | $properties = (array) $this->_source;
46 | $source = '';
47 | foreach ($properties as $property)
48 | {
49 | $source .= '-'.$obj->{$property};
50 | }
51 |
52 | $slug = \Inflector::friendly_title(substr($source, 1), '-', true);
53 | $same = $obj->query()->where($this->_property, 'like', $slug.'%')->get();
54 |
55 | if ( ! empty($same))
56 | {
57 | $max = -1;
58 |
59 | foreach ($same as $record)
60 | {
61 | if (preg_match('/^'.$slug.'(?:-([0-9]+))?$/', $record->{$this->_property}, $matches))
62 | {
63 | $index = isset($matches[1]) ? (int) $matches[1] : 0;
64 | $max < $index and $max = $index;
65 | }
66 | }
67 |
68 | $max < 0 or $slug .= '-'.($max + 1);
69 | }
70 |
71 | $obj->{$this->_property} = $slug;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/fuel/core/classes/profiler.php:
--------------------------------------------------------------------------------
1 | queries = array();
24 | static::$profiler->queryCount = 0;
25 | }
26 | }
27 |
28 | public static function mark($label)
29 | {
30 | static::$profiler and Console::logSpeed($label);
31 | }
32 |
33 | public static function mark_memory($var = false, $name = 'PHP')
34 | {
35 | static::$profiler and Console::logMemory($var, $name);
36 | }
37 |
38 | public static function console($text)
39 | {
40 | static::$profiler or Console::log($text);
41 | }
42 |
43 | public static function output()
44 | {
45 | return static::$profiler ? static::$profiler->display(static::$profiler) : '';
46 | }
47 |
48 | public static function start($dbname, $sql)
49 | {
50 | if (static::$profiler)
51 | {
52 | static::$query = array(
53 | 'sql' => \Security::htmlentities($sql),
54 | 'time' => static::$profiler->getMicroTime(),
55 | );
56 | return true;
57 | }
58 | }
59 |
60 | public static function stop($text)
61 | {
62 | if (static::$profiler)
63 | {
64 | static::$query['time'] = (static::$profiler->getMicroTime() - static::$query['time']) *1000;
65 | array_push(static::$profiler->queries, static::$query);
66 | static::$profiler->queryCount++;
67 | }
68 | }
69 |
70 | public static function delete($text)
71 | {
72 | static::$query = null;
73 | }
74 |
75 | public static function app_total()
76 | {
77 | return array(
78 | microtime(true) - FUEL_START_TIME,
79 | memory_get_peak_usage() - FUEL_START_MEM
80 | );
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/fuel/core/lang/en/upload.php:
--------------------------------------------------------------------------------
1 | 'The file uploaded with success',
5 | 'error_'.\Upload::UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
6 | 'error_'.\Upload::UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
7 | 'error_'.\Upload::UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded',
8 | 'error_'.\Upload::UPLOAD_ERR_NO_FILE => 'No file was uploaded',
9 | 'error_'.\Upload::UPLOAD_ERR_NO_TMP_DIR => 'Configured temporary upload folder is missing',
10 | 'error_'.\Upload::UPLOAD_ERR_CANT_WRITE => 'Failed to write uploaded file to disk',
11 | 'error_'.\Upload::UPLOAD_ERR_EXTENSION => 'Upload blocked by an installed PHP extension',
12 | 'error_'.\Upload::UPLOAD_ERR_MAX_SIZE => 'The uploaded file exceeds the defined maximum size',
13 | 'error_'.\Upload::UPLOAD_ERR_EXT_BLACKLISTED => 'Upload of files with this extension is not allowed',
14 | 'error_'.\Upload::UPLOAD_ERR_EXT_NOT_WHITELISTED => 'Upload of files with this extension is not allowed',
15 | 'error_'.\Upload::UPLOAD_ERR_TYPE_BLACKLISTED => 'Upload of files of this file type is not allowed',
16 | 'error_'.\Upload::UPLOAD_ERR_TYPE_NOT_WHITELISTED => 'Upload of files of this file type is not allowed',
17 | 'error_'.\Upload::UPLOAD_ERR_MIME_BLACKLISTED => 'Upload of files of this mime type is not allowed',
18 | 'error_'.\Upload::UPLOAD_ERR_MIME_NOT_WHITELISTED => 'Upload of files of this mime type is not allowed',
19 | 'error_'.\Upload::UPLOAD_ERR_MAX_FILENAME_LENGTH => 'The uploaded file name exceeds the defined maximum length',
20 | 'error_'.\Upload::UPLOAD_ERR_MOVE_FAILED => 'Unable to move the uploaded file to it\'s final destination',
21 | 'error_'.\Upload::UPLOAD_ERR_DUPLICATE_FILE => 'A file with the name of the uploaded file already exists',
22 | 'error_'.\Upload::UPLOAD_ERR_MKDIR_FAILED => 'Unable to create the file\'s destination directory',
23 | );
24 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/crud/controllers/admin.php:
--------------------------------------------------------------------------------
1 | action != 'login')
12 | {
13 | Response::redirect('admin/login');
14 | }
15 | }
16 |
17 | public function action_login()
18 | {
19 | if (Auth::check())
20 | {
21 | Response::redirect('admin');
22 | }
23 |
24 | $val = Validation::forge();
25 |
26 | if (Input::method() == 'POST')
27 | {
28 | $val->add('email', 'Email or Username')
29 | ->add_rule('required');
30 | $val->add('password', 'Password')
31 | ->add_rule('required');
32 |
33 | if ($val->run())
34 | {
35 | $auth = Auth::instance();
36 |
37 | // check the credentials. This assumes that you have the previous table created
38 | if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
39 | {
40 | // credentials ok, go right in
41 | $current_user = Model_User::find_by_username(Auth::get_screen_name());
42 | Session::set_flash('success', e('Welcome, '.$current_user->username));
43 | Response::redirect('admin');
44 | }
45 | else
46 | {
47 | $this->template->set_global('login_error', 'Fail');
48 | }
49 | }
50 | }
51 |
52 | $this->template->title = 'Login';
53 | $this->template->content = View::forge('admin/login', array('val' => $val), false);
54 | }
55 |
56 | /**
57 | * The logout action.
58 | *
59 | * @access public
60 | * @return void
61 | */
62 | public function action_logout()
63 | {
64 | Auth::logout();
65 | Response::redirect('admin');
66 | }
67 |
68 | /**
69 | * The index action.
70 | *
71 | * @access public
72 | * @return void
73 | */
74 | public function action_index()
75 | {
76 | $this->template->title = 'Dashboard';
77 | $this->template->content = View::forge('admin/dashboard');
78 | }
79 |
80 | }
81 |
82 | /* End of file app.php */
83 |
--------------------------------------------------------------------------------
/fuel/packages/oil/views/admin/orm/controllers/admin.php:
--------------------------------------------------------------------------------
1 | action != 'login')
12 | {
13 | Response::redirect('admin/login');
14 | }
15 | }
16 |
17 | public function action_login()
18 | {
19 | // Already logged in
20 | Auth::check() and Response::redirect('admin');
21 |
22 | $val = Validation::forge();
23 |
24 | if (Input::method() == 'POST')
25 | {
26 | $val->add('email', 'Email or Username')
27 | ->add_rule('required');
28 | $val->add('password', 'Password')
29 | ->add_rule('required');
30 |
31 | if ($val->run())
32 | {
33 | $auth = Auth::instance();
34 |
35 | // check the credentials. This assumes that you have the previous table created
36 | if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
37 | {
38 | // credentials ok, go right in
39 | $current_user = Model_User::find_by_username(Auth::get_screen_name());
40 | Session::set_flash('success', e('Welcome, '.$current_user->username));
41 | Response::redirect('admin');
42 | }
43 | else
44 | {
45 | $this->template->set_global('login_error', 'Fail');
46 | }
47 | }
48 | }
49 |
50 | $this->template->title = 'Login';
51 | $this->template->content = View::forge('admin/login', array('val' => $val), false);
52 | }
53 |
54 | /**
55 | * The logout action.
56 | *
57 | * @access public
58 | * @return void
59 | */
60 | public function action_logout()
61 | {
62 | Auth::logout();
63 | Response::redirect('admin');
64 | }
65 |
66 | /**
67 | * The index action.
68 | *
69 | * @access public
70 | * @return void
71 | */
72 | public function action_index()
73 | {
74 | $this->template->title = 'Dashboard';
75 | $this->template->content = View::forge('admin/dashboard');
76 | }
77 |
78 | }
79 |
80 | /* End of file admin.php */
81 |
--------------------------------------------------------------------------------