Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
122f3abd
Commit
122f3abd
authored
May 17, 2013
by
尘缘
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2 from laravel/master
merge
parents
f742cc32
6a1d203b
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
60 additions
and
40 deletions
+60
-40
validation.php
application/language/en/validation.php
+3
-3
validation.php
application/language/nl/validation.php
+2
-0
validation.php
application/language/ru/validation.php
+5
-5
migrator.php
laravel/cli/tasks/migrate/migrator.php
+2
-2
runner.php
laravel/cli/tasks/test/runner.php
+2
-1
core.php
laravel/core.php
+4
-0
crypter.php
laravel/crypter.php
+3
-15
connection.php
laravel/database/connection.php
+1
-1
model.php
laravel/database/eloquent/model.php
+8
-5
belongs_to.php
laravel/database/eloquent/relationships/belongs_to.php
+2
-2
input.php
laravel/input.php
+2
-0
response.php
laravel/response.php
+7
-2
eloquent.test.php
laravel/tests/cases/eloquent.test.php
+14
-1
url.php
laravel/url.php
+2
-0
.htaccess
public/.htaccess
+3
-3
No files found.
application/language/en/validation.php
View file @
122f3abd
...
...
@@ -46,9 +46,9 @@ return array(
"ip"
=>
"The :attribute must be a valid IP address."
,
"match"
=>
"The :attribute format is invalid."
,
"max"
=>
array
(
"numeric"
=>
"The :attribute m
ust be less
than :max."
,
"file"
=>
"The :attribute m
ust be less
than :max kilobytes."
,
"string"
=>
"The :attribute m
ust be less
than :max characters."
,
"numeric"
=>
"The :attribute m
ay not be greater
than :max."
,
"file"
=>
"The :attribute m
ay not be greater
than :max kilobytes."
,
"string"
=>
"The :attribute m
ay not be greater
than :max characters."
,
),
"mimes"
=>
"The :attribute must be a file of type: :values."
,
"min"
=>
array
(
...
...
application/language/nl/validation.php
View file @
122f3abd
...
...
@@ -27,6 +27,7 @@ return array(
"countbetween"
=>
":attribute moet tussen :min en :max geselecteerde elementen bevatten."
,
"countmax"
=>
":attribute moet minder dan :max geselecteerde elementen bevatten."
,
"countmin"
=>
":attribute moet minimaal :min geselecteerde elementen bevatten."
,
"date_format"
=>
":attribute moet een geldig datum formaat bevatten."
,
"different"
=>
":attribute en :other moeten verschillend zijn."
,
"email"
=>
":attribute is geen geldig e-mailadres."
,
"exists"
=>
":attribute bestaat niet."
,
...
...
@@ -49,6 +50,7 @@ return array(
"not_in"
=>
"Het formaat van :attribute is ongeldig."
,
"numeric"
=>
":attribute moet een nummer zijn."
,
"required"
=>
":attribute is verplicht."
,
"required_with"
=>
":attribute is verplicht i.c.m. :field"
,
"same"
=>
":attribute en :other moeten overeenkomen."
,
"size"
=>
array
(
"numeric"
=>
":attribute moet :size zijn."
,
...
...
application/language/ru/validation.php
View file @
122f3abd
...
...
@@ -38,16 +38,16 @@ return array(
"countmin"
=>
"The :attribute must have at least :min selected elements."
,
"different"
=>
"Поля :attribute и :other должны различаться."
,
"email"
=>
"Поле :attribute имеет неверный формат."
,
"exists"
=>
"Выбранное значение для :attribute
уже существует
."
,
"exists"
=>
"Выбранное значение для :attribute
не верно
."
,
"image"
=>
"Поле :attribute должно быть картинкой."
,
"in"
=>
"Выбранное значение для :attribute не верно."
,
"integer"
=>
"Поле :attribute должно быть целым числом."
,
"ip"
=>
"Поле :attribute должно быть полным IP-адресом."
,
"match"
=>
"Поле :attribute имеет неверный формат."
,
"max"
=>
array
(
"numeric"
=>
"Поле :attribute должно быть
мен
ьше :max."
,
"file"
=>
"Поле :attribute должно быть
мен
ьше :max Килобайт."
,
"string"
=>
"Поле :attribute должно быть
короч
е :max символов."
,
"numeric"
=>
"Поле :attribute должно быть
не бол
ьше :max."
,
"file"
=>
"Поле :attribute должно быть
не бол
ьше :max Килобайт."
,
"string"
=>
"Поле :attribute должно быть
не длинне
е :max символов."
,
),
"mimes"
=>
"Поле :attribute должно быть файлом одного из типов: :values."
,
"min"
=>
array
(
...
...
@@ -101,4 +101,4 @@ return array(
'attributes'
=>
array
(),
);
\ No newline at end of file
);
laravel/cli/tasks/migrate/migrator.php
View file @
122f3abd
...
...
@@ -200,7 +200,7 @@ class Migrator extends Task {
$table
->
primary
(
array
(
'bundle'
,
'name'
));
});
echo
"Migration table created successfully."
;
echo
"Migration table created successfully."
.
PHP_EOL
;
}
/**
...
...
@@ -275,4 +275,4 @@ class Migrator extends Task {
return
$migration
[
'bundle'
]
.
'/'
.
$migration
[
'name'
];
}
}
\ No newline at end of file
}
laravel/cli/tasks/test/runner.php
View file @
122f3abd
...
...
@@ -88,7 +88,8 @@ class Runner extends Task {
// strings with spaces inside should be wrapped in quotes.
$esc_path
=
escapeshellarg
(
$path
);
passthru
(
'LARAVEL_ENV='
.
Request
::
env
()
.
' phpunit --configuration '
.
$esc_path
,
$status
);
putenv
(
'LARAVEL_ENV='
.
Request
::
env
());
passthru
(
'phpunit --configuration '
.
$esc_path
,
$status
);
@
unlink
(
$path
);
...
...
laravel/core.php
View file @
122f3abd
...
...
@@ -154,8 +154,12 @@ if (magic_quotes())
use
Symfony\Component\HttpFoundation\LaravelRequest
as
RequestFoundation
;
RequestFoundation
::
enableHttpMethodParameterOverride
();
Request
::
$foundation
=
RequestFoundation
::
createFromGlobals
();
/*
|--------------------------------------------------------------------------
| Determine The Application Environment
...
...
laravel/crypter.php
View file @
122f3abd
...
...
@@ -116,7 +116,7 @@ class Crypter {
*/
protected
static
function
pad
(
$value
)
{
$pad
=
static
::
$block
-
(
Str
::
length
(
$value
)
%
static
::
$block
);
$pad
=
static
::
$block
-
(
strlen
(
$value
)
%
static
::
$block
);
return
$value
.=
str_repeat
(
chr
(
$pad
),
$pad
);
}
...
...
@@ -129,14 +129,7 @@ class Crypter {
*/
protected
static
function
unpad
(
$value
)
{
if
(
MB_STRING
)
{
$pad
=
ord
(
mb_substr
(
$value
,
-
1
,
1
,
Config
::
get
(
'application.encoding'
)));
}
else
{
$pad
=
ord
(
substr
(
$value
,
-
1
));
}
$pad
=
ord
(
substr
(
$value
,
-
1
));
if
(
$pad
and
$pad
<=
static
::
$block
)
{
...
...
@@ -145,12 +138,7 @@ class Crypter {
// as the padding appears to have been changed.
if
(
preg_match
(
'/'
.
chr
(
$pad
)
.
'{'
.
$pad
.
'}$/'
,
$value
))
{
if
(
MB_STRING
)
{
return
mb_substr
(
$value
,
0
,
Str
::
length
(
$value
)
-
$pad
,
Config
::
get
(
'application.encoding'
));
}
return
substr
(
$value
,
0
,
Str
::
length
(
$value
)
-
$pad
);
return
substr
(
$value
,
0
,
strlen
(
$value
)
-
$pad
);
}
// If the padding characters do not match the expected padding
...
...
laravel/database/connection.php
View file @
122f3abd
...
...
@@ -197,7 +197,7 @@ class Connection {
// For insert statements that use the "returning" clause, which is allowed
// by database systems such as Postgres, we need to actually return the
// real query result so the consumer can get the ID.
elseif
(
stripos
(
$sql
,
'insert'
)
===
0
and
stripos
(
$sql
,
'returning'
)
!==
false
)
elseif
(
stripos
(
$sql
,
'insert'
)
===
0
and
stripos
(
$sql
,
'
)
returning'
)
!==
false
)
{
return
$this
->
fetch
(
$statement
,
Config
::
get
(
'database.fetch'
));
}
...
...
laravel/database/eloquent/model.php
View file @
122f3abd
...
...
@@ -335,7 +335,7 @@ abstract class Model {
*/
public
function
push
()
{
$this
->
save
()
;
if
(
!
$this
->
save
())
return
false
;
// To sync all of the relationships to the database, we will simply spin through
// the relationships, calling the "push" method on each of the models in that
...
...
@@ -349,9 +349,11 @@ abstract class Model {
foreach
(
$models
as
$model
)
{
$model
->
push
()
;
if
(
!
$model
->
push
())
return
false
;
}
}
return
true
;
}
/**
...
...
@@ -441,7 +443,7 @@ abstract class Model {
}
/**
*Updates the timestamp on the model and immediately saves it.
*
Updates the timestamp on the model and immediately saves it.
*
* @return void
*/
...
...
@@ -562,11 +564,12 @@ abstract class Model {
*
* @param string $key
* @param mixed $value
* @return
void
* @return
Model
*/
public
function
set_attribute
(
$key
,
$value
)
{
$this
->
attributes
[
$key
]
=
$value
;
return
$this
;
}
/**
...
...
@@ -769,7 +772,7 @@ abstract class Model {
}
elseif
(
starts_with
(
$method
,
'set_'
))
{
$this
->
set_attribute
(
substr
(
$method
,
4
),
$parameters
[
0
]);
return
$this
->
set_attribute
(
substr
(
$method
,
4
),
$parameters
[
0
]);
}
// Finally we will assume that the method is actually the beginning of a
...
...
laravel/database/eloquent/relationships/belongs_to.php
View file @
122f3abd
...
...
@@ -110,7 +110,7 @@ class Belongs_To extends Relationship {
*/
public
function
foreign_value
()
{
return
$this
->
base
->
get_attribute
(
$this
->
foreign
)
;
return
$this
->
base
->
{
$this
->
foreign
}
;
}
/**
...
...
@@ -126,4 +126,4 @@ class Belongs_To extends Relationship {
return
$this
->
base
;
}
}
\ No newline at end of file
}
laravel/input.php
View file @
122f3abd
...
...
@@ -160,6 +160,8 @@ class Input {
*/
public
static
function
had
(
$key
)
{
if
(
is_array
(
static
::
old
(
$key
)))
return
true
;
return
trim
((
string
)
static
::
old
(
$key
))
!==
''
;
}
...
...
laravel/response.php
View file @
122f3abd
...
...
@@ -202,9 +202,14 @@ class Response {
// off to the HttpFoundation and let it create the header text.
$response
=
new
static
(
File
::
get
(
$path
),
200
,
$headers
);
$d
=
$response
->
disposition
(
$name
);
// If the Content-Disposition header has already been set by the
// merge above, then do not override it with out generated one.
if
(
!
isset
(
$headers
[
'Content-Disposition'
]))
{
$d
=
$response
->
disposition
(
$name
);
$response
=
$response
->
header
(
'Content-Disposition'
,
$d
);
}
return
$response
->
header
(
'Content-Disposition'
,
$d
)
;
return
$response
;
}
/**
...
...
laravel/tests/cases/eloquent.test.php
View file @
122f3abd
...
...
@@ -133,6 +133,19 @@ class EloquentTest extends PHPUnit_Framework_TestCase {
Model
::
$accessible
=
null
;
}
/**
* Test the Model::__set method allows chaining.
*
* @group laravel
*/
public
function
testAttributeMagicSetterMethodAllowsChaining
()
{
$model
=
new
Model
;
$this
->
assertInstanceOf
(
'Model'
,
$model
->
set_foo
(
'foo'
));
$model
->
set_bar
(
'bar'
)
->
set_baz
(
'baz'
);
$this
->
assertEquals
(
array
(
'foo'
=>
'foo'
,
'bar'
=>
'bar'
,
'baz'
=>
'baz'
),
$model
->
to_array
());
}
/**
* Test the Model::__get method.
*
...
...
@@ -288,4 +301,4 @@ class EloquentTest extends PHPUnit_Framework_TestCase {
}
}
\ No newline at end of file
}
laravel/url.php
View file @
122f3abd
...
...
@@ -355,6 +355,8 @@ class URL {
*/
public
static
function
valid
(
$url
)
{
if
(
starts_with
(
$url
,
'//'
))
return
true
;
return
filter_var
(
$url
,
FILTER_VALIDATE_URL
)
!==
false
;
}
...
...
public/.htaccess
View file @
122f3abd
# Apache configuration file
# http://httpd.apache.org/docs/
2.2
/mod/quickreference.html
# http://httpd.apache.org/docs/
current
/mod/quickreference.html
# Note: ".htaccess" files are an overhead for each request. This logic should
# be placed in your Apache config whenever possible.
# http://httpd.apache.org/docs/
2.2
/howto/htaccess.html
# http://httpd.apache.org/docs/
current
/howto/htaccess.html
# Turning on the rewrite engine is necessary for the following rules and
# features. "+FollowSymLinks" must be enabled for this to work symbolically.
...
...
@@ -20,4 +20,4 @@
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteRule
^(.*)$ index.php/$1 [L]
</
IfModule
>
\ No newline at end of file
</
IfModule
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment