Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
7bbcb51d
Commit
7bbcb51d
authored
Oct 05, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed Spyc to DoctrineSpyc to avoid any conflicts with other libraries.
parent
a0857060
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
Yml.php
lib/Doctrine/Parser/Yml.php
+2
-2
spyc.php
lib/Doctrine/Parser/spyc.php
+15
-15
No files found.
lib/Doctrine/Parser/Yml.php
View file @
7bbcb51d
...
@@ -45,7 +45,7 @@ class Doctrine_Parser_Yml extends Doctrine_Parser
...
@@ -45,7 +45,7 @@ class Doctrine_Parser_Yml extends Doctrine_Parser
*/
*/
public
function
dumpData
(
$array
,
$path
=
null
)
public
function
dumpData
(
$array
,
$path
=
null
)
{
{
$spyc
=
new
Spyc
();
$spyc
=
new
Doctrine
Spyc
();
$yml
=
$spyc
->
dump
(
$array
,
false
,
false
);
$yml
=
$spyc
->
dump
(
$array
,
false
,
false
);
...
@@ -66,7 +66,7 @@ class Doctrine_Parser_Yml extends Doctrine_Parser
...
@@ -66,7 +66,7 @@ class Doctrine_Parser_Yml extends Doctrine_Parser
*/
*/
public
function
loadData
(
$path
)
public
function
loadData
(
$path
)
{
{
$spyc
=
new
Spyc
();
$spyc
=
new
Doctrine
Spyc
();
$array
=
$spyc
->
load
(
$path
);
$array
=
$spyc
->
load
(
$path
);
...
...
lib/Doctrine/Parser/spyc.php
View file @
7bbcb51d
<?php
<?php
/**
/**
* Spyc -- A Simple PHP YAML Class
*
Doctrine
Spyc -- A Simple PHP YAML Class
* @version 0.2.(5) -- 2006-12-31
* @version 0.2.(5) -- 2006-12-31
* @author Chris Wanstrath <chris@ozmm.org>
* @author Chris Wanstrath <chris@ozmm.org>
* @author Vlad Andersen <vlad@oneiros.ru>
* @author Vlad Andersen <vlad@oneiros.ru>
* @link http://spyc.sourceforge.net/
* @link http://spyc.sourceforge.net/
* @copyright Copyright 2005-2006 Chris Wanstrath
* @copyright Copyright 2005-2006 Chris Wanstrath
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @package Spyc
* @package
Doctrine
Spyc
*/
*/
/**
/**
* A node, used by Spyc for parsing YAML.
* A node, used by
Doctrine
Spyc for parsing YAML.
* @package Spyc
* @package
Doctrine
Spyc
*/
*/
class
YAMLNode
{
class
Doctrine
YAMLNode
{
/**#@+
/**#@+
* @access public
* @access public
* @var string
* @var string
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
* @access public
* @access public
* @return void
* @return void
*/
*/
function
YAMLNode
(
$nodeId
)
{
function
Doctrine
YAMLNode
(
$nodeId
)
{
$this
->
id
=
$nodeId
;
$this
->
id
=
$nodeId
;
}
}
}
}
...
@@ -57,12 +57,12 @@
...
@@ -57,12 +57,12 @@
*
*
* Usage:
* Usage:
* <code>
* <code>
* $parser = new Spyc;
* $parser = new
Doctrine
Spyc;
* $array = $parser->load($file);
* $array = $parser->load($file);
* </code>
* </code>
* @package Spyc
* @package
Doctrine
Spyc
*/
*/
class
Spyc
{
class
Doctrine
Spyc
{
/**
/**
* Load YAML into a PHP array statically
* Load YAML into a PHP array statically
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
* simple.
* simple.
* Usage:
* Usage:
* <code>
* <code>
* $array = Spyc::YAMLLoad('lucky.yaml');
* $array =
Doctrine
Spyc::YAMLLoad('lucky.yaml');
* print_r($array);
* print_r($array);
* </code>
* </code>
* @access public
* @access public
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
* @param string $input Path of YAML file or string containing YAML
* @param string $input Path of YAML file or string containing YAML
*/
*/
function
YAMLLoad
(
$input
)
{
function
YAMLLoad
(
$input
)
{
$spyc
=
new
Spyc
;
$spyc
=
new
Doctrine
Spyc
;
return
$spyc
->
load
(
$input
);
return
$spyc
->
load
(
$input
);
}
}
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
* @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
* @param int $wordwrap Pass in 0 for no wordwrap, false for default (40)
*/
*/
function
YAMLDump
(
$array
,
$indent
=
false
,
$wordwrap
=
false
)
{
function
YAMLDump
(
$array
,
$indent
=
false
,
$wordwrap
=
false
)
{
$spyc
=
new
Spyc
;
$spyc
=
new
Doctrine
Spyc
;
return
$spyc
->
dump
(
$array
,
$indent
,
$wordwrap
);
return
$spyc
->
dump
(
$array
,
$indent
,
$wordwrap
);
}
}
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
* will do its best to convert the YAML into a PHP array. Pretty simple.
* will do its best to convert the YAML into a PHP array. Pretty simple.
* Usage:
* Usage:
* <code>
* <code>
* $parser = new Spyc;
* $parser = new
Doctrine
Spyc;
* $array = $parser->load('lucky.yaml');
* $array = $parser->load('lucky.yaml');
* print_r($array);
* print_r($array);
* </code>
* </code>
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
$yaml
=
explode
(
"
\n
"
,
$input
);
$yaml
=
explode
(
"
\n
"
,
$input
);
}
}
// Initiate some objects and values
// Initiate some objects and values
$base
=
new
YAMLNode
(
1
);
$base
=
new
Doctrine
YAMLNode
(
1
);
$base
->
indent
=
0
;
$base
->
indent
=
0
;
$this
->
_lastIndent
=
0
;
$this
->
_lastIndent
=
0
;
$this
->
_lastNode
=
$base
->
id
;
$this
->
_lastNode
=
$base
->
id
;
...
@@ -159,7 +159,7 @@
...
@@ -159,7 +159,7 @@
$last
->
data
[
key
(
$last
->
data
)]
.=
"
\n
"
;
$last
->
data
[
key
(
$last
->
data
)]
.=
"
\n
"
;
}
elseif
(
$ifchk
{
0
}
!=
'#'
&&
substr
(
$ifchk
,
0
,
3
)
!=
'---'
)
{
}
elseif
(
$ifchk
{
0
}
!=
'#'
&&
substr
(
$ifchk
,
0
,
3
)
!=
'---'
)
{
// Create a new node and get its indent
// Create a new node and get its indent
$node
=
new
YAMLNode
(
$this
->
_nodeId
);
$node
=
new
Doctrine
YAMLNode
(
$this
->
_nodeId
);
$this
->
_nodeId
++
;
$this
->
_nodeId
++
;
$node
->
indent
=
$this
->
_getIndent
(
$line
);
$node
->
indent
=
$this
->
_getIndent
(
$line
);
...
...
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